Skip to content

Commit

Permalink
CodeGen from PR 19969 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge b29178dec655cc41f2d2b591d8acf2a9439ee5bf into eec106884e9491f000db50c56539fe4c322603e1
  • Loading branch information
SDKAuto committed Aug 31, 2022
1 parent a0ff9ab commit 351da6c
Show file tree
Hide file tree
Showing 411 changed files with 90,424 additions and 53,065 deletions.
10 changes: 5 additions & 5 deletions sdk/iothub/azure-mgmt-iothub/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.7.2",
"autorest": "3.8.4",
"use": [
"@autorest/python@5.12.0",
"@autorest/modelerfour@4.19.3"
"@autorest/python@6.0.1",
"@autorest/modelerfour@4.23.5"
],
"commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb",
"commit": "2e2b50a9ca9c5b775f2cb76f92b950b351f7c1e2",
"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 --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
"autorest_command": "autorest specification/iothub/resource-manager/readme.md --models-mode=msrest --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.0.1 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False",
"readme": "specification/iothub/resource-manager/readme.md"
}
12 changes: 5 additions & 7 deletions sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import TYPE_CHECKING
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
Expand All @@ -18,8 +18,6 @@

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

from azure.core.credentials import TokenCredential

class IotHubClientConfiguration(Configuration):
Expand All @@ -28,16 +26,16 @@ class IotHubClientConfiguration(Configuration):
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription identifier.
:param subscription_id: The subscription identifier. Required.
:type subscription_id: str
"""

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
credential: "TokenCredential",
subscription_id: str,
**kwargs # type: Any
):
# type: (...) -> None
Expand Down
41 changes: 32 additions & 9 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,19 +9,17 @@
# regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING
from typing import Any, Optional, 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
from ._serialization import Deserializer, Serializer

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

from azure.core.credentials import TokenCredential

class _SDKClient(object):
Expand All @@ -42,9 +40,9 @@ class IotHubClient(MultiApiClientMixin, _SDKClient):
The api-version parameter sets the default API version if the operation
group is not described in the profile.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription identifier.
:param subscription_id: The subscription identifier. Required.
:type subscription_id: str
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
Expand All @@ -66,10 +64,10 @@ class IotHubClient(MultiApiClientMixin, _SDKClient):

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
credential: "TokenCredential",
subscription_id: str,
api_version=None, # type: Optional[str]
base_url="https://management.azure.com", # type: str
base_url: str = "https://management.azure.com",
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
Expand Down Expand Up @@ -101,6 +99,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2021-03-31: :mod:`v2021_03_31.models<azure.mgmt.iothub.v2021_03_31.models>`
* 2021-07-01: :mod:`v2021_07_01.models<azure.mgmt.iothub.v2021_07_01.models>`
* 2021-07-02: :mod:`v2021_07_02.models<azure.mgmt.iothub.v2021_07_02.models>`
* 2022-04-30-preview: :mod:`v2022_04_30_preview.models<azure.mgmt.iothub.v2022_04_30_preview.models>`
"""
if api_version == '2016-02-03':
from .v2016_02_03 import models
Expand Down Expand Up @@ -141,6 +140,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2021-07-02':
from .v2021_07_02 import models
return models
elif api_version == '2022-04-30-preview':
from .v2022_04_30_preview import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand All @@ -158,6 +160,7 @@ def certificates(self):
* 2021-03-31: :class:`CertificatesOperations<azure.mgmt.iothub.v2021_03_31.operations.CertificatesOperations>`
* 2021-07-01: :class:`CertificatesOperations<azure.mgmt.iothub.v2021_07_01.operations.CertificatesOperations>`
* 2021-07-02: :class:`CertificatesOperations<azure.mgmt.iothub.v2021_07_02.operations.CertificatesOperations>`
* 2022-04-30-preview: :class:`CertificatesOperations<azure.mgmt.iothub.v2022_04_30_preview.operations.CertificatesOperations>`
"""
api_version = self._get_api_version('certificates')
if api_version == '2017-07-01':
Expand All @@ -182,6 +185,8 @@ def certificates(self):
from .v2021_07_01.operations import CertificatesOperations as OperationClass
elif api_version == '2021-07-02':
from .v2021_07_02.operations import CertificatesOperations as OperationClass
elif api_version == '2022-04-30-preview':
from .v2022_04_30_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 @@ -198,6 +203,7 @@ def iot_hub(self):
* 2021-03-31: :class:`IotHubOperations<azure.mgmt.iothub.v2021_03_31.operations.IotHubOperations>`
* 2021-07-01: :class:`IotHubOperations<azure.mgmt.iothub.v2021_07_01.operations.IotHubOperations>`
* 2021-07-02: :class:`IotHubOperations<azure.mgmt.iothub.v2021_07_02.operations.IotHubOperations>`
* 2022-04-30-preview: :class:`IotHubOperations<azure.mgmt.iothub.v2022_04_30_preview.operations.IotHubOperations>`
"""
api_version = self._get_api_version('iot_hub')
if api_version == '2019-03-22':
Expand All @@ -216,6 +222,8 @@ def iot_hub(self):
from .v2021_07_01.operations import IotHubOperations as OperationClass
elif api_version == '2021-07-02':
from .v2021_07_02.operations import IotHubOperations as OperationClass
elif api_version == '2022-04-30-preview':
from .v2022_04_30_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 @@ -237,6 +245,7 @@ def iot_hub_resource(self):
* 2021-03-31: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2021_03_31.operations.IotHubResourceOperations>`
* 2021-07-01: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2021_07_01.operations.IotHubResourceOperations>`
* 2021-07-02: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2021_07_02.operations.IotHubResourceOperations>`
* 2022-04-30-preview: :class:`IotHubResourceOperations<azure.mgmt.iothub.v2022_04_30_preview.operations.IotHubResourceOperations>`
"""
api_version = self._get_api_version('iot_hub_resource')
if api_version == '2016-02-03':
Expand Down Expand Up @@ -265,6 +274,8 @@ def iot_hub_resource(self):
from .v2021_07_01.operations import IotHubResourceOperations as OperationClass
elif api_version == '2021-07-02':
from .v2021_07_02.operations import IotHubResourceOperations as OperationClass
elif api_version == '2022-04-30-preview':
from .v2022_04_30_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 @@ -284,6 +295,7 @@ def operations(self):
* 2021-03-31: :class:`Operations<azure.mgmt.iothub.v2021_03_31.operations.Operations>`
* 2021-07-01: :class:`Operations<azure.mgmt.iothub.v2021_07_01.operations.Operations>`
* 2021-07-02: :class:`Operations<azure.mgmt.iothub.v2021_07_02.operations.Operations>`
* 2022-04-30-preview: :class:`Operations<azure.mgmt.iothub.v2022_04_30_preview.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2017-07-01':
Expand All @@ -308,6 +320,8 @@ def operations(self):
from .v2021_07_01.operations import Operations as OperationClass
elif api_version == '2021-07-02':
from .v2021_07_02.operations import Operations as OperationClass
elif api_version == '2022-04-30-preview':
from .v2022_04_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 @@ -321,6 +335,7 @@ def private_endpoint_connections(self):
* 2021-03-31: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.iothub.v2021_03_31.operations.PrivateEndpointConnectionsOperations>`
* 2021-07-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.iothub.v2021_07_01.operations.PrivateEndpointConnectionsOperations>`
* 2021-07-02: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.iothub.v2021_07_02.operations.PrivateEndpointConnectionsOperations>`
* 2022-04-30-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.iothub.v2022_04_30_preview.operations.PrivateEndpointConnectionsOperations>`
"""
api_version = self._get_api_version('private_endpoint_connections')
if api_version == '2020-03-01':
Expand All @@ -333,6 +348,8 @@ def private_endpoint_connections(self):
from .v2021_07_01.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2021-07-02':
from .v2021_07_02.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2022-04-30-preview':
from .v2022_04_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 @@ -346,6 +363,7 @@ def private_link_resources(self):
* 2021-03-31: :class:`PrivateLinkResourcesOperations<azure.mgmt.iothub.v2021_03_31.operations.PrivateLinkResourcesOperations>`
* 2021-07-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.iothub.v2021_07_01.operations.PrivateLinkResourcesOperations>`
* 2021-07-02: :class:`PrivateLinkResourcesOperations<azure.mgmt.iothub.v2021_07_02.operations.PrivateLinkResourcesOperations>`
* 2022-04-30-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.iothub.v2022_04_30_preview.operations.PrivateLinkResourcesOperations>`
"""
api_version = self._get_api_version('private_link_resources')
if api_version == '2020-03-01':
Expand All @@ -358,6 +376,8 @@ def private_link_resources(self):
from .v2021_07_01.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2021-07-02':
from .v2021_07_02.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2022-04-30-preview':
from .v2022_04_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)))
Expand All @@ -375,6 +395,7 @@ def resource_provider_common(self):
* 2021-03-31: :class:`ResourceProviderCommonOperations<azure.mgmt.iothub.v2021_03_31.operations.ResourceProviderCommonOperations>`
* 2021-07-01: :class:`ResourceProviderCommonOperations<azure.mgmt.iothub.v2021_07_01.operations.ResourceProviderCommonOperations>`
* 2021-07-02: :class:`ResourceProviderCommonOperations<azure.mgmt.iothub.v2021_07_02.operations.ResourceProviderCommonOperations>`
* 2022-04-30-preview: :class:`ResourceProviderCommonOperations<azure.mgmt.iothub.v2022_04_30_preview.operations.ResourceProviderCommonOperations>`
"""
api_version = self._get_api_version('resource_provider_common')
if api_version == '2018-04-01':
Expand All @@ -395,6 +416,8 @@ def resource_provider_common(self):
from .v2021_07_01.operations import ResourceProviderCommonOperations as OperationClass
elif api_version == '2021-07-02':
from .v2021_07_02.operations import ResourceProviderCommonOperations as OperationClass
elif api_version == '2022-04-30-preview':
from .v2022_04_30_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
Loading

0 comments on commit 351da6c

Please sign in to comment.