Skip to content

Commit

Permalink
code and test (#23586)
Browse files Browse the repository at this point in the history
Co-authored-by: PythonSdkPipelines <PythonSdkPipelines>
  • Loading branch information
azclibot authored Mar 21, 2022
1 parent dbad6c1 commit 2ab1234
Show file tree
Hide file tree
Showing 104 changed files with 13,537 additions and 6,496 deletions.
12 changes: 12 additions & 0 deletions sdk/digitaltwins/azure-mgmt-digitaltwins/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Release History

## 6.1.0 (2022-03-21)

**Features**

- Added operation group TimeSeriesDatabaseConnectionsOperations
- Model DigitalTwinsDescription has a new parameter system_data
- Model DigitalTwinsEndpointResource has a new parameter system_data
- Model DigitalTwinsResource has a new parameter system_data
- Model ExternalResource has a new parameter system_data
- Model Operation has a new parameter properties
- Model PrivateEndpointConnection has a new parameter system_data

## 6.0.0 (2021-05-18)

- GA release
Expand Down
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": "162460648e39b3cd20ef3d302008add138e90223",
"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/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)
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "6.0.0"
VERSION = "6.1.0"

Loading

0 comments on commit 2ab1234

Please sign in to comment.