Skip to content

Commit

Permalink
CodeGen from PR 14061 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
update (Azure#14061)
  • Loading branch information
SDKAuto committed Apr 26, 2021
1 parent 9585622 commit 6e94dc4
Show file tree
Hide file tree
Showing 141 changed files with 17,542 additions and 2,592 deletions.
1 change: 1 addition & 0 deletions sdk/iothub/azure-mgmt-iothub/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
8 changes: 8 additions & 0 deletions sdk/iothub/azure-mgmt-iothub/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autorest": "3.3.0",
"use": "@autorest/[email protected]",
"commit": "4c881abe43b82c6f001f2f2ca7f2a2d63299749e",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/iothub/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/[email protected] --version=3.3.0",
"readme": "specification/iothub/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import Any
from typing import TYPE_CHECKING

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

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential

class IotHubClientConfiguration(Configuration):
"""Configuration for IotHubClient.
Expand Down
51 changes: 43 additions & 8 deletions sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/_iot_hub_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@
# regenerated.
# --------------------------------------------------------------------------

from azure.mgmt.core import ARMPipelineClient
from msrest import Serializer, Deserializer
from typing import TYPE_CHECKING

from azure.mgmt.core import ARMPipelineClient
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from msrest import Deserializer, Serializer

from ._configuration import IotHubClientConfiguration

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
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):
"""This is a fake class to support current implemetation of MultiApiClientMixin."
Expand All @@ -38,9 +47,10 @@ class IotHubClient(MultiApiClientMixin, _SDKClient):
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription identifier.
:type subscription_id: str
:param str api_version: API version to use if no profile is provided, or if
missing in profile.
:param str base_url: Service URL
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
:param base_url: Service URL
:type base_url: str
:param profile: A profile definition, from KnownProfiles to dict.
:type profile: azure.profiles.KnownProfiles
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
Expand All @@ -59,9 +69,9 @@ def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
api_version=None,
base_url=None,
profile=KnownProfiles.default,
api_version=None, # type: Optional[str]
base_url=None, # type: Optional[str]
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
if not base_url:
Expand Down Expand Up @@ -89,6 +99,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2019-03-22: :mod:`v2019_03_22.models<azure.mgmt.iothub.v2019_03_22.models>`
* 2019-11-04: :mod:`v2019_11_04.models<azure.mgmt.iothub.v2019_11_04.models>`
* 2020-03-01: :mod:`v2020_03_01.models<azure.mgmt.iothub.v2020_03_01.models>`
* 2021-03-03-preview: :mod:`v2021_03_03_preview.models<azure.mgmt.iothub.v2021_03_03_preview.models>`
"""
if api_version == '2016-02-03':
from .v2016_02_03 import models
Expand All @@ -114,6 +125,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2020-03-01':
from .v2020_03_01 import models
return models
elif api_version == '2021-03-03-preview':
from .v2021_03_03_preview import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand All @@ -126,6 +140,7 @@ def certificates(self):
* 2019-03-22: :class:`CertificatesOperations<azure.mgmt.iothub.v2019_03_22.operations.CertificatesOperations>`
* 2019-11-04: :class:`CertificatesOperations<azure.mgmt.iothub.v2019_11_04.operations.CertificatesOperations>`
* 2020-03-01: :class:`CertificatesOperations<azure.mgmt.iothub.v2020_03_01.operations.CertificatesOperations>`
* 2021-03-03-preview: :class:`CertificatesOperations<azure.mgmt.iothub.v2021_03_03_preview.operations.CertificatesOperations>`
"""
api_version = self._get_api_version('certificates')
if api_version == '2017-07-01':
Expand All @@ -140,6 +155,8 @@ def certificates(self):
from .v2019_11_04.operations import CertificatesOperations as OperationClass
elif api_version == '2020-03-01':
from .v2020_03_01.operations import CertificatesOperations as OperationClass
elif api_version == '2021-03-03-preview':
from .v2021_03_03_preview.operations import CertificatesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'certificates'".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 +168,7 @@ def iot_hub(self):
* 2019-03-22: :class:`IotHubOperations<azure.mgmt.iothub.v2019_03_22.operations.IotHubOperations>`
* 2019-11-04: :class:`IotHubOperations<azure.mgmt.iothub.v2019_11_04.operations.IotHubOperations>`
* 2020-03-01: :class:`IotHubOperations<azure.mgmt.iothub.v2020_03_01.operations.IotHubOperations>`
* 2021-03-03-preview: :class:`IotHubOperations<azure.mgmt.iothub.v2021_03_03_preview.operations.IotHubOperations>`
"""
api_version = self._get_api_version('iot_hub')
if api_version == '2019-03-22':
Expand All @@ -159,6 +177,8 @@ def iot_hub(self):
from .v2019_11_04.operations import IotHubOperations as OperationClass
elif api_version == '2020-03-01':
from .v2020_03_01.operations import IotHubOperations as OperationClass
elif api_version == '2021-03-03-preview':
from .v2021_03_03_preview.operations import IotHubOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'iot_hub'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -175,6 +195,7 @@ def iot_hub_resource(self):
* 2019-03-22: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2019_03_22.operations.IotHubResourceOperations>`
* 2019-11-04: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2019_11_04.operations.IotHubResourceOperations>`
* 2020-03-01: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2020_03_01.operations.IotHubResourceOperations>`
* 2021-03-03-preview: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2021_03_03_preview.operations.IotHubResourceOperations>`
"""
api_version = self._get_api_version('iot_hub_resource')
if api_version == '2016-02-03':
Expand All @@ -193,6 +214,8 @@ def iot_hub_resource(self):
from .v2019_11_04.operations import IotHubResourceOperations as OperationClass
elif api_version == '2020-03-01':
from .v2020_03_01.operations import IotHubResourceOperations as OperationClass
elif api_version == '2021-03-03-preview':
from .v2021_03_03_preview.operations import IotHubResourceOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'iot_hub_resource'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -207,6 +230,7 @@ def operations(self):
* 2019-03-22: :class:`Operations<azure.mgmt.iothub.v2019_03_22.operations.Operations>`
* 2019-11-04: :class:`Operations<azure.mgmt.iothub.v2019_11_04.operations.Operations>`
* 2020-03-01: :class:`Operations<azure.mgmt.iothub.v2020_03_01.operations.Operations>`
* 2021-03-03-preview: :class:`Operations<azure.mgmt.iothub.v2021_03_03_preview.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2017-07-01':
Expand All @@ -221,6 +245,8 @@ def operations(self):
from .v2019_11_04.operations import Operations as OperationClass
elif api_version == '2020-03-01':
from .v2020_03_01.operations import Operations as OperationClass
elif api_version == '2021-03-03-preview':
from .v2021_03_03_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 @@ -230,10 +256,13 @@ def private_endpoint_connections(self):
"""Instance depends on the API version:
* 2020-03-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.iothub.v2020_03_01.operations.PrivateEndpointConnectionsOperations>`
* 2021-03-03-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.iothub.v2021_03_03_preview.operations.PrivateEndpointConnectionsOperations>`
"""
api_version = self._get_api_version('private_endpoint_connections')
if api_version == '2020-03-01':
from .v2020_03_01.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2021-03-03-preview':
from .v2021_03_03_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 @@ -243,10 +272,13 @@ def private_link_resources(self):
"""Instance depends on the API version:
* 2020-03-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.iothub.v2020_03_01.operations.PrivateLinkResourcesOperations>`
* 2021-03-03-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.iothub.v2021_03_03_preview.operations.PrivateLinkResourcesOperations>`
"""
api_version = self._get_api_version('private_link_resources')
if api_version == '2020-03-01':
from .v2020_03_01.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2021-03-03-preview':
from .v2021_03_03_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)))
Expand All @@ -259,6 +291,7 @@ def resource_provider_common(self):
* 2019-03-22: :class:`ResourceProviderCommonOperations<azure.mgmt.iothub.v2019_03_22.operations.ResourceProviderCommonOperations>`
* 2019-11-04: :class:`ResourceProviderCommonOperations<azure.mgmt.iothub.v2019_11_04.operations.ResourceProviderCommonOperations>`
* 2020-03-01: :class:`ResourceProviderCommonOperations<azure.mgmt.iothub.v2020_03_01.operations.ResourceProviderCommonOperations>`
* 2021-03-03-preview: :class:`ResourceProviderCommonOperations<azure.mgmt.iothub.v2021_03_03_preview.operations.ResourceProviderCommonOperations>`
"""
api_version = self._get_api_version('resource_provider_common')
if api_version == '2018-04-01':
Expand All @@ -269,6 +302,8 @@ def resource_provider_common(self):
from .v2019_11_04.operations import ResourceProviderCommonOperations as OperationClass
elif api_version == '2020-03-01':
from .v2020_03_01.operations import ResourceProviderCommonOperations as OperationClass
elif api_version == '2021-03-03-preview':
from .v2021_03_03_preview.operations import ResourceProviderCommonOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'resource_provider_common'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import Any
from typing import Any, TYPE_CHECKING

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

from .._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

class IotHubClientConfiguration(Configuration):
"""Configuration for IotHubClient.
Expand All @@ -31,8 +34,8 @@ class IotHubClientConfiguration(Configuration):

def __init__(
self,
credential, # type: "AsyncTokenCredential"
subscription_id, # type: str
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs # type: Any
) -> None:
if credential is None:
Expand Down
Loading

0 comments on commit 6e94dc4

Please sign in to comment.