Skip to content

Commit

Permalink
CodeGen from PR 17186 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Hub Generated] Public private branch 'dev-digitaltwins-Microsoft.DigitalTwins-2021-06-30-preview-merge-with-main' (Azure#17186)

* Adds base for updating Microsoft.DigitalTwins from version stable/2020-12-01 to version 2021-06-30-preview

* Updates readme

* Updates API version in new specs and examples

* Add RM API Version Microsoft.DigitalTwins 2021-06-30-preview (#3404)

* Add SDK Generation Options for new API Version (#3179)

* Add SDK generation for 2021-06-30-preview

* The following fixes were done:
 * Fixed schema location: preview instead of stable
 * Updated go SDK generation to point to preview namespace

* Remove Ruby support

* add SystemData and update instance and endpoints definitions

* added systemdata to all examples

* fix typo

* fix prettier issues

* added experimental operations fix

* fixed some errors

* addressed lint and model errors

* fixed type issues with endpoints examples

* Fixed autorest error

* removed unnecessary _allOf_s

* Add Time Series Database Connection Resource and CRUD API Endpoints (#3180)

* Added basic time series integration resource CRUD and resource description

* Add list call for TSDB integration resources

* Modify naming for adx endpoint

* Rename document names and paths from integration resources to time series database connections; also clean up descriptions, and make more specific to time series database connections (rather than general integrations)

* Update operation names

* Resolve review comments

* Add examples for time series database connection CRUD

* Add example for missing status code 200 to DELETE

* Run prettier and fix formatting issues

* Align tags, solve issue in Python SDK generation

* Align python readme

* Fix linter error

* Fix linter error 2

* Fix linter error

* Made privateEndpointConnections readonly, added additional documentation for keybased and entitybased authenticationType (#3358)

* Address major lintdiff warnings

* Fix more linter warnings

* Address remaining lintdiff warnings and errors

* Remove property flattening to avoid issues with polymorphism, edit suppression directives to point to new location

* Address lintdiff error

* Add systemData property to private endpoint connection resource

* Address breaking change warnings

* Fix inheritance

* Update suppressions to point to new locations in document

* Updated TSDB connection parameter set

* Fix issue in property set

* Revert readOnly=true from private endpoint connections property

* Revert change to TopicEndpoint

* Back to camelcase...

* Revert change in old API version

* Revert TopicEndpoint back to camelCase

* Revert allOf addition

* Change capitalization of TopicEndpoint back to original from previous version

* Add approved suppression

* Fix $.definitions path in suppression rules

Co-authored-by: Nate Lehman <[email protected]>
Co-authored-by: Nate Lehman <[email protected]>

* Align with repo (#5658)

Co-authored-by: Nate Lehman <[email protected]>
Co-authored-by: Nate Lehman <[email protected]>
  • Loading branch information
3 people committed Feb 1, 2022
1 parent cb4ac37 commit 7eed418
Show file tree
Hide file tree
Showing 101 changed files with 13,522 additions and 6,495 deletions.
11 changes: 7 additions & 4 deletions sdk/digitaltwins/azure-mgmt-digitaltwins/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"autorest": "3.3.0",
"use": "@autorest/[email protected]",
"commit": "dda51a4bf761a7e9e22c9085623f6201910f5efd",
"autorest": "3.7.2",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"commit": "938d33ac71d661bfa53946ad4fa72c7fdbf2dfcf",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/digitaltwins/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.6 --version=3.3.0",
"autorest_command": "autorest specification/digitaltwins/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/[email protected] --version=3.7.2",
"readme": "specification/digitaltwins/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

class _SDKClient(object):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -70,12 +69,10 @@ def __init__(
credential, # type: "TokenCredential"
subscription_id, # type: str
api_version=None, # type: Optional[str]
base_url=None, # type: Optional[str]
base_url="https://management.azure.com", # type: str
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
if not base_url:
base_url = 'https://management.azure.com'
self._config = AzureDigitalTwinsManagementClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(AzureDigitalTwinsManagementClient, self).__init__(
Expand All @@ -94,6 +91,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2020-03-01-preview: :mod:`v2020_03_01_preview.models<azure.mgmt.digitaltwins.v2020_03_01_preview.models>`
* 2020-10-31: :mod:`v2020_10_31.models<azure.mgmt.digitaltwins.v2020_10_31.models>`
* 2020-12-01: :mod:`v2020_12_01.models<azure.mgmt.digitaltwins.v2020_12_01.models>`
* 2021-06-30-preview: :mod:`v2021_06_30_preview.models<azure.mgmt.digitaltwins.v2021_06_30_preview.models>`
"""
if api_version == '2020-03-01-preview':
from .v2020_03_01_preview import models
Expand All @@ -104,6 +102,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2020-12-01':
from .v2020_12_01 import models
return models
elif api_version == '2021-06-30-preview':
from .v2021_06_30_preview import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand All @@ -113,6 +114,7 @@ def digital_twins(self):
* 2020-03-01-preview: :class:`DigitalTwinsOperations<azure.mgmt.digitaltwins.v2020_03_01_preview.operations.DigitalTwinsOperations>`
* 2020-10-31: :class:`DigitalTwinsOperations<azure.mgmt.digitaltwins.v2020_10_31.operations.DigitalTwinsOperations>`
* 2020-12-01: :class:`DigitalTwinsOperations<azure.mgmt.digitaltwins.v2020_12_01.operations.DigitalTwinsOperations>`
* 2021-06-30-preview: :class:`DigitalTwinsOperations<azure.mgmt.digitaltwins.v2021_06_30_preview.operations.DigitalTwinsOperations>`
"""
api_version = self._get_api_version('digital_twins')
if api_version == '2020-03-01-preview':
Expand All @@ -121,6 +123,8 @@ def digital_twins(self):
from .v2020_10_31.operations import DigitalTwinsOperations as OperationClass
elif api_version == '2020-12-01':
from .v2020_12_01.operations import DigitalTwinsOperations as OperationClass
elif api_version == '2021-06-30-preview':
from .v2021_06_30_preview.operations import DigitalTwinsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'digital_twins'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -132,6 +136,7 @@ def digital_twins_endpoint(self):
* 2020-03-01-preview: :class:`DigitalTwinsEndpointOperations<azure.mgmt.digitaltwins.v2020_03_01_preview.operations.DigitalTwinsEndpointOperations>`
* 2020-10-31: :class:`DigitalTwinsEndpointOperations<azure.mgmt.digitaltwins.v2020_10_31.operations.DigitalTwinsEndpointOperations>`
* 2020-12-01: :class:`DigitalTwinsEndpointOperations<azure.mgmt.digitaltwins.v2020_12_01.operations.DigitalTwinsEndpointOperations>`
* 2021-06-30-preview: :class:`DigitalTwinsEndpointOperations<azure.mgmt.digitaltwins.v2021_06_30_preview.operations.DigitalTwinsEndpointOperations>`
"""
api_version = self._get_api_version('digital_twins_endpoint')
if api_version == '2020-03-01-preview':
Expand All @@ -140,6 +145,8 @@ def digital_twins_endpoint(self):
from .v2020_10_31.operations import DigitalTwinsEndpointOperations as OperationClass
elif api_version == '2020-12-01':
from .v2020_12_01.operations import DigitalTwinsEndpointOperations as OperationClass
elif api_version == '2021-06-30-preview':
from .v2021_06_30_preview.operations import DigitalTwinsEndpointOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'digital_twins_endpoint'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -151,6 +158,7 @@ def operations(self):
* 2020-03-01-preview: :class:`Operations<azure.mgmt.digitaltwins.v2020_03_01_preview.operations.Operations>`
* 2020-10-31: :class:`Operations<azure.mgmt.digitaltwins.v2020_10_31.operations.Operations>`
* 2020-12-01: :class:`Operations<azure.mgmt.digitaltwins.v2020_12_01.operations.Operations>`
* 2021-06-30-preview: :class:`Operations<azure.mgmt.digitaltwins.v2021_06_30_preview.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2020-03-01-preview':
Expand All @@ -159,6 +167,8 @@ def operations(self):
from .v2020_10_31.operations import Operations as OperationClass
elif api_version == '2020-12-01':
from .v2020_12_01.operations import Operations as OperationClass
elif api_version == '2021-06-30-preview':
from .v2021_06_30_preview.operations import Operations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -168,10 +178,13 @@ def private_endpoint_connections(self):
"""Instance depends on the API version:
* 2020-12-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.digitaltwins.v2020_12_01.operations.PrivateEndpointConnectionsOperations>`
* 2021-06-30-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.digitaltwins.v2021_06_30_preview.operations.PrivateEndpointConnectionsOperations>`
"""
api_version = self._get_api_version('private_endpoint_connections')
if api_version == '2020-12-01':
from .v2020_12_01.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2021-06-30-preview':
from .v2021_06_30_preview.operations import PrivateEndpointConnectionsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -181,14 +194,30 @@ def private_link_resources(self):
"""Instance depends on the API version:
* 2020-12-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.digitaltwins.v2020_12_01.operations.PrivateLinkResourcesOperations>`
* 2021-06-30-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.digitaltwins.v2021_06_30_preview.operations.PrivateLinkResourcesOperations>`
"""
api_version = self._get_api_version('private_link_resources')
if api_version == '2020-12-01':
from .v2020_12_01.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2021-06-30-preview':
from .v2021_06_30_preview.operations import PrivateLinkResourcesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def time_series_database_connections(self):
"""Instance depends on the API version:
* 2021-06-30-preview: :class:`TimeSeriesDatabaseConnectionsOperations<azure.mgmt.digitaltwins.v2021_06_30_preview.operations.TimeSeriesDatabaseConnectionsOperations>`
"""
api_version = self._get_api_version('time_series_database_connections')
if api_version == '2021-06-30-preview':
from .v2021_06_30_preview.operations import TimeSeriesDatabaseConnectionsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'time_series_database_connections'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

def close(self):
self._client.close()
def __enter__(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

Expand Down Expand Up @@ -68,4 +68,4 @@ def _configure(
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Loading

0 comments on commit 7eed418

Please sign in to comment.