From 801f894ae6a854425eea6a47ab65f203fd7b3a11 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 25 Aug 2021 02:02:15 +0000 Subject: [PATCH] CodeGen from PR 15722 in Azure/azure-rest-api-specs Removing readonly for isVerified property as it is no more readonly property (#15722) --- sdk/iothub/azure-mgmt-iothub/_meta.json | 11 +- .../azure/mgmt/iothub/_iot_hub_client.py | 27 +- .../azure/mgmt/iothub/aio/_iot_hub_client.py | 27 +- .../azure/mgmt/iothub/models.py | 2 +- .../azure/mgmt/iothub/v2016_02_03/_version.py | 2 +- .../_iot_hub_resource_operations.py | 50 +- .../_iot_hub_resource_operations.py | 8 +- .../azure/mgmt/iothub/v2017_01_19/_version.py | 2 +- .../_iot_hub_resource_operations.py | 50 +- .../_iot_hub_resource_operations.py | 8 +- .../azure/mgmt/iothub/v2017_07_01/_version.py | 2 +- .../operations/_certificates_operations.py | 12 +- .../_iot_hub_resource_operations.py | 50 +- .../v2017_07_01/aio/operations/_operations.py | 2 +- .../_iot_hub_resource_operations.py | 8 +- .../azure/mgmt/iothub/v2018_01_22/_version.py | 2 +- .../operations/_certificates_operations.py | 12 +- .../_iot_hub_resource_operations.py | 58 +- .../v2018_01_22/aio/operations/_operations.py | 2 +- .../_iot_hub_resource_operations.py | 12 +- .../azure/mgmt/iothub/v2018_04_01/_version.py | 2 +- .../operations/_certificates_operations.py | 12 +- .../_iot_hub_resource_operations.py | 64 +- .../v2018_04_01/aio/operations/_operations.py | 2 +- .../_resource_provider_common_operations.py | 2 +- .../mgmt/iothub/v2018_04_01/models/_models.py | 12 +- .../iothub/v2018_04_01/models/_models_py3.py | 20 +- .../_iot_hub_resource_operations.py | 12 +- .../azure/mgmt/iothub/v2019_03_22/_version.py | 2 +- .../operations/_certificates_operations.py | 12 +- .../aio/operations/_iot_hub_operations.py | 8 +- .../_iot_hub_resource_operations.py | 64 +- .../v2019_03_22/aio/operations/_operations.py | 2 +- .../_resource_provider_common_operations.py | 2 +- .../mgmt/iothub/v2019_03_22/models/_models.py | 12 +- .../iothub/v2019_03_22/models/_models_py3.py | 20 +- .../operations/_iot_hub_operations.py | 4 +- .../_iot_hub_resource_operations.py | 12 +- .../iothub/v2019_07_01_preview/_version.py | 2 +- .../operations/_certificates_operations.py | 12 +- .../aio/operations/_iot_hub_operations.py | 8 +- .../_iot_hub_resource_operations.py | 64 +- .../aio/operations/_operations.py | 2 +- .../_resource_provider_common_operations.py | 2 +- .../v2019_07_01_preview/models/_models.py | 12 +- .../v2019_07_01_preview/models/_models_py3.py | 20 +- .../operations/_iot_hub_operations.py | 4 +- .../_iot_hub_resource_operations.py | 12 +- .../azure/mgmt/iothub/v2019_11_04/_version.py | 2 +- .../operations/_certificates_operations.py | 12 +- .../aio/operations/_iot_hub_operations.py | 8 +- .../_iot_hub_resource_operations.py | 64 +- .../v2019_11_04/aio/operations/_operations.py | 2 +- .../_resource_provider_common_operations.py | 2 +- .../mgmt/iothub/v2019_11_04/models/_models.py | 12 +- .../iothub/v2019_11_04/models/_models_py3.py | 20 +- .../operations/_iot_hub_operations.py | 4 +- .../_iot_hub_resource_operations.py | 12 +- .../azure/mgmt/iothub/v2020_03_01/_version.py | 2 +- .../operations/_certificates_operations.py | 12 +- .../aio/operations/_iot_hub_operations.py | 8 +- .../_iot_hub_resource_operations.py | 64 +- .../v2020_03_01/aio/operations/_operations.py | 2 +- ...private_endpoint_connections_operations.py | 20 +- .../_private_link_resources_operations.py | 4 +- .../_resource_provider_common_operations.py | 2 +- .../mgmt/iothub/v2020_03_01/models/_models.py | 12 +- .../iothub/v2020_03_01/models/_models_py3.py | 20 +- .../operations/_iot_hub_operations.py | 4 +- .../_iot_hub_resource_operations.py | 12 +- ...private_endpoint_connections_operations.py | 8 +- .../iothub/v2021_03_03_preview/_version.py | 2 +- .../operations/_certificates_operations.py | 12 +- .../aio/operations/_iot_hub_operations.py | 8 +- .../_iot_hub_resource_operations.py | 64 +- .../aio/operations/_operations.py | 2 +- ...private_endpoint_connections_operations.py | 20 +- .../_private_link_resources_operations.py | 4 +- .../_resource_provider_common_operations.py | 2 +- .../v2021_03_03_preview/models/_models.py | 12 +- .../v2021_03_03_preview/models/_models_py3.py | 20 +- .../operations/_iot_hub_operations.py | 4 +- .../_iot_hub_resource_operations.py | 12 +- ...private_endpoint_connections_operations.py | 8 +- .../azure/mgmt/iothub/v2021_03_31/_version.py | 2 +- .../operations/_certificates_operations.py | 12 +- .../aio/operations/_iot_hub_operations.py | 8 +- .../_iot_hub_resource_operations.py | 64 +- .../v2021_03_31/aio/operations/_operations.py | 2 +- ...private_endpoint_connections_operations.py | 20 +- .../_private_link_resources_operations.py | 4 +- .../_resource_provider_common_operations.py | 2 +- .../mgmt/iothub/v2021_03_31/models/_models.py | 14 +- .../iothub/v2021_03_31/models/_models_py3.py | 24 +- .../operations/_iot_hub_operations.py | 4 +- .../_iot_hub_resource_operations.py | 12 +- ...private_endpoint_connections_operations.py | 8 +- .../azure/mgmt/iothub/v2021_07_01/__init__.py | 19 + .../mgmt/iothub/v2021_07_01/_configuration.py | 71 + .../iothub/v2021_07_01/_iot_hub_client.py | 119 + .../mgmt/iothub/v2021_07_01/_metadata.json | 109 + .../azure/mgmt/iothub/v2021_07_01/_version.py | 9 + .../mgmt/iothub/v2021_07_01/aio/__init__.py | 10 + .../iothub/v2021_07_01/aio/_configuration.py | 67 + .../iothub/v2021_07_01/aio/_iot_hub_client.py | 112 + .../v2021_07_01/aio/operations/__init__.py | 25 + .../operations/_certificates_operations.py | 464 +++ .../aio/operations/_iot_hub_operations.py | 167 + .../_iot_hub_resource_operations.py | 1857 +++++++++ .../v2021_07_01/aio/operations/_operations.py | 105 + ...private_endpoint_connections_operations.py | 436 +++ .../_private_link_resources_operations.py | 167 + .../_resource_provider_common_operations.py | 94 + .../iothub/v2021_07_01/models/__init__.py | 301 ++ .../models/_iot_hub_client_enums.py | 231 ++ .../mgmt/iothub/v2021_07_01/models/_models.py | 3026 +++++++++++++++ .../iothub/v2021_07_01/models/_models_py3.py | 3317 +++++++++++++++++ .../iothub/v2021_07_01/operations/__init__.py | 25 + .../operations/_certificates_operations.py | 474 +++ .../operations/_iot_hub_operations.py | 173 + .../_iot_hub_resource_operations.py | 1887 ++++++++++ .../v2021_07_01/operations/_operations.py | 110 + ...private_endpoint_connections_operations.py | 446 +++ .../_private_link_resources_operations.py | 173 + .../_resource_provider_common_operations.py | 99 + .../azure/mgmt/iothub/v2021_07_01/py.typed | 1 + 126 files changed, 14822 insertions(+), 675 deletions(-) create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/__init__.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_configuration.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_iot_hub_client.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_metadata.json create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_version.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/__init__.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/_configuration.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/_iot_hub_client.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/__init__.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_certificates_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_iot_hub_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_iot_hub_resource_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_private_link_resources_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_resource_provider_common_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/__init__.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/_iot_hub_client_enums.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/_models.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/_models_py3.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/__init__.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_certificates_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_iot_hub_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_iot_hub_resource_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_private_link_resources_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_resource_provider_common_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/py.typed diff --git a/sdk/iothub/azure-mgmt-iothub/_meta.json b/sdk/iothub/azure-mgmt-iothub/_meta.json index 2426a3f90ba0..1e15d4ff063d 100644 --- a/sdk/iothub/azure-mgmt-iothub/_meta.json +++ b/sdk/iothub/azure-mgmt-iothub/_meta.json @@ -1,8 +1,11 @@ { - "autorest": "3.3.0", - "use": "@autorest/python@5.6.6", - "commit": "495e6fd12856cf3d909125b1119c83a3a9f18a8a", + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "1f327d204d0c1835d7ee675d93b423028341a6b7", "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/python@5.6.6 --version=3.3.0", + "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/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/iothub/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/_iot_hub_client.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/_iot_hub_client.py index 5b416c4da857..7bc8275a0cc3 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/_iot_hub_client.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/_iot_hub_client.py @@ -56,7 +56,7 @@ class IotHubClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2021-03-31' + DEFAULT_API_VERSION = '2021-07-01' _PROFILE_TAG = "azure.mgmt.iothub.IotHubClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -102,6 +102,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2020-03-01: :mod:`v2020_03_01.models` * 2021-03-03-preview: :mod:`v2021_03_03_preview.models` * 2021-03-31: :mod:`v2021_03_31.models` + * 2021-07-01: :mod:`v2021_07_01.models` """ if api_version == '2016-02-03': from .v2016_02_03 import models @@ -136,6 +137,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-03-31': from .v2021_03_31 import models return models + elif api_version == '2021-07-01': + from .v2021_07_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -151,6 +155,7 @@ def certificates(self): * 2020-03-01: :class:`CertificatesOperations` * 2021-03-03-preview: :class:`CertificatesOperations` * 2021-03-31: :class:`CertificatesOperations` + * 2021-07-01: :class:`CertificatesOperations` """ api_version = self._get_api_version('certificates') if api_version == '2017-07-01': @@ -171,6 +176,8 @@ def certificates(self): from .v2021_03_03_preview.operations import CertificatesOperations as OperationClass elif api_version == '2021-03-31': from .v2021_03_31.operations import CertificatesOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -185,6 +192,7 @@ def iot_hub(self): * 2020-03-01: :class:`IotHubOperations` * 2021-03-03-preview: :class:`IotHubOperations` * 2021-03-31: :class:`IotHubOperations` + * 2021-07-01: :class:`IotHubOperations` """ api_version = self._get_api_version('iot_hub') if api_version == '2019-03-22': @@ -199,6 +207,8 @@ def iot_hub(self): from .v2021_03_03_preview.operations import IotHubOperations as OperationClass elif api_version == '2021-03-31': from .v2021_03_31.operations import IotHubOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -218,6 +228,7 @@ def iot_hub_resource(self): * 2020-03-01: :class:`IotHubResourceOperations` * 2021-03-03-preview: :class:`IotHubResourceOperations` * 2021-03-31: :class:`IotHubResourceOperations` + * 2021-07-01: :class:`IotHubResourceOperations` """ api_version = self._get_api_version('iot_hub_resource') if api_version == '2016-02-03': @@ -242,6 +253,8 @@ def iot_hub_resource(self): from .v2021_03_03_preview.operations import IotHubResourceOperations as OperationClass elif api_version == '2021-03-31': from .v2021_03_31.operations import IotHubResourceOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -259,6 +272,7 @@ def operations(self): * 2020-03-01: :class:`Operations` * 2021-03-03-preview: :class:`Operations` * 2021-03-31: :class:`Operations` + * 2021-07-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-07-01': @@ -279,6 +293,8 @@ def operations(self): from .v2021_03_03_preview.operations import Operations as OperationClass elif api_version == '2021-03-31': from .v2021_03_31.operations import Operations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -290,6 +306,7 @@ def private_endpoint_connections(self): * 2020-03-01: :class:`PrivateEndpointConnectionsOperations` * 2021-03-03-preview: :class:`PrivateEndpointConnectionsOperations` * 2021-03-31: :class:`PrivateEndpointConnectionsOperations` + * 2021-07-01: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-03-01': @@ -298,6 +315,8 @@ def private_endpoint_connections(self): from .v2021_03_03_preview.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2021-03-31': from .v2021_03_31.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -309,6 +328,7 @@ def private_link_resources(self): * 2020-03-01: :class:`PrivateLinkResourcesOperations` * 2021-03-03-preview: :class:`PrivateLinkResourcesOperations` * 2021-03-31: :class:`PrivateLinkResourcesOperations` + * 2021-07-01: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-03-01': @@ -317,6 +337,8 @@ def private_link_resources(self): from .v2021_03_03_preview.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2021-03-31': from .v2021_03_31.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) @@ -332,6 +354,7 @@ def resource_provider_common(self): * 2020-03-01: :class:`ResourceProviderCommonOperations` * 2021-03-03-preview: :class:`ResourceProviderCommonOperations` * 2021-03-31: :class:`ResourceProviderCommonOperations` + * 2021-07-01: :class:`ResourceProviderCommonOperations` """ api_version = self._get_api_version('resource_provider_common') if api_version == '2018-04-01': @@ -348,6 +371,8 @@ def resource_provider_common(self): from .v2021_03_03_preview.operations import ResourceProviderCommonOperations as OperationClass elif api_version == '2021-03-31': from .v2021_03_31.operations import ResourceProviderCommonOperations as OperationClass + elif api_version == '2021-07-01': + from .v2021_07_01.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))) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/aio/_iot_hub_client.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/aio/_iot_hub_client.py index 08328758a18d..92ad0119e2e9 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/aio/_iot_hub_client.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/aio/_iot_hub_client.py @@ -54,7 +54,7 @@ class IotHubClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2021-03-31' + DEFAULT_API_VERSION = '2021-07-01' _PROFILE_TAG = "azure.mgmt.iothub.IotHubClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -100,6 +100,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2020-03-01: :mod:`v2020_03_01.models` * 2021-03-03-preview: :mod:`v2021_03_03_preview.models` * 2021-03-31: :mod:`v2021_03_31.models` + * 2021-07-01: :mod:`v2021_07_01.models` """ if api_version == '2016-02-03': from ..v2016_02_03 import models @@ -134,6 +135,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-03-31': from ..v2021_03_31 import models return models + elif api_version == '2021-07-01': + from ..v2021_07_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -149,6 +153,7 @@ def certificates(self): * 2020-03-01: :class:`CertificatesOperations` * 2021-03-03-preview: :class:`CertificatesOperations` * 2021-03-31: :class:`CertificatesOperations` + * 2021-07-01: :class:`CertificatesOperations` """ api_version = self._get_api_version('certificates') if api_version == '2017-07-01': @@ -169,6 +174,8 @@ def certificates(self): from ..v2021_03_03_preview.aio.operations import CertificatesOperations as OperationClass elif api_version == '2021-03-31': from ..v2021_03_31.aio.operations import CertificatesOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.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))) @@ -183,6 +190,7 @@ def iot_hub(self): * 2020-03-01: :class:`IotHubOperations` * 2021-03-03-preview: :class:`IotHubOperations` * 2021-03-31: :class:`IotHubOperations` + * 2021-07-01: :class:`IotHubOperations` """ api_version = self._get_api_version('iot_hub') if api_version == '2019-03-22': @@ -197,6 +205,8 @@ def iot_hub(self): from ..v2021_03_03_preview.aio.operations import IotHubOperations as OperationClass elif api_version == '2021-03-31': from ..v2021_03_31.aio.operations import IotHubOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.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))) @@ -216,6 +226,7 @@ def iot_hub_resource(self): * 2020-03-01: :class:`IotHubResourceOperations` * 2021-03-03-preview: :class:`IotHubResourceOperations` * 2021-03-31: :class:`IotHubResourceOperations` + * 2021-07-01: :class:`IotHubResourceOperations` """ api_version = self._get_api_version('iot_hub_resource') if api_version == '2016-02-03': @@ -240,6 +251,8 @@ def iot_hub_resource(self): from ..v2021_03_03_preview.aio.operations import IotHubResourceOperations as OperationClass elif api_version == '2021-03-31': from ..v2021_03_31.aio.operations import IotHubResourceOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.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))) @@ -257,6 +270,7 @@ def operations(self): * 2020-03-01: :class:`Operations` * 2021-03-03-preview: :class:`Operations` * 2021-03-31: :class:`Operations` + * 2021-07-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-07-01': @@ -277,6 +291,8 @@ def operations(self): from ..v2021_03_03_preview.aio.operations import Operations as OperationClass elif api_version == '2021-03-31': from ..v2021_03_31.aio.operations import Operations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.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))) @@ -288,6 +304,7 @@ def private_endpoint_connections(self): * 2020-03-01: :class:`PrivateEndpointConnectionsOperations` * 2021-03-03-preview: :class:`PrivateEndpointConnectionsOperations` * 2021-03-31: :class:`PrivateEndpointConnectionsOperations` + * 2021-07-01: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-03-01': @@ -296,6 +313,8 @@ def private_endpoint_connections(self): from ..v2021_03_03_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2021-03-31': from ..v2021_03_31.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.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))) @@ -307,6 +326,7 @@ def private_link_resources(self): * 2020-03-01: :class:`PrivateLinkResourcesOperations` * 2021-03-03-preview: :class:`PrivateLinkResourcesOperations` * 2021-03-31: :class:`PrivateLinkResourcesOperations` + * 2021-07-01: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-03-01': @@ -315,6 +335,8 @@ def private_link_resources(self): from ..v2021_03_03_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2021-03-31': from ..v2021_03_31.aio.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.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))) @@ -330,6 +352,7 @@ def resource_provider_common(self): * 2020-03-01: :class:`ResourceProviderCommonOperations` * 2021-03-03-preview: :class:`ResourceProviderCommonOperations` * 2021-03-31: :class:`ResourceProviderCommonOperations` + * 2021-07-01: :class:`ResourceProviderCommonOperations` """ api_version = self._get_api_version('resource_provider_common') if api_version == '2018-04-01': @@ -346,6 +369,8 @@ def resource_provider_common(self): from ..v2021_03_03_preview.aio.operations import ResourceProviderCommonOperations as OperationClass elif api_version == '2021-03-31': from ..v2021_03_31.aio.operations import ResourceProviderCommonOperations as OperationClass + elif api_version == '2021-07-01': + from ..v2021_07_01.aio.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))) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/models.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/models.py index 741ec6871f50..059efe06ada8 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/models.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/models.py @@ -4,4 +4,4 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from .v2021_03_31.models import * +from .v2021_07_01.models import * diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2016_02_03/_version.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2016_02_03/_version.py index 48944bf3938a..e5754a47ce68 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2016_02_03/_version.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2016_02_03/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2016_02_03/aio/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2016_02_03/aio/operations/_iot_hub_resource_operations.py index 384ab94f1da4..7e51870c2283 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2016_02_03/aio/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2016_02_03/aio/operations/_iot_hub_resource_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": """Get the non-security related metadata of an IoT hub. @@ -109,7 +109,7 @@ async def _create_or_update_initial( resource_group_name: str, resource_name: str, iot_hub_description: "_models.IotHubDescription", - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -167,7 +167,7 @@ async def begin_create_or_update( resource_group_name: str, resource_name: str, iot_hub_description: "_models.IotHubDescription", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Create or update the metadata of an IoT hub. @@ -185,8 +185,8 @@ async def begin_create_or_update( :type iot_hub_description: ~azure.mgmt.iothub.v2016_02_03.models.IotHubDescription :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -243,7 +243,7 @@ async def _delete_initial( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]] error_map = { @@ -299,7 +299,7 @@ async def begin_delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: """Delete an IoT hub. @@ -311,8 +311,8 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -366,7 +366,7 @@ def get_long_running_output(pipeline_response): def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a subscription. @@ -436,7 +436,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a resource group. @@ -510,7 +510,7 @@ async def get_stats( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.RegistryStatistics": """Get the statistics from an IoT hub. @@ -571,7 +571,7 @@ def get_valid_skus( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubSkuDescriptionListResult"]: """Get the list of valid SKUs for an IoT hub. @@ -649,7 +649,7 @@ def list_event_hub_consumer_groups( resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EventHubConsumerGroupsListResult"]: """Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. @@ -732,7 +732,7 @@ async def get_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. @@ -801,7 +801,7 @@ async def create_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. @@ -870,7 +870,7 @@ async def delete_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. @@ -934,7 +934,7 @@ def list_jobs( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResponseListResult"]: """Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1013,7 +1013,7 @@ async def get_job( resource_group_name: str, resource_name: str, job_id: str, - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1078,7 +1078,7 @@ def get_quota_metrics( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubQuotaMetricInfoListResult"]: """Get the quota metrics for an IoT hub. @@ -1154,7 +1154,7 @@ async def get_next(next_link=None): async def check_name_availability( self, operation_inputs: "_models.OperationInputs", - **kwargs + **kwargs: Any ) -> "_models.IotHubNameAvailabilityInfo": """Check if an IoT hub name is available. @@ -1217,7 +1217,7 @@ def list_keys( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SharedAccessSignatureAuthorizationRuleListResult"]: """Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1296,7 +1296,7 @@ async def get_keys_for_key_name( resource_group_name: str, resource_name: str, key_name: str, - **kwargs + **kwargs: Any ) -> "_models.SharedAccessSignatureAuthorizationRule": """Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1362,7 +1362,7 @@ async def export_devices( resource_group_name: str, resource_name: str, export_devices_parameters: "_models.ExportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. @@ -1433,7 +1433,7 @@ async def import_devices( resource_group_name: str, resource_name: str, import_devices_parameters: "_models.ImportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2016_02_03/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2016_02_03/operations/_iot_hub_resource_operations.py index d9fd44c0541b..3d1bb9d52598 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2016_02_03/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2016_02_03/operations/_iot_hub_resource_operations.py @@ -192,8 +192,8 @@ def begin_create_or_update( :type iot_hub_description: ~azure.mgmt.iothub.v2016_02_03.models.IotHubDescription :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -320,8 +320,8 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/_version.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/_version.py index 48944bf3938a..e5754a47ce68 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/_version.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/aio/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/aio/operations/_iot_hub_resource_operations.py index 0995929a66c0..2a33be26b012 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/aio/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/aio/operations/_iot_hub_resource_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": """Get the non-security related metadata of an IoT hub. @@ -109,7 +109,7 @@ async def _create_or_update_initial( resource_group_name: str, resource_name: str, iot_hub_description: "_models.IotHubDescription", - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -167,7 +167,7 @@ async def begin_create_or_update( resource_group_name: str, resource_name: str, iot_hub_description: "_models.IotHubDescription", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Create or update the metadata of an IoT hub. @@ -185,8 +185,8 @@ async def begin_create_or_update( :type iot_hub_description: ~azure.mgmt.iothub.v2017_01_19.models.IotHubDescription :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -243,7 +243,7 @@ async def _delete_initial( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]] error_map = { @@ -299,7 +299,7 @@ async def begin_delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: """Delete an IoT hub. @@ -311,8 +311,8 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -366,7 +366,7 @@ def get_long_running_output(pipeline_response): def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a subscription. @@ -436,7 +436,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a resource group. @@ -510,7 +510,7 @@ async def get_stats( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.RegistryStatistics": """Get the statistics from an IoT hub. @@ -571,7 +571,7 @@ def get_valid_skus( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubSkuDescriptionListResult"]: """Get the list of valid SKUs for an IoT hub. @@ -649,7 +649,7 @@ def list_event_hub_consumer_groups( resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EventHubConsumerGroupsListResult"]: """Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. @@ -732,7 +732,7 @@ async def get_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. @@ -801,7 +801,7 @@ async def create_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. @@ -870,7 +870,7 @@ async def delete_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. @@ -934,7 +934,7 @@ def list_jobs( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResponseListResult"]: """Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1013,7 +1013,7 @@ async def get_job( resource_group_name: str, resource_name: str, job_id: str, - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1078,7 +1078,7 @@ def get_quota_metrics( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubQuotaMetricInfoListResult"]: """Get the quota metrics for an IoT hub. @@ -1154,7 +1154,7 @@ async def get_next(next_link=None): async def check_name_availability( self, operation_inputs: "_models.OperationInputs", - **kwargs + **kwargs: Any ) -> "_models.IotHubNameAvailabilityInfo": """Check if an IoT hub name is available. @@ -1217,7 +1217,7 @@ def list_keys( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SharedAccessSignatureAuthorizationRuleListResult"]: """Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1296,7 +1296,7 @@ async def get_keys_for_key_name( resource_group_name: str, resource_name: str, key_name: str, - **kwargs + **kwargs: Any ) -> "_models.SharedAccessSignatureAuthorizationRule": """Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1362,7 +1362,7 @@ async def export_devices( resource_group_name: str, resource_name: str, export_devices_parameters: "_models.ExportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. @@ -1433,7 +1433,7 @@ async def import_devices( resource_group_name: str, resource_name: str, import_devices_parameters: "_models.ImportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/operations/_iot_hub_resource_operations.py index d2e9ea4df1e5..147bfad382cd 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_01_19/operations/_iot_hub_resource_operations.py @@ -192,8 +192,8 @@ def begin_create_or_update( :type iot_hub_description: ~azure.mgmt.iothub.v2017_01_19.models.IotHubDescription :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -320,8 +320,8 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/_version.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/_version.py index 48944bf3938a..e5754a47ce68 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/_version.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/aio/operations/_certificates_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/aio/operations/_certificates_operations.py index 7496b1975f37..d6525ec37b30 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/aio/operations/_certificates_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/aio/operations/_certificates_operations.py @@ -44,7 +44,7 @@ async def list_by_iot_hub( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateListDescription": """Get the certificate list. @@ -106,7 +106,7 @@ async def get( resource_group_name: str, resource_name: str, certificate_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Get the certificate. @@ -173,7 +173,7 @@ async def create_or_update( certificate_name: str, certificate_description: "_models.CertificateBodyDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Upload the certificate to the IoT hub. @@ -255,7 +255,7 @@ async def delete( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> None: """Delete an X509 certificate. @@ -321,7 +321,7 @@ async def generate_verification_code( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateWithNonceDescription": """Generate verification code for proof of possession flow. @@ -392,7 +392,7 @@ async def verify( certificate_name: str, if_match: str, certificate_verification_body: "_models.CertificateVerificationDescription", - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Verify certificate's private key possession. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/aio/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/aio/operations/_iot_hub_resource_operations.py index 25662122bb60..dccd4e4bacc5 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/aio/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/aio/operations/_iot_hub_resource_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": """Get the non-security related metadata of an IoT hub. @@ -110,7 +110,7 @@ async def _create_or_update_initial( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -171,7 +171,7 @@ async def begin_create_or_update( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Create or update the metadata of an IoT hub. @@ -192,8 +192,8 @@ async def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -251,7 +251,7 @@ async def _delete_initial( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]] error_map = { @@ -307,7 +307,7 @@ async def begin_delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: """Delete an IoT hub. @@ -319,8 +319,8 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -374,7 +374,7 @@ def get_long_running_output(pipeline_response): def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a subscription. @@ -444,7 +444,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a resource group. @@ -518,7 +518,7 @@ async def get_stats( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.RegistryStatistics": """Get the statistics from an IoT hub. @@ -579,7 +579,7 @@ def get_valid_skus( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubSkuDescriptionListResult"]: """Get the list of valid SKUs for an IoT hub. @@ -657,7 +657,7 @@ def list_event_hub_consumer_groups( resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EventHubConsumerGroupsListResult"]: """Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. @@ -740,7 +740,7 @@ async def get_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. @@ -809,7 +809,7 @@ async def create_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. @@ -878,7 +878,7 @@ async def delete_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. @@ -942,7 +942,7 @@ def list_jobs( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResponseListResult"]: """Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1021,7 +1021,7 @@ async def get_job( resource_group_name: str, resource_name: str, job_id: str, - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1086,7 +1086,7 @@ def get_quota_metrics( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubQuotaMetricInfoListResult"]: """Get the quota metrics for an IoT hub. @@ -1162,7 +1162,7 @@ async def get_next(next_link=None): async def check_name_availability( self, operation_inputs: "_models.OperationInputs", - **kwargs + **kwargs: Any ) -> "_models.IotHubNameAvailabilityInfo": """Check if an IoT hub name is available. @@ -1225,7 +1225,7 @@ def list_keys( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SharedAccessSignatureAuthorizationRuleListResult"]: """Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1304,7 +1304,7 @@ async def get_keys_for_key_name( resource_group_name: str, resource_name: str, key_name: str, - **kwargs + **kwargs: Any ) -> "_models.SharedAccessSignatureAuthorizationRule": """Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1370,7 +1370,7 @@ async def export_devices( resource_group_name: str, resource_name: str, export_devices_parameters: "_models.ExportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. @@ -1441,7 +1441,7 @@ async def import_devices( resource_group_name: str, resource_name: str, import_devices_parameters: "_models.ImportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/aio/operations/_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/aio/operations/_operations.py index 515a81d13e04..e18c07af9281 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/aio/operations/_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available IoT Hub REST API operations. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/operations/_iot_hub_resource_operations.py index 643d440b9067..ad374e0f45fb 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/operations/_iot_hub_resource_operations.py @@ -199,8 +199,8 @@ def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -328,8 +328,8 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/_version.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/_version.py index 48944bf3938a..e5754a47ce68 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/_version.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/aio/operations/_certificates_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/aio/operations/_certificates_operations.py index deeaa6708f2d..99a1ed3a7e8c 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/aio/operations/_certificates_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/aio/operations/_certificates_operations.py @@ -44,7 +44,7 @@ async def list_by_iot_hub( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateListDescription": """Get the certificate list. @@ -106,7 +106,7 @@ async def get( resource_group_name: str, resource_name: str, certificate_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Get the certificate. @@ -173,7 +173,7 @@ async def create_or_update( certificate_name: str, certificate_description: "_models.CertificateBodyDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Upload the certificate to the IoT hub. @@ -255,7 +255,7 @@ async def delete( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> None: """Delete an X509 certificate. @@ -321,7 +321,7 @@ async def generate_verification_code( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateWithNonceDescription": """Generate verification code for proof of possession flow. @@ -392,7 +392,7 @@ async def verify( certificate_name: str, if_match: str, certificate_verification_body: "_models.CertificateVerificationDescription", - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Verify certificate's private key possession. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/aio/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/aio/operations/_iot_hub_resource_operations.py index 203567972d98..57193c221bf7 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/aio/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/aio/operations/_iot_hub_resource_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": """Get the non-security related metadata of an IoT hub. @@ -110,7 +110,7 @@ async def _create_or_update_initial( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -171,7 +171,7 @@ async def begin_create_or_update( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Create or update the metadata of an IoT hub. @@ -192,8 +192,8 @@ async def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -252,7 +252,7 @@ async def _update_initial( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -305,7 +305,7 @@ async def begin_update( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Update an existing IoT Hubs tags. @@ -319,8 +319,8 @@ async def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2018_01_22.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -377,7 +377,7 @@ async def _delete_initial( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]] error_map = { @@ -433,7 +433,7 @@ async def begin_delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: """Delete an IoT hub. @@ -445,8 +445,8 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -500,7 +500,7 @@ def get_long_running_output(pipeline_response): def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a subscription. @@ -570,7 +570,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a resource group. @@ -644,7 +644,7 @@ async def get_stats( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.RegistryStatistics": """Get the statistics from an IoT hub. @@ -705,7 +705,7 @@ def get_valid_skus( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubSkuDescriptionListResult"]: """Get the list of valid SKUs for an IoT hub. @@ -783,7 +783,7 @@ def list_event_hub_consumer_groups( resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EventHubConsumerGroupsListResult"]: """Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. @@ -866,7 +866,7 @@ async def get_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. @@ -935,7 +935,7 @@ async def create_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. @@ -1004,7 +1004,7 @@ async def delete_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. @@ -1068,7 +1068,7 @@ def list_jobs( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResponseListResult"]: """Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1147,7 +1147,7 @@ async def get_job( resource_group_name: str, resource_name: str, job_id: str, - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1212,7 +1212,7 @@ def get_quota_metrics( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubQuotaMetricInfoListResult"]: """Get the quota metrics for an IoT hub. @@ -1288,7 +1288,7 @@ async def get_next(next_link=None): async def check_name_availability( self, operation_inputs: "_models.OperationInputs", - **kwargs + **kwargs: Any ) -> "_models.IotHubNameAvailabilityInfo": """Check if an IoT hub name is available. @@ -1351,7 +1351,7 @@ def list_keys( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SharedAccessSignatureAuthorizationRuleListResult"]: """Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1430,7 +1430,7 @@ async def get_keys_for_key_name( resource_group_name: str, resource_name: str, key_name: str, - **kwargs + **kwargs: Any ) -> "_models.SharedAccessSignatureAuthorizationRule": """Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1496,7 +1496,7 @@ async def export_devices( resource_group_name: str, resource_name: str, export_devices_parameters: "_models.ExportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. @@ -1567,7 +1567,7 @@ async def import_devices( resource_group_name: str, resource_name: str, import_devices_parameters: "_models.ImportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/aio/operations/_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/aio/operations/_operations.py index aaa7b933a784..5ced46710767 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/aio/operations/_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available IoT Hub REST API operations. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/operations/_iot_hub_resource_operations.py index 3f4fffc7ec75..173495d79397 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_01_22/operations/_iot_hub_resource_operations.py @@ -199,8 +199,8 @@ def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -328,8 +328,8 @@ def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2018_01_22.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -456,8 +456,8 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/_version.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/_version.py index 48944bf3938a..e5754a47ce68 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/_version.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_certificates_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_certificates_operations.py index f7bada776fde..6f2338e5a2b9 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_certificates_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_certificates_operations.py @@ -44,7 +44,7 @@ async def list_by_iot_hub( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateListDescription": """Get the certificate list. @@ -106,7 +106,7 @@ async def get( resource_group_name: str, resource_name: str, certificate_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Get the certificate. @@ -173,7 +173,7 @@ async def create_or_update( certificate_name: str, certificate_description: "_models.CertificateBodyDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Upload the certificate to the IoT hub. @@ -255,7 +255,7 @@ async def delete( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> None: """Delete an X509 certificate. @@ -321,7 +321,7 @@ async def generate_verification_code( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateWithNonceDescription": """Generate verification code for proof of possession flow. @@ -392,7 +392,7 @@ async def verify( certificate_name: str, if_match: str, certificate_verification_body: "_models.CertificateVerificationDescription", - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Verify certificate's private key possession. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_iot_hub_resource_operations.py index 66b41de9ecc3..6d146901419b 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_iot_hub_resource_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": """Get the non-security related metadata of an IoT hub. @@ -110,7 +110,7 @@ async def _create_or_update_initial( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -171,7 +171,7 @@ async def begin_create_or_update( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Create or update the metadata of an IoT hub. @@ -192,8 +192,8 @@ async def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -252,7 +252,7 @@ async def _update_initial( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -305,7 +305,7 @@ async def begin_update( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Update an existing IoT Hubs tags. @@ -319,8 +319,8 @@ async def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2018_04_01.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -377,7 +377,7 @@ async def _delete_initial( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]] error_map = { @@ -433,7 +433,7 @@ async def begin_delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: """Delete an IoT hub. @@ -445,8 +445,8 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -500,7 +500,7 @@ def get_long_running_output(pipeline_response): def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a subscription. @@ -570,7 +570,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a resource group. @@ -644,7 +644,7 @@ async def get_stats( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.RegistryStatistics": """Get the statistics from an IoT hub. @@ -705,7 +705,7 @@ def get_valid_skus( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubSkuDescriptionListResult"]: """Get the list of valid SKUs for an IoT hub. @@ -783,7 +783,7 @@ def list_event_hub_consumer_groups( resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EventHubConsumerGroupsListResult"]: """Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. @@ -866,7 +866,7 @@ async def get_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. @@ -935,7 +935,7 @@ async def create_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. @@ -1004,7 +1004,7 @@ async def delete_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. @@ -1068,7 +1068,7 @@ def list_jobs( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResponseListResult"]: """Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1147,7 +1147,7 @@ async def get_job( resource_group_name: str, resource_name: str, job_id: str, - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1212,7 +1212,7 @@ def get_quota_metrics( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubQuotaMetricInfoListResult"]: """Get the quota metrics for an IoT hub. @@ -1289,7 +1289,7 @@ def get_endpoint_health( self, resource_group_name: str, iot_hub_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EndpointHealthDataListResult"]: """Get the health for routing endpoints. @@ -1365,7 +1365,7 @@ async def get_next(next_link=None): async def check_name_availability( self, operation_inputs: "_models.OperationInputs", - **kwargs + **kwargs: Any ) -> "_models.IotHubNameAvailabilityInfo": """Check if an IoT hub name is available. @@ -1429,7 +1429,7 @@ async def test_all_routes( iot_hub_name: str, resource_group_name: str, input: "_models.TestAllRoutesInput", - **kwargs + **kwargs: Any ) -> "_models.TestAllRoutesResult": """Test all routes. @@ -1498,7 +1498,7 @@ async def test_route( iot_hub_name: str, resource_group_name: str, input: "_models.TestRouteInput", - **kwargs + **kwargs: Any ) -> "_models.TestRouteResult": """Test the new route. @@ -1566,7 +1566,7 @@ def list_keys( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SharedAccessSignatureAuthorizationRuleListResult"]: """Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1645,7 +1645,7 @@ async def get_keys_for_key_name( resource_group_name: str, resource_name: str, key_name: str, - **kwargs + **kwargs: Any ) -> "_models.SharedAccessSignatureAuthorizationRule": """Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1711,7 +1711,7 @@ async def export_devices( resource_group_name: str, resource_name: str, export_devices_parameters: "_models.ExportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. @@ -1782,7 +1782,7 @@ async def import_devices( resource_group_name: str, resource_name: str, import_devices_parameters: "_models.ImportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_operations.py index 1a0d52047cad..e64469ea5166 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available IoT Hub REST API operations. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_resource_provider_common_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_resource_provider_common_operations.py index e0089dac35b7..66379c6dbde4 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_resource_provider_common_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/operations/_resource_provider_common_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_subscription_quota( self, - **kwargs + **kwargs: Any ) -> "_models.UserSubscriptionQuotaListResult": """Get the number of iot hubs in the subscription. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/models/_models.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/models/_models.py index 5178b3abdbcc..15b86cdf4710 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/models/_models.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/models/_models.py @@ -1938,13 +1938,13 @@ class RoutingTwin(msrest.serialization.Model): """Twin reference input parameter. This is an optional parameter. :param tags: A set of tags. Twin Tags. - :type tags: str + :type tags: any :param properties: :type properties: ~azure.mgmt.iothub.v2018_04_01.models.RoutingTwinProperties """ _attribute_map = { - 'tags': {'key': 'tags', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, } @@ -1961,14 +1961,14 @@ class RoutingTwinProperties(msrest.serialization.Model): """RoutingTwinProperties. :param desired_properties: Twin desired properties. - :type desired_properties: str + :type desired_properties: any :param reported_properties: Twin desired properties. - :type reported_properties: str + :type reported_properties: any """ _attribute_map = { - 'desired_properties': {'key': 'desiredProperties', 'type': 'str'}, - 'reported_properties': {'key': 'reportedProperties', 'type': 'str'}, + 'desired_properties': {'key': 'desiredProperties', 'type': 'object'}, + 'reported_properties': {'key': 'reportedProperties', 'type': 'object'}, } def __init__( diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/models/_models_py3.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/models/_models_py3.py index 4142210dac5e..bb46abdae2ea 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/models/_models_py3.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -2097,20 +2097,20 @@ class RoutingTwin(msrest.serialization.Model): """Twin reference input parameter. This is an optional parameter. :param tags: A set of tags. Twin Tags. - :type tags: str + :type tags: any :param properties: :type properties: ~azure.mgmt.iothub.v2018_04_01.models.RoutingTwinProperties """ _attribute_map = { - 'tags': {'key': 'tags', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, } def __init__( self, *, - tags: Optional[str] = None, + tags: Optional[Any] = None, properties: Optional["RoutingTwinProperties"] = None, **kwargs ): @@ -2123,21 +2123,21 @@ class RoutingTwinProperties(msrest.serialization.Model): """RoutingTwinProperties. :param desired_properties: Twin desired properties. - :type desired_properties: str + :type desired_properties: any :param reported_properties: Twin desired properties. - :type reported_properties: str + :type reported_properties: any """ _attribute_map = { - 'desired_properties': {'key': 'desiredProperties', 'type': 'str'}, - 'reported_properties': {'key': 'reportedProperties', 'type': 'str'}, + 'desired_properties': {'key': 'desiredProperties', 'type': 'object'}, + 'reported_properties': {'key': 'reportedProperties', 'type': 'object'}, } def __init__( self, *, - desired_properties: Optional[str] = None, - reported_properties: Optional[str] = None, + desired_properties: Optional[Any] = None, + reported_properties: Optional[Any] = None, **kwargs ): super(RoutingTwinProperties, self).__init__(**kwargs) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/operations/_iot_hub_resource_operations.py index cf2e2c7a5757..c017f84076e1 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/operations/_iot_hub_resource_operations.py @@ -199,8 +199,8 @@ def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -328,8 +328,8 @@ def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2018_04_01.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -456,8 +456,8 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/_version.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/_version.py index 48944bf3938a..e5754a47ce68 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/_version.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_certificates_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_certificates_operations.py index cb3ee9059642..67eca47974e4 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_certificates_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_certificates_operations.py @@ -44,7 +44,7 @@ async def list_by_iot_hub( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateListDescription": """Get the certificate list. @@ -106,7 +106,7 @@ async def get( resource_group_name: str, resource_name: str, certificate_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Get the certificate. @@ -173,7 +173,7 @@ async def create_or_update( certificate_name: str, certificate_description: "_models.CertificateBodyDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Upload the certificate to the IoT hub. @@ -255,7 +255,7 @@ async def delete( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> None: """Delete an X509 certificate. @@ -321,7 +321,7 @@ async def generate_verification_code( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateWithNonceDescription": """Generate verification code for proof of possession flow. @@ -392,7 +392,7 @@ async def verify( certificate_name: str, if_match: str, certificate_verification_body: "_models.CertificateVerificationDescription", - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Verify certificate's private key possession. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_iot_hub_operations.py index f01e44a77654..c2cb8ac10b48 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_iot_hub_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_iot_hub_operations.py @@ -47,7 +47,7 @@ async def _manual_failover_initial( iot_hub_name: str, resource_group_name: str, failover_input: "_models.FailoverInput", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -98,7 +98,7 @@ async def begin_manual_failover( iot_hub_name: str, resource_group_name: str, failover_input: "_models.FailoverInput", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Manually initiate a failover for the IoT Hub to its secondary region. @@ -115,8 +115,8 @@ async def begin_manual_failover( :type failover_input: ~azure.mgmt.iothub.v2019_03_22.models.FailoverInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_iot_hub_resource_operations.py index 6721dfe911b5..efb90a4b000c 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_iot_hub_resource_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": """Get the non-security related metadata of an IoT hub. @@ -110,7 +110,7 @@ async def _create_or_update_initial( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -171,7 +171,7 @@ async def begin_create_or_update( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Create or update the metadata of an IoT hub. @@ -192,8 +192,8 @@ async def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -252,7 +252,7 @@ async def _update_initial( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -305,7 +305,7 @@ async def begin_update( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Update an existing IoT Hubs tags. @@ -319,8 +319,8 @@ async def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2019_03_22.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -377,7 +377,7 @@ async def _delete_initial( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]] error_map = { @@ -433,7 +433,7 @@ async def begin_delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: """Delete an IoT hub. @@ -445,8 +445,8 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -500,7 +500,7 @@ def get_long_running_output(pipeline_response): def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a subscription. @@ -570,7 +570,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a resource group. @@ -644,7 +644,7 @@ async def get_stats( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.RegistryStatistics": """Get the statistics from an IoT hub. @@ -705,7 +705,7 @@ def get_valid_skus( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubSkuDescriptionListResult"]: """Get the list of valid SKUs for an IoT hub. @@ -783,7 +783,7 @@ def list_event_hub_consumer_groups( resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EventHubConsumerGroupsListResult"]: """Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. @@ -866,7 +866,7 @@ async def get_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. @@ -935,7 +935,7 @@ async def create_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. @@ -1004,7 +1004,7 @@ async def delete_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. @@ -1068,7 +1068,7 @@ def list_jobs( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResponseListResult"]: """Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1147,7 +1147,7 @@ async def get_job( resource_group_name: str, resource_name: str, job_id: str, - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1212,7 +1212,7 @@ def get_quota_metrics( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubQuotaMetricInfoListResult"]: """Get the quota metrics for an IoT hub. @@ -1289,7 +1289,7 @@ def get_endpoint_health( self, resource_group_name: str, iot_hub_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EndpointHealthDataListResult"]: """Get the health for routing endpoints. @@ -1365,7 +1365,7 @@ async def get_next(next_link=None): async def check_name_availability( self, operation_inputs: "_models.OperationInputs", - **kwargs + **kwargs: Any ) -> "_models.IotHubNameAvailabilityInfo": """Check if an IoT hub name is available. @@ -1429,7 +1429,7 @@ async def test_all_routes( iot_hub_name: str, resource_group_name: str, input: "_models.TestAllRoutesInput", - **kwargs + **kwargs: Any ) -> "_models.TestAllRoutesResult": """Test all routes. @@ -1498,7 +1498,7 @@ async def test_route( iot_hub_name: str, resource_group_name: str, input: "_models.TestRouteInput", - **kwargs + **kwargs: Any ) -> "_models.TestRouteResult": """Test the new route. @@ -1566,7 +1566,7 @@ def list_keys( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SharedAccessSignatureAuthorizationRuleListResult"]: """Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1645,7 +1645,7 @@ async def get_keys_for_key_name( resource_group_name: str, resource_name: str, key_name: str, - **kwargs + **kwargs: Any ) -> "_models.SharedAccessSignatureAuthorizationRule": """Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1711,7 +1711,7 @@ async def export_devices( resource_group_name: str, resource_name: str, export_devices_parameters: "_models.ExportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. @@ -1782,7 +1782,7 @@ async def import_devices( resource_group_name: str, resource_name: str, import_devices_parameters: "_models.ImportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_operations.py index 767d94699063..aa1890635d53 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available IoT Hub REST API operations. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_resource_provider_common_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_resource_provider_common_operations.py index 6e0eaaa66f08..c880e562b35a 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_resource_provider_common_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/aio/operations/_resource_provider_common_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_subscription_quota( self, - **kwargs + **kwargs: Any ) -> "_models.UserSubscriptionQuotaListResult": """Get the number of iot hubs in the subscription. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/models/_models.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/models/_models.py index b8c0e90a3bc3..0359132db5a2 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/models/_models.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/models/_models.py @@ -1982,13 +1982,13 @@ class RoutingTwin(msrest.serialization.Model): """Twin reference input parameter. This is an optional parameter. :param tags: A set of tags. Twin Tags. - :type tags: str + :type tags: any :param properties: :type properties: ~azure.mgmt.iothub.v2019_03_22.models.RoutingTwinProperties """ _attribute_map = { - 'tags': {'key': 'tags', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, } @@ -2005,14 +2005,14 @@ class RoutingTwinProperties(msrest.serialization.Model): """RoutingTwinProperties. :param desired: Twin desired properties. - :type desired: str + :type desired: any :param reported: Twin desired properties. - :type reported: str + :type reported: any """ _attribute_map = { - 'desired': {'key': 'desired', 'type': 'str'}, - 'reported': {'key': 'reported', 'type': 'str'}, + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, } def __init__( diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/models/_models_py3.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/models/_models_py3.py index f9c35a23e451..202cfa479536 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/models/_models_py3.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -2143,20 +2143,20 @@ class RoutingTwin(msrest.serialization.Model): """Twin reference input parameter. This is an optional parameter. :param tags: A set of tags. Twin Tags. - :type tags: str + :type tags: any :param properties: :type properties: ~azure.mgmt.iothub.v2019_03_22.models.RoutingTwinProperties """ _attribute_map = { - 'tags': {'key': 'tags', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, } def __init__( self, *, - tags: Optional[str] = None, + tags: Optional[Any] = None, properties: Optional["RoutingTwinProperties"] = None, **kwargs ): @@ -2169,21 +2169,21 @@ class RoutingTwinProperties(msrest.serialization.Model): """RoutingTwinProperties. :param desired: Twin desired properties. - :type desired: str + :type desired: any :param reported: Twin desired properties. - :type reported: str + :type reported: any """ _attribute_map = { - 'desired': {'key': 'desired', 'type': 'str'}, - 'reported': {'key': 'reported', 'type': 'str'}, + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, } def __init__( self, *, - desired: Optional[str] = None, - reported: Optional[str] = None, + desired: Optional[Any] = None, + reported: Optional[Any] = None, **kwargs ): super(RoutingTwinProperties, self).__init__(**kwargs) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/operations/_iot_hub_operations.py index 28329370db17..518aec6fce65 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/operations/_iot_hub_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/operations/_iot_hub_operations.py @@ -121,8 +121,8 @@ def begin_manual_failover( :type failover_input: ~azure.mgmt.iothub.v2019_03_22.models.FailoverInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/operations/_iot_hub_resource_operations.py index a6dce212eef9..754a6e33e4b1 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_03_22/operations/_iot_hub_resource_operations.py @@ -199,8 +199,8 @@ def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -328,8 +328,8 @@ def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2019_03_22.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -456,8 +456,8 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/_version.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/_version.py index 48944bf3938a..e5754a47ce68 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/_version.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_certificates_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_certificates_operations.py index fbbb35d4a06f..ec1a719dae39 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_certificates_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_certificates_operations.py @@ -44,7 +44,7 @@ async def list_by_iot_hub( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateListDescription": """Get the certificate list. @@ -106,7 +106,7 @@ async def get( resource_group_name: str, resource_name: str, certificate_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Get the certificate. @@ -173,7 +173,7 @@ async def create_or_update( certificate_name: str, certificate_description: "_models.CertificateBodyDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Upload the certificate to the IoT hub. @@ -255,7 +255,7 @@ async def delete( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> None: """Delete an X509 certificate. @@ -321,7 +321,7 @@ async def generate_verification_code( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateWithNonceDescription": """Generate verification code for proof of possession flow. @@ -392,7 +392,7 @@ async def verify( certificate_name: str, if_match: str, certificate_verification_body: "_models.CertificateVerificationDescription", - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Verify certificate's private key possession. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_iot_hub_operations.py index b63469b630c0..00b17cbe6034 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_iot_hub_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_iot_hub_operations.py @@ -47,7 +47,7 @@ async def _manual_failover_initial( iot_hub_name: str, resource_group_name: str, failover_input: "_models.FailoverInput", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -98,7 +98,7 @@ async def begin_manual_failover( iot_hub_name: str, resource_group_name: str, failover_input: "_models.FailoverInput", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Manual Failover Fail over. @@ -112,8 +112,8 @@ async def begin_manual_failover( :type failover_input: ~azure.mgmt.iothub.v2019_07_01_preview.models.FailoverInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_iot_hub_resource_operations.py index 692350d82ee1..4e2aa39c4e7d 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_iot_hub_resource_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": """Get the non-security related metadata of an IoT hub. @@ -110,7 +110,7 @@ async def _create_or_update_initial( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -171,7 +171,7 @@ async def begin_create_or_update( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Create or update the metadata of an IoT hub. @@ -192,8 +192,8 @@ async def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -252,7 +252,7 @@ async def _update_initial( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -305,7 +305,7 @@ async def begin_update( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Update an existing IoT Hubs tags. @@ -319,8 +319,8 @@ async def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2019_07_01_preview.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -377,7 +377,7 @@ async def _delete_initial( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]] error_map = { @@ -433,7 +433,7 @@ async def begin_delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: """Delete an IoT hub. @@ -445,8 +445,8 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -500,7 +500,7 @@ def get_long_running_output(pipeline_response): def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a subscription. @@ -570,7 +570,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a resource group. @@ -644,7 +644,7 @@ async def get_stats( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.RegistryStatistics": """Get the statistics from an IoT hub. @@ -705,7 +705,7 @@ def get_valid_skus( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubSkuDescriptionListResult"]: """Get the list of valid SKUs for an IoT hub. @@ -783,7 +783,7 @@ def list_event_hub_consumer_groups( resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EventHubConsumerGroupsListResult"]: """Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. @@ -866,7 +866,7 @@ async def get_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. @@ -935,7 +935,7 @@ async def create_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. @@ -1004,7 +1004,7 @@ async def delete_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. @@ -1068,7 +1068,7 @@ def list_jobs( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResponseListResult"]: """Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1147,7 +1147,7 @@ async def get_job( resource_group_name: str, resource_name: str, job_id: str, - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1212,7 +1212,7 @@ def get_quota_metrics( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubQuotaMetricInfoListResult"]: """Get the quota metrics for an IoT hub. @@ -1289,7 +1289,7 @@ def get_endpoint_health( self, resource_group_name: str, iot_hub_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EndpointHealthDataListResult"]: """Get the health for routing endpoints. @@ -1365,7 +1365,7 @@ async def get_next(next_link=None): async def check_name_availability( self, operation_inputs: "_models.OperationInputs", - **kwargs + **kwargs: Any ) -> "_models.IotHubNameAvailabilityInfo": """Check if an IoT hub name is available. @@ -1429,7 +1429,7 @@ async def test_all_routes( iot_hub_name: str, resource_group_name: str, input: "_models.TestAllRoutesInput", - **kwargs + **kwargs: Any ) -> "_models.TestAllRoutesResult": """Test all routes. @@ -1498,7 +1498,7 @@ async def test_route( iot_hub_name: str, resource_group_name: str, input: "_models.TestRouteInput", - **kwargs + **kwargs: Any ) -> "_models.TestRouteResult": """Test the new route. @@ -1566,7 +1566,7 @@ def list_keys( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SharedAccessSignatureAuthorizationRuleListResult"]: """Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1645,7 +1645,7 @@ async def get_keys_for_key_name( resource_group_name: str, resource_name: str, key_name: str, - **kwargs + **kwargs: Any ) -> "_models.SharedAccessSignatureAuthorizationRule": """Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1711,7 +1711,7 @@ async def export_devices( resource_group_name: str, resource_name: str, export_devices_parameters: "_models.ExportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. @@ -1782,7 +1782,7 @@ async def import_devices( resource_group_name: str, resource_name: str, import_devices_parameters: "_models.ImportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_operations.py index 72444286966c..743295d26784 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available IoT Hub REST API operations. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_resource_provider_common_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_resource_provider_common_operations.py index efc6e9c852c3..f85aaa1dec40 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_resource_provider_common_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/aio/operations/_resource_provider_common_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_subscription_quota( self, - **kwargs + **kwargs: Any ) -> "_models.UserSubscriptionQuotaListResult": """Get the number of iot hubs in the subscription. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/models/_models.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/models/_models.py index 2c9b6d3bacf3..f55305672417 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/models/_models.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/models/_models.py @@ -2048,13 +2048,13 @@ class RoutingTwin(msrest.serialization.Model): """Twin reference input parameter. This is an optional parameter. :param tags: A set of tags. Twin Tags. - :type tags: str + :type tags: any :param properties: :type properties: ~azure.mgmt.iothub.v2019_07_01_preview.models.RoutingTwinProperties """ _attribute_map = { - 'tags': {'key': 'tags', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, } @@ -2071,14 +2071,14 @@ class RoutingTwinProperties(msrest.serialization.Model): """RoutingTwinProperties. :param desired: Twin desired properties. - :type desired: str + :type desired: any :param reported: Twin desired properties. - :type reported: str + :type reported: any """ _attribute_map = { - 'desired': {'key': 'desired', 'type': 'str'}, - 'reported': {'key': 'reported', 'type': 'str'}, + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, } def __init__( diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/models/_models_py3.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/models/_models_py3.py index 1f5dda93152b..9a354236e9c8 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/models/_models_py3.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -2217,20 +2217,20 @@ class RoutingTwin(msrest.serialization.Model): """Twin reference input parameter. This is an optional parameter. :param tags: A set of tags. Twin Tags. - :type tags: str + :type tags: any :param properties: :type properties: ~azure.mgmt.iothub.v2019_07_01_preview.models.RoutingTwinProperties """ _attribute_map = { - 'tags': {'key': 'tags', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, } def __init__( self, *, - tags: Optional[str] = None, + tags: Optional[Any] = None, properties: Optional["RoutingTwinProperties"] = None, **kwargs ): @@ -2243,21 +2243,21 @@ class RoutingTwinProperties(msrest.serialization.Model): """RoutingTwinProperties. :param desired: Twin desired properties. - :type desired: str + :type desired: any :param reported: Twin desired properties. - :type reported: str + :type reported: any """ _attribute_map = { - 'desired': {'key': 'desired', 'type': 'str'}, - 'reported': {'key': 'reported', 'type': 'str'}, + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, } def __init__( self, *, - desired: Optional[str] = None, - reported: Optional[str] = None, + desired: Optional[Any] = None, + reported: Optional[Any] = None, **kwargs ): super(RoutingTwinProperties, self).__init__(**kwargs) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/operations/_iot_hub_operations.py index 0019b5e7c9de..667b2645228a 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/operations/_iot_hub_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/operations/_iot_hub_operations.py @@ -118,8 +118,8 @@ def begin_manual_failover( :type failover_input: ~azure.mgmt.iothub.v2019_07_01_preview.models.FailoverInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/operations/_iot_hub_resource_operations.py index a30b829b5a0f..e556b24941aa 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_07_01_preview/operations/_iot_hub_resource_operations.py @@ -199,8 +199,8 @@ def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -328,8 +328,8 @@ def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2019_07_01_preview.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -456,8 +456,8 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/_version.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/_version.py index 48944bf3938a..e5754a47ce68 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/_version.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_certificates_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_certificates_operations.py index d73a25442cf3..8a941f871504 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_certificates_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_certificates_operations.py @@ -44,7 +44,7 @@ async def list_by_iot_hub( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateListDescription": """Get the certificate list. @@ -106,7 +106,7 @@ async def get( resource_group_name: str, resource_name: str, certificate_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Get the certificate. @@ -173,7 +173,7 @@ async def create_or_update( certificate_name: str, certificate_description: "_models.CertificateBodyDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Upload the certificate to the IoT hub. @@ -255,7 +255,7 @@ async def delete( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> None: """Delete an X509 certificate. @@ -321,7 +321,7 @@ async def generate_verification_code( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateWithNonceDescription": """Generate verification code for proof of possession flow. @@ -392,7 +392,7 @@ async def verify( certificate_name: str, if_match: str, certificate_verification_body: "_models.CertificateVerificationDescription", - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Verify certificate's private key possession. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_iot_hub_operations.py index 85a3fb0f95e4..aab3a24ea223 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_iot_hub_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_iot_hub_operations.py @@ -47,7 +47,7 @@ async def _manual_failover_initial( iot_hub_name: str, resource_group_name: str, failover_input: "_models.FailoverInput", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -98,7 +98,7 @@ async def begin_manual_failover( iot_hub_name: str, resource_group_name: str, failover_input: "_models.FailoverInput", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Manually initiate a failover for the IoT Hub to its secondary region. @@ -115,8 +115,8 @@ async def begin_manual_failover( :type failover_input: ~azure.mgmt.iothub.v2019_11_04.models.FailoverInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_iot_hub_resource_operations.py index 0bac613fabcf..a60aa6c1a20a 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_iot_hub_resource_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": """Get the non-security related metadata of an IoT hub. @@ -110,7 +110,7 @@ async def _create_or_update_initial( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -171,7 +171,7 @@ async def begin_create_or_update( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Create or update the metadata of an IoT hub. @@ -192,8 +192,8 @@ async def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -252,7 +252,7 @@ async def _update_initial( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -305,7 +305,7 @@ async def begin_update( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Update an existing IoT Hubs tags. @@ -319,8 +319,8 @@ async def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2019_11_04.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -377,7 +377,7 @@ async def _delete_initial( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]] error_map = { @@ -433,7 +433,7 @@ async def begin_delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: """Delete an IoT hub. @@ -445,8 +445,8 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -500,7 +500,7 @@ def get_long_running_output(pipeline_response): def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a subscription. @@ -570,7 +570,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a resource group. @@ -644,7 +644,7 @@ async def get_stats( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.RegistryStatistics": """Get the statistics from an IoT hub. @@ -705,7 +705,7 @@ def get_valid_skus( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubSkuDescriptionListResult"]: """Get the list of valid SKUs for an IoT hub. @@ -783,7 +783,7 @@ def list_event_hub_consumer_groups( resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EventHubConsumerGroupsListResult"]: """Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. @@ -866,7 +866,7 @@ async def get_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. @@ -935,7 +935,7 @@ async def create_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. @@ -1004,7 +1004,7 @@ async def delete_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. @@ -1068,7 +1068,7 @@ def list_jobs( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResponseListResult"]: """Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1147,7 +1147,7 @@ async def get_job( resource_group_name: str, resource_name: str, job_id: str, - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1212,7 +1212,7 @@ def get_quota_metrics( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubQuotaMetricInfoListResult"]: """Get the quota metrics for an IoT hub. @@ -1289,7 +1289,7 @@ def get_endpoint_health( self, resource_group_name: str, iot_hub_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EndpointHealthDataListResult"]: """Get the health for routing endpoints. @@ -1365,7 +1365,7 @@ async def get_next(next_link=None): async def check_name_availability( self, operation_inputs: "_models.OperationInputs", - **kwargs + **kwargs: Any ) -> "_models.IotHubNameAvailabilityInfo": """Check if an IoT hub name is available. @@ -1429,7 +1429,7 @@ async def test_all_routes( iot_hub_name: str, resource_group_name: str, input: "_models.TestAllRoutesInput", - **kwargs + **kwargs: Any ) -> "_models.TestAllRoutesResult": """Test all routes. @@ -1498,7 +1498,7 @@ async def test_route( iot_hub_name: str, resource_group_name: str, input: "_models.TestRouteInput", - **kwargs + **kwargs: Any ) -> "_models.TestRouteResult": """Test the new route. @@ -1566,7 +1566,7 @@ def list_keys( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SharedAccessSignatureAuthorizationRuleListResult"]: """Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1645,7 +1645,7 @@ async def get_keys_for_key_name( resource_group_name: str, resource_name: str, key_name: str, - **kwargs + **kwargs: Any ) -> "_models.SharedAccessSignatureAuthorizationRule": """Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1711,7 +1711,7 @@ async def export_devices( resource_group_name: str, resource_name: str, export_devices_parameters: "_models.ExportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. @@ -1782,7 +1782,7 @@ async def import_devices( resource_group_name: str, resource_name: str, import_devices_parameters: "_models.ImportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_operations.py index f9b29316cb08..606437d237f0 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available IoT Hub REST API operations. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_resource_provider_common_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_resource_provider_common_operations.py index 971d90f6376d..225317d7ee58 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_resource_provider_common_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/aio/operations/_resource_provider_common_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_subscription_quota( self, - **kwargs + **kwargs: Any ) -> "_models.UserSubscriptionQuotaListResult": """Get the number of iot hubs in the subscription. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/models/_models.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/models/_models.py index 10fcf5965e1d..af609c11b7ff 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/models/_models.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/models/_models.py @@ -2023,13 +2023,13 @@ class RoutingTwin(msrest.serialization.Model): """Twin reference input parameter. This is an optional parameter. :param tags: A set of tags. Twin Tags. - :type tags: str + :type tags: any :param properties: :type properties: ~azure.mgmt.iothub.v2019_11_04.models.RoutingTwinProperties """ _attribute_map = { - 'tags': {'key': 'tags', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, } @@ -2046,14 +2046,14 @@ class RoutingTwinProperties(msrest.serialization.Model): """RoutingTwinProperties. :param desired: Twin desired properties. - :type desired: str + :type desired: any :param reported: Twin desired properties. - :type reported: str + :type reported: any """ _attribute_map = { - 'desired': {'key': 'desired', 'type': 'str'}, - 'reported': {'key': 'reported', 'type': 'str'}, + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, } def __init__( diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/models/_models_py3.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/models/_models_py3.py index 17df9b4cea40..9dee07a997a6 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/models/_models_py3.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -2189,20 +2189,20 @@ class RoutingTwin(msrest.serialization.Model): """Twin reference input parameter. This is an optional parameter. :param tags: A set of tags. Twin Tags. - :type tags: str + :type tags: any :param properties: :type properties: ~azure.mgmt.iothub.v2019_11_04.models.RoutingTwinProperties """ _attribute_map = { - 'tags': {'key': 'tags', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, } def __init__( self, *, - tags: Optional[str] = None, + tags: Optional[Any] = None, properties: Optional["RoutingTwinProperties"] = None, **kwargs ): @@ -2215,21 +2215,21 @@ class RoutingTwinProperties(msrest.serialization.Model): """RoutingTwinProperties. :param desired: Twin desired properties. - :type desired: str + :type desired: any :param reported: Twin desired properties. - :type reported: str + :type reported: any """ _attribute_map = { - 'desired': {'key': 'desired', 'type': 'str'}, - 'reported': {'key': 'reported', 'type': 'str'}, + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, } def __init__( self, *, - desired: Optional[str] = None, - reported: Optional[str] = None, + desired: Optional[Any] = None, + reported: Optional[Any] = None, **kwargs ): super(RoutingTwinProperties, self).__init__(**kwargs) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/operations/_iot_hub_operations.py index ff32b7e36f4d..b140ad5eba5a 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/operations/_iot_hub_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/operations/_iot_hub_operations.py @@ -121,8 +121,8 @@ def begin_manual_failover( :type failover_input: ~azure.mgmt.iothub.v2019_11_04.models.FailoverInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/operations/_iot_hub_resource_operations.py index cdd0a11789c1..f5556c8f14d2 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/operations/_iot_hub_resource_operations.py @@ -199,8 +199,8 @@ def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -328,8 +328,8 @@ def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2019_11_04.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -456,8 +456,8 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/_version.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/_version.py index 48944bf3938a..e5754a47ce68 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/_version.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_certificates_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_certificates_operations.py index 955e866bfcb8..4dbb41d6941c 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_certificates_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_certificates_operations.py @@ -44,7 +44,7 @@ async def list_by_iot_hub( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateListDescription": """Get the certificate list. @@ -106,7 +106,7 @@ async def get( resource_group_name: str, resource_name: str, certificate_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Get the certificate. @@ -173,7 +173,7 @@ async def create_or_update( certificate_name: str, certificate_description: "_models.CertificateBodyDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Upload the certificate to the IoT hub. @@ -255,7 +255,7 @@ async def delete( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> None: """Delete an X509 certificate. @@ -321,7 +321,7 @@ async def generate_verification_code( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateWithNonceDescription": """Generate verification code for proof of possession flow. @@ -392,7 +392,7 @@ async def verify( certificate_name: str, if_match: str, certificate_verification_body: "_models.CertificateVerificationDescription", - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Verify certificate's private key possession. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_iot_hub_operations.py index 6ccccbceeacb..bf818219456b 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_iot_hub_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_iot_hub_operations.py @@ -47,7 +47,7 @@ async def _manual_failover_initial( iot_hub_name: str, resource_group_name: str, failover_input: "_models.FailoverInput", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -98,7 +98,7 @@ async def begin_manual_failover( iot_hub_name: str, resource_group_name: str, failover_input: "_models.FailoverInput", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Manually initiate a failover for the IoT Hub to its secondary region. @@ -115,8 +115,8 @@ async def begin_manual_failover( :type failover_input: ~azure.mgmt.iothub.v2020_03_01.models.FailoverInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_iot_hub_resource_operations.py index 795b7eadc29b..6eba81156669 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_iot_hub_resource_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": """Get the non-security related metadata of an IoT hub. @@ -110,7 +110,7 @@ async def _create_or_update_initial( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -171,7 +171,7 @@ async def begin_create_or_update( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Create or update the metadata of an IoT hub. @@ -192,8 +192,8 @@ async def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -252,7 +252,7 @@ async def _update_initial( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -305,7 +305,7 @@ async def begin_update( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Update an existing IoT Hubs tags. @@ -319,8 +319,8 @@ async def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2020_03_01.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -377,7 +377,7 @@ async def _delete_initial( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]] error_map = { @@ -433,7 +433,7 @@ async def begin_delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: """Delete an IoT hub. @@ -445,8 +445,8 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -500,7 +500,7 @@ def get_long_running_output(pipeline_response): def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a subscription. @@ -570,7 +570,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a resource group. @@ -644,7 +644,7 @@ async def get_stats( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.RegistryStatistics": """Get the statistics from an IoT hub. @@ -705,7 +705,7 @@ def get_valid_skus( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubSkuDescriptionListResult"]: """Get the list of valid SKUs for an IoT hub. @@ -783,7 +783,7 @@ def list_event_hub_consumer_groups( resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EventHubConsumerGroupsListResult"]: """Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. @@ -866,7 +866,7 @@ async def get_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. @@ -935,7 +935,7 @@ async def create_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. @@ -1004,7 +1004,7 @@ async def delete_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. @@ -1068,7 +1068,7 @@ def list_jobs( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResponseListResult"]: """Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1147,7 +1147,7 @@ async def get_job( resource_group_name: str, resource_name: str, job_id: str, - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1212,7 +1212,7 @@ def get_quota_metrics( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubQuotaMetricInfoListResult"]: """Get the quota metrics for an IoT hub. @@ -1289,7 +1289,7 @@ def get_endpoint_health( self, resource_group_name: str, iot_hub_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EndpointHealthDataListResult"]: """Get the health for routing endpoints. @@ -1365,7 +1365,7 @@ async def get_next(next_link=None): async def check_name_availability( self, operation_inputs: "_models.OperationInputs", - **kwargs + **kwargs: Any ) -> "_models.IotHubNameAvailabilityInfo": """Check if an IoT hub name is available. @@ -1429,7 +1429,7 @@ async def test_all_routes( iot_hub_name: str, resource_group_name: str, input: "_models.TestAllRoutesInput", - **kwargs + **kwargs: Any ) -> "_models.TestAllRoutesResult": """Test all routes. @@ -1498,7 +1498,7 @@ async def test_route( iot_hub_name: str, resource_group_name: str, input: "_models.TestRouteInput", - **kwargs + **kwargs: Any ) -> "_models.TestRouteResult": """Test the new route. @@ -1566,7 +1566,7 @@ def list_keys( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SharedAccessSignatureAuthorizationRuleListResult"]: """Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1645,7 +1645,7 @@ async def get_keys_for_key_name( resource_group_name: str, resource_name: str, key_name: str, - **kwargs + **kwargs: Any ) -> "_models.SharedAccessSignatureAuthorizationRule": """Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1711,7 +1711,7 @@ async def export_devices( resource_group_name: str, resource_name: str, export_devices_parameters: "_models.ExportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. @@ -1782,7 +1782,7 @@ async def import_devices( resource_group_name: str, resource_name: str, import_devices_parameters: "_models.ImportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_operations.py index 84bdf1d834f6..3803c9762b4d 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available IoT Hub REST API operations. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_private_endpoint_connections_operations.py index 12bdfa137783..ebc1580cad7a 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_private_endpoint_connections_operations.py @@ -46,7 +46,7 @@ async def list( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> List["_models.PrivateEndpointConnection"]: """List private endpoint connections. @@ -108,7 +108,7 @@ async def get( resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Get private endpoint connection. @@ -174,7 +174,7 @@ async def _update_initial( resource_name: str, private_endpoint_connection_name: str, private_endpoint_connection: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { @@ -234,7 +234,7 @@ async def begin_update( resource_name: str, private_endpoint_connection_name: str, private_endpoint_connection: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.PrivateEndpointConnection"]: """Update private endpoint connection. @@ -250,8 +250,8 @@ async def begin_update( :type private_endpoint_connection: ~azure.mgmt.iothub.v2020_03_01.models.PrivateEndpointConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) @@ -311,7 +311,7 @@ async def _delete_initial( resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> Optional["_models.PrivateEndpointConnection"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateEndpointConnection"]] error_map = { @@ -366,7 +366,7 @@ async def begin_delete( resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.PrivateEndpointConnection"]: """Delete private endpoint connection. @@ -380,8 +380,8 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_private_link_resources_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_private_link_resources_operations.py index c59c99ccec7a..7749488f0d1b 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_private_link_resources_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateLinkResources": """List private link resources. @@ -106,7 +106,7 @@ async def get( resource_group_name: str, resource_name: str, group_id: str, - **kwargs + **kwargs: Any ) -> "_models.GroupIdInformation": """Get the specified private link resource. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_resource_provider_common_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_resource_provider_common_operations.py index c8d34f0a0c44..748bdf90123e 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_resource_provider_common_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/aio/operations/_resource_provider_common_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_subscription_quota( self, - **kwargs + **kwargs: Any ) -> "_models.UserSubscriptionQuotaListResult": """Get the number of iot hubs in the subscription. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/models/_models.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/models/_models.py index 7211387af228..5d9f13920872 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/models/_models.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/models/_models.py @@ -2346,13 +2346,13 @@ class RoutingTwin(msrest.serialization.Model): """Twin reference input parameter. This is an optional parameter. :param tags: A set of tags. Twin Tags. - :type tags: str + :type tags: any :param properties: :type properties: ~azure.mgmt.iothub.v2020_03_01.models.RoutingTwinProperties """ _attribute_map = { - 'tags': {'key': 'tags', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, } @@ -2369,14 +2369,14 @@ class RoutingTwinProperties(msrest.serialization.Model): """RoutingTwinProperties. :param desired: Twin desired properties. - :type desired: str + :type desired: any :param reported: Twin desired properties. - :type reported: str + :type reported: any """ _attribute_map = { - 'desired': {'key': 'desired', 'type': 'str'}, - 'reported': {'key': 'reported', 'type': 'str'}, + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, } def __init__( diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/models/_models_py3.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/models/_models_py3.py index 9d3043420cce..0d47050e4f9a 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/models/_models_py3.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -2552,20 +2552,20 @@ class RoutingTwin(msrest.serialization.Model): """Twin reference input parameter. This is an optional parameter. :param tags: A set of tags. Twin Tags. - :type tags: str + :type tags: any :param properties: :type properties: ~azure.mgmt.iothub.v2020_03_01.models.RoutingTwinProperties """ _attribute_map = { - 'tags': {'key': 'tags', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, } def __init__( self, *, - tags: Optional[str] = None, + tags: Optional[Any] = None, properties: Optional["RoutingTwinProperties"] = None, **kwargs ): @@ -2578,21 +2578,21 @@ class RoutingTwinProperties(msrest.serialization.Model): """RoutingTwinProperties. :param desired: Twin desired properties. - :type desired: str + :type desired: any :param reported: Twin desired properties. - :type reported: str + :type reported: any """ _attribute_map = { - 'desired': {'key': 'desired', 'type': 'str'}, - 'reported': {'key': 'reported', 'type': 'str'}, + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, } def __init__( self, *, - desired: Optional[str] = None, - reported: Optional[str] = None, + desired: Optional[Any] = None, + reported: Optional[Any] = None, **kwargs ): super(RoutingTwinProperties, self).__init__(**kwargs) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/operations/_iot_hub_operations.py index 98c9e41d9e39..5074a8f939da 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/operations/_iot_hub_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/operations/_iot_hub_operations.py @@ -121,8 +121,8 @@ def begin_manual_failover( :type failover_input: ~azure.mgmt.iothub.v2020_03_01.models.FailoverInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/operations/_iot_hub_resource_operations.py index 1a45f7c7a039..c1ed507d469c 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/operations/_iot_hub_resource_operations.py @@ -199,8 +199,8 @@ def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -328,8 +328,8 @@ def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2020_03_01.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -456,8 +456,8 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/operations/_private_endpoint_connections_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/operations/_private_endpoint_connections_operations.py index abf05f575b4b..73f726bdbb94 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/operations/_private_endpoint_connections_operations.py @@ -258,8 +258,8 @@ def begin_update( :type private_endpoint_connection: ~azure.mgmt.iothub.v2020_03_01.models.PrivateEndpointConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) @@ -390,8 +390,8 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/_version.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/_version.py index 48944bf3938a..e5754a47ce68 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/_version.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_certificates_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_certificates_operations.py index e017ea2b7397..b396fb3535ea 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_certificates_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_certificates_operations.py @@ -44,7 +44,7 @@ async def list_by_iot_hub( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateListDescription": """Get the certificate list. @@ -106,7 +106,7 @@ async def get( resource_group_name: str, resource_name: str, certificate_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Get the certificate. @@ -173,7 +173,7 @@ async def create_or_update( certificate_name: str, certificate_description: "_models.CertificateDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Upload the certificate to the IoT hub. @@ -255,7 +255,7 @@ async def delete( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> None: """Delete an X509 certificate. @@ -321,7 +321,7 @@ async def generate_verification_code( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateWithNonceDescription": """Generate verification code for proof of possession flow. @@ -392,7 +392,7 @@ async def verify( certificate_name: str, if_match: str, certificate_verification_body: "_models.CertificateVerificationDescription", - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Verify certificate's private key possession. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_iot_hub_operations.py index 2804a1d024b4..6de4792dabf1 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_iot_hub_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_iot_hub_operations.py @@ -47,7 +47,7 @@ async def _manual_failover_initial( iot_hub_name: str, resource_group_name: str, failover_input: "_models.FailoverInput", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -98,7 +98,7 @@ async def begin_manual_failover( iot_hub_name: str, resource_group_name: str, failover_input: "_models.FailoverInput", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Manually initiate a failover for the IoT Hub to its secondary region. @@ -115,8 +115,8 @@ async def begin_manual_failover( :type failover_input: ~azure.mgmt.iothub.v2021_03_03_preview.models.FailoverInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_iot_hub_resource_operations.py index 07be5cbce6f3..416a5dddfb21 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_iot_hub_resource_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": """Get the non-security related metadata of an IoT hub. @@ -110,7 +110,7 @@ async def _create_or_update_initial( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -171,7 +171,7 @@ async def begin_create_or_update( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Create or update the metadata of an IoT hub. @@ -190,8 +190,8 @@ async def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -250,7 +250,7 @@ async def _update_initial( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -303,7 +303,7 @@ async def begin_update( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Update an existing IoT Hubs tags. @@ -317,8 +317,8 @@ async def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2021_03_03_preview.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -375,7 +375,7 @@ async def _delete_initial( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]] error_map = { @@ -431,7 +431,7 @@ async def begin_delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: """Delete an IoT hub. @@ -443,8 +443,8 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -498,7 +498,7 @@ def get_long_running_output(pipeline_response): def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a subscription. @@ -568,7 +568,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a resource group. @@ -642,7 +642,7 @@ async def get_stats( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.RegistryStatistics": """Get the statistics from an IoT hub. @@ -703,7 +703,7 @@ def get_valid_skus( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubSkuDescriptionListResult"]: """Get the list of valid SKUs for an IoT hub. @@ -781,7 +781,7 @@ def list_event_hub_consumer_groups( resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EventHubConsumerGroupsListResult"]: """Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. @@ -864,7 +864,7 @@ async def get_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. @@ -934,7 +934,7 @@ async def create_event_hub_consumer_group( event_hub_endpoint_name: str, name: str, consumer_group_body: "_models.EventHubConsumerGroupBodyDescription", - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. @@ -1010,7 +1010,7 @@ async def delete_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. @@ -1074,7 +1074,7 @@ def list_jobs( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResponseListResult"]: """Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1153,7 +1153,7 @@ async def get_job( resource_group_name: str, resource_name: str, job_id: str, - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1218,7 +1218,7 @@ def get_quota_metrics( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubQuotaMetricInfoListResult"]: """Get the quota metrics for an IoT hub. @@ -1295,7 +1295,7 @@ def get_endpoint_health( self, resource_group_name: str, iot_hub_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EndpointHealthDataListResult"]: """Get the health for routing endpoints. @@ -1371,7 +1371,7 @@ async def get_next(next_link=None): async def check_name_availability( self, operation_inputs: "_models.OperationInputs", - **kwargs + **kwargs: Any ) -> "_models.IotHubNameAvailabilityInfo": """Check if an IoT hub name is available. @@ -1435,7 +1435,7 @@ async def test_all_routes( iot_hub_name: str, resource_group_name: str, input: "_models.TestAllRoutesInput", - **kwargs + **kwargs: Any ) -> "_models.TestAllRoutesResult": """Test all routes. @@ -1504,7 +1504,7 @@ async def test_route( iot_hub_name: str, resource_group_name: str, input: "_models.TestRouteInput", - **kwargs + **kwargs: Any ) -> "_models.TestRouteResult": """Test the new route. @@ -1572,7 +1572,7 @@ def list_keys( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SharedAccessSignatureAuthorizationRuleListResult"]: """Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1651,7 +1651,7 @@ async def get_keys_for_key_name( resource_group_name: str, resource_name: str, key_name: str, - **kwargs + **kwargs: Any ) -> "_models.SharedAccessSignatureAuthorizationRule": """Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1717,7 +1717,7 @@ async def export_devices( resource_group_name: str, resource_name: str, export_devices_parameters: "_models.ExportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. @@ -1788,7 +1788,7 @@ async def import_devices( resource_group_name: str, resource_name: str, import_devices_parameters: "_models.ImportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_operations.py index ddbda76dfe15..397b3f45c3af 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available IoT Hub REST API operations. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_private_endpoint_connections_operations.py index cd26826afcc3..848003d6c0d5 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_private_endpoint_connections_operations.py @@ -46,7 +46,7 @@ async def list( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> List["_models.PrivateEndpointConnection"]: """List private endpoint connections. @@ -108,7 +108,7 @@ async def get( resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Get private endpoint connection. @@ -174,7 +174,7 @@ async def _update_initial( resource_name: str, private_endpoint_connection_name: str, private_endpoint_connection: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { @@ -234,7 +234,7 @@ async def begin_update( resource_name: str, private_endpoint_connection_name: str, private_endpoint_connection: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.PrivateEndpointConnection"]: """Update private endpoint connection. @@ -250,8 +250,8 @@ async def begin_update( :type private_endpoint_connection: ~azure.mgmt.iothub.v2021_03_03_preview.models.PrivateEndpointConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) @@ -311,7 +311,7 @@ async def _delete_initial( resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> Optional["_models.PrivateEndpointConnection"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateEndpointConnection"]] error_map = { @@ -366,7 +366,7 @@ async def begin_delete( resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.PrivateEndpointConnection"]: """Delete private endpoint connection. @@ -380,8 +380,8 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_private_link_resources_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_private_link_resources_operations.py index abad86d7ff4a..a138a40dea52 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_private_link_resources_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateLinkResources": """List private link resources. @@ -106,7 +106,7 @@ async def get( resource_group_name: str, resource_name: str, group_id: str, - **kwargs + **kwargs: Any ) -> "_models.GroupIdInformation": """Get the specified private link resource. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_resource_provider_common_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_resource_provider_common_operations.py index 91ddb2fc0c3f..8f18daa04c36 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_resource_provider_common_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/aio/operations/_resource_provider_common_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_subscription_quota( self, - **kwargs + **kwargs: Any ) -> "_models.UserSubscriptionQuotaListResult": """Get the number of iot hubs in the subscription. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/models/_models.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/models/_models.py index aa366765aa72..59d5b0732b8f 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/models/_models.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/models/_models.py @@ -2684,13 +2684,13 @@ class RoutingTwin(msrest.serialization.Model): """Twin reference input parameter. This is an optional parameter. :param tags: A set of tags. Twin Tags. - :type tags: str + :type tags: any :param properties: :type properties: ~azure.mgmt.iothub.v2021_03_03_preview.models.RoutingTwinProperties """ _attribute_map = { - 'tags': {'key': 'tags', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, } @@ -2707,14 +2707,14 @@ class RoutingTwinProperties(msrest.serialization.Model): """RoutingTwinProperties. :param desired: Twin desired properties. - :type desired: str + :type desired: any :param reported: Twin desired properties. - :type reported: str + :type reported: any """ _attribute_map = { - 'desired': {'key': 'desired', 'type': 'str'}, - 'reported': {'key': 'reported', 'type': 'str'}, + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, } def __init__( diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/models/_models_py3.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/models/_models_py3.py index a48155474741..3208fb57c4b9 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/models/_models_py3.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -2929,20 +2929,20 @@ class RoutingTwin(msrest.serialization.Model): """Twin reference input parameter. This is an optional parameter. :param tags: A set of tags. Twin Tags. - :type tags: str + :type tags: any :param properties: :type properties: ~azure.mgmt.iothub.v2021_03_03_preview.models.RoutingTwinProperties """ _attribute_map = { - 'tags': {'key': 'tags', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, } def __init__( self, *, - tags: Optional[str] = None, + tags: Optional[Any] = None, properties: Optional["RoutingTwinProperties"] = None, **kwargs ): @@ -2955,21 +2955,21 @@ class RoutingTwinProperties(msrest.serialization.Model): """RoutingTwinProperties. :param desired: Twin desired properties. - :type desired: str + :type desired: any :param reported: Twin desired properties. - :type reported: str + :type reported: any """ _attribute_map = { - 'desired': {'key': 'desired', 'type': 'str'}, - 'reported': {'key': 'reported', 'type': 'str'}, + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, } def __init__( self, *, - desired: Optional[str] = None, - reported: Optional[str] = None, + desired: Optional[Any] = None, + reported: Optional[Any] = None, **kwargs ): super(RoutingTwinProperties, self).__init__(**kwargs) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/operations/_iot_hub_operations.py index ba2885a44b52..25a6ba351247 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/operations/_iot_hub_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/operations/_iot_hub_operations.py @@ -121,8 +121,8 @@ def begin_manual_failover( :type failover_input: ~azure.mgmt.iothub.v2021_03_03_preview.models.FailoverInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/operations/_iot_hub_resource_operations.py index 1ed38763255a..3f26f763b334 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/operations/_iot_hub_resource_operations.py @@ -197,8 +197,8 @@ def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -326,8 +326,8 @@ def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2021_03_03_preview.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -454,8 +454,8 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/operations/_private_endpoint_connections_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/operations/_private_endpoint_connections_operations.py index 37e894ac4915..1dc5cda2d50b 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/operations/_private_endpoint_connections_operations.py @@ -258,8 +258,8 @@ def begin_update( :type private_endpoint_connection: ~azure.mgmt.iothub.v2021_03_03_preview.models.PrivateEndpointConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) @@ -390,8 +390,8 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/_version.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/_version.py index 48944bf3938a..e5754a47ce68 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/_version.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_certificates_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_certificates_operations.py index 2ab30b20626f..6be8dc807724 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_certificates_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_certificates_operations.py @@ -44,7 +44,7 @@ async def list_by_iot_hub( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateListDescription": """Get the certificate list. @@ -106,7 +106,7 @@ async def get( resource_group_name: str, resource_name: str, certificate_name: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Get the certificate. @@ -173,7 +173,7 @@ async def create_or_update( certificate_name: str, certificate_description: "_models.CertificateDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Upload the certificate to the IoT hub. @@ -255,7 +255,7 @@ async def delete( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> None: """Delete an X509 certificate. @@ -321,7 +321,7 @@ async def generate_verification_code( resource_name: str, certificate_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.CertificateWithNonceDescription": """Generate verification code for proof of possession flow. @@ -392,7 +392,7 @@ async def verify( certificate_name: str, if_match: str, certificate_verification_body: "_models.CertificateVerificationDescription", - **kwargs + **kwargs: Any ) -> "_models.CertificateDescription": """Verify certificate's private key possession. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_iot_hub_operations.py index ae761208f89d..6b6e8e4e6609 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_iot_hub_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_iot_hub_operations.py @@ -47,7 +47,7 @@ async def _manual_failover_initial( iot_hub_name: str, resource_group_name: str, failover_input: "_models.FailoverInput", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -98,7 +98,7 @@ async def begin_manual_failover( iot_hub_name: str, resource_group_name: str, failover_input: "_models.FailoverInput", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Manually initiate a failover for the IoT Hub to its secondary region. @@ -115,8 +115,8 @@ async def begin_manual_failover( :type failover_input: ~azure.mgmt.iothub.v2021_03_31.models.FailoverInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_iot_hub_resource_operations.py index ea79ff1a8b9f..ce53fec51266 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_iot_hub_resource_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": """Get the non-security related metadata of an IoT hub. @@ -110,7 +110,7 @@ async def _create_or_update_initial( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -171,7 +171,7 @@ async def begin_create_or_update( resource_name: str, iot_hub_description: "_models.IotHubDescription", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Create or update the metadata of an IoT hub. @@ -192,8 +192,8 @@ async def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -252,7 +252,7 @@ async def _update_initial( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> "_models.IotHubDescription": cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] error_map = { @@ -305,7 +305,7 @@ async def begin_update( resource_group_name: str, resource_name: str, iot_hub_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.IotHubDescription"]: """Update an existing IoT Hubs tags. @@ -319,8 +319,8 @@ async def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2021_03_31.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -377,7 +377,7 @@ async def _delete_initial( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]] error_map = { @@ -433,7 +433,7 @@ async def begin_delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: """Delete an IoT hub. @@ -445,8 +445,8 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) @@ -500,7 +500,7 @@ def get_long_running_output(pipeline_response): def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a subscription. @@ -570,7 +570,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: """Get all the IoT hubs in a resource group. @@ -644,7 +644,7 @@ async def get_stats( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.RegistryStatistics": """Get the statistics from an IoT hub. @@ -705,7 +705,7 @@ def get_valid_skus( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubSkuDescriptionListResult"]: """Get the list of valid SKUs for an IoT hub. @@ -783,7 +783,7 @@ def list_event_hub_consumer_groups( resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EventHubConsumerGroupsListResult"]: """Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. @@ -866,7 +866,7 @@ async def get_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. @@ -936,7 +936,7 @@ async def create_event_hub_consumer_group( event_hub_endpoint_name: str, name: str, consumer_group_body: "_models.EventHubConsumerGroupBodyDescription", - **kwargs + **kwargs: Any ) -> "_models.EventHubConsumerGroupInfo": """Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. @@ -1012,7 +1012,7 @@ async def delete_event_hub_consumer_group( resource_name: str, event_hub_endpoint_name: str, name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. @@ -1076,7 +1076,7 @@ def list_jobs( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResponseListResult"]: """Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1155,7 +1155,7 @@ async def get_job( resource_group_name: str, resource_name: str, job_id: str, - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. @@ -1220,7 +1220,7 @@ def get_quota_metrics( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotHubQuotaMetricInfoListResult"]: """Get the quota metrics for an IoT hub. @@ -1297,7 +1297,7 @@ def get_endpoint_health( self, resource_group_name: str, iot_hub_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EndpointHealthDataListResult"]: """Get the health for routing endpoints. @@ -1373,7 +1373,7 @@ async def get_next(next_link=None): async def check_name_availability( self, operation_inputs: "_models.OperationInputs", - **kwargs + **kwargs: Any ) -> "_models.IotHubNameAvailabilityInfo": """Check if an IoT hub name is available. @@ -1437,7 +1437,7 @@ async def test_all_routes( iot_hub_name: str, resource_group_name: str, input: "_models.TestAllRoutesInput", - **kwargs + **kwargs: Any ) -> "_models.TestAllRoutesResult": """Test all routes. @@ -1506,7 +1506,7 @@ async def test_route( iot_hub_name: str, resource_group_name: str, input: "_models.TestRouteInput", - **kwargs + **kwargs: Any ) -> "_models.TestRouteResult": """Test the new route. @@ -1574,7 +1574,7 @@ def list_keys( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SharedAccessSignatureAuthorizationRuleListResult"]: """Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1653,7 +1653,7 @@ async def get_keys_for_key_name( resource_group_name: str, resource_name: str, key_name: str, - **kwargs + **kwargs: Any ) -> "_models.SharedAccessSignatureAuthorizationRule": """Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @@ -1719,7 +1719,7 @@ async def export_devices( resource_group_name: str, resource_name: str, export_devices_parameters: "_models.ExportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. @@ -1790,7 +1790,7 @@ async def import_devices( resource_group_name: str, resource_name: str, import_devices_parameters: "_models.ImportDevicesRequest", - **kwargs + **kwargs: Any ) -> "_models.JobResponse": """Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_operations.py index 2535b954f078..baeb94261ee2 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available IoT Hub REST API operations. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_private_endpoint_connections_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_private_endpoint_connections_operations.py index 132ab4e3daf2..2b3111df0d15 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_private_endpoint_connections_operations.py @@ -46,7 +46,7 @@ async def list( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> List["_models.PrivateEndpointConnection"]: """List private endpoint connections. @@ -108,7 +108,7 @@ async def get( resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Get private endpoint connection. @@ -174,7 +174,7 @@ async def _update_initial( resource_name: str, private_endpoint_connection_name: str, private_endpoint_connection: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { @@ -234,7 +234,7 @@ async def begin_update( resource_name: str, private_endpoint_connection_name: str, private_endpoint_connection: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.PrivateEndpointConnection"]: """Update private endpoint connection. @@ -250,8 +250,8 @@ async def begin_update( :type private_endpoint_connection: ~azure.mgmt.iothub.v2021_03_31.models.PrivateEndpointConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) @@ -311,7 +311,7 @@ async def _delete_initial( resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> Optional["_models.PrivateEndpointConnection"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateEndpointConnection"]] error_map = { @@ -366,7 +366,7 @@ async def begin_delete( resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.PrivateEndpointConnection"]: """Delete private endpoint connection. @@ -380,8 +380,8 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_private_link_resources_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_private_link_resources_operations.py index 9ae1ec6eab24..e29aa7bb7727 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_private_link_resources_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_private_link_resources_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateLinkResources": """List private link resources. @@ -106,7 +106,7 @@ async def get( resource_group_name: str, resource_name: str, group_id: str, - **kwargs + **kwargs: Any ) -> "_models.GroupIdInformation": """Get the specified private link resource. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_resource_provider_common_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_resource_provider_common_operations.py index 529f55e9fcf8..67582636977a 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_resource_provider_common_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/aio/operations/_resource_provider_common_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_subscription_quota( self, - **kwargs + **kwargs: Any ) -> "_models.UserSubscriptionQuotaListResult": """Get the number of iot hubs in the subscription. diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/models/_models.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/models/_models.py index d91f42533c72..2c62b6b5bc47 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/models/_models.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/models/_models.py @@ -565,7 +565,7 @@ class EventHubConsumerGroupInfo(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :param properties: The tags. - :type properties: dict[str, object] + :type properties: dict[str, any] :ivar id: The Event Hub-compatible consumer group identifier. :vartype id: str :ivar name: The Event Hub-compatible consumer group name. @@ -2625,13 +2625,13 @@ class RoutingTwin(msrest.serialization.Model): """Twin reference input parameter. This is an optional parameter. :param tags: A set of tags. Twin Tags. - :type tags: str + :type tags: any :param properties: :type properties: ~azure.mgmt.iothub.v2021_03_31.models.RoutingTwinProperties """ _attribute_map = { - 'tags': {'key': 'tags', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, } @@ -2648,14 +2648,14 @@ class RoutingTwinProperties(msrest.serialization.Model): """RoutingTwinProperties. :param desired: Twin desired properties. - :type desired: str + :type desired: any :param reported: Twin desired properties. - :type reported: str + :type reported: any """ _attribute_map = { - 'desired': {'key': 'desired', 'type': 'str'}, - 'reported': {'key': 'reported', 'type': 'str'}, + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, } def __init__( diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/models/_models_py3.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/models/_models_py3.py index 9b2483967fe3..f39ce7fab9f6 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/models/_models_py3.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -604,7 +604,7 @@ class EventHubConsumerGroupInfo(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :param properties: The tags. - :type properties: dict[str, object] + :type properties: dict[str, any] :ivar id: The Event Hub-compatible consumer group identifier. :vartype id: str :ivar name: The Event Hub-compatible consumer group name. @@ -633,7 +633,7 @@ class EventHubConsumerGroupInfo(msrest.serialization.Model): def __init__( self, *, - properties: Optional[Dict[str, object]] = None, + properties: Optional[Dict[str, Any]] = None, **kwargs ): super(EventHubConsumerGroupInfo, self).__init__(**kwargs) @@ -2864,20 +2864,20 @@ class RoutingTwin(msrest.serialization.Model): """Twin reference input parameter. This is an optional parameter. :param tags: A set of tags. Twin Tags. - :type tags: str + :type tags: any :param properties: :type properties: ~azure.mgmt.iothub.v2021_03_31.models.RoutingTwinProperties """ _attribute_map = { - 'tags': {'key': 'tags', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, } def __init__( self, *, - tags: Optional[str] = None, + tags: Optional[Any] = None, properties: Optional["RoutingTwinProperties"] = None, **kwargs ): @@ -2890,21 +2890,21 @@ class RoutingTwinProperties(msrest.serialization.Model): """RoutingTwinProperties. :param desired: Twin desired properties. - :type desired: str + :type desired: any :param reported: Twin desired properties. - :type reported: str + :type reported: any """ _attribute_map = { - 'desired': {'key': 'desired', 'type': 'str'}, - 'reported': {'key': 'reported', 'type': 'str'}, + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, } def __init__( self, *, - desired: Optional[str] = None, - reported: Optional[str] = None, + desired: Optional[Any] = None, + reported: Optional[Any] = None, **kwargs ): super(RoutingTwinProperties, self).__init__(**kwargs) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/operations/_iot_hub_operations.py index 3867a64cd8d3..42dc351fc990 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/operations/_iot_hub_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/operations/_iot_hub_operations.py @@ -121,8 +121,8 @@ def begin_manual_failover( :type failover_input: ~azure.mgmt.iothub.v2021_03_31.models.FailoverInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/operations/_iot_hub_resource_operations.py index 442b6248f58f..5892b4dffa1e 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/operations/_iot_hub_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/operations/_iot_hub_resource_operations.py @@ -199,8 +199,8 @@ def begin_create_or_update( :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -328,8 +328,8 @@ def begin_update( :type iot_hub_tags: ~azure.mgmt.iothub.v2021_03_31.models.TagsResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) @@ -456,8 +456,8 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/operations/_private_endpoint_connections_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/operations/_private_endpoint_connections_operations.py index 2fb547fd021e..985f2660a5c5 100644 --- a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/operations/_private_endpoint_connections_operations.py +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_31/operations/_private_endpoint_connections_operations.py @@ -258,8 +258,8 @@ def begin_update( :type private_endpoint_connection: ~azure.mgmt.iothub.v2021_03_31.models.PrivateEndpointConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) @@ -390,8 +390,8 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/__init__.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/__init__.py new file mode 100644 index 000000000000..8883d8041fab --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._iot_hub_client import IotHubClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['IotHubClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_configuration.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_configuration.py new file mode 100644 index 000000000000..16d86d588306 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_configuration.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +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. + + 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. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription identifier. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(IotHubClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-07-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-iothub/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + 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) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_iot_hub_client.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_iot_hub_client.py new file mode 100644 index 000000000000..f8d1369a548c --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_iot_hub_client.py @@ -0,0 +1,119 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +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 + +from ._configuration import IotHubClientConfiguration +from .operations import Operations +from .operations import IotHubResourceOperations +from .operations import ResourceProviderCommonOperations +from .operations import CertificatesOperations +from .operations import IotHubOperations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionsOperations +from . import models + + +class IotHubClient(object): + """Use this API to manage the IoT hubs in your Azure subscription. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.iothub.v2021_07_01.operations.Operations + :ivar iot_hub_resource: IotHubResourceOperations operations + :vartype iot_hub_resource: azure.mgmt.iothub.v2021_07_01.operations.IotHubResourceOperations + :ivar resource_provider_common: ResourceProviderCommonOperations operations + :vartype resource_provider_common: azure.mgmt.iothub.v2021_07_01.operations.ResourceProviderCommonOperations + :ivar certificates: CertificatesOperations operations + :vartype certificates: azure.mgmt.iothub.v2021_07_01.operations.CertificatesOperations + :ivar iot_hub: IotHubOperations operations + :vartype iot_hub: azure.mgmt.iothub.v2021_07_01.operations.IotHubOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.iothub.v2021_07_01.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.iothub.v2021_07_01.operations.PrivateEndpointConnectionsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription identifier. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = IotHubClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.iot_hub_resource = IotHubResourceOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_provider_common = ResourceProviderCommonOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificates = CertificatesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.iot_hub = IotHubOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> IotHubClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_metadata.json b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_metadata.json new file mode 100644 index 000000000000..35497d20c61e --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_metadata.json @@ -0,0 +1,109 @@ +{ + "chosen_version": "2021-07-01", + "total_api_version_list": ["2021-07-01"], + "client": { + "name": "IotHubClient", + "filename": "_iot_hub_client", + "description": "Use this API to manage the IoT hubs in your Azure subscription.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"IotHubClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"IotHubClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The subscription identifier.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The subscription identifier.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "iot_hub_resource": "IotHubResourceOperations", + "resource_provider_common": "ResourceProviderCommonOperations", + "certificates": "CertificatesOperations", + "iot_hub": "IotHubOperations", + "private_link_resources": "PrivateLinkResourcesOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations" + } +} \ No newline at end of file diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_version.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_version.py new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/__init__.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/__init__.py new file mode 100644 index 000000000000..a84cf700a930 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._iot_hub_client import IotHubClient +__all__ = ['IotHubClient'] diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/_configuration.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/_configuration.py new file mode 100644 index 000000000000..535240e2770a --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +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. + + 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. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription identifier. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(IotHubClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-07-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-iothub/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/_iot_hub_client.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/_iot_hub_client.py new file mode 100644 index 000000000000..a390aadace03 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/_iot_hub_client.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import IotHubClientConfiguration +from .operations import Operations +from .operations import IotHubResourceOperations +from .operations import ResourceProviderCommonOperations +from .operations import CertificatesOperations +from .operations import IotHubOperations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionsOperations +from .. import models + + +class IotHubClient(object): + """Use this API to manage the IoT hubs in your Azure subscription. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.iothub.v2021_07_01.aio.operations.Operations + :ivar iot_hub_resource: IotHubResourceOperations operations + :vartype iot_hub_resource: azure.mgmt.iothub.v2021_07_01.aio.operations.IotHubResourceOperations + :ivar resource_provider_common: ResourceProviderCommonOperations operations + :vartype resource_provider_common: azure.mgmt.iothub.v2021_07_01.aio.operations.ResourceProviderCommonOperations + :ivar certificates: CertificatesOperations operations + :vartype certificates: azure.mgmt.iothub.v2021_07_01.aio.operations.CertificatesOperations + :ivar iot_hub: IotHubOperations operations + :vartype iot_hub: azure.mgmt.iothub.v2021_07_01.aio.operations.IotHubOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.iothub.v2021_07_01.aio.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.iothub.v2021_07_01.aio.operations.PrivateEndpointConnectionsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription identifier. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = IotHubClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.iot_hub_resource = IotHubResourceOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_provider_common = ResourceProviderCommonOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificates = CertificatesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.iot_hub = IotHubOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "IotHubClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/__init__.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/__init__.py new file mode 100644 index 000000000000..3930a2f261c8 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._iot_hub_resource_operations import IotHubResourceOperations +from ._resource_provider_common_operations import ResourceProviderCommonOperations +from ._certificates_operations import CertificatesOperations +from ._iot_hub_operations import IotHubOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations + +__all__ = [ + 'Operations', + 'IotHubResourceOperations', + 'ResourceProviderCommonOperations', + 'CertificatesOperations', + 'IotHubOperations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionsOperations', +] diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_certificates_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_certificates_operations.py new file mode 100644 index 000000000000..65d17b636757 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_certificates_operations.py @@ -0,0 +1,464 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CertificatesOperations: + """CertificatesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.iothub.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list_by_iot_hub( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CertificateListDescription": + """Get the certificate list. + + Returns the list of certificates. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateListDescription, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.CertificateListDescription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateListDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list_by_iot_hub.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CertificateListDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_iot_hub.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + certificate_name: str, + **kwargs: Any + ) -> "_models.CertificateDescription": + """Get the certificate. + + Returns the certificate. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateDescription, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.CertificateDescription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[A-Za-z0-9-._]{1,64}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CertificateDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + certificate_name: str, + certificate_description: "_models.CertificateDescription", + if_match: Optional[str] = None, + **kwargs: Any + ) -> "_models.CertificateDescription": + """Upload the certificate to the IoT hub. + + Adds new or replaces existing certificate. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param certificate_description: The certificate body. + :type certificate_description: ~azure.mgmt.iothub.v2021_07_01.models.CertificateDescription + :param if_match: ETag of the Certificate. Do not specify for creating a brand new certificate. + Required to update an existing certificate. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateDescription, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.CertificateDescription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[A-Za-z0-9-._]{1,64}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_description, 'CertificateDescription') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('CertificateDescription', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CertificateDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + resource_name: str, + certificate_name: str, + if_match: str, + **kwargs: Any + ) -> None: + """Delete an X509 certificate. + + Deletes an existing X509 certificate or does nothing if it does not exist. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param if_match: ETag of the Certificate. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[A-Za-z0-9-._]{1,64}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}'} # type: ignore + + async def generate_verification_code( + self, + resource_group_name: str, + resource_name: str, + certificate_name: str, + if_match: str, + **kwargs: Any + ) -> "_models.CertificateWithNonceDescription": + """Generate verification code for proof of possession flow. + + Generates verification code for proof of possession flow. The verification code will be used to + generate a leaf certificate. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param if_match: ETag of the Certificate. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateWithNonceDescription, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.CertificateWithNonceDescription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateWithNonceDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.generate_verification_code.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[A-Za-z0-9-._]{1,64}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CertificateWithNonceDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_verification_code.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/generateVerificationCode'} # type: ignore + + async def verify( + self, + resource_group_name: str, + resource_name: str, + certificate_name: str, + if_match: str, + certificate_verification_body: "_models.CertificateVerificationDescription", + **kwargs: Any + ) -> "_models.CertificateDescription": + """Verify certificate's private key possession. + + Verifies the certificate's private key possession by providing the leaf cert issued by the + verifying pre uploaded certificate. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param if_match: ETag of the Certificate. + :type if_match: str + :param certificate_verification_body: The name of the certificate. + :type certificate_verification_body: ~azure.mgmt.iothub.v2021_07_01.models.CertificateVerificationDescription + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateDescription, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.CertificateDescription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.verify.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[A-Za-z0-9-._]{1,64}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_verification_body, 'CertificateVerificationDescription') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CertificateDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + verify.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify'} # type: ignore diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_iot_hub_operations.py new file mode 100644 index 000000000000..a894031b3087 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_iot_hub_operations.py @@ -0,0 +1,167 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IotHubOperations: + """IotHubOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.iothub.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _manual_failover_initial( + self, + iot_hub_name: str, + resource_group_name: str, + failover_input: "_models.FailoverInput", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._manual_failover_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'iotHubName': self._serialize.url("iot_hub_name", iot_hub_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(failover_input, 'FailoverInput') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _manual_failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover'} # type: ignore + + async def begin_manual_failover( + self, + iot_hub_name: str, + resource_group_name: str, + failover_input: "_models.FailoverInput", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Manually initiate a failover for the IoT Hub to its secondary region. + + Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see + https://aka.ms/manualfailover. + + :param iot_hub_name: Name of the IoT hub to failover. + :type iot_hub_name: str + :param resource_group_name: Name of the resource group containing the IoT hub resource. + :type resource_group_name: str + :param failover_input: Region to failover to. Must be the Azure paired region. Get the value + from the secondary location in the locations property. To learn more, see + https://aka.ms/manualfailover/region. + :type failover_input: ~azure.mgmt.iothub.v2021_07_01.models.FailoverInput + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._manual_failover_initial( + iot_hub_name=iot_hub_name, + resource_group_name=resource_group_name, + failover_input=failover_input, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'iotHubName': self._serialize.url("iot_hub_name", iot_hub_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_manual_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover'} # type: ignore diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_iot_hub_resource_operations.py new file mode 100644 index 000000000000..cb7cb62ba5cb --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_iot_hub_resource_operations.py @@ -0,0 +1,1857 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IotHubResourceOperations: + """IotHubResourceOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.iothub.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.IotHubDescription": + """Get the non-security related metadata of an IoT hub. + + Get the non-security related metadata of an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IotHubDescription, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.IotHubDescription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + iot_hub_description: "_models.IotHubDescription", + if_match: Optional[str] = None, + **kwargs: Any + ) -> "_models.IotHubDescription": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(iot_hub_description, 'IotHubDescription') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + iot_hub_description: "_models.IotHubDescription", + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller["_models.IotHubDescription"]: + """Create or update the metadata of an IoT hub. + + Create or update the metadata of an Iot hub. The usual pattern to modify a property is to + retrieve the IoT hub metadata and security metadata, and then combine them with the modified + values in a new body to update the IoT hub. If certain properties are missing in the JSON, + updating IoT Hub may cause these values to fallback to default, which may lead to unexpected + behavior. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param iot_hub_description: The IoT hub metadata and security metadata. + :type iot_hub_description: ~azure.mgmt.iothub.v2021_07_01.models.IotHubDescription + :param if_match: ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required + to update an existing IoT Hub. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.iothub.v2021_07_01.models.IotHubDescription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + iot_hub_description=iot_hub_description, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + resource_name: str, + iot_hub_tags: "_models.TagsResource", + **kwargs: Any + ) -> "_models.IotHubDescription": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(iot_hub_tags, 'TagsResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + resource_name: str, + iot_hub_tags: "_models.TagsResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.IotHubDescription"]: + """Update an existing IoT Hubs tags. + + Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + + :param resource_group_name: Resource group identifier. + :type resource_group_name: str + :param resource_name: Name of iot hub to update. + :type resource_name: str + :param iot_hub_tags: Updated tag information to set into the iot hub instance. + :type iot_hub_tags: ~azure.mgmt.iothub.v2021_07_01.models.TagsResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.iothub.v2021_07_01.models.IotHubDescription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + iot_hub_tags=iot_hub_tags, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if response.status_code == 404: + deserialized = self._deserialize('ErrorDetails', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncLROPoller[Union["_models.IotHubDescription", "_models.ErrorDetails"]]: + """Delete an IoT hub. + + Delete an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.iothub.v2021_07_01.models.IotHubDescription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.IotHubDescription", "_models.ErrorDetails"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} # type: ignore + + def list_by_subscription( + self, + **kwargs: Any + ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: + """Get all the IoT hubs in a subscription. + + Get all the IoT hubs in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IotHubDescriptionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.iothub.v2021_07_01.models.IotHubDescriptionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescriptionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IotHubDescriptionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/IotHubs'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.IotHubDescriptionListResult"]: + """Get all the IoT hubs in a resource group. + + Get all the IoT hubs in a resource group. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IotHubDescriptionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.iothub.v2021_07_01.models.IotHubDescriptionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescriptionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IotHubDescriptionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs'} # type: ignore + + async def get_stats( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.RegistryStatistics": + """Get the statistics from an IoT hub. + + Get the statistics from an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegistryStatistics, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.RegistryStatistics + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryStatistics"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_stats.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegistryStatistics', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats'} # type: ignore + + def get_valid_skus( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.IotHubSkuDescriptionListResult"]: + """Get the list of valid SKUs for an IoT hub. + + Get the list of valid SKUs for an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IotHubSkuDescriptionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.iothub.v2021_07_01.models.IotHubSkuDescriptionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubSkuDescriptionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_valid_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IotHubSkuDescriptionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_valid_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/skus'} # type: ignore + + def list_event_hub_consumer_groups( + self, + resource_group_name: str, + resource_name: str, + event_hub_endpoint_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.EventHubConsumerGroupsListResult"]: + """Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + + Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an + IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param event_hub_endpoint_name: The name of the Event Hub-compatible endpoint. + :type event_hub_endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EventHubConsumerGroupsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.iothub.v2021_07_01.models.EventHubConsumerGroupsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubConsumerGroupsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_event_hub_consumer_groups.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'eventHubEndpointName': self._serialize.url("event_hub_endpoint_name", event_hub_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('EventHubConsumerGroupsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_event_hub_consumer_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups'} # type: ignore + + async def get_event_hub_consumer_group( + self, + resource_group_name: str, + resource_name: str, + event_hub_endpoint_name: str, + name: str, + **kwargs: Any + ) -> "_models.EventHubConsumerGroupInfo": + """Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + + Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param event_hub_endpoint_name: The name of the Event Hub-compatible endpoint in the IoT hub. + :type event_hub_endpoint_name: str + :param name: The name of the consumer group to retrieve. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EventHubConsumerGroupInfo, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.EventHubConsumerGroupInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubConsumerGroupInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_event_hub_consumer_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'eventHubEndpointName': self._serialize.url("event_hub_endpoint_name", event_hub_endpoint_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EventHubConsumerGroupInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_event_hub_consumer_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'} # type: ignore + + async def create_event_hub_consumer_group( + self, + resource_group_name: str, + resource_name: str, + event_hub_endpoint_name: str, + name: str, + consumer_group_body: "_models.EventHubConsumerGroupBodyDescription", + **kwargs: Any + ) -> "_models.EventHubConsumerGroupInfo": + """Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. + + Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param event_hub_endpoint_name: The name of the Event Hub-compatible endpoint in the IoT hub. + :type event_hub_endpoint_name: str + :param name: The name of the consumer group to add. + :type name: str + :param consumer_group_body: The consumer group to add. + :type consumer_group_body: ~azure.mgmt.iothub.v2021_07_01.models.EventHubConsumerGroupBodyDescription + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EventHubConsumerGroupInfo, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.EventHubConsumerGroupInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubConsumerGroupInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_event_hub_consumer_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'eventHubEndpointName': self._serialize.url("event_hub_endpoint_name", event_hub_endpoint_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(consumer_group_body, 'EventHubConsumerGroupBodyDescription') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EventHubConsumerGroupInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_event_hub_consumer_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'} # type: ignore + + async def delete_event_hub_consumer_group( + self, + resource_group_name: str, + resource_name: str, + event_hub_endpoint_name: str, + name: str, + **kwargs: Any + ) -> None: + """Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + + Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param event_hub_endpoint_name: The name of the Event Hub-compatible endpoint in the IoT hub. + :type event_hub_endpoint_name: str + :param name: The name of the consumer group to delete. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.delete_event_hub_consumer_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'eventHubEndpointName': self._serialize.url("event_hub_endpoint_name", event_hub_endpoint_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_event_hub_consumer_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'} # type: ignore + + def list_jobs( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.JobResponseListResult"]: + """Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + + Get a list of all the jobs in an IoT hub. For more information, see: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResponseListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.iothub.v2021_07_01.models.JobResponseListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResponseListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('JobResponseListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs'} # type: ignore + + async def get_job( + self, + resource_group_name: str, + resource_name: str, + job_id: str, + **kwargs: Any + ) -> "_models.JobResponse": + """Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + + Get the details of a job from an IoT hub. For more information, see: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param job_id: The job identifier. + :type job_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResponse, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.JobResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_job.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'jobId': self._serialize.url("job_id", job_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs/{jobId}'} # type: ignore + + def get_quota_metrics( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.IotHubQuotaMetricInfoListResult"]: + """Get the quota metrics for an IoT hub. + + Get the quota metrics for an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IotHubQuotaMetricInfoListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.iothub.v2021_07_01.models.IotHubQuotaMetricInfoListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubQuotaMetricInfoListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_quota_metrics.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IotHubQuotaMetricInfoListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_quota_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics'} # type: ignore + + def get_endpoint_health( + self, + resource_group_name: str, + iot_hub_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.EndpointHealthDataListResult"]: + """Get the health for routing endpoints. + + Get the health for routing endpoints. + + :param resource_group_name: + :type resource_group_name: str + :param iot_hub_name: + :type iot_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EndpointHealthDataListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.iothub.v2021_07_01.models.EndpointHealthDataListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointHealthDataListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_endpoint_health.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'iotHubName': self._serialize.url("iot_hub_name", iot_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('EndpointHealthDataListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_endpoint_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routingEndpointsHealth'} # type: ignore + + async def check_name_availability( + self, + operation_inputs: "_models.OperationInputs", + **kwargs: Any + ) -> "_models.IotHubNameAvailabilityInfo": + """Check if an IoT hub name is available. + + Check if an IoT hub name is available. + + :param operation_inputs: Set the name parameter in the OperationInputs structure to the name of + the IoT hub to check. + :type operation_inputs: ~azure.mgmt.iothub.v2021_07_01.models.OperationInputs + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IotHubNameAvailabilityInfo, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.IotHubNameAvailabilityInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubNameAvailabilityInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(operation_inputs, 'OperationInputs') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IotHubNameAvailabilityInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability'} # type: ignore + + async def test_all_routes( + self, + iot_hub_name: str, + resource_group_name: str, + input: "_models.TestAllRoutesInput", + **kwargs: Any + ) -> "_models.TestAllRoutesResult": + """Test all routes. + + Test all routes configured in this Iot Hub. + + :param iot_hub_name: IotHub to be tested. + :type iot_hub_name: str + :param resource_group_name: resource group which Iot Hub belongs to. + :type resource_group_name: str + :param input: Input for testing all routes. + :type input: ~azure.mgmt.iothub.v2021_07_01.models.TestAllRoutesInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TestAllRoutesResult, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.TestAllRoutesResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TestAllRoutesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.test_all_routes.metadata['url'] # type: ignore + path_format_arguments = { + 'iotHubName': self._serialize.url("iot_hub_name", iot_hub_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(input, 'TestAllRoutesInput') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TestAllRoutesResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + test_all_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall'} # type: ignore + + async def test_route( + self, + iot_hub_name: str, + resource_group_name: str, + input: "_models.TestRouteInput", + **kwargs: Any + ) -> "_models.TestRouteResult": + """Test the new route. + + Test the new route for this Iot Hub. + + :param iot_hub_name: IotHub to be tested. + :type iot_hub_name: str + :param resource_group_name: resource group which Iot Hub belongs to. + :type resource_group_name: str + :param input: Route that needs to be tested. + :type input: ~azure.mgmt.iothub.v2021_07_01.models.TestRouteInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TestRouteResult, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.TestRouteResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TestRouteResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.test_route.metadata['url'] # type: ignore + path_format_arguments = { + 'iotHubName': self._serialize.url("iot_hub_name", iot_hub_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(input, 'TestRouteInput') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TestRouteResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + test_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testnew'} # type: ignore + + def list_keys( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SharedAccessSignatureAuthorizationRuleListResult"]: + """Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + + Get the security metadata for an IoT hub. For more information, see: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SharedAccessSignatureAuthorizationRuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.iothub.v2021_07_01.models.SharedAccessSignatureAuthorizationRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessSignatureAuthorizationRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SharedAccessSignatureAuthorizationRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys'} # type: ignore + + async def get_keys_for_key_name( + self, + resource_group_name: str, + resource_name: str, + key_name: str, + **kwargs: Any + ) -> "_models.SharedAccessSignatureAuthorizationRule": + """Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + + Get a shared access policy by name from an IoT hub. For more information, see: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param key_name: The name of the shared access policy. + :type key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SharedAccessSignatureAuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.SharedAccessSignatureAuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessSignatureAuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_keys_for_key_name.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SharedAccessSignatureAuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_keys_for_key_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys'} # type: ignore + + async def export_devices( + self, + resource_group_name: str, + resource_name: str, + export_devices_parameters: "_models.ExportDevicesRequest", + **kwargs: Any + ) -> "_models.JobResponse": + """Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + + Exports all the device identities in the IoT hub identity registry to an Azure Storage blob + container. For more information, see: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param export_devices_parameters: The parameters that specify the export devices operation. + :type export_devices_parameters: ~azure.mgmt.iothub.v2021_07_01.models.ExportDevicesRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResponse, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.JobResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.export_devices.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(export_devices_parameters, 'ExportDevicesRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + export_devices.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices'} # type: ignore + + async def import_devices( + self, + resource_group_name: str, + resource_name: str, + import_devices_parameters: "_models.ImportDevicesRequest", + **kwargs: Any + ) -> "_models.JobResponse": + """Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + + Import, update, or delete device identities in the IoT hub identity registry from a blob. For + more information, see: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param import_devices_parameters: The parameters that specify the import devices operation. + :type import_devices_parameters: ~azure.mgmt.iothub.v2021_07_01.models.ImportDevicesRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResponse, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.JobResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.import_devices.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(import_devices_parameters, 'ImportDevicesRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + import_devices.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices'} # type: ignore diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_operations.py new file mode 100644 index 000000000000..df02361d4cf2 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.iothub.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.OperationListResult"]: + """Lists all of the available IoT Hub REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.iothub.v2021_07_01.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Devices/operations'} # type: ignore diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..f97b00f7b2f3 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,436 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.iothub.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> List["_models.PrivateEndpointConnection"]: + """List private endpoint connections. + + List private endpoint connection properties. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of PrivateEndpointConnection, or the result of cls(response) + :rtype: list[~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpointConnection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.PrivateEndpointConnection"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[PrivateEndpointConnection]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Get private endpoint connection. + + Get private endpoint connection properties. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + private_endpoint_connection: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_connection, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + private_endpoint_connection: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> AsyncLROPoller["_models.PrivateEndpointConnection"]: + """Update private endpoint connection. + + Update the status of a private endpoint connection with the specified name. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param private_endpoint_connection: The private endpoint connection with updated properties. + :type private_endpoint_connection: ~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_connection=private_endpoint_connection, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> Optional["_models.PrivateEndpointConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateEndpointConnection"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.PrivateEndpointConnection"]: + """Delete private endpoint connection. + + Delete private endpoint connection with the specified name. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_private_link_resources_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..51a0aec9cc56 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,167 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.iothub.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResources": + """List private link resources. + + List private link resources for the given IotHub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResources, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.PrivateLinkResources + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResources"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResources', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + group_id: str, + **kwargs: Any + ) -> "_models.GroupIdInformation": + """Get the specified private link resource. + + Get the specified private link resource for the given IotHub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param group_id: The name of the private link resource. + :type group_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GroupIdInformation, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.GroupIdInformation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupIdInformation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'groupId': self._serialize.url("group_id", group_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GroupIdInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources/{groupId}'} # type: ignore diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_resource_provider_common_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_resource_provider_common_operations.py new file mode 100644 index 000000000000..0b0852664095 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/aio/operations/_resource_provider_common_operations.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ResourceProviderCommonOperations: + """ResourceProviderCommonOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.iothub.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get_subscription_quota( + self, + **kwargs: Any + ) -> "_models.UserSubscriptionQuotaListResult": + """Get the number of iot hubs in the subscription. + + Get the number of free and paid iot hubs in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UserSubscriptionQuotaListResult, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.UserSubscriptionQuotaListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UserSubscriptionQuotaListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_subscription_quota.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UserSubscriptionQuotaListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_subscription_quota.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/usages'} # type: ignore diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/__init__.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/__init__.py new file mode 100644 index 000000000000..1491e763a154 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/__init__.py @@ -0,0 +1,301 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import ArmIdentity + from ._models_py3 import ArmUserIdentity + from ._models_py3 import CertificateBodyDescription + from ._models_py3 import CertificateDescription + from ._models_py3 import CertificateListDescription + from ._models_py3 import CertificateProperties + from ._models_py3 import CertificatePropertiesWithNonce + from ._models_py3 import CertificateVerificationDescription + from ._models_py3 import CertificateWithNonceDescription + from ._models_py3 import CloudToDeviceProperties + from ._models_py3 import EndpointHealthData + from ._models_py3 import EndpointHealthDataListResult + from ._models_py3 import EnrichmentProperties + from ._models_py3 import ErrorDetails + from ._models_py3 import EventHubConsumerGroupBodyDescription + from ._models_py3 import EventHubConsumerGroupInfo + from ._models_py3 import EventHubConsumerGroupName + from ._models_py3 import EventHubConsumerGroupsListResult + from ._models_py3 import EventHubProperties + from ._models_py3 import ExportDevicesRequest + from ._models_py3 import FailoverInput + from ._models_py3 import FallbackRouteProperties + from ._models_py3 import FeedbackProperties + from ._models_py3 import GroupIdInformation + from ._models_py3 import GroupIdInformationProperties + from ._models_py3 import ImportDevicesRequest + from ._models_py3 import IotHubCapacity + from ._models_py3 import IotHubDescription + from ._models_py3 import IotHubDescriptionListResult + from ._models_py3 import IotHubLocationDescription + from ._models_py3 import IotHubNameAvailabilityInfo + from ._models_py3 import IotHubProperties + from ._models_py3 import IotHubQuotaMetricInfo + from ._models_py3 import IotHubQuotaMetricInfoListResult + from ._models_py3 import IotHubSkuDescription + from ._models_py3 import IotHubSkuDescriptionListResult + from ._models_py3 import IotHubSkuInfo + from ._models_py3 import IpFilterRule + from ._models_py3 import JobResponse + from ._models_py3 import JobResponseListResult + from ._models_py3 import ManagedIdentity + from ._models_py3 import MatchedRoute + from ._models_py3 import MessagingEndpointProperties + from ._models_py3 import Name + from ._models_py3 import NetworkRuleSetIpRule + from ._models_py3 import NetworkRuleSetProperties + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationInputs + from ._models_py3 import OperationListResult + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionProperties + from ._models_py3 import PrivateLinkResources + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import RegistryStatistics + from ._models_py3 import Resource + from ._models_py3 import RouteCompilationError + from ._models_py3 import RouteErrorPosition + from ._models_py3 import RouteErrorRange + from ._models_py3 import RouteProperties + from ._models_py3 import RoutingEndpoints + from ._models_py3 import RoutingEventHubProperties + from ._models_py3 import RoutingMessage + from ._models_py3 import RoutingProperties + from ._models_py3 import RoutingServiceBusQueueEndpointProperties + from ._models_py3 import RoutingServiceBusTopicEndpointProperties + from ._models_py3 import RoutingStorageContainerProperties + from ._models_py3 import RoutingTwin + from ._models_py3 import RoutingTwinProperties + from ._models_py3 import SharedAccessSignatureAuthorizationRule + from ._models_py3 import SharedAccessSignatureAuthorizationRuleListResult + from ._models_py3 import StorageEndpointProperties + from ._models_py3 import TagsResource + from ._models_py3 import TestAllRoutesInput + from ._models_py3 import TestAllRoutesResult + from ._models_py3 import TestRouteInput + from ._models_py3 import TestRouteResult + from ._models_py3 import TestRouteResultDetails + from ._models_py3 import UserSubscriptionQuota + from ._models_py3 import UserSubscriptionQuotaListResult +except (SyntaxError, ImportError): + from ._models import ArmIdentity # type: ignore + from ._models import ArmUserIdentity # type: ignore + from ._models import CertificateBodyDescription # type: ignore + from ._models import CertificateDescription # type: ignore + from ._models import CertificateListDescription # type: ignore + from ._models import CertificateProperties # type: ignore + from ._models import CertificatePropertiesWithNonce # type: ignore + from ._models import CertificateVerificationDescription # type: ignore + from ._models import CertificateWithNonceDescription # type: ignore + from ._models import CloudToDeviceProperties # type: ignore + from ._models import EndpointHealthData # type: ignore + from ._models import EndpointHealthDataListResult # type: ignore + from ._models import EnrichmentProperties # type: ignore + from ._models import ErrorDetails # type: ignore + from ._models import EventHubConsumerGroupBodyDescription # type: ignore + from ._models import EventHubConsumerGroupInfo # type: ignore + from ._models import EventHubConsumerGroupName # type: ignore + from ._models import EventHubConsumerGroupsListResult # type: ignore + from ._models import EventHubProperties # type: ignore + from ._models import ExportDevicesRequest # type: ignore + from ._models import FailoverInput # type: ignore + from ._models import FallbackRouteProperties # type: ignore + from ._models import FeedbackProperties # type: ignore + from ._models import GroupIdInformation # type: ignore + from ._models import GroupIdInformationProperties # type: ignore + from ._models import ImportDevicesRequest # type: ignore + from ._models import IotHubCapacity # type: ignore + from ._models import IotHubDescription # type: ignore + from ._models import IotHubDescriptionListResult # type: ignore + from ._models import IotHubLocationDescription # type: ignore + from ._models import IotHubNameAvailabilityInfo # type: ignore + from ._models import IotHubProperties # type: ignore + from ._models import IotHubQuotaMetricInfo # type: ignore + from ._models import IotHubQuotaMetricInfoListResult # type: ignore + from ._models import IotHubSkuDescription # type: ignore + from ._models import IotHubSkuDescriptionListResult # type: ignore + from ._models import IotHubSkuInfo # type: ignore + from ._models import IpFilterRule # type: ignore + from ._models import JobResponse # type: ignore + from ._models import JobResponseListResult # type: ignore + from ._models import ManagedIdentity # type: ignore + from ._models import MatchedRoute # type: ignore + from ._models import MessagingEndpointProperties # type: ignore + from ._models import Name # type: ignore + from ._models import NetworkRuleSetIpRule # type: ignore + from ._models import NetworkRuleSetProperties # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationInputs # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionProperties # type: ignore + from ._models import PrivateLinkResources # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import RegistryStatistics # type: ignore + from ._models import Resource # type: ignore + from ._models import RouteCompilationError # type: ignore + from ._models import RouteErrorPosition # type: ignore + from ._models import RouteErrorRange # type: ignore + from ._models import RouteProperties # type: ignore + from ._models import RoutingEndpoints # type: ignore + from ._models import RoutingEventHubProperties # type: ignore + from ._models import RoutingMessage # type: ignore + from ._models import RoutingProperties # type: ignore + from ._models import RoutingServiceBusQueueEndpointProperties # type: ignore + from ._models import RoutingServiceBusTopicEndpointProperties # type: ignore + from ._models import RoutingStorageContainerProperties # type: ignore + from ._models import RoutingTwin # type: ignore + from ._models import RoutingTwinProperties # type: ignore + from ._models import SharedAccessSignatureAuthorizationRule # type: ignore + from ._models import SharedAccessSignatureAuthorizationRuleListResult # type: ignore + from ._models import StorageEndpointProperties # type: ignore + from ._models import TagsResource # type: ignore + from ._models import TestAllRoutesInput # type: ignore + from ._models import TestAllRoutesResult # type: ignore + from ._models import TestRouteInput # type: ignore + from ._models import TestRouteResult # type: ignore + from ._models import TestRouteResultDetails # type: ignore + from ._models import UserSubscriptionQuota # type: ignore + from ._models import UserSubscriptionQuotaListResult # type: ignore + +from ._iot_hub_client_enums import ( + AccessRights, + AuthenticationType, + Capabilities, + DefaultAction, + EndpointHealthStatus, + IotHubNameUnavailabilityReason, + IotHubReplicaRoleType, + IotHubScaleType, + IotHubSku, + IotHubSkuTier, + IpFilterActionType, + JobStatus, + JobType, + NetworkRuleIPAction, + PrivateLinkServiceConnectionStatus, + PublicNetworkAccess, + ResourceIdentityType, + RouteErrorSeverity, + RoutingSource, + RoutingStorageContainerPropertiesEncoding, + TestResultStatus, +) + +__all__ = [ + 'ArmIdentity', + 'ArmUserIdentity', + 'CertificateBodyDescription', + 'CertificateDescription', + 'CertificateListDescription', + 'CertificateProperties', + 'CertificatePropertiesWithNonce', + 'CertificateVerificationDescription', + 'CertificateWithNonceDescription', + 'CloudToDeviceProperties', + 'EndpointHealthData', + 'EndpointHealthDataListResult', + 'EnrichmentProperties', + 'ErrorDetails', + 'EventHubConsumerGroupBodyDescription', + 'EventHubConsumerGroupInfo', + 'EventHubConsumerGroupName', + 'EventHubConsumerGroupsListResult', + 'EventHubProperties', + 'ExportDevicesRequest', + 'FailoverInput', + 'FallbackRouteProperties', + 'FeedbackProperties', + 'GroupIdInformation', + 'GroupIdInformationProperties', + 'ImportDevicesRequest', + 'IotHubCapacity', + 'IotHubDescription', + 'IotHubDescriptionListResult', + 'IotHubLocationDescription', + 'IotHubNameAvailabilityInfo', + 'IotHubProperties', + 'IotHubQuotaMetricInfo', + 'IotHubQuotaMetricInfoListResult', + 'IotHubSkuDescription', + 'IotHubSkuDescriptionListResult', + 'IotHubSkuInfo', + 'IpFilterRule', + 'JobResponse', + 'JobResponseListResult', + 'ManagedIdentity', + 'MatchedRoute', + 'MessagingEndpointProperties', + 'Name', + 'NetworkRuleSetIpRule', + 'NetworkRuleSetProperties', + 'Operation', + 'OperationDisplay', + 'OperationInputs', + 'OperationListResult', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionProperties', + 'PrivateLinkResources', + 'PrivateLinkServiceConnectionState', + 'RegistryStatistics', + 'Resource', + 'RouteCompilationError', + 'RouteErrorPosition', + 'RouteErrorRange', + 'RouteProperties', + 'RoutingEndpoints', + 'RoutingEventHubProperties', + 'RoutingMessage', + 'RoutingProperties', + 'RoutingServiceBusQueueEndpointProperties', + 'RoutingServiceBusTopicEndpointProperties', + 'RoutingStorageContainerProperties', + 'RoutingTwin', + 'RoutingTwinProperties', + 'SharedAccessSignatureAuthorizationRule', + 'SharedAccessSignatureAuthorizationRuleListResult', + 'StorageEndpointProperties', + 'TagsResource', + 'TestAllRoutesInput', + 'TestAllRoutesResult', + 'TestRouteInput', + 'TestRouteResult', + 'TestRouteResultDetails', + 'UserSubscriptionQuota', + 'UserSubscriptionQuotaListResult', + 'AccessRights', + 'AuthenticationType', + 'Capabilities', + 'DefaultAction', + 'EndpointHealthStatus', + 'IotHubNameUnavailabilityReason', + 'IotHubReplicaRoleType', + 'IotHubScaleType', + 'IotHubSku', + 'IotHubSkuTier', + 'IpFilterActionType', + 'JobStatus', + 'JobType', + 'NetworkRuleIPAction', + 'PrivateLinkServiceConnectionStatus', + 'PublicNetworkAccess', + 'ResourceIdentityType', + 'RouteErrorSeverity', + 'RoutingSource', + 'RoutingStorageContainerPropertiesEncoding', + 'TestResultStatus', +] diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/_iot_hub_client_enums.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/_iot_hub_client_enums.py new file mode 100644 index 000000000000..77789fe60025 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/_iot_hub_client_enums.py @@ -0,0 +1,231 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AccessRights(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The permissions assigned to the shared access policy. + """ + + REGISTRY_READ = "RegistryRead" + REGISTRY_WRITE = "RegistryWrite" + SERVICE_CONNECT = "ServiceConnect" + DEVICE_CONNECT = "DeviceConnect" + REGISTRY_READ_REGISTRY_WRITE = "RegistryRead, RegistryWrite" + REGISTRY_READ_SERVICE_CONNECT = "RegistryRead, ServiceConnect" + REGISTRY_READ_DEVICE_CONNECT = "RegistryRead, DeviceConnect" + REGISTRY_WRITE_SERVICE_CONNECT = "RegistryWrite, ServiceConnect" + REGISTRY_WRITE_DEVICE_CONNECT = "RegistryWrite, DeviceConnect" + SERVICE_CONNECT_DEVICE_CONNECT = "ServiceConnect, DeviceConnect" + REGISTRY_READ_REGISTRY_WRITE_SERVICE_CONNECT = "RegistryRead, RegistryWrite, ServiceConnect" + REGISTRY_READ_REGISTRY_WRITE_DEVICE_CONNECT = "RegistryRead, RegistryWrite, DeviceConnect" + REGISTRY_READ_SERVICE_CONNECT_DEVICE_CONNECT = "RegistryRead, ServiceConnect, DeviceConnect" + REGISTRY_WRITE_SERVICE_CONNECT_DEVICE_CONNECT = "RegistryWrite, ServiceConnect, DeviceConnect" + REGISTRY_READ_REGISTRY_WRITE_SERVICE_CONNECT_DEVICE_CONNECT = "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect" + +class AuthenticationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies authentication type being used for connecting to the storage account. + """ + + KEY_BASED = "keyBased" + IDENTITY_BASED = "identityBased" + +class Capabilities(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The capabilities and features enabled for the IoT hub. + """ + + NONE = "None" + DEVICE_MANAGEMENT = "DeviceManagement" + +class DefaultAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Default Action for Network Rule Set + """ + + DENY = "Deny" + ALLOW = "Allow" + +class EndpointHealthStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Health statuses have following meanings. The 'healthy' status shows that the endpoint is + accepting messages as expected. The 'unhealthy' status shows that the endpoint is not accepting + messages as expected and IoT Hub is retrying to send data to this endpoint. The status of an + unhealthy endpoint will be updated to healthy when IoT Hub has established an eventually + consistent state of health. The 'dead' status shows that the endpoint is not accepting + messages, after IoT Hub retried sending messages for the retrial period. See IoT Hub metrics to + identify errors and monitor issues with endpoints. The 'unknown' status shows that the IoT Hub + has not established a connection with the endpoint. No messages have been delivered to or + rejected from this endpoint + """ + + UNKNOWN = "unknown" + HEALTHY = "healthy" + DEGRADED = "degraded" + UNHEALTHY = "unhealthy" + DEAD = "dead" + +class IotHubNameUnavailabilityReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The reason for unavailability. + """ + + INVALID = "Invalid" + ALREADY_EXISTS = "AlreadyExists" + +class IotHubReplicaRoleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The role of the region, can be either primary or secondary. The primary region is where the IoT + hub is currently provisioned. The secondary region is the Azure disaster recovery (DR) paired + region and also the region where the IoT hub can failover to. + """ + + PRIMARY = "primary" + SECONDARY = "secondary" + +class IotHubScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the scaling enabled. + """ + + AUTOMATIC = "Automatic" + MANUAL = "Manual" + NONE = "None" + +class IotHubSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The name of the SKU. + """ + + F1 = "F1" + S1 = "S1" + S2 = "S2" + S3 = "S3" + B1 = "B1" + B2 = "B2" + B3 = "B3" + +class IotHubSkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The billing tier for the IoT hub. + """ + + FREE = "Free" + STANDARD = "Standard" + BASIC = "Basic" + +class IpFilterActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The desired action for requests captured by this rule. + """ + + ACCEPT = "Accept" + REJECT = "Reject" + +class JobStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the job. + """ + + UNKNOWN = "unknown" + ENQUEUED = "enqueued" + RUNNING = "running" + COMPLETED = "completed" + FAILED = "failed" + CANCELLED = "cancelled" + +class JobType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the job. + """ + + UNKNOWN = "unknown" + EXPORT = "export" + IMPORT_ENUM = "import" + BACKUP = "backup" + READ_DEVICE_PROPERTIES = "readDeviceProperties" + WRITE_DEVICE_PROPERTIES = "writeDeviceProperties" + UPDATE_DEVICE_CONFIGURATION = "updateDeviceConfiguration" + REBOOT_DEVICE = "rebootDevice" + FACTORY_RESET_DEVICE = "factoryResetDevice" + FIRMWARE_UPDATE = "firmwareUpdate" + +class NetworkRuleIPAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """IP Filter Action + """ + + ALLOW = "Allow" + +class PrivateLinkServiceConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of a private endpoint connection + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + +class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Whether requests from Public Network are allowed + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes + both an implicitly created identity and a set of user assigned identities. The type 'None' will + remove any identities from the service. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" + +class RouteErrorSeverity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Severity of the route error + """ + + ERROR = "error" + WARNING = "warning" + +class RoutingSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The source that the routing rule is to be applied to, such as DeviceMessages. + """ + + INVALID = "Invalid" + DEVICE_MESSAGES = "DeviceMessages" + TWIN_CHANGE_EVENTS = "TwinChangeEvents" + DEVICE_LIFECYCLE_EVENTS = "DeviceLifecycleEvents" + DEVICE_JOB_LIFECYCLE_EVENTS = "DeviceJobLifecycleEvents" + DEVICE_CONNECTION_STATE_EVENTS = "DeviceConnectionStateEvents" + +class RoutingStorageContainerPropertiesEncoding(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Encoding that is used to serialize messages to blobs. Supported values are 'avro', + 'avrodeflate', and 'JSON'. Default value is 'avro'. + """ + + AVRO = "Avro" + AVRO_DEFLATE = "AvroDeflate" + JSON = "JSON" + +class TestResultStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Result of testing route + """ + + UNDEFINED = "undefined" + FALSE = "false" + TRUE = "true" diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/_models.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/_models.py new file mode 100644 index 000000000000..4f074f1b0a30 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/_models.py @@ -0,0 +1,3026 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class ArmIdentity(msrest.serialization.Model): + """ArmIdentity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Principal Id. + :vartype principal_id: str + :ivar tenant_id: Tenant Id. + :vartype tenant_id: str + :param type: The type of identity used for the resource. The type 'SystemAssigned, + UserAssigned' includes both an implicitly created identity and a set of user assigned + identities. The type 'None' will remove any identities from the service. Possible values + include: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.iothub.v2021_07_01.models.ResourceIdentityType + :param user_assigned_identities: Dictionary of :code:``. + :type user_assigned_identities: dict[str, + ~azure.mgmt.iothub.v2021_07_01.models.ArmUserIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ArmUserIdentity}'}, + } + + def __init__( + self, + **kwargs + ): + super(ArmIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class ArmUserIdentity(msrest.serialization.Model): + """ArmUserIdentity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: + :vartype principal_id: str + :ivar client_id: + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArmUserIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class CertificateBodyDescription(msrest.serialization.Model): + """The JSON-serialized X509 Certificate. + + :param certificate: base-64 representation of the X509 leaf certificate .cer file or just .pem + file content. + :type certificate: str + :param is_verified: True indicates that the certificate will be created in verified state and + proof of possession will not be required. + :type is_verified: bool + """ + + _attribute_map = { + 'certificate': {'key': 'certificate', 'type': 'str'}, + 'is_verified': {'key': 'isVerified', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateBodyDescription, self).__init__(**kwargs) + self.certificate = kwargs.get('certificate', None) + self.is_verified = kwargs.get('is_verified', None) + + +class CertificateDescription(msrest.serialization.Model): + """The X509 Certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param properties: The description of an X509 CA Certificate. + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.CertificateProperties + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The name of the certificate. + :vartype name: str + :ivar etag: The entity tag. + :vartype etag: str + :ivar type: The resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'CertificateProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateDescription, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.id = None + self.name = None + self.etag = None + self.type = None + + +class CertificateListDescription(msrest.serialization.Model): + """The JSON-serialized array of Certificate objects. + + :param value: The array of Certificate objects. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.CertificateDescription] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CertificateDescription]'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateListDescription, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class CertificateProperties(msrest.serialization.Model): + """The description of an X509 CA Certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar subject: The certificate's subject name. + :vartype subject: str + :ivar expiry: The certificate's expiration date and time. + :vartype expiry: ~datetime.datetime + :ivar thumbprint: The certificate's thumbprint. + :vartype thumbprint: str + :param is_verified: Determines whether certificate has been verified. + :type is_verified: bool + :ivar created: The certificate's create date and time. + :vartype created: ~datetime.datetime + :ivar updated: The certificate's last update date and time. + :vartype updated: ~datetime.datetime + :param certificate: The certificate content. + :type certificate: str + """ + + _validation = { + 'subject': {'readonly': True}, + 'expiry': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + } + + _attribute_map = { + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiry': {'key': 'expiry', 'type': 'rfc-1123'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'is_verified': {'key': 'isVerified', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'rfc-1123'}, + 'updated': {'key': 'updated', 'type': 'rfc-1123'}, + 'certificate': {'key': 'certificate', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateProperties, self).__init__(**kwargs) + self.subject = None + self.expiry = None + self.thumbprint = None + self.is_verified = kwargs.get('is_verified', None) + self.created = None + self.updated = None + self.certificate = kwargs.get('certificate', None) + + +class CertificatePropertiesWithNonce(msrest.serialization.Model): + """The description of an X509 CA Certificate including the challenge nonce issued for the Proof-Of-Possession flow. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar subject: The certificate's subject name. + :vartype subject: str + :ivar expiry: The certificate's expiration date and time. + :vartype expiry: ~datetime.datetime + :ivar thumbprint: The certificate's thumbprint. + :vartype thumbprint: str + :ivar is_verified: Determines whether certificate has been verified. + :vartype is_verified: bool + :ivar created: The certificate's create date and time. + :vartype created: ~datetime.datetime + :ivar updated: The certificate's last update date and time. + :vartype updated: ~datetime.datetime + :ivar verification_code: The certificate's verification code that will be used for proof of + possession. + :vartype verification_code: str + :ivar certificate: The certificate content. + :vartype certificate: str + """ + + _validation = { + 'subject': {'readonly': True}, + 'expiry': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'is_verified': {'readonly': True}, + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'verification_code': {'readonly': True}, + 'certificate': {'readonly': True}, + } + + _attribute_map = { + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiry': {'key': 'expiry', 'type': 'rfc-1123'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'is_verified': {'key': 'isVerified', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'rfc-1123'}, + 'updated': {'key': 'updated', 'type': 'rfc-1123'}, + 'verification_code': {'key': 'verificationCode', 'type': 'str'}, + 'certificate': {'key': 'certificate', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificatePropertiesWithNonce, self).__init__(**kwargs) + self.subject = None + self.expiry = None + self.thumbprint = None + self.is_verified = None + self.created = None + self.updated = None + self.verification_code = None + self.certificate = None + + +class CertificateVerificationDescription(msrest.serialization.Model): + """The JSON-serialized leaf certificate. + + :param certificate: base-64 representation of X509 certificate .cer file or just .pem file + content. + :type certificate: str + """ + + _attribute_map = { + 'certificate': {'key': 'certificate', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateVerificationDescription, self).__init__(**kwargs) + self.certificate = kwargs.get('certificate', None) + + +class CertificateWithNonceDescription(msrest.serialization.Model): + """The X509 Certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param properties: The description of an X509 CA Certificate including the challenge nonce + issued for the Proof-Of-Possession flow. + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.CertificatePropertiesWithNonce + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The name of the certificate. + :vartype name: str + :ivar etag: The entity tag. + :vartype etag: str + :ivar type: The resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'CertificatePropertiesWithNonce'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateWithNonceDescription, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.id = None + self.name = None + self.etag = None + self.type = None + + +class CloudToDeviceProperties(msrest.serialization.Model): + """The IoT hub cloud-to-device messaging properties. + + :param max_delivery_count: The max delivery count for cloud-to-device messages in the device + queue. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + :type max_delivery_count: int + :param default_ttl_as_iso8601: The default time to live for cloud-to-device messages in the + device queue. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + :type default_ttl_as_iso8601: ~datetime.timedelta + :param feedback: The properties of the feedback queue for cloud-to-device messages. + :type feedback: ~azure.mgmt.iothub.v2021_07_01.models.FeedbackProperties + """ + + _validation = { + 'max_delivery_count': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int'}, + 'default_ttl_as_iso8601': {'key': 'defaultTtlAsIso8601', 'type': 'duration'}, + 'feedback': {'key': 'feedback', 'type': 'FeedbackProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudToDeviceProperties, self).__init__(**kwargs) + self.max_delivery_count = kwargs.get('max_delivery_count', None) + self.default_ttl_as_iso8601 = kwargs.get('default_ttl_as_iso8601', None) + self.feedback = kwargs.get('feedback', None) + + +class EndpointHealthData(msrest.serialization.Model): + """The health data for an endpoint. + + :param endpoint_id: Id of the endpoint. + :type endpoint_id: str + :param health_status: Health statuses have following meanings. The 'healthy' status shows that + the endpoint is accepting messages as expected. The 'unhealthy' status shows that the endpoint + is not accepting messages as expected and IoT Hub is retrying to send data to this endpoint. + The status of an unhealthy endpoint will be updated to healthy when IoT Hub has established an + eventually consistent state of health. The 'dead' status shows that the endpoint is not + accepting messages, after IoT Hub retried sending messages for the retrial period. See IoT Hub + metrics to identify errors and monitor issues with endpoints. The 'unknown' status shows that + the IoT Hub has not established a connection with the endpoint. No messages have been delivered + to or rejected from this endpoint. Possible values include: "unknown", "healthy", "degraded", + "unhealthy", "dead". + :type health_status: str or ~azure.mgmt.iothub.v2021_07_01.models.EndpointHealthStatus + :param last_known_error: Last error obtained when a message failed to be delivered to iot hub. + :type last_known_error: str + :param last_known_error_time: Time at which the last known error occurred. + :type last_known_error_time: ~datetime.datetime + :param last_successful_send_attempt_time: Last time iot hub successfully sent a message to the + endpoint. + :type last_successful_send_attempt_time: ~datetime.datetime + :param last_send_attempt_time: Last time iot hub tried to send a message to the endpoint. + :type last_send_attempt_time: ~datetime.datetime + """ + + _attribute_map = { + 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'last_known_error': {'key': 'lastKnownError', 'type': 'str'}, + 'last_known_error_time': {'key': 'lastKnownErrorTime', 'type': 'rfc-1123'}, + 'last_successful_send_attempt_time': {'key': 'lastSuccessfulSendAttemptTime', 'type': 'rfc-1123'}, + 'last_send_attempt_time': {'key': 'lastSendAttemptTime', 'type': 'rfc-1123'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointHealthData, self).__init__(**kwargs) + self.endpoint_id = kwargs.get('endpoint_id', None) + self.health_status = kwargs.get('health_status', None) + self.last_known_error = kwargs.get('last_known_error', None) + self.last_known_error_time = kwargs.get('last_known_error_time', None) + self.last_successful_send_attempt_time = kwargs.get('last_successful_send_attempt_time', None) + self.last_send_attempt_time = kwargs.get('last_send_attempt_time', None) + + +class EndpointHealthDataListResult(msrest.serialization.Model): + """The JSON-serialized array of EndpointHealthData objects with a next link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: JSON-serialized array of Endpoint health data. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.EndpointHealthData] + :ivar next_link: Link to more results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EndpointHealthData]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointHealthDataListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class EnrichmentProperties(msrest.serialization.Model): + """The properties of an enrichment that your IoT hub applies to messages delivered to endpoints. + + All required parameters must be populated in order to send to Azure. + + :param key: Required. The key or name for the enrichment property. + :type key: str + :param value: Required. The value for the enrichment property. + :type value: str + :param endpoint_names: Required. The list of endpoints for which the enrichment is applied to + the message. + :type endpoint_names: list[str] + """ + + _validation = { + 'key': {'required': True}, + 'value': {'required': True}, + 'endpoint_names': {'required': True, 'min_items': 1}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'endpoint_names': {'key': 'endpointNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(EnrichmentProperties, self).__init__(**kwargs) + self.key = kwargs['key'] + self.value = kwargs['value'] + self.endpoint_names = kwargs['endpoint_names'] + + +class ErrorDetails(msrest.serialization.Model): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar http_status_code: The HTTP status code. + :vartype http_status_code: str + :ivar message: The error message. + :vartype message: str + :ivar details: The error details. + :vartype details: str + """ + + _validation = { + 'code': {'readonly': True}, + 'http_status_code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'http_status_code': {'key': 'httpStatusCode', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.http_status_code = None + self.message = None + self.details = None + + +class EventHubConsumerGroupBodyDescription(msrest.serialization.Model): + """The EventHub consumer group. + + All required parameters must be populated in order to send to Azure. + + :param properties: Required. The EventHub consumer group name. + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.EventHubConsumerGroupName + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'EventHubConsumerGroupName'}, + } + + def __init__( + self, + **kwargs + ): + super(EventHubConsumerGroupBodyDescription, self).__init__(**kwargs) + self.properties = kwargs['properties'] + + +class EventHubConsumerGroupInfo(msrest.serialization.Model): + """The properties of the EventHubConsumerGroupInfo object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param properties: The tags. + :type properties: dict[str, any] + :ivar id: The Event Hub-compatible consumer group identifier. + :vartype id: str + :ivar name: The Event Hub-compatible consumer group name. + :vartype name: str + :ivar type: the resource type. + :vartype type: str + :ivar etag: The etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': '{object}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EventHubConsumerGroupInfo, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.id = None + self.name = None + self.type = None + self.etag = None + + +class EventHubConsumerGroupName(msrest.serialization.Model): + """The EventHub consumer group name. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. EventHub consumer group name. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EventHubConsumerGroupName, self).__init__(**kwargs) + self.name = kwargs['name'] + + +class EventHubConsumerGroupsListResult(msrest.serialization.Model): + """The JSON-serialized array of Event Hub-compatible consumer group names with a next link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: List of consumer groups objects. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.EventHubConsumerGroupInfo] + :ivar next_link: The next link. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EventHubConsumerGroupInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EventHubConsumerGroupsListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class EventHubProperties(msrest.serialization.Model): + """The properties of the provisioned Event Hub-compatible endpoint used by the IoT hub. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param retention_time_in_days: The retention time for device-to-cloud messages in days. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. + :type retention_time_in_days: long + :param partition_count: The number of partitions for receiving device-to-cloud messages in the + Event Hub-compatible endpoint. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. + :type partition_count: int + :ivar partition_ids: The partition ids in the Event Hub-compatible endpoint. + :vartype partition_ids: list[str] + :ivar path: The Event Hub-compatible name. + :vartype path: str + :ivar endpoint: The Event Hub-compatible endpoint. + :vartype endpoint: str + """ + + _validation = { + 'partition_ids': {'readonly': True}, + 'path': {'readonly': True}, + 'endpoint': {'readonly': True}, + } + + _attribute_map = { + 'retention_time_in_days': {'key': 'retentionTimeInDays', 'type': 'long'}, + 'partition_count': {'key': 'partitionCount', 'type': 'int'}, + 'partition_ids': {'key': 'partitionIds', 'type': '[str]'}, + 'path': {'key': 'path', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EventHubProperties, self).__init__(**kwargs) + self.retention_time_in_days = kwargs.get('retention_time_in_days', None) + self.partition_count = kwargs.get('partition_count', None) + self.partition_ids = None + self.path = None + self.endpoint = None + + +class ExportDevicesRequest(msrest.serialization.Model): + """Use to provide parameters when requesting an export of all devices in the IoT hub. + + All required parameters must be populated in order to send to Azure. + + :param export_blob_container_uri: Required. The export blob container URI. + :type export_blob_container_uri: str + :param exclude_keys: Required. The value indicating whether keys should be excluded during + export. + :type exclude_keys: bool + :param export_blob_name: The name of the blob that will be created in the provided output blob + container. This blob will contain the exported device registry information for the IoT Hub. + :type export_blob_name: str + :param authentication_type: Specifies authentication type being used for connecting to the + storage account. Possible values include: "keyBased", "identityBased". + :type authentication_type: str or ~azure.mgmt.iothub.v2021_07_01.models.AuthenticationType + :param identity: Managed identity properties of storage endpoint for export devices. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ManagedIdentity + :param include_configurations: The value indicating whether configurations should be exported. + :type include_configurations: bool + :param configurations_blob_name: The name of the blob that will be created in the provided + output blob container. This blob will contain the exported configurations for the Iot Hub. + :type configurations_blob_name: str + """ + + _validation = { + 'export_blob_container_uri': {'required': True}, + 'exclude_keys': {'required': True}, + } + + _attribute_map = { + 'export_blob_container_uri': {'key': 'exportBlobContainerUri', 'type': 'str'}, + 'exclude_keys': {'key': 'excludeKeys', 'type': 'bool'}, + 'export_blob_name': {'key': 'exportBlobName', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + 'include_configurations': {'key': 'includeConfigurations', 'type': 'bool'}, + 'configurations_blob_name': {'key': 'configurationsBlobName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExportDevicesRequest, self).__init__(**kwargs) + self.export_blob_container_uri = kwargs['export_blob_container_uri'] + self.exclude_keys = kwargs['exclude_keys'] + self.export_blob_name = kwargs.get('export_blob_name', None) + self.authentication_type = kwargs.get('authentication_type', None) + self.identity = kwargs.get('identity', None) + self.include_configurations = kwargs.get('include_configurations', None) + self.configurations_blob_name = kwargs.get('configurations_blob_name', None) + + +class FailoverInput(msrest.serialization.Model): + """Use to provide failover region when requesting manual Failover for a hub. + + All required parameters must be populated in order to send to Azure. + + :param failover_region: Required. Region the hub will be failed over to. + :type failover_region: str + """ + + _validation = { + 'failover_region': {'required': True}, + } + + _attribute_map = { + 'failover_region': {'key': 'failoverRegion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FailoverInput, self).__init__(**kwargs) + self.failover_region = kwargs['failover_region'] + + +class FallbackRouteProperties(msrest.serialization.Model): + """The properties of the fallback route. IoT Hub uses these properties when it routes messages to the fallback endpoint. + + All required parameters must be populated in order to send to Azure. + + :param name: The name of the route. The name can only include alphanumeric characters, periods, + underscores, hyphens, has a maximum length of 64 characters, and must be unique. + :type name: str + :param source: Required. The source to which the routing rule is to be applied to. For example, + DeviceMessages. Possible values include: "Invalid", "DeviceMessages", "TwinChangeEvents", + "DeviceLifecycleEvents", "DeviceJobLifecycleEvents", "DeviceConnectionStateEvents". + :type source: str or ~azure.mgmt.iothub.v2021_07_01.models.RoutingSource + :param condition: The condition which is evaluated in order to apply the fallback route. If the + condition is not provided it will evaluate to true by default. For grammar, See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. + :type condition: str + :param endpoint_names: Required. The list of endpoints to which the messages that satisfy the + condition are routed to. Currently only 1 endpoint is allowed. + :type endpoint_names: list[str] + :param is_enabled: Required. Used to specify whether the fallback route is enabled. + :type is_enabled: bool + """ + + _validation = { + 'source': {'required': True}, + 'endpoint_names': {'required': True, 'max_items': 1, 'min_items': 1}, + 'is_enabled': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'condition': {'key': 'condition', 'type': 'str'}, + 'endpoint_names': {'key': 'endpointNames', 'type': '[str]'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(FallbackRouteProperties, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.source = kwargs['source'] + self.condition = kwargs.get('condition', None) + self.endpoint_names = kwargs['endpoint_names'] + self.is_enabled = kwargs['is_enabled'] + + +class FeedbackProperties(msrest.serialization.Model): + """The properties of the feedback queue for cloud-to-device messages. + + :param lock_duration_as_iso8601: The lock duration for the feedback queue. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + :type lock_duration_as_iso8601: ~datetime.timedelta + :param ttl_as_iso8601: The period of time for which a message is available to consume before it + is expired by the IoT hub. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + :type ttl_as_iso8601: ~datetime.timedelta + :param max_delivery_count: The number of times the IoT hub attempts to deliver a message on the + feedback queue. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + :type max_delivery_count: int + """ + + _validation = { + 'max_delivery_count': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'lock_duration_as_iso8601': {'key': 'lockDurationAsIso8601', 'type': 'duration'}, + 'ttl_as_iso8601': {'key': 'ttlAsIso8601', 'type': 'duration'}, + 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(FeedbackProperties, self).__init__(**kwargs) + self.lock_duration_as_iso8601 = kwargs.get('lock_duration_as_iso8601', None) + self.ttl_as_iso8601 = kwargs.get('ttl_as_iso8601', None) + self.max_delivery_count = kwargs.get('max_delivery_count', None) + + +class GroupIdInformation(msrest.serialization.Model): + """The group information for creating a private endpoint on an IotHub. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param properties: Required. The properties for a group information object. + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.GroupIdInformationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'GroupIdInformationProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(GroupIdInformation, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = kwargs['properties'] + + +class GroupIdInformationProperties(msrest.serialization.Model): + """The properties for a group information object. + + :param group_id: The group id. + :type group_id: str + :param required_members: The required members for a specific group id. + :type required_members: list[str] + :param required_zone_names: The required DNS zones for a specific group id. + :type required_zone_names: list[str] + """ + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(GroupIdInformationProperties, self).__init__(**kwargs) + self.group_id = kwargs.get('group_id', None) + self.required_members = kwargs.get('required_members', None) + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class ImportDevicesRequest(msrest.serialization.Model): + """Use to provide parameters when requesting an import of all devices in the hub. + + All required parameters must be populated in order to send to Azure. + + :param input_blob_container_uri: Required. The input blob container URI. + :type input_blob_container_uri: str + :param output_blob_container_uri: Required. The output blob container URI. + :type output_blob_container_uri: str + :param input_blob_name: The blob name to be used when importing from the provided input blob + container. + :type input_blob_name: str + :param output_blob_name: The blob name to use for storing the status of the import job. + :type output_blob_name: str + :param authentication_type: Specifies authentication type being used for connecting to the + storage account. Possible values include: "keyBased", "identityBased". + :type authentication_type: str or ~azure.mgmt.iothub.v2021_07_01.models.AuthenticationType + :param identity: Managed identity properties of storage endpoint for import devices. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ManagedIdentity + :param include_configurations: The value indicating whether configurations should be imported. + :type include_configurations: bool + :param configurations_blob_name: The blob name to be used when importing configurations from + the provided input blob container. + :type configurations_blob_name: str + """ + + _validation = { + 'input_blob_container_uri': {'required': True}, + 'output_blob_container_uri': {'required': True}, + } + + _attribute_map = { + 'input_blob_container_uri': {'key': 'inputBlobContainerUri', 'type': 'str'}, + 'output_blob_container_uri': {'key': 'outputBlobContainerUri', 'type': 'str'}, + 'input_blob_name': {'key': 'inputBlobName', 'type': 'str'}, + 'output_blob_name': {'key': 'outputBlobName', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + 'include_configurations': {'key': 'includeConfigurations', 'type': 'bool'}, + 'configurations_blob_name': {'key': 'configurationsBlobName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ImportDevicesRequest, self).__init__(**kwargs) + self.input_blob_container_uri = kwargs['input_blob_container_uri'] + self.output_blob_container_uri = kwargs['output_blob_container_uri'] + self.input_blob_name = kwargs.get('input_blob_name', None) + self.output_blob_name = kwargs.get('output_blob_name', None) + self.authentication_type = kwargs.get('authentication_type', None) + self.identity = kwargs.get('identity', None) + self.include_configurations = kwargs.get('include_configurations', None) + self.configurations_blob_name = kwargs.get('configurations_blob_name', None) + + +class IotHubCapacity(msrest.serialization.Model): + """IoT Hub capacity information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar minimum: The minimum number of units. + :vartype minimum: long + :ivar maximum: The maximum number of units. + :vartype maximum: long + :ivar default: The default number of units. + :vartype default: long + :ivar scale_type: The type of the scaling enabled. Possible values include: "Automatic", + "Manual", "None". + :vartype scale_type: str or ~azure.mgmt.iothub.v2021_07_01.models.IotHubScaleType + """ + + _validation = { + 'minimum': {'readonly': True, 'maximum': 1, 'minimum': 1}, + 'maximum': {'readonly': True}, + 'default': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'long'}, + 'maximum': {'key': 'maximum', 'type': 'long'}, + 'default': {'key': 'default', 'type': 'long'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHubCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default = None + self.scale_type = None + + +class Resource(msrest.serialization.Model): + """The common properties of an Azure resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param location: Required. The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + + +class IotHubDescription(Resource): + """The description of the IoT hub. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param location: Required. The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param etag: The Etag field is *not* required. If it is provided in the response body, it must + also be provided as a header per the normal ETag convention. + :type etag: str + :param properties: IotHub properties. + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.IotHubProperties + :param sku: Required. IotHub SKU info. + :type sku: ~azure.mgmt.iothub.v2021_07_01.models.IotHubSkuInfo + :param identity: The managed identities for the IotHub. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ArmIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'IotHubProperties'}, + 'sku': {'key': 'sku', 'type': 'IotHubSkuInfo'}, + 'identity': {'key': 'identity', 'type': 'ArmIdentity'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHubDescription, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.properties = kwargs.get('properties', None) + self.sku = kwargs['sku'] + self.identity = kwargs.get('identity', None) + + +class IotHubDescriptionListResult(msrest.serialization.Model): + """The JSON-serialized array of IotHubDescription objects with a next link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The array of IotHubDescription objects. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.IotHubDescription] + :ivar next_link: The next link. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotHubDescription]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHubDescriptionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class IotHubLocationDescription(msrest.serialization.Model): + """Public representation of one of the locations where a resource is provisioned. + + :param location: The name of the Azure region. + :type location: str + :param role: The role of the region, can be either primary or secondary. The primary region is + where the IoT hub is currently provisioned. The secondary region is the Azure disaster recovery + (DR) paired region and also the region where the IoT hub can failover to. Possible values + include: "primary", "secondary". + :type role: str or ~azure.mgmt.iothub.v2021_07_01.models.IotHubReplicaRoleType + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'role': {'key': 'role', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHubLocationDescription, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.role = kwargs.get('role', None) + + +class IotHubNameAvailabilityInfo(msrest.serialization.Model): + """The properties indicating whether a given IoT hub name is available. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name_available: The value which indicates whether the provided name is available. + :vartype name_available: bool + :ivar reason: The reason for unavailability. Possible values include: "Invalid", + "AlreadyExists". + :vartype reason: str or ~azure.mgmt.iothub.v2021_07_01.models.IotHubNameUnavailabilityReason + :param message: The detailed reason message. + :type message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHubNameAvailabilityInfo, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = kwargs.get('message', None) + + +class IotHubProperties(msrest.serialization.Model): + """The properties of an IoT hub. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param authorization_policies: The shared access policies you can use to secure a connection to + the IoT hub. + :type authorization_policies: + list[~azure.mgmt.iothub.v2021_07_01.models.SharedAccessSignatureAuthorizationRule] + :param disable_local_auth: If true, SAS tokens with Iot hub scoped SAS keys cannot be used for + authentication. + :type disable_local_auth: bool + :param disable_device_sas: If true, all device(including Edge devices but excluding modules) + scoped SAS keys cannot be used for authentication. + :type disable_device_sas: bool + :param disable_module_sas: If true, all module scoped SAS keys cannot be used for + authentication. + :type disable_module_sas: bool + :param restrict_outbound_network_access: If true, egress from IotHub will be restricted to only + the allowed FQDNs that are configured via allowedFqdnList. + :type restrict_outbound_network_access: bool + :param allowed_fqdn_list: List of allowed FQDNs(Fully Qualified Domain Name) for egress from + Iot Hub. + :type allowed_fqdn_list: list[str] + :param public_network_access: Whether requests from Public Network are allowed. Possible values + include: "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.iothub.v2021_07_01.models.PublicNetworkAccess + :param ip_filter_rules: The IP filter rules. + :type ip_filter_rules: list[~azure.mgmt.iothub.v2021_07_01.models.IpFilterRule] + :param network_rule_sets: Network Rule Set Properties of IotHub. + :type network_rule_sets: ~azure.mgmt.iothub.v2021_07_01.models.NetworkRuleSetProperties + :param min_tls_version: Specifies the minimum TLS version to support for this hub. Can be set + to "1.2" to have clients that use a TLS version below 1.2 to be rejected. + :type min_tls_version: str + :param private_endpoint_connections: Private endpoint connections created on this IotHub. + :type private_endpoint_connections: + list[~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpointConnection] + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + :ivar state: The hub state. + :vartype state: str + :ivar host_name: The name of the host. + :vartype host_name: str + :param event_hub_endpoints: The Event Hub-compatible endpoint properties. The only possible + keys to this dictionary is events. This key has to be present in the dictionary while making + create or update calls for the IoT hub. + :type event_hub_endpoints: dict[str, ~azure.mgmt.iothub.v2021_07_01.models.EventHubProperties] + :param routing: The routing related properties of the IoT hub. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging. + :type routing: ~azure.mgmt.iothub.v2021_07_01.models.RoutingProperties + :param storage_endpoints: The list of Azure Storage endpoints where you can upload files. + Currently you can configure only one Azure Storage account and that MUST have its key as + $default. Specifying more than one storage account causes an error to be thrown. Not specifying + a value for this property when the enableFileUploadNotifications property is set to True, + causes an error to be thrown. + :type storage_endpoints: dict[str, + ~azure.mgmt.iothub.v2021_07_01.models.StorageEndpointProperties] + :param messaging_endpoints: The messaging endpoint properties for the file upload notification + queue. + :type messaging_endpoints: dict[str, + ~azure.mgmt.iothub.v2021_07_01.models.MessagingEndpointProperties] + :param enable_file_upload_notifications: If True, file upload notifications are enabled. + :type enable_file_upload_notifications: bool + :param cloud_to_device: The IoT hub cloud-to-device messaging properties. + :type cloud_to_device: ~azure.mgmt.iothub.v2021_07_01.models.CloudToDeviceProperties + :param comments: IoT hub comments. + :type comments: str + :param features: The capabilities and features enabled for the IoT hub. Possible values + include: "None", "DeviceManagement". + :type features: str or ~azure.mgmt.iothub.v2021_07_01.models.Capabilities + :ivar locations: Primary and secondary location for iot hub. + :vartype locations: list[~azure.mgmt.iothub.v2021_07_01.models.IotHubLocationDescription] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'state': {'readonly': True}, + 'host_name': {'readonly': True}, + 'locations': {'readonly': True}, + } + + _attribute_map = { + 'authorization_policies': {'key': 'authorizationPolicies', 'type': '[SharedAccessSignatureAuthorizationRule]'}, + 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + 'disable_device_sas': {'key': 'disableDeviceSAS', 'type': 'bool'}, + 'disable_module_sas': {'key': 'disableModuleSAS', 'type': 'bool'}, + 'restrict_outbound_network_access': {'key': 'restrictOutboundNetworkAccess', 'type': 'bool'}, + 'allowed_fqdn_list': {'key': 'allowedFqdnList', 'type': '[str]'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'ip_filter_rules': {'key': 'ipFilterRules', 'type': '[IpFilterRule]'}, + 'network_rule_sets': {'key': 'networkRuleSets', 'type': 'NetworkRuleSetProperties'}, + 'min_tls_version': {'key': 'minTlsVersion', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'event_hub_endpoints': {'key': 'eventHubEndpoints', 'type': '{EventHubProperties}'}, + 'routing': {'key': 'routing', 'type': 'RoutingProperties'}, + 'storage_endpoints': {'key': 'storageEndpoints', 'type': '{StorageEndpointProperties}'}, + 'messaging_endpoints': {'key': 'messagingEndpoints', 'type': '{MessagingEndpointProperties}'}, + 'enable_file_upload_notifications': {'key': 'enableFileUploadNotifications', 'type': 'bool'}, + 'cloud_to_device': {'key': 'cloudToDevice', 'type': 'CloudToDeviceProperties'}, + 'comments': {'key': 'comments', 'type': 'str'}, + 'features': {'key': 'features', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[IotHubLocationDescription]'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHubProperties, self).__init__(**kwargs) + self.authorization_policies = kwargs.get('authorization_policies', None) + self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_device_sas = kwargs.get('disable_device_sas', None) + self.disable_module_sas = kwargs.get('disable_module_sas', None) + self.restrict_outbound_network_access = kwargs.get('restrict_outbound_network_access', None) + self.allowed_fqdn_list = kwargs.get('allowed_fqdn_list', None) + self.public_network_access = kwargs.get('public_network_access', None) + self.ip_filter_rules = kwargs.get('ip_filter_rules', None) + self.network_rule_sets = kwargs.get('network_rule_sets', None) + self.min_tls_version = kwargs.get('min_tls_version', None) + self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None) + self.provisioning_state = None + self.state = None + self.host_name = None + self.event_hub_endpoints = kwargs.get('event_hub_endpoints', None) + self.routing = kwargs.get('routing', None) + self.storage_endpoints = kwargs.get('storage_endpoints', None) + self.messaging_endpoints = kwargs.get('messaging_endpoints', None) + self.enable_file_upload_notifications = kwargs.get('enable_file_upload_notifications', None) + self.cloud_to_device = kwargs.get('cloud_to_device', None) + self.comments = kwargs.get('comments', None) + self.features = kwargs.get('features', None) + self.locations = None + + +class IotHubQuotaMetricInfo(msrest.serialization.Model): + """Quota metrics properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the quota metric. + :vartype name: str + :ivar current_value: The current value for the quota metric. + :vartype current_value: long + :ivar max_value: The maximum value of the quota metric. + :vartype max_value: long + """ + + _validation = { + 'name': {'readonly': True}, + 'current_value': {'readonly': True}, + 'max_value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'max_value': {'key': 'maxValue', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHubQuotaMetricInfo, self).__init__(**kwargs) + self.name = None + self.current_value = None + self.max_value = None + + +class IotHubQuotaMetricInfoListResult(msrest.serialization.Model): + """The JSON-serialized array of IotHubQuotaMetricInfo objects with a next link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The array of quota metrics objects. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.IotHubQuotaMetricInfo] + :ivar next_link: The next link. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotHubQuotaMetricInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHubQuotaMetricInfoListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class IotHubSkuDescription(msrest.serialization.Model): + """SKU properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :param sku: Required. The type of the resource. + :type sku: ~azure.mgmt.iothub.v2021_07_01.models.IotHubSkuInfo + :param capacity: Required. IotHub capacity. + :type capacity: ~azure.mgmt.iothub.v2021_07_01.models.IotHubCapacity + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'sku': {'required': True}, + 'capacity': {'required': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'IotHubSkuInfo'}, + 'capacity': {'key': 'capacity', 'type': 'IotHubCapacity'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHubSkuDescription, self).__init__(**kwargs) + self.resource_type = None + self.sku = kwargs['sku'] + self.capacity = kwargs['capacity'] + + +class IotHubSkuDescriptionListResult(msrest.serialization.Model): + """The JSON-serialized array of IotHubSkuDescription objects with a next link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The array of IotHubSkuDescription. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.IotHubSkuDescription] + :ivar next_link: The next link. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotHubSkuDescription]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHubSkuDescriptionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class IotHubSkuInfo(msrest.serialization.Model): + """Information about the SKU of the IoT hub. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. Possible values include: "F1", "S1", "S2", "S3", + "B1", "B2", "B3". + :type name: str or ~azure.mgmt.iothub.v2021_07_01.models.IotHubSku + :ivar tier: The billing tier for the IoT hub. Possible values include: "Free", "Standard", + "Basic". + :vartype tier: str or ~azure.mgmt.iothub.v2021_07_01.models.IotHubSkuTier + :param capacity: The number of provisioned IoT Hub units. See: + https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits. + :type capacity: long + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHubSkuInfo, self).__init__(**kwargs) + self.name = kwargs['name'] + self.tier = None + self.capacity = kwargs.get('capacity', None) + + +class IpFilterRule(msrest.serialization.Model): + """The IP filter rules for the IoT hub. + + All required parameters must be populated in order to send to Azure. + + :param filter_name: Required. The name of the IP filter rule. + :type filter_name: str + :param action: Required. The desired action for requests captured by this rule. Possible values + include: "Accept", "Reject". + :type action: str or ~azure.mgmt.iothub.v2021_07_01.models.IpFilterActionType + :param ip_mask: Required. A string that contains the IP address range in CIDR notation for the + rule. + :type ip_mask: str + """ + + _validation = { + 'filter_name': {'required': True}, + 'action': {'required': True}, + 'ip_mask': {'required': True}, + } + + _attribute_map = { + 'filter_name': {'key': 'filterName', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'ip_mask': {'key': 'ipMask', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IpFilterRule, self).__init__(**kwargs) + self.filter_name = kwargs['filter_name'] + self.action = kwargs['action'] + self.ip_mask = kwargs['ip_mask'] + + +class JobResponse(msrest.serialization.Model): + """The properties of the Job Response object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar job_id: The job identifier. + :vartype job_id: str + :ivar start_time_utc: The start time of the job. + :vartype start_time_utc: ~datetime.datetime + :ivar end_time_utc: The time the job stopped processing. + :vartype end_time_utc: ~datetime.datetime + :ivar type: The type of the job. Possible values include: "unknown", "export", "import", + "backup", "readDeviceProperties", "writeDeviceProperties", "updateDeviceConfiguration", + "rebootDevice", "factoryResetDevice", "firmwareUpdate". + :vartype type: str or ~azure.mgmt.iothub.v2021_07_01.models.JobType + :ivar status: The status of the job. Possible values include: "unknown", "enqueued", "running", + "completed", "failed", "cancelled". + :vartype status: str or ~azure.mgmt.iothub.v2021_07_01.models.JobStatus + :ivar failure_reason: If status == failed, this string containing the reason for the failure. + :vartype failure_reason: str + :ivar status_message: The status message for the job. + :vartype status_message: str + :ivar parent_job_id: The job identifier of the parent job, if any. + :vartype parent_job_id: str + """ + + _validation = { + 'job_id': {'readonly': True}, + 'start_time_utc': {'readonly': True}, + 'end_time_utc': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'failure_reason': {'readonly': True}, + 'status_message': {'readonly': True}, + 'parent_job_id': {'readonly': True}, + } + + _attribute_map = { + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'start_time_utc': {'key': 'startTimeUtc', 'type': 'rfc-1123'}, + 'end_time_utc': {'key': 'endTimeUtc', 'type': 'rfc-1123'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'failure_reason': {'key': 'failureReason', 'type': 'str'}, + 'status_message': {'key': 'statusMessage', 'type': 'str'}, + 'parent_job_id': {'key': 'parentJobId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobResponse, self).__init__(**kwargs) + self.job_id = None + self.start_time_utc = None + self.end_time_utc = None + self.type = None + self.status = None + self.failure_reason = None + self.status_message = None + self.parent_job_id = None + + +class JobResponseListResult(msrest.serialization.Model): + """The JSON-serialized array of JobResponse objects with a next link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The array of JobResponse objects. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.JobResponse] + :ivar next_link: The next link. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobResponseListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ManagedIdentity(msrest.serialization.Model): + """The properties of the Managed identity. + + :param user_assigned_identity: The user assigned identity. + :type user_assigned_identity: str + """ + + _attribute_map = { + 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedIdentity, self).__init__(**kwargs) + self.user_assigned_identity = kwargs.get('user_assigned_identity', None) + + +class MatchedRoute(msrest.serialization.Model): + """Routes that matched. + + :param properties: Properties of routes that matched. + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.RouteProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'RouteProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(MatchedRoute, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class MessagingEndpointProperties(msrest.serialization.Model): + """The properties of the messaging endpoints used by this IoT hub. + + :param lock_duration_as_iso8601: The lock duration. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + :type lock_duration_as_iso8601: ~datetime.timedelta + :param ttl_as_iso8601: The period of time for which a message is available to consume before it + is expired by the IoT hub. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + :type ttl_as_iso8601: ~datetime.timedelta + :param max_delivery_count: The number of times the IoT hub attempts to deliver a message. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + :type max_delivery_count: int + """ + + _validation = { + 'max_delivery_count': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'lock_duration_as_iso8601': {'key': 'lockDurationAsIso8601', 'type': 'duration'}, + 'ttl_as_iso8601': {'key': 'ttlAsIso8601', 'type': 'duration'}, + 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(MessagingEndpointProperties, self).__init__(**kwargs) + self.lock_duration_as_iso8601 = kwargs.get('lock_duration_as_iso8601', None) + self.ttl_as_iso8601 = kwargs.get('ttl_as_iso8601', None) + self.max_delivery_count = kwargs.get('max_delivery_count', None) + + +class Name(msrest.serialization.Model): + """Name of Iot Hub type. + + :param value: IotHub type. + :type value: str + :param localized_value: Localized value of name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Name, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) + + +class NetworkRuleSetIpRule(msrest.serialization.Model): + """IP Rule to be applied as part of Network Rule Set. + + All required parameters must be populated in order to send to Azure. + + :param filter_name: Required. Name of the IP filter rule. + :type filter_name: str + :param action: IP Filter Action. Possible values include: "Allow". Default value: "Allow". + :type action: str or ~azure.mgmt.iothub.v2021_07_01.models.NetworkRuleIPAction + :param ip_mask: Required. A string that contains the IP address range in CIDR notation for the + rule. + :type ip_mask: str + """ + + _validation = { + 'filter_name': {'required': True}, + 'ip_mask': {'required': True}, + } + + _attribute_map = { + 'filter_name': {'key': 'filterName', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'ip_mask': {'key': 'ipMask', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkRuleSetIpRule, self).__init__(**kwargs) + self.filter_name = kwargs['filter_name'] + self.action = kwargs.get('action', "Allow") + self.ip_mask = kwargs['ip_mask'] + + +class NetworkRuleSetProperties(msrest.serialization.Model): + """Network Rule Set Properties of IotHub. + + All required parameters must be populated in order to send to Azure. + + :param default_action: Default Action for Network Rule Set. Possible values include: "Deny", + "Allow". Default value: "Deny". + :type default_action: str or ~azure.mgmt.iothub.v2021_07_01.models.DefaultAction + :param apply_to_built_in_event_hub_endpoint: Required. If True, then Network Rule Set is also + applied to BuiltIn EventHub EndPoint of IotHub. + :type apply_to_built_in_event_hub_endpoint: bool + :param ip_rules: Required. List of IP Rules. + :type ip_rules: list[~azure.mgmt.iothub.v2021_07_01.models.NetworkRuleSetIpRule] + """ + + _validation = { + 'apply_to_built_in_event_hub_endpoint': {'required': True}, + 'ip_rules': {'required': True}, + } + + _attribute_map = { + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'apply_to_built_in_event_hub_endpoint': {'key': 'applyToBuiltInEventHubEndpoint', 'type': 'bool'}, + 'ip_rules': {'key': 'ipRules', 'type': '[NetworkRuleSetIpRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkRuleSetProperties, self).__init__(**kwargs) + self.default_action = kwargs.get('default_action', "Deny") + self.apply_to_built_in_event_hub_endpoint = kwargs['apply_to_built_in_event_hub_endpoint'] + self.ip_rules = kwargs['ip_rules'] + + +class Operation(msrest.serialization.Model): + """IoT Hub REST API operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name: {provider}/{resource}/{read | write | action | delete}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.iothub.v2021_07_01.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: Service provider: Microsoft Devices. + :vartype provider: str + :ivar resource: Resource Type: IotHubs. + :vartype resource: str + :ivar operation: Name of the operation. + :vartype operation: str + :ivar description: Description of the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationInputs(msrest.serialization.Model): + """Input values. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the IoT hub to check. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationInputs, self).__init__(**kwargs) + self.name = kwargs['name'] + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list IoT Hub operations. It contains a list of operations and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of IoT Hub operations supported by the Microsoft.Devices resource provider. + :vartype value: list[~azure.mgmt.iothub.v2021_07_01.models.Operation] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PrivateEndpoint(msrest.serialization.Model): + """The private endpoint property of a private endpoint connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource identifier. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(msrest.serialization.Model): + """The private endpoint connection of an IotHub. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param properties: Required. The properties of a private endpoint connection. + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpointConnectionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = kwargs['properties'] + + +class PrivateEndpointConnectionProperties(msrest.serialization.Model): + """The properties of a private endpoint connection. + + All required parameters must be populated in order to send to Azure. + + :param private_endpoint: The private endpoint property of a private endpoint connection. + :type private_endpoint: ~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpoint + :param private_link_service_connection_state: Required. The current state of a private endpoint + connection. + :type private_link_service_connection_state: + ~azure.mgmt.iothub.v2021_07_01.models.PrivateLinkServiceConnectionState + """ + + _validation = { + 'private_link_service_connection_state': {'required': True}, + } + + _attribute_map = { + 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionProperties, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs['private_link_service_connection_state'] + + +class PrivateLinkResources(msrest.serialization.Model): + """The available private link resources for an IotHub. + + :param value: The list of available private link resources for an IotHub. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.GroupIdInformation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GroupIdInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResources, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """The current state of a private endpoint connection. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. The status of a private endpoint connection. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :type status: str or ~azure.mgmt.iothub.v2021_07_01.models.PrivateLinkServiceConnectionStatus + :param description: Required. The description for the current state of a private endpoint + connection. + :type description: str + :param actions_required: Actions required for a private endpoint connection. + :type actions_required: str + """ + + _validation = { + 'status': {'required': True}, + 'description': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs['status'] + self.description = kwargs['description'] + self.actions_required = kwargs.get('actions_required', None) + + +class RegistryStatistics(msrest.serialization.Model): + """Identity registry statistics. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar total_device_count: The total count of devices in the identity registry. + :vartype total_device_count: long + :ivar enabled_device_count: The count of enabled devices in the identity registry. + :vartype enabled_device_count: long + :ivar disabled_device_count: The count of disabled devices in the identity registry. + :vartype disabled_device_count: long + """ + + _validation = { + 'total_device_count': {'readonly': True}, + 'enabled_device_count': {'readonly': True}, + 'disabled_device_count': {'readonly': True}, + } + + _attribute_map = { + 'total_device_count': {'key': 'totalDeviceCount', 'type': 'long'}, + 'enabled_device_count': {'key': 'enabledDeviceCount', 'type': 'long'}, + 'disabled_device_count': {'key': 'disabledDeviceCount', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(RegistryStatistics, self).__init__(**kwargs) + self.total_device_count = None + self.enabled_device_count = None + self.disabled_device_count = None + + +class RouteCompilationError(msrest.serialization.Model): + """Compilation error when evaluating route. + + :param message: Route error message. + :type message: str + :param severity: Severity of the route error. Possible values include: "error", "warning". + :type severity: str or ~azure.mgmt.iothub.v2021_07_01.models.RouteErrorSeverity + :param location: Location where the route error happened. + :type location: ~azure.mgmt.iothub.v2021_07_01.models.RouteErrorRange + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'RouteErrorRange'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteCompilationError, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.severity = kwargs.get('severity', None) + self.location = kwargs.get('location', None) + + +class RouteErrorPosition(msrest.serialization.Model): + """Position where the route error happened. + + :param line: Line where the route error happened. + :type line: int + :param column: Column where the route error happened. + :type column: int + """ + + _attribute_map = { + 'line': {'key': 'line', 'type': 'int'}, + 'column': {'key': 'column', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteErrorPosition, self).__init__(**kwargs) + self.line = kwargs.get('line', None) + self.column = kwargs.get('column', None) + + +class RouteErrorRange(msrest.serialization.Model): + """Range of route errors. + + :param start: Start where the route error happened. + :type start: ~azure.mgmt.iothub.v2021_07_01.models.RouteErrorPosition + :param end: End where the route error happened. + :type end: ~azure.mgmt.iothub.v2021_07_01.models.RouteErrorPosition + """ + + _attribute_map = { + 'start': {'key': 'start', 'type': 'RouteErrorPosition'}, + 'end': {'key': 'end', 'type': 'RouteErrorPosition'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteErrorRange, self).__init__(**kwargs) + self.start = kwargs.get('start', None) + self.end = kwargs.get('end', None) + + +class RouteProperties(msrest.serialization.Model): + """The properties of a routing rule that your IoT hub uses to route messages to endpoints. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the route. The name can only include alphanumeric + characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be + unique. + :type name: str + :param source: Required. The source that the routing rule is to be applied to, such as + DeviceMessages. Possible values include: "Invalid", "DeviceMessages", "TwinChangeEvents", + "DeviceLifecycleEvents", "DeviceJobLifecycleEvents", "DeviceConnectionStateEvents". + :type source: str or ~azure.mgmt.iothub.v2021_07_01.models.RoutingSource + :param condition: The condition that is evaluated to apply the routing rule. If no condition is + provided, it evaluates to true by default. For grammar, see: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. + :type condition: str + :param endpoint_names: Required. The list of endpoints to which messages that satisfy the + condition are routed. Currently only one endpoint is allowed. + :type endpoint_names: list[str] + :param is_enabled: Required. Used to specify whether a route is enabled. + :type is_enabled: bool + """ + + _validation = { + 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, + 'source': {'required': True}, + 'endpoint_names': {'required': True, 'max_items': 1, 'min_items': 1}, + 'is_enabled': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'condition': {'key': 'condition', 'type': 'str'}, + 'endpoint_names': {'key': 'endpointNames', 'type': '[str]'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteProperties, self).__init__(**kwargs) + self.name = kwargs['name'] + self.source = kwargs['source'] + self.condition = kwargs.get('condition', None) + self.endpoint_names = kwargs['endpoint_names'] + self.is_enabled = kwargs['is_enabled'] + + +class RoutingEndpoints(msrest.serialization.Model): + """The properties related to the custom endpoints to which your IoT hub routes messages based on the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs and only 1 custom endpoint is allowed across all endpoint types for free hubs. + + :param service_bus_queues: The list of Service Bus queue endpoints that IoT hub routes the + messages to, based on the routing rules. + :type service_bus_queues: + list[~azure.mgmt.iothub.v2021_07_01.models.RoutingServiceBusQueueEndpointProperties] + :param service_bus_topics: The list of Service Bus topic endpoints that the IoT hub routes the + messages to, based on the routing rules. + :type service_bus_topics: + list[~azure.mgmt.iothub.v2021_07_01.models.RoutingServiceBusTopicEndpointProperties] + :param event_hubs: The list of Event Hubs endpoints that IoT hub routes messages to, based on + the routing rules. This list does not include the built-in Event Hubs endpoint. + :type event_hubs: list[~azure.mgmt.iothub.v2021_07_01.models.RoutingEventHubProperties] + :param storage_containers: The list of storage container endpoints that IoT hub routes messages + to, based on the routing rules. + :type storage_containers: + list[~azure.mgmt.iothub.v2021_07_01.models.RoutingStorageContainerProperties] + """ + + _attribute_map = { + 'service_bus_queues': {'key': 'serviceBusQueues', 'type': '[RoutingServiceBusQueueEndpointProperties]'}, + 'service_bus_topics': {'key': 'serviceBusTopics', 'type': '[RoutingServiceBusTopicEndpointProperties]'}, + 'event_hubs': {'key': 'eventHubs', 'type': '[RoutingEventHubProperties]'}, + 'storage_containers': {'key': 'storageContainers', 'type': '[RoutingStorageContainerProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(RoutingEndpoints, self).__init__(**kwargs) + self.service_bus_queues = kwargs.get('service_bus_queues', None) + self.service_bus_topics = kwargs.get('service_bus_topics', None) + self.event_hubs = kwargs.get('event_hubs', None) + self.storage_containers = kwargs.get('storage_containers', None) + + +class RoutingEventHubProperties(msrest.serialization.Model): + """The properties related to an event hub endpoint. + + All required parameters must be populated in order to send to Azure. + + :param id: Id of the event hub endpoint. + :type id: str + :param connection_string: The connection string of the event hub endpoint. + :type connection_string: str + :param endpoint_uri: The url of the event hub endpoint. It must include the protocol sb://. + :type endpoint_uri: str + :param entity_path: Event hub name on the event hub namespace. + :type entity_path: str + :param authentication_type: Method used to authenticate against the event hub endpoint. + Possible values include: "keyBased", "identityBased". + :type authentication_type: str or ~azure.mgmt.iothub.v2021_07_01.models.AuthenticationType + :param identity: Managed identity properties of routing event hub endpoint. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ManagedIdentity + :param name: Required. The name that identifies this endpoint. The name can only include + alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 + characters. The following names are reserved: events, fileNotifications, $default. Endpoint + names must be unique across endpoint types. + :type name: str + :param subscription_id: The subscription identifier of the event hub endpoint. + :type subscription_id: str + :param resource_group: The name of the resource group of the event hub endpoint. + :type resource_group: str + """ + + _validation = { + 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + 'entity_path': {'key': 'entityPath', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoutingEventHubProperties, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.connection_string = kwargs.get('connection_string', None) + self.endpoint_uri = kwargs.get('endpoint_uri', None) + self.entity_path = kwargs.get('entity_path', None) + self.authentication_type = kwargs.get('authentication_type', None) + self.identity = kwargs.get('identity', None) + self.name = kwargs['name'] + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + + +class RoutingMessage(msrest.serialization.Model): + """Routing message. + + :param body: Body of routing message. + :type body: str + :param app_properties: App properties. + :type app_properties: dict[str, str] + :param system_properties: System properties. + :type system_properties: dict[str, str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'str'}, + 'app_properties': {'key': 'appProperties', 'type': '{str}'}, + 'system_properties': {'key': 'systemProperties', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(RoutingMessage, self).__init__(**kwargs) + self.body = kwargs.get('body', None) + self.app_properties = kwargs.get('app_properties', None) + self.system_properties = kwargs.get('system_properties', None) + + +class RoutingProperties(msrest.serialization.Model): + """The routing related properties of the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging. + + :param endpoints: The properties related to the custom endpoints to which your IoT hub routes + messages based on the routing rules. A maximum of 10 custom endpoints are allowed across all + endpoint types for paid hubs and only 1 custom endpoint is allowed across all endpoint types + for free hubs. + :type endpoints: ~azure.mgmt.iothub.v2021_07_01.models.RoutingEndpoints + :param routes: The list of user-provided routing rules that the IoT hub uses to route messages + to built-in and custom endpoints. A maximum of 100 routing rules are allowed for paid hubs and + a maximum of 5 routing rules are allowed for free hubs. + :type routes: list[~azure.mgmt.iothub.v2021_07_01.models.RouteProperties] + :param fallback_route: The properties of the route that is used as a fall-back route when none + of the conditions specified in the 'routes' section are met. This is an optional parameter. + When this property is not set, the messages which do not meet any of the conditions specified + in the 'routes' section get routed to the built-in eventhub endpoint. + :type fallback_route: ~azure.mgmt.iothub.v2021_07_01.models.FallbackRouteProperties + :param enrichments: The list of user-provided enrichments that the IoT hub applies to messages + to be delivered to built-in and custom endpoints. See: https://aka.ms/telemetryoneventgrid. + :type enrichments: list[~azure.mgmt.iothub.v2021_07_01.models.EnrichmentProperties] + """ + + _attribute_map = { + 'endpoints': {'key': 'endpoints', 'type': 'RoutingEndpoints'}, + 'routes': {'key': 'routes', 'type': '[RouteProperties]'}, + 'fallback_route': {'key': 'fallbackRoute', 'type': 'FallbackRouteProperties'}, + 'enrichments': {'key': 'enrichments', 'type': '[EnrichmentProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(RoutingProperties, self).__init__(**kwargs) + self.endpoints = kwargs.get('endpoints', None) + self.routes = kwargs.get('routes', None) + self.fallback_route = kwargs.get('fallback_route', None) + self.enrichments = kwargs.get('enrichments', None) + + +class RoutingServiceBusQueueEndpointProperties(msrest.serialization.Model): + """The properties related to service bus queue endpoint types. + + All required parameters must be populated in order to send to Azure. + + :param id: Id of the service bus queue endpoint. + :type id: str + :param connection_string: The connection string of the service bus queue endpoint. + :type connection_string: str + :param endpoint_uri: The url of the service bus queue endpoint. It must include the protocol + sb://. + :type endpoint_uri: str + :param entity_path: Queue name on the service bus namespace. + :type entity_path: str + :param authentication_type: Method used to authenticate against the service bus queue endpoint. + Possible values include: "keyBased", "identityBased". + :type authentication_type: str or ~azure.mgmt.iothub.v2021_07_01.models.AuthenticationType + :param identity: Managed identity properties of routing service bus queue endpoint. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ManagedIdentity + :param name: Required. The name that identifies this endpoint. The name can only include + alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 + characters. The following names are reserved: events, fileNotifications, $default. Endpoint + names must be unique across endpoint types. The name need not be the same as the actual queue + name. + :type name: str + :param subscription_id: The subscription identifier of the service bus queue endpoint. + :type subscription_id: str + :param resource_group: The name of the resource group of the service bus queue endpoint. + :type resource_group: str + """ + + _validation = { + 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + 'entity_path': {'key': 'entityPath', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoutingServiceBusQueueEndpointProperties, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.connection_string = kwargs.get('connection_string', None) + self.endpoint_uri = kwargs.get('endpoint_uri', None) + self.entity_path = kwargs.get('entity_path', None) + self.authentication_type = kwargs.get('authentication_type', None) + self.identity = kwargs.get('identity', None) + self.name = kwargs['name'] + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + + +class RoutingServiceBusTopicEndpointProperties(msrest.serialization.Model): + """The properties related to service bus topic endpoint types. + + All required parameters must be populated in order to send to Azure. + + :param id: Id of the service bus topic endpoint. + :type id: str + :param connection_string: The connection string of the service bus topic endpoint. + :type connection_string: str + :param endpoint_uri: The url of the service bus topic endpoint. It must include the protocol + sb://. + :type endpoint_uri: str + :param entity_path: Queue name on the service bus topic. + :type entity_path: str + :param authentication_type: Method used to authenticate against the service bus topic endpoint. + Possible values include: "keyBased", "identityBased". + :type authentication_type: str or ~azure.mgmt.iothub.v2021_07_01.models.AuthenticationType + :param identity: Managed identity properties of routing service bus topic endpoint. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ManagedIdentity + :param name: Required. The name that identifies this endpoint. The name can only include + alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 + characters. The following names are reserved: events, fileNotifications, $default. Endpoint + names must be unique across endpoint types. The name need not be the same as the actual topic + name. + :type name: str + :param subscription_id: The subscription identifier of the service bus topic endpoint. + :type subscription_id: str + :param resource_group: The name of the resource group of the service bus topic endpoint. + :type resource_group: str + """ + + _validation = { + 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + 'entity_path': {'key': 'entityPath', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoutingServiceBusTopicEndpointProperties, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.connection_string = kwargs.get('connection_string', None) + self.endpoint_uri = kwargs.get('endpoint_uri', None) + self.entity_path = kwargs.get('entity_path', None) + self.authentication_type = kwargs.get('authentication_type', None) + self.identity = kwargs.get('identity', None) + self.name = kwargs['name'] + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + + +class RoutingStorageContainerProperties(msrest.serialization.Model): + """The properties related to a storage container endpoint. + + All required parameters must be populated in order to send to Azure. + + :param id: Id of the storage container endpoint. + :type id: str + :param connection_string: The connection string of the storage account. + :type connection_string: str + :param endpoint_uri: The url of the storage endpoint. It must include the protocol https://. + :type endpoint_uri: str + :param authentication_type: Method used to authenticate against the storage endpoint. Possible + values include: "keyBased", "identityBased". + :type authentication_type: str or ~azure.mgmt.iothub.v2021_07_01.models.AuthenticationType + :param identity: Managed identity properties of routing storage endpoint. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ManagedIdentity + :param name: Required. The name that identifies this endpoint. The name can only include + alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 + characters. The following names are reserved: events, fileNotifications, $default. Endpoint + names must be unique across endpoint types. + :type name: str + :param subscription_id: The subscription identifier of the storage account. + :type subscription_id: str + :param resource_group: The name of the resource group of the storage account. + :type resource_group: str + :param container_name: Required. The name of storage container in the storage account. + :type container_name: str + :param file_name_format: File name format for the blob. Default format is + {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are mandatory but can be + reordered. + :type file_name_format: str + :param batch_frequency_in_seconds: Time interval at which blobs are written to storage. Value + should be between 60 and 720 seconds. Default value is 300 seconds. + :type batch_frequency_in_seconds: int + :param max_chunk_size_in_bytes: Maximum number of bytes for each blob written to storage. Value + should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB). + :type max_chunk_size_in_bytes: int + :param encoding: Encoding that is used to serialize messages to blobs. Supported values are + 'avro', 'avrodeflate', and 'JSON'. Default value is 'avro'. Possible values include: "Avro", + "AvroDeflate", "JSON". + :type encoding: str or + ~azure.mgmt.iothub.v2021_07_01.models.RoutingStorageContainerPropertiesEncoding + """ + + _validation = { + 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, + 'container_name': {'required': True}, + 'batch_frequency_in_seconds': {'maximum': 720, 'minimum': 60}, + 'max_chunk_size_in_bytes': {'maximum': 524288000, 'minimum': 10485760}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'file_name_format': {'key': 'fileNameFormat', 'type': 'str'}, + 'batch_frequency_in_seconds': {'key': 'batchFrequencyInSeconds', 'type': 'int'}, + 'max_chunk_size_in_bytes': {'key': 'maxChunkSizeInBytes', 'type': 'int'}, + 'encoding': {'key': 'encoding', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoutingStorageContainerProperties, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.connection_string = kwargs.get('connection_string', None) + self.endpoint_uri = kwargs.get('endpoint_uri', None) + self.authentication_type = kwargs.get('authentication_type', None) + self.identity = kwargs.get('identity', None) + self.name = kwargs['name'] + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + self.container_name = kwargs['container_name'] + self.file_name_format = kwargs.get('file_name_format', None) + self.batch_frequency_in_seconds = kwargs.get('batch_frequency_in_seconds', None) + self.max_chunk_size_in_bytes = kwargs.get('max_chunk_size_in_bytes', None) + self.encoding = kwargs.get('encoding', None) + + +class RoutingTwin(msrest.serialization.Model): + """Twin reference input parameter. This is an optional parameter. + + :param tags: A set of tags. Twin Tags. + :type tags: any + :param properties: + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.RoutingTwinProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': 'object'}, + 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(RoutingTwin, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) + + +class RoutingTwinProperties(msrest.serialization.Model): + """RoutingTwinProperties. + + :param desired: Twin desired properties. + :type desired: any + :param reported: Twin desired properties. + :type reported: any + """ + + _attribute_map = { + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(RoutingTwinProperties, self).__init__(**kwargs) + self.desired = kwargs.get('desired', None) + self.reported = kwargs.get('reported', None) + + +class SharedAccessSignatureAuthorizationRule(msrest.serialization.Model): + """The properties of an IoT hub shared access policy. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of the shared access policy. + :type key_name: str + :param primary_key: The primary key. + :type primary_key: str + :param secondary_key: The secondary key. + :type secondary_key: str + :param rights: Required. The permissions assigned to the shared access policy. Possible values + include: "RegistryRead", "RegistryWrite", "ServiceConnect", "DeviceConnect", "RegistryRead, + RegistryWrite", "RegistryRead, ServiceConnect", "RegistryRead, DeviceConnect", "RegistryWrite, + ServiceConnect", "RegistryWrite, DeviceConnect", "ServiceConnect, DeviceConnect", + "RegistryRead, RegistryWrite, ServiceConnect", "RegistryRead, RegistryWrite, DeviceConnect", + "RegistryRead, ServiceConnect, DeviceConnect", "RegistryWrite, ServiceConnect, DeviceConnect", + "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect". + :type rights: str or ~azure.mgmt.iothub.v2021_07_01.models.AccessRights + """ + + _validation = { + 'key_name': {'required': True}, + 'rights': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'rights': {'key': 'rights', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SharedAccessSignatureAuthorizationRule, self).__init__(**kwargs) + self.key_name = kwargs['key_name'] + self.primary_key = kwargs.get('primary_key', None) + self.secondary_key = kwargs.get('secondary_key', None) + self.rights = kwargs['rights'] + + +class SharedAccessSignatureAuthorizationRuleListResult(msrest.serialization.Model): + """The list of shared access policies with a next link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of shared access policies. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.SharedAccessSignatureAuthorizationRule] + :ivar next_link: The next link. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SharedAccessSignatureAuthorizationRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SharedAccessSignatureAuthorizationRuleListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class StorageEndpointProperties(msrest.serialization.Model): + """The properties of the Azure Storage endpoint for file upload. + + All required parameters must be populated in order to send to Azure. + + :param sas_ttl_as_iso8601: The period of time for which the SAS URI generated by IoT Hub for + file upload is valid. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options. + :type sas_ttl_as_iso8601: ~datetime.timedelta + :param connection_string: Required. The connection string for the Azure Storage account to + which files are uploaded. + :type connection_string: str + :param container_name: Required. The name of the root container where you upload files. The + container need not exist but should be creatable using the connectionString specified. + :type container_name: str + :param authentication_type: Specifies authentication type being used for connecting to the + storage account. Possible values include: "keyBased", "identityBased". + :type authentication_type: str or ~azure.mgmt.iothub.v2021_07_01.models.AuthenticationType + :param identity: Managed identity properties of storage endpoint for file upload. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ManagedIdentity + """ + + _validation = { + 'connection_string': {'required': True}, + 'container_name': {'required': True}, + } + + _attribute_map = { + 'sas_ttl_as_iso8601': {'key': 'sasTtlAsIso8601', 'type': 'duration'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageEndpointProperties, self).__init__(**kwargs) + self.sas_ttl_as_iso8601 = kwargs.get('sas_ttl_as_iso8601', None) + self.connection_string = kwargs['connection_string'] + self.container_name = kwargs['container_name'] + self.authentication_type = kwargs.get('authentication_type', None) + self.identity = kwargs.get('identity', None) + + +class TagsResource(msrest.serialization.Model): + """A container holding only the Tags for a resource, allowing the user to update the tags on an IoT Hub instance. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(TagsResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class TestAllRoutesInput(msrest.serialization.Model): + """Input for testing all routes. + + :param routing_source: Routing source. Possible values include: "Invalid", "DeviceMessages", + "TwinChangeEvents", "DeviceLifecycleEvents", "DeviceJobLifecycleEvents", + "DeviceConnectionStateEvents". + :type routing_source: str or ~azure.mgmt.iothub.v2021_07_01.models.RoutingSource + :param message: Routing message. + :type message: ~azure.mgmt.iothub.v2021_07_01.models.RoutingMessage + :param twin: Routing Twin Reference. + :type twin: ~azure.mgmt.iothub.v2021_07_01.models.RoutingTwin + """ + + _attribute_map = { + 'routing_source': {'key': 'routingSource', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'RoutingMessage'}, + 'twin': {'key': 'twin', 'type': 'RoutingTwin'}, + } + + def __init__( + self, + **kwargs + ): + super(TestAllRoutesInput, self).__init__(**kwargs) + self.routing_source = kwargs.get('routing_source', None) + self.message = kwargs.get('message', None) + self.twin = kwargs.get('twin', None) + + +class TestAllRoutesResult(msrest.serialization.Model): + """Result of testing all routes. + + :param routes: JSON-serialized array of matched routes. + :type routes: list[~azure.mgmt.iothub.v2021_07_01.models.MatchedRoute] + """ + + _attribute_map = { + 'routes': {'key': 'routes', 'type': '[MatchedRoute]'}, + } + + def __init__( + self, + **kwargs + ): + super(TestAllRoutesResult, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) + + +class TestRouteInput(msrest.serialization.Model): + """Input for testing route. + + All required parameters must be populated in order to send to Azure. + + :param message: Routing message. + :type message: ~azure.mgmt.iothub.v2021_07_01.models.RoutingMessage + :param route: Required. Route properties. + :type route: ~azure.mgmt.iothub.v2021_07_01.models.RouteProperties + :param twin: Routing Twin Reference. + :type twin: ~azure.mgmt.iothub.v2021_07_01.models.RoutingTwin + """ + + _validation = { + 'route': {'required': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'RoutingMessage'}, + 'route': {'key': 'route', 'type': 'RouteProperties'}, + 'twin': {'key': 'twin', 'type': 'RoutingTwin'}, + } + + def __init__( + self, + **kwargs + ): + super(TestRouteInput, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.route = kwargs['route'] + self.twin = kwargs.get('twin', None) + + +class TestRouteResult(msrest.serialization.Model): + """Result of testing one route. + + :param result: Result of testing route. Possible values include: "undefined", "false", "true". + :type result: str or ~azure.mgmt.iothub.v2021_07_01.models.TestResultStatus + :param details: Detailed result of testing route. + :type details: ~azure.mgmt.iothub.v2021_07_01.models.TestRouteResultDetails + """ + + _attribute_map = { + 'result': {'key': 'result', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'TestRouteResultDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(TestRouteResult, self).__init__(**kwargs) + self.result = kwargs.get('result', None) + self.details = kwargs.get('details', None) + + +class TestRouteResultDetails(msrest.serialization.Model): + """Detailed result of testing a route. + + :param compilation_errors: JSON-serialized list of route compilation errors. + :type compilation_errors: list[~azure.mgmt.iothub.v2021_07_01.models.RouteCompilationError] + """ + + _attribute_map = { + 'compilation_errors': {'key': 'compilationErrors', 'type': '[RouteCompilationError]'}, + } + + def __init__( + self, + **kwargs + ): + super(TestRouteResultDetails, self).__init__(**kwargs) + self.compilation_errors = kwargs.get('compilation_errors', None) + + +class UserSubscriptionQuota(msrest.serialization.Model): + """User subscription quota response. + + :param id: IotHub type id. + :type id: str + :param type: Response type. + :type type: str + :param unit: Unit of IotHub type. + :type unit: str + :param current_value: Current number of IotHub type. + :type current_value: int + :param limit: Numerical limit on IotHub type. + :type limit: int + :param name: IotHub type. + :type name: ~azure.mgmt.iothub.v2021_07_01.models.Name + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'Name'}, + } + + def __init__( + self, + **kwargs + ): + super(UserSubscriptionQuota, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.unit = kwargs.get('unit', None) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) + + +class UserSubscriptionQuotaListResult(msrest.serialization.Model): + """Json-serialized array of User subscription quota response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.UserSubscriptionQuota] + :ivar next_link: + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UserSubscriptionQuota]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserSubscriptionQuotaListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/_models_py3.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/_models_py3.py new file mode 100644 index 000000000000..cf884965f372 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/models/_models_py3.py @@ -0,0 +1,3317 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Any, Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._iot_hub_client_enums import * + + +class ArmIdentity(msrest.serialization.Model): + """ArmIdentity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Principal Id. + :vartype principal_id: str + :ivar tenant_id: Tenant Id. + :vartype tenant_id: str + :param type: The type of identity used for the resource. The type 'SystemAssigned, + UserAssigned' includes both an implicitly created identity and a set of user assigned + identities. The type 'None' will remove any identities from the service. Possible values + include: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.iothub.v2021_07_01.models.ResourceIdentityType + :param user_assigned_identities: Dictionary of :code:``. + :type user_assigned_identities: dict[str, + ~azure.mgmt.iothub.v2021_07_01.models.ArmUserIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ArmUserIdentity}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ArmUserIdentity"]] = None, + **kwargs + ): + super(ArmIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class ArmUserIdentity(msrest.serialization.Model): + """ArmUserIdentity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: + :vartype principal_id: str + :ivar client_id: + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArmUserIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class CertificateBodyDescription(msrest.serialization.Model): + """The JSON-serialized X509 Certificate. + + :param certificate: base-64 representation of the X509 leaf certificate .cer file or just .pem + file content. + :type certificate: str + :param is_verified: True indicates that the certificate will be created in verified state and + proof of possession will not be required. + :type is_verified: bool + """ + + _attribute_map = { + 'certificate': {'key': 'certificate', 'type': 'str'}, + 'is_verified': {'key': 'isVerified', 'type': 'bool'}, + } + + def __init__( + self, + *, + certificate: Optional[str] = None, + is_verified: Optional[bool] = None, + **kwargs + ): + super(CertificateBodyDescription, self).__init__(**kwargs) + self.certificate = certificate + self.is_verified = is_verified + + +class CertificateDescription(msrest.serialization.Model): + """The X509 Certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param properties: The description of an X509 CA Certificate. + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.CertificateProperties + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The name of the certificate. + :vartype name: str + :ivar etag: The entity tag. + :vartype etag: str + :ivar type: The resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'CertificateProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + properties: Optional["CertificateProperties"] = None, + **kwargs + ): + super(CertificateDescription, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.name = None + self.etag = None + self.type = None + + +class CertificateListDescription(msrest.serialization.Model): + """The JSON-serialized array of Certificate objects. + + :param value: The array of Certificate objects. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.CertificateDescription] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CertificateDescription]'}, + } + + def __init__( + self, + *, + value: Optional[List["CertificateDescription"]] = None, + **kwargs + ): + super(CertificateListDescription, self).__init__(**kwargs) + self.value = value + + +class CertificateProperties(msrest.serialization.Model): + """The description of an X509 CA Certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar subject: The certificate's subject name. + :vartype subject: str + :ivar expiry: The certificate's expiration date and time. + :vartype expiry: ~datetime.datetime + :ivar thumbprint: The certificate's thumbprint. + :vartype thumbprint: str + :param is_verified: Determines whether certificate has been verified. + :type is_verified: bool + :ivar created: The certificate's create date and time. + :vartype created: ~datetime.datetime + :ivar updated: The certificate's last update date and time. + :vartype updated: ~datetime.datetime + :param certificate: The certificate content. + :type certificate: str + """ + + _validation = { + 'subject': {'readonly': True}, + 'expiry': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + } + + _attribute_map = { + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiry': {'key': 'expiry', 'type': 'rfc-1123'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'is_verified': {'key': 'isVerified', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'rfc-1123'}, + 'updated': {'key': 'updated', 'type': 'rfc-1123'}, + 'certificate': {'key': 'certificate', 'type': 'str'}, + } + + def __init__( + self, + *, + is_verified: Optional[bool] = None, + certificate: Optional[str] = None, + **kwargs + ): + super(CertificateProperties, self).__init__(**kwargs) + self.subject = None + self.expiry = None + self.thumbprint = None + self.is_verified = is_verified + self.created = None + self.updated = None + self.certificate = certificate + + +class CertificatePropertiesWithNonce(msrest.serialization.Model): + """The description of an X509 CA Certificate including the challenge nonce issued for the Proof-Of-Possession flow. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar subject: The certificate's subject name. + :vartype subject: str + :ivar expiry: The certificate's expiration date and time. + :vartype expiry: ~datetime.datetime + :ivar thumbprint: The certificate's thumbprint. + :vartype thumbprint: str + :ivar is_verified: Determines whether certificate has been verified. + :vartype is_verified: bool + :ivar created: The certificate's create date and time. + :vartype created: ~datetime.datetime + :ivar updated: The certificate's last update date and time. + :vartype updated: ~datetime.datetime + :ivar verification_code: The certificate's verification code that will be used for proof of + possession. + :vartype verification_code: str + :ivar certificate: The certificate content. + :vartype certificate: str + """ + + _validation = { + 'subject': {'readonly': True}, + 'expiry': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'is_verified': {'readonly': True}, + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'verification_code': {'readonly': True}, + 'certificate': {'readonly': True}, + } + + _attribute_map = { + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiry': {'key': 'expiry', 'type': 'rfc-1123'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'is_verified': {'key': 'isVerified', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'rfc-1123'}, + 'updated': {'key': 'updated', 'type': 'rfc-1123'}, + 'verification_code': {'key': 'verificationCode', 'type': 'str'}, + 'certificate': {'key': 'certificate', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificatePropertiesWithNonce, self).__init__(**kwargs) + self.subject = None + self.expiry = None + self.thumbprint = None + self.is_verified = None + self.created = None + self.updated = None + self.verification_code = None + self.certificate = None + + +class CertificateVerificationDescription(msrest.serialization.Model): + """The JSON-serialized leaf certificate. + + :param certificate: base-64 representation of X509 certificate .cer file or just .pem file + content. + :type certificate: str + """ + + _attribute_map = { + 'certificate': {'key': 'certificate', 'type': 'str'}, + } + + def __init__( + self, + *, + certificate: Optional[str] = None, + **kwargs + ): + super(CertificateVerificationDescription, self).__init__(**kwargs) + self.certificate = certificate + + +class CertificateWithNonceDescription(msrest.serialization.Model): + """The X509 Certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param properties: The description of an X509 CA Certificate including the challenge nonce + issued for the Proof-Of-Possession flow. + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.CertificatePropertiesWithNonce + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The name of the certificate. + :vartype name: str + :ivar etag: The entity tag. + :vartype etag: str + :ivar type: The resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'CertificatePropertiesWithNonce'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + properties: Optional["CertificatePropertiesWithNonce"] = None, + **kwargs + ): + super(CertificateWithNonceDescription, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.name = None + self.etag = None + self.type = None + + +class CloudToDeviceProperties(msrest.serialization.Model): + """The IoT hub cloud-to-device messaging properties. + + :param max_delivery_count: The max delivery count for cloud-to-device messages in the device + queue. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + :type max_delivery_count: int + :param default_ttl_as_iso8601: The default time to live for cloud-to-device messages in the + device queue. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + :type default_ttl_as_iso8601: ~datetime.timedelta + :param feedback: The properties of the feedback queue for cloud-to-device messages. + :type feedback: ~azure.mgmt.iothub.v2021_07_01.models.FeedbackProperties + """ + + _validation = { + 'max_delivery_count': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int'}, + 'default_ttl_as_iso8601': {'key': 'defaultTtlAsIso8601', 'type': 'duration'}, + 'feedback': {'key': 'feedback', 'type': 'FeedbackProperties'}, + } + + def __init__( + self, + *, + max_delivery_count: Optional[int] = None, + default_ttl_as_iso8601: Optional[datetime.timedelta] = None, + feedback: Optional["FeedbackProperties"] = None, + **kwargs + ): + super(CloudToDeviceProperties, self).__init__(**kwargs) + self.max_delivery_count = max_delivery_count + self.default_ttl_as_iso8601 = default_ttl_as_iso8601 + self.feedback = feedback + + +class EndpointHealthData(msrest.serialization.Model): + """The health data for an endpoint. + + :param endpoint_id: Id of the endpoint. + :type endpoint_id: str + :param health_status: Health statuses have following meanings. The 'healthy' status shows that + the endpoint is accepting messages as expected. The 'unhealthy' status shows that the endpoint + is not accepting messages as expected and IoT Hub is retrying to send data to this endpoint. + The status of an unhealthy endpoint will be updated to healthy when IoT Hub has established an + eventually consistent state of health. The 'dead' status shows that the endpoint is not + accepting messages, after IoT Hub retried sending messages for the retrial period. See IoT Hub + metrics to identify errors and monitor issues with endpoints. The 'unknown' status shows that + the IoT Hub has not established a connection with the endpoint. No messages have been delivered + to or rejected from this endpoint. Possible values include: "unknown", "healthy", "degraded", + "unhealthy", "dead". + :type health_status: str or ~azure.mgmt.iothub.v2021_07_01.models.EndpointHealthStatus + :param last_known_error: Last error obtained when a message failed to be delivered to iot hub. + :type last_known_error: str + :param last_known_error_time: Time at which the last known error occurred. + :type last_known_error_time: ~datetime.datetime + :param last_successful_send_attempt_time: Last time iot hub successfully sent a message to the + endpoint. + :type last_successful_send_attempt_time: ~datetime.datetime + :param last_send_attempt_time: Last time iot hub tried to send a message to the endpoint. + :type last_send_attempt_time: ~datetime.datetime + """ + + _attribute_map = { + 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'last_known_error': {'key': 'lastKnownError', 'type': 'str'}, + 'last_known_error_time': {'key': 'lastKnownErrorTime', 'type': 'rfc-1123'}, + 'last_successful_send_attempt_time': {'key': 'lastSuccessfulSendAttemptTime', 'type': 'rfc-1123'}, + 'last_send_attempt_time': {'key': 'lastSendAttemptTime', 'type': 'rfc-1123'}, + } + + def __init__( + self, + *, + endpoint_id: Optional[str] = None, + health_status: Optional[Union[str, "EndpointHealthStatus"]] = None, + last_known_error: Optional[str] = None, + last_known_error_time: Optional[datetime.datetime] = None, + last_successful_send_attempt_time: Optional[datetime.datetime] = None, + last_send_attempt_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(EndpointHealthData, self).__init__(**kwargs) + self.endpoint_id = endpoint_id + self.health_status = health_status + self.last_known_error = last_known_error + self.last_known_error_time = last_known_error_time + self.last_successful_send_attempt_time = last_successful_send_attempt_time + self.last_send_attempt_time = last_send_attempt_time + + +class EndpointHealthDataListResult(msrest.serialization.Model): + """The JSON-serialized array of EndpointHealthData objects with a next link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: JSON-serialized array of Endpoint health data. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.EndpointHealthData] + :ivar next_link: Link to more results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EndpointHealthData]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["EndpointHealthData"]] = None, + **kwargs + ): + super(EndpointHealthDataListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class EnrichmentProperties(msrest.serialization.Model): + """The properties of an enrichment that your IoT hub applies to messages delivered to endpoints. + + All required parameters must be populated in order to send to Azure. + + :param key: Required. The key or name for the enrichment property. + :type key: str + :param value: Required. The value for the enrichment property. + :type value: str + :param endpoint_names: Required. The list of endpoints for which the enrichment is applied to + the message. + :type endpoint_names: list[str] + """ + + _validation = { + 'key': {'required': True}, + 'value': {'required': True}, + 'endpoint_names': {'required': True, 'min_items': 1}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'endpoint_names': {'key': 'endpointNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + key: str, + value: str, + endpoint_names: List[str], + **kwargs + ): + super(EnrichmentProperties, self).__init__(**kwargs) + self.key = key + self.value = value + self.endpoint_names = endpoint_names + + +class ErrorDetails(msrest.serialization.Model): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar http_status_code: The HTTP status code. + :vartype http_status_code: str + :ivar message: The error message. + :vartype message: str + :ivar details: The error details. + :vartype details: str + """ + + _validation = { + 'code': {'readonly': True}, + 'http_status_code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'http_status_code': {'key': 'httpStatusCode', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.http_status_code = None + self.message = None + self.details = None + + +class EventHubConsumerGroupBodyDescription(msrest.serialization.Model): + """The EventHub consumer group. + + All required parameters must be populated in order to send to Azure. + + :param properties: Required. The EventHub consumer group name. + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.EventHubConsumerGroupName + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'EventHubConsumerGroupName'}, + } + + def __init__( + self, + *, + properties: "EventHubConsumerGroupName", + **kwargs + ): + super(EventHubConsumerGroupBodyDescription, self).__init__(**kwargs) + self.properties = properties + + +class EventHubConsumerGroupInfo(msrest.serialization.Model): + """The properties of the EventHubConsumerGroupInfo object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param properties: The tags. + :type properties: dict[str, any] + :ivar id: The Event Hub-compatible consumer group identifier. + :vartype id: str + :ivar name: The Event Hub-compatible consumer group name. + :vartype name: str + :ivar type: the resource type. + :vartype type: str + :ivar etag: The etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': '{object}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__( + self, + *, + properties: Optional[Dict[str, Any]] = None, + **kwargs + ): + super(EventHubConsumerGroupInfo, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.name = None + self.type = None + self.etag = None + + +class EventHubConsumerGroupName(msrest.serialization.Model): + """The EventHub consumer group name. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. EventHub consumer group name. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(EventHubConsumerGroupName, self).__init__(**kwargs) + self.name = name + + +class EventHubConsumerGroupsListResult(msrest.serialization.Model): + """The JSON-serialized array of Event Hub-compatible consumer group names with a next link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: List of consumer groups objects. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.EventHubConsumerGroupInfo] + :ivar next_link: The next link. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EventHubConsumerGroupInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["EventHubConsumerGroupInfo"]] = None, + **kwargs + ): + super(EventHubConsumerGroupsListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class EventHubProperties(msrest.serialization.Model): + """The properties of the provisioned Event Hub-compatible endpoint used by the IoT hub. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param retention_time_in_days: The retention time for device-to-cloud messages in days. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. + :type retention_time_in_days: long + :param partition_count: The number of partitions for receiving device-to-cloud messages in the + Event Hub-compatible endpoint. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. + :type partition_count: int + :ivar partition_ids: The partition ids in the Event Hub-compatible endpoint. + :vartype partition_ids: list[str] + :ivar path: The Event Hub-compatible name. + :vartype path: str + :ivar endpoint: The Event Hub-compatible endpoint. + :vartype endpoint: str + """ + + _validation = { + 'partition_ids': {'readonly': True}, + 'path': {'readonly': True}, + 'endpoint': {'readonly': True}, + } + + _attribute_map = { + 'retention_time_in_days': {'key': 'retentionTimeInDays', 'type': 'long'}, + 'partition_count': {'key': 'partitionCount', 'type': 'int'}, + 'partition_ids': {'key': 'partitionIds', 'type': '[str]'}, + 'path': {'key': 'path', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + } + + def __init__( + self, + *, + retention_time_in_days: Optional[int] = None, + partition_count: Optional[int] = None, + **kwargs + ): + super(EventHubProperties, self).__init__(**kwargs) + self.retention_time_in_days = retention_time_in_days + self.partition_count = partition_count + self.partition_ids = None + self.path = None + self.endpoint = None + + +class ExportDevicesRequest(msrest.serialization.Model): + """Use to provide parameters when requesting an export of all devices in the IoT hub. + + All required parameters must be populated in order to send to Azure. + + :param export_blob_container_uri: Required. The export blob container URI. + :type export_blob_container_uri: str + :param exclude_keys: Required. The value indicating whether keys should be excluded during + export. + :type exclude_keys: bool + :param export_blob_name: The name of the blob that will be created in the provided output blob + container. This blob will contain the exported device registry information for the IoT Hub. + :type export_blob_name: str + :param authentication_type: Specifies authentication type being used for connecting to the + storage account. Possible values include: "keyBased", "identityBased". + :type authentication_type: str or ~azure.mgmt.iothub.v2021_07_01.models.AuthenticationType + :param identity: Managed identity properties of storage endpoint for export devices. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ManagedIdentity + :param include_configurations: The value indicating whether configurations should be exported. + :type include_configurations: bool + :param configurations_blob_name: The name of the blob that will be created in the provided + output blob container. This blob will contain the exported configurations for the Iot Hub. + :type configurations_blob_name: str + """ + + _validation = { + 'export_blob_container_uri': {'required': True}, + 'exclude_keys': {'required': True}, + } + + _attribute_map = { + 'export_blob_container_uri': {'key': 'exportBlobContainerUri', 'type': 'str'}, + 'exclude_keys': {'key': 'excludeKeys', 'type': 'bool'}, + 'export_blob_name': {'key': 'exportBlobName', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + 'include_configurations': {'key': 'includeConfigurations', 'type': 'bool'}, + 'configurations_blob_name': {'key': 'configurationsBlobName', 'type': 'str'}, + } + + def __init__( + self, + *, + export_blob_container_uri: str, + exclude_keys: bool, + export_blob_name: Optional[str] = None, + authentication_type: Optional[Union[str, "AuthenticationType"]] = None, + identity: Optional["ManagedIdentity"] = None, + include_configurations: Optional[bool] = None, + configurations_blob_name: Optional[str] = None, + **kwargs + ): + super(ExportDevicesRequest, self).__init__(**kwargs) + self.export_blob_container_uri = export_blob_container_uri + self.exclude_keys = exclude_keys + self.export_blob_name = export_blob_name + self.authentication_type = authentication_type + self.identity = identity + self.include_configurations = include_configurations + self.configurations_blob_name = configurations_blob_name + + +class FailoverInput(msrest.serialization.Model): + """Use to provide failover region when requesting manual Failover for a hub. + + All required parameters must be populated in order to send to Azure. + + :param failover_region: Required. Region the hub will be failed over to. + :type failover_region: str + """ + + _validation = { + 'failover_region': {'required': True}, + } + + _attribute_map = { + 'failover_region': {'key': 'failoverRegion', 'type': 'str'}, + } + + def __init__( + self, + *, + failover_region: str, + **kwargs + ): + super(FailoverInput, self).__init__(**kwargs) + self.failover_region = failover_region + + +class FallbackRouteProperties(msrest.serialization.Model): + """The properties of the fallback route. IoT Hub uses these properties when it routes messages to the fallback endpoint. + + All required parameters must be populated in order to send to Azure. + + :param name: The name of the route. The name can only include alphanumeric characters, periods, + underscores, hyphens, has a maximum length of 64 characters, and must be unique. + :type name: str + :param source: Required. The source to which the routing rule is to be applied to. For example, + DeviceMessages. Possible values include: "Invalid", "DeviceMessages", "TwinChangeEvents", + "DeviceLifecycleEvents", "DeviceJobLifecycleEvents", "DeviceConnectionStateEvents". + :type source: str or ~azure.mgmt.iothub.v2021_07_01.models.RoutingSource + :param condition: The condition which is evaluated in order to apply the fallback route. If the + condition is not provided it will evaluate to true by default. For grammar, See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. + :type condition: str + :param endpoint_names: Required. The list of endpoints to which the messages that satisfy the + condition are routed to. Currently only 1 endpoint is allowed. + :type endpoint_names: list[str] + :param is_enabled: Required. Used to specify whether the fallback route is enabled. + :type is_enabled: bool + """ + + _validation = { + 'source': {'required': True}, + 'endpoint_names': {'required': True, 'max_items': 1, 'min_items': 1}, + 'is_enabled': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'condition': {'key': 'condition', 'type': 'str'}, + 'endpoint_names': {'key': 'endpointNames', 'type': '[str]'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + source: Union[str, "RoutingSource"], + endpoint_names: List[str], + is_enabled: bool, + name: Optional[str] = None, + condition: Optional[str] = None, + **kwargs + ): + super(FallbackRouteProperties, self).__init__(**kwargs) + self.name = name + self.source = source + self.condition = condition + self.endpoint_names = endpoint_names + self.is_enabled = is_enabled + + +class FeedbackProperties(msrest.serialization.Model): + """The properties of the feedback queue for cloud-to-device messages. + + :param lock_duration_as_iso8601: The lock duration for the feedback queue. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + :type lock_duration_as_iso8601: ~datetime.timedelta + :param ttl_as_iso8601: The period of time for which a message is available to consume before it + is expired by the IoT hub. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + :type ttl_as_iso8601: ~datetime.timedelta + :param max_delivery_count: The number of times the IoT hub attempts to deliver a message on the + feedback queue. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + :type max_delivery_count: int + """ + + _validation = { + 'max_delivery_count': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'lock_duration_as_iso8601': {'key': 'lockDurationAsIso8601', 'type': 'duration'}, + 'ttl_as_iso8601': {'key': 'ttlAsIso8601', 'type': 'duration'}, + 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int'}, + } + + def __init__( + self, + *, + lock_duration_as_iso8601: Optional[datetime.timedelta] = None, + ttl_as_iso8601: Optional[datetime.timedelta] = None, + max_delivery_count: Optional[int] = None, + **kwargs + ): + super(FeedbackProperties, self).__init__(**kwargs) + self.lock_duration_as_iso8601 = lock_duration_as_iso8601 + self.ttl_as_iso8601 = ttl_as_iso8601 + self.max_delivery_count = max_delivery_count + + +class GroupIdInformation(msrest.serialization.Model): + """The group information for creating a private endpoint on an IotHub. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param properties: Required. The properties for a group information object. + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.GroupIdInformationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'GroupIdInformationProperties'}, + } + + def __init__( + self, + *, + properties: "GroupIdInformationProperties", + **kwargs + ): + super(GroupIdInformation, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + + +class GroupIdInformationProperties(msrest.serialization.Model): + """The properties for a group information object. + + :param group_id: The group id. + :type group_id: str + :param required_members: The required members for a specific group id. + :type required_members: list[str] + :param required_zone_names: The required DNS zones for a specific group id. + :type required_zone_names: list[str] + """ + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + group_id: Optional[str] = None, + required_members: Optional[List[str]] = None, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + super(GroupIdInformationProperties, self).__init__(**kwargs) + self.group_id = group_id + self.required_members = required_members + self.required_zone_names = required_zone_names + + +class ImportDevicesRequest(msrest.serialization.Model): + """Use to provide parameters when requesting an import of all devices in the hub. + + All required parameters must be populated in order to send to Azure. + + :param input_blob_container_uri: Required. The input blob container URI. + :type input_blob_container_uri: str + :param output_blob_container_uri: Required. The output blob container URI. + :type output_blob_container_uri: str + :param input_blob_name: The blob name to be used when importing from the provided input blob + container. + :type input_blob_name: str + :param output_blob_name: The blob name to use for storing the status of the import job. + :type output_blob_name: str + :param authentication_type: Specifies authentication type being used for connecting to the + storage account. Possible values include: "keyBased", "identityBased". + :type authentication_type: str or ~azure.mgmt.iothub.v2021_07_01.models.AuthenticationType + :param identity: Managed identity properties of storage endpoint for import devices. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ManagedIdentity + :param include_configurations: The value indicating whether configurations should be imported. + :type include_configurations: bool + :param configurations_blob_name: The blob name to be used when importing configurations from + the provided input blob container. + :type configurations_blob_name: str + """ + + _validation = { + 'input_blob_container_uri': {'required': True}, + 'output_blob_container_uri': {'required': True}, + } + + _attribute_map = { + 'input_blob_container_uri': {'key': 'inputBlobContainerUri', 'type': 'str'}, + 'output_blob_container_uri': {'key': 'outputBlobContainerUri', 'type': 'str'}, + 'input_blob_name': {'key': 'inputBlobName', 'type': 'str'}, + 'output_blob_name': {'key': 'outputBlobName', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + 'include_configurations': {'key': 'includeConfigurations', 'type': 'bool'}, + 'configurations_blob_name': {'key': 'configurationsBlobName', 'type': 'str'}, + } + + def __init__( + self, + *, + input_blob_container_uri: str, + output_blob_container_uri: str, + input_blob_name: Optional[str] = None, + output_blob_name: Optional[str] = None, + authentication_type: Optional[Union[str, "AuthenticationType"]] = None, + identity: Optional["ManagedIdentity"] = None, + include_configurations: Optional[bool] = None, + configurations_blob_name: Optional[str] = None, + **kwargs + ): + super(ImportDevicesRequest, self).__init__(**kwargs) + self.input_blob_container_uri = input_blob_container_uri + self.output_blob_container_uri = output_blob_container_uri + self.input_blob_name = input_blob_name + self.output_blob_name = output_blob_name + self.authentication_type = authentication_type + self.identity = identity + self.include_configurations = include_configurations + self.configurations_blob_name = configurations_blob_name + + +class IotHubCapacity(msrest.serialization.Model): + """IoT Hub capacity information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar minimum: The minimum number of units. + :vartype minimum: long + :ivar maximum: The maximum number of units. + :vartype maximum: long + :ivar default: The default number of units. + :vartype default: long + :ivar scale_type: The type of the scaling enabled. Possible values include: "Automatic", + "Manual", "None". + :vartype scale_type: str or ~azure.mgmt.iothub.v2021_07_01.models.IotHubScaleType + """ + + _validation = { + 'minimum': {'readonly': True, 'maximum': 1, 'minimum': 1}, + 'maximum': {'readonly': True}, + 'default': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'long'}, + 'maximum': {'key': 'maximum', 'type': 'long'}, + 'default': {'key': 'default', 'type': 'long'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHubCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default = None + self.scale_type = None + + +class Resource(msrest.serialization.Model): + """The common properties of an Azure resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param location: Required. The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class IotHubDescription(Resource): + """The description of the IoT hub. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param location: Required. The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param etag: The Etag field is *not* required. If it is provided in the response body, it must + also be provided as a header per the normal ETag convention. + :type etag: str + :param properties: IotHub properties. + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.IotHubProperties + :param sku: Required. IotHub SKU info. + :type sku: ~azure.mgmt.iothub.v2021_07_01.models.IotHubSkuInfo + :param identity: The managed identities for the IotHub. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ArmIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'IotHubProperties'}, + 'sku': {'key': 'sku', 'type': 'IotHubSkuInfo'}, + 'identity': {'key': 'identity', 'type': 'ArmIdentity'}, + } + + def __init__( + self, + *, + location: str, + sku: "IotHubSkuInfo", + tags: Optional[Dict[str, str]] = None, + etag: Optional[str] = None, + properties: Optional["IotHubProperties"] = None, + identity: Optional["ArmIdentity"] = None, + **kwargs + ): + super(IotHubDescription, self).__init__(location=location, tags=tags, **kwargs) + self.etag = etag + self.properties = properties + self.sku = sku + self.identity = identity + + +class IotHubDescriptionListResult(msrest.serialization.Model): + """The JSON-serialized array of IotHubDescription objects with a next link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The array of IotHubDescription objects. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.IotHubDescription] + :ivar next_link: The next link. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotHubDescription]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["IotHubDescription"]] = None, + **kwargs + ): + super(IotHubDescriptionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class IotHubLocationDescription(msrest.serialization.Model): + """Public representation of one of the locations where a resource is provisioned. + + :param location: The name of the Azure region. + :type location: str + :param role: The role of the region, can be either primary or secondary. The primary region is + where the IoT hub is currently provisioned. The secondary region is the Azure disaster recovery + (DR) paired region and also the region where the IoT hub can failover to. Possible values + include: "primary", "secondary". + :type role: str or ~azure.mgmt.iothub.v2021_07_01.models.IotHubReplicaRoleType + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'role': {'key': 'role', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + role: Optional[Union[str, "IotHubReplicaRoleType"]] = None, + **kwargs + ): + super(IotHubLocationDescription, self).__init__(**kwargs) + self.location = location + self.role = role + + +class IotHubNameAvailabilityInfo(msrest.serialization.Model): + """The properties indicating whether a given IoT hub name is available. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name_available: The value which indicates whether the provided name is available. + :vartype name_available: bool + :ivar reason: The reason for unavailability. Possible values include: "Invalid", + "AlreadyExists". + :vartype reason: str or ~azure.mgmt.iothub.v2021_07_01.models.IotHubNameUnavailabilityReason + :param message: The detailed reason message. + :type message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + message: Optional[str] = None, + **kwargs + ): + super(IotHubNameAvailabilityInfo, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = message + + +class IotHubProperties(msrest.serialization.Model): + """The properties of an IoT hub. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param authorization_policies: The shared access policies you can use to secure a connection to + the IoT hub. + :type authorization_policies: + list[~azure.mgmt.iothub.v2021_07_01.models.SharedAccessSignatureAuthorizationRule] + :param disable_local_auth: If true, SAS tokens with Iot hub scoped SAS keys cannot be used for + authentication. + :type disable_local_auth: bool + :param disable_device_sas: If true, all device(including Edge devices but excluding modules) + scoped SAS keys cannot be used for authentication. + :type disable_device_sas: bool + :param disable_module_sas: If true, all module scoped SAS keys cannot be used for + authentication. + :type disable_module_sas: bool + :param restrict_outbound_network_access: If true, egress from IotHub will be restricted to only + the allowed FQDNs that are configured via allowedFqdnList. + :type restrict_outbound_network_access: bool + :param allowed_fqdn_list: List of allowed FQDNs(Fully Qualified Domain Name) for egress from + Iot Hub. + :type allowed_fqdn_list: list[str] + :param public_network_access: Whether requests from Public Network are allowed. Possible values + include: "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.iothub.v2021_07_01.models.PublicNetworkAccess + :param ip_filter_rules: The IP filter rules. + :type ip_filter_rules: list[~azure.mgmt.iothub.v2021_07_01.models.IpFilterRule] + :param network_rule_sets: Network Rule Set Properties of IotHub. + :type network_rule_sets: ~azure.mgmt.iothub.v2021_07_01.models.NetworkRuleSetProperties + :param min_tls_version: Specifies the minimum TLS version to support for this hub. Can be set + to "1.2" to have clients that use a TLS version below 1.2 to be rejected. + :type min_tls_version: str + :param private_endpoint_connections: Private endpoint connections created on this IotHub. + :type private_endpoint_connections: + list[~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpointConnection] + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + :ivar state: The hub state. + :vartype state: str + :ivar host_name: The name of the host. + :vartype host_name: str + :param event_hub_endpoints: The Event Hub-compatible endpoint properties. The only possible + keys to this dictionary is events. This key has to be present in the dictionary while making + create or update calls for the IoT hub. + :type event_hub_endpoints: dict[str, ~azure.mgmt.iothub.v2021_07_01.models.EventHubProperties] + :param routing: The routing related properties of the IoT hub. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging. + :type routing: ~azure.mgmt.iothub.v2021_07_01.models.RoutingProperties + :param storage_endpoints: The list of Azure Storage endpoints where you can upload files. + Currently you can configure only one Azure Storage account and that MUST have its key as + $default. Specifying more than one storage account causes an error to be thrown. Not specifying + a value for this property when the enableFileUploadNotifications property is set to True, + causes an error to be thrown. + :type storage_endpoints: dict[str, + ~azure.mgmt.iothub.v2021_07_01.models.StorageEndpointProperties] + :param messaging_endpoints: The messaging endpoint properties for the file upload notification + queue. + :type messaging_endpoints: dict[str, + ~azure.mgmt.iothub.v2021_07_01.models.MessagingEndpointProperties] + :param enable_file_upload_notifications: If True, file upload notifications are enabled. + :type enable_file_upload_notifications: bool + :param cloud_to_device: The IoT hub cloud-to-device messaging properties. + :type cloud_to_device: ~azure.mgmt.iothub.v2021_07_01.models.CloudToDeviceProperties + :param comments: IoT hub comments. + :type comments: str + :param features: The capabilities and features enabled for the IoT hub. Possible values + include: "None", "DeviceManagement". + :type features: str or ~azure.mgmt.iothub.v2021_07_01.models.Capabilities + :ivar locations: Primary and secondary location for iot hub. + :vartype locations: list[~azure.mgmt.iothub.v2021_07_01.models.IotHubLocationDescription] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'state': {'readonly': True}, + 'host_name': {'readonly': True}, + 'locations': {'readonly': True}, + } + + _attribute_map = { + 'authorization_policies': {'key': 'authorizationPolicies', 'type': '[SharedAccessSignatureAuthorizationRule]'}, + 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + 'disable_device_sas': {'key': 'disableDeviceSAS', 'type': 'bool'}, + 'disable_module_sas': {'key': 'disableModuleSAS', 'type': 'bool'}, + 'restrict_outbound_network_access': {'key': 'restrictOutboundNetworkAccess', 'type': 'bool'}, + 'allowed_fqdn_list': {'key': 'allowedFqdnList', 'type': '[str]'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'ip_filter_rules': {'key': 'ipFilterRules', 'type': '[IpFilterRule]'}, + 'network_rule_sets': {'key': 'networkRuleSets', 'type': 'NetworkRuleSetProperties'}, + 'min_tls_version': {'key': 'minTlsVersion', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'event_hub_endpoints': {'key': 'eventHubEndpoints', 'type': '{EventHubProperties}'}, + 'routing': {'key': 'routing', 'type': 'RoutingProperties'}, + 'storage_endpoints': {'key': 'storageEndpoints', 'type': '{StorageEndpointProperties}'}, + 'messaging_endpoints': {'key': 'messagingEndpoints', 'type': '{MessagingEndpointProperties}'}, + 'enable_file_upload_notifications': {'key': 'enableFileUploadNotifications', 'type': 'bool'}, + 'cloud_to_device': {'key': 'cloudToDevice', 'type': 'CloudToDeviceProperties'}, + 'comments': {'key': 'comments', 'type': 'str'}, + 'features': {'key': 'features', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[IotHubLocationDescription]'}, + } + + def __init__( + self, + *, + authorization_policies: Optional[List["SharedAccessSignatureAuthorizationRule"]] = None, + disable_local_auth: Optional[bool] = None, + disable_device_sas: Optional[bool] = None, + disable_module_sas: Optional[bool] = None, + restrict_outbound_network_access: Optional[bool] = None, + allowed_fqdn_list: Optional[List[str]] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + ip_filter_rules: Optional[List["IpFilterRule"]] = None, + network_rule_sets: Optional["NetworkRuleSetProperties"] = None, + min_tls_version: Optional[str] = None, + private_endpoint_connections: Optional[List["PrivateEndpointConnection"]] = None, + event_hub_endpoints: Optional[Dict[str, "EventHubProperties"]] = None, + routing: Optional["RoutingProperties"] = None, + storage_endpoints: Optional[Dict[str, "StorageEndpointProperties"]] = None, + messaging_endpoints: Optional[Dict[str, "MessagingEndpointProperties"]] = None, + enable_file_upload_notifications: Optional[bool] = None, + cloud_to_device: Optional["CloudToDeviceProperties"] = None, + comments: Optional[str] = None, + features: Optional[Union[str, "Capabilities"]] = None, + **kwargs + ): + super(IotHubProperties, self).__init__(**kwargs) + self.authorization_policies = authorization_policies + self.disable_local_auth = disable_local_auth + self.disable_device_sas = disable_device_sas + self.disable_module_sas = disable_module_sas + self.restrict_outbound_network_access = restrict_outbound_network_access + self.allowed_fqdn_list = allowed_fqdn_list + self.public_network_access = public_network_access + self.ip_filter_rules = ip_filter_rules + self.network_rule_sets = network_rule_sets + self.min_tls_version = min_tls_version + self.private_endpoint_connections = private_endpoint_connections + self.provisioning_state = None + self.state = None + self.host_name = None + self.event_hub_endpoints = event_hub_endpoints + self.routing = routing + self.storage_endpoints = storage_endpoints + self.messaging_endpoints = messaging_endpoints + self.enable_file_upload_notifications = enable_file_upload_notifications + self.cloud_to_device = cloud_to_device + self.comments = comments + self.features = features + self.locations = None + + +class IotHubQuotaMetricInfo(msrest.serialization.Model): + """Quota metrics properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the quota metric. + :vartype name: str + :ivar current_value: The current value for the quota metric. + :vartype current_value: long + :ivar max_value: The maximum value of the quota metric. + :vartype max_value: long + """ + + _validation = { + 'name': {'readonly': True}, + 'current_value': {'readonly': True}, + 'max_value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'max_value': {'key': 'maxValue', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHubQuotaMetricInfo, self).__init__(**kwargs) + self.name = None + self.current_value = None + self.max_value = None + + +class IotHubQuotaMetricInfoListResult(msrest.serialization.Model): + """The JSON-serialized array of IotHubQuotaMetricInfo objects with a next link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The array of quota metrics objects. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.IotHubQuotaMetricInfo] + :ivar next_link: The next link. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotHubQuotaMetricInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["IotHubQuotaMetricInfo"]] = None, + **kwargs + ): + super(IotHubQuotaMetricInfoListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class IotHubSkuDescription(msrest.serialization.Model): + """SKU properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :param sku: Required. The type of the resource. + :type sku: ~azure.mgmt.iothub.v2021_07_01.models.IotHubSkuInfo + :param capacity: Required. IotHub capacity. + :type capacity: ~azure.mgmt.iothub.v2021_07_01.models.IotHubCapacity + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'sku': {'required': True}, + 'capacity': {'required': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'IotHubSkuInfo'}, + 'capacity': {'key': 'capacity', 'type': 'IotHubCapacity'}, + } + + def __init__( + self, + *, + sku: "IotHubSkuInfo", + capacity: "IotHubCapacity", + **kwargs + ): + super(IotHubSkuDescription, self).__init__(**kwargs) + self.resource_type = None + self.sku = sku + self.capacity = capacity + + +class IotHubSkuDescriptionListResult(msrest.serialization.Model): + """The JSON-serialized array of IotHubSkuDescription objects with a next link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The array of IotHubSkuDescription. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.IotHubSkuDescription] + :ivar next_link: The next link. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotHubSkuDescription]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["IotHubSkuDescription"]] = None, + **kwargs + ): + super(IotHubSkuDescriptionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class IotHubSkuInfo(msrest.serialization.Model): + """Information about the SKU of the IoT hub. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. Possible values include: "F1", "S1", "S2", "S3", + "B1", "B2", "B3". + :type name: str or ~azure.mgmt.iothub.v2021_07_01.models.IotHubSku + :ivar tier: The billing tier for the IoT hub. Possible values include: "Free", "Standard", + "Basic". + :vartype tier: str or ~azure.mgmt.iothub.v2021_07_01.models.IotHubSkuTier + :param capacity: The number of provisioned IoT Hub units. See: + https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits. + :type capacity: long + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'long'}, + } + + def __init__( + self, + *, + name: Union[str, "IotHubSku"], + capacity: Optional[int] = None, + **kwargs + ): + super(IotHubSkuInfo, self).__init__(**kwargs) + self.name = name + self.tier = None + self.capacity = capacity + + +class IpFilterRule(msrest.serialization.Model): + """The IP filter rules for the IoT hub. + + All required parameters must be populated in order to send to Azure. + + :param filter_name: Required. The name of the IP filter rule. + :type filter_name: str + :param action: Required. The desired action for requests captured by this rule. Possible values + include: "Accept", "Reject". + :type action: str or ~azure.mgmt.iothub.v2021_07_01.models.IpFilterActionType + :param ip_mask: Required. A string that contains the IP address range in CIDR notation for the + rule. + :type ip_mask: str + """ + + _validation = { + 'filter_name': {'required': True}, + 'action': {'required': True}, + 'ip_mask': {'required': True}, + } + + _attribute_map = { + 'filter_name': {'key': 'filterName', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'ip_mask': {'key': 'ipMask', 'type': 'str'}, + } + + def __init__( + self, + *, + filter_name: str, + action: Union[str, "IpFilterActionType"], + ip_mask: str, + **kwargs + ): + super(IpFilterRule, self).__init__(**kwargs) + self.filter_name = filter_name + self.action = action + self.ip_mask = ip_mask + + +class JobResponse(msrest.serialization.Model): + """The properties of the Job Response object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar job_id: The job identifier. + :vartype job_id: str + :ivar start_time_utc: The start time of the job. + :vartype start_time_utc: ~datetime.datetime + :ivar end_time_utc: The time the job stopped processing. + :vartype end_time_utc: ~datetime.datetime + :ivar type: The type of the job. Possible values include: "unknown", "export", "import", + "backup", "readDeviceProperties", "writeDeviceProperties", "updateDeviceConfiguration", + "rebootDevice", "factoryResetDevice", "firmwareUpdate". + :vartype type: str or ~azure.mgmt.iothub.v2021_07_01.models.JobType + :ivar status: The status of the job. Possible values include: "unknown", "enqueued", "running", + "completed", "failed", "cancelled". + :vartype status: str or ~azure.mgmt.iothub.v2021_07_01.models.JobStatus + :ivar failure_reason: If status == failed, this string containing the reason for the failure. + :vartype failure_reason: str + :ivar status_message: The status message for the job. + :vartype status_message: str + :ivar parent_job_id: The job identifier of the parent job, if any. + :vartype parent_job_id: str + """ + + _validation = { + 'job_id': {'readonly': True}, + 'start_time_utc': {'readonly': True}, + 'end_time_utc': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'failure_reason': {'readonly': True}, + 'status_message': {'readonly': True}, + 'parent_job_id': {'readonly': True}, + } + + _attribute_map = { + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'start_time_utc': {'key': 'startTimeUtc', 'type': 'rfc-1123'}, + 'end_time_utc': {'key': 'endTimeUtc', 'type': 'rfc-1123'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'failure_reason': {'key': 'failureReason', 'type': 'str'}, + 'status_message': {'key': 'statusMessage', 'type': 'str'}, + 'parent_job_id': {'key': 'parentJobId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobResponse, self).__init__(**kwargs) + self.job_id = None + self.start_time_utc = None + self.end_time_utc = None + self.type = None + self.status = None + self.failure_reason = None + self.status_message = None + self.parent_job_id = None + + +class JobResponseListResult(msrest.serialization.Model): + """The JSON-serialized array of JobResponse objects with a next link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The array of JobResponse objects. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.JobResponse] + :ivar next_link: The next link. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["JobResponse"]] = None, + **kwargs + ): + super(JobResponseListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedIdentity(msrest.serialization.Model): + """The properties of the Managed identity. + + :param user_assigned_identity: The user assigned identity. + :type user_assigned_identity: str + """ + + _attribute_map = { + 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + } + + def __init__( + self, + *, + user_assigned_identity: Optional[str] = None, + **kwargs + ): + super(ManagedIdentity, self).__init__(**kwargs) + self.user_assigned_identity = user_assigned_identity + + +class MatchedRoute(msrest.serialization.Model): + """Routes that matched. + + :param properties: Properties of routes that matched. + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.RouteProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'RouteProperties'}, + } + + def __init__( + self, + *, + properties: Optional["RouteProperties"] = None, + **kwargs + ): + super(MatchedRoute, self).__init__(**kwargs) + self.properties = properties + + +class MessagingEndpointProperties(msrest.serialization.Model): + """The properties of the messaging endpoints used by this IoT hub. + + :param lock_duration_as_iso8601: The lock duration. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + :type lock_duration_as_iso8601: ~datetime.timedelta + :param ttl_as_iso8601: The period of time for which a message is available to consume before it + is expired by the IoT hub. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + :type ttl_as_iso8601: ~datetime.timedelta + :param max_delivery_count: The number of times the IoT hub attempts to deliver a message. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + :type max_delivery_count: int + """ + + _validation = { + 'max_delivery_count': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'lock_duration_as_iso8601': {'key': 'lockDurationAsIso8601', 'type': 'duration'}, + 'ttl_as_iso8601': {'key': 'ttlAsIso8601', 'type': 'duration'}, + 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int'}, + } + + def __init__( + self, + *, + lock_duration_as_iso8601: Optional[datetime.timedelta] = None, + ttl_as_iso8601: Optional[datetime.timedelta] = None, + max_delivery_count: Optional[int] = None, + **kwargs + ): + super(MessagingEndpointProperties, self).__init__(**kwargs) + self.lock_duration_as_iso8601 = lock_duration_as_iso8601 + self.ttl_as_iso8601 = ttl_as_iso8601 + self.max_delivery_count = max_delivery_count + + +class Name(msrest.serialization.Model): + """Name of Iot Hub type. + + :param value: IotHub type. + :type value: str + :param localized_value: Localized value of name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[str] = None, + localized_value: Optional[str] = None, + **kwargs + ): + super(Name, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value + + +class NetworkRuleSetIpRule(msrest.serialization.Model): + """IP Rule to be applied as part of Network Rule Set. + + All required parameters must be populated in order to send to Azure. + + :param filter_name: Required. Name of the IP filter rule. + :type filter_name: str + :param action: IP Filter Action. Possible values include: "Allow". Default value: "Allow". + :type action: str or ~azure.mgmt.iothub.v2021_07_01.models.NetworkRuleIPAction + :param ip_mask: Required. A string that contains the IP address range in CIDR notation for the + rule. + :type ip_mask: str + """ + + _validation = { + 'filter_name': {'required': True}, + 'ip_mask': {'required': True}, + } + + _attribute_map = { + 'filter_name': {'key': 'filterName', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'ip_mask': {'key': 'ipMask', 'type': 'str'}, + } + + def __init__( + self, + *, + filter_name: str, + ip_mask: str, + action: Optional[Union[str, "NetworkRuleIPAction"]] = "Allow", + **kwargs + ): + super(NetworkRuleSetIpRule, self).__init__(**kwargs) + self.filter_name = filter_name + self.action = action + self.ip_mask = ip_mask + + +class NetworkRuleSetProperties(msrest.serialization.Model): + """Network Rule Set Properties of IotHub. + + All required parameters must be populated in order to send to Azure. + + :param default_action: Default Action for Network Rule Set. Possible values include: "Deny", + "Allow". Default value: "Deny". + :type default_action: str or ~azure.mgmt.iothub.v2021_07_01.models.DefaultAction + :param apply_to_built_in_event_hub_endpoint: Required. If True, then Network Rule Set is also + applied to BuiltIn EventHub EndPoint of IotHub. + :type apply_to_built_in_event_hub_endpoint: bool + :param ip_rules: Required. List of IP Rules. + :type ip_rules: list[~azure.mgmt.iothub.v2021_07_01.models.NetworkRuleSetIpRule] + """ + + _validation = { + 'apply_to_built_in_event_hub_endpoint': {'required': True}, + 'ip_rules': {'required': True}, + } + + _attribute_map = { + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'apply_to_built_in_event_hub_endpoint': {'key': 'applyToBuiltInEventHubEndpoint', 'type': 'bool'}, + 'ip_rules': {'key': 'ipRules', 'type': '[NetworkRuleSetIpRule]'}, + } + + def __init__( + self, + *, + apply_to_built_in_event_hub_endpoint: bool, + ip_rules: List["NetworkRuleSetIpRule"], + default_action: Optional[Union[str, "DefaultAction"]] = "Deny", + **kwargs + ): + super(NetworkRuleSetProperties, self).__init__(**kwargs) + self.default_action = default_action + self.apply_to_built_in_event_hub_endpoint = apply_to_built_in_event_hub_endpoint + self.ip_rules = ip_rules + + +class Operation(msrest.serialization.Model): + """IoT Hub REST API operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name: {provider}/{resource}/{read | write | action | delete}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.iothub.v2021_07_01.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + *, + display: Optional["OperationDisplay"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: Service provider: Microsoft Devices. + :vartype provider: str + :ivar resource: Resource Type: IotHubs. + :vartype resource: str + :ivar operation: Name of the operation. + :vartype operation: str + :ivar description: Description of the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationInputs(msrest.serialization.Model): + """Input values. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the IoT hub to check. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(OperationInputs, self).__init__(**kwargs) + self.name = name + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list IoT Hub operations. It contains a list of operations and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of IoT Hub operations supported by the Microsoft.Devices resource provider. + :vartype value: list[~azure.mgmt.iothub.v2021_07_01.models.Operation] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PrivateEndpoint(msrest.serialization.Model): + """The private endpoint property of a private endpoint connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource identifier. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(msrest.serialization.Model): + """The private endpoint connection of an IotHub. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param properties: Required. The properties of a private endpoint connection. + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpointConnectionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, + } + + def __init__( + self, + *, + properties: "PrivateEndpointConnectionProperties", + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + + +class PrivateEndpointConnectionProperties(msrest.serialization.Model): + """The properties of a private endpoint connection. + + All required parameters must be populated in order to send to Azure. + + :param private_endpoint: The private endpoint property of a private endpoint connection. + :type private_endpoint: ~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpoint + :param private_link_service_connection_state: Required. The current state of a private endpoint + connection. + :type private_link_service_connection_state: + ~azure.mgmt.iothub.v2021_07_01.models.PrivateLinkServiceConnectionState + """ + + _validation = { + 'private_link_service_connection_state': {'required': True}, + } + + _attribute_map = { + 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + } + + def __init__( + self, + *, + private_link_service_connection_state: "PrivateLinkServiceConnectionState", + private_endpoint: Optional["PrivateEndpoint"] = None, + **kwargs + ): + super(PrivateEndpointConnectionProperties, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateLinkResources(msrest.serialization.Model): + """The available private link resources for an IotHub. + + :param value: The list of available private link resources for an IotHub. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.GroupIdInformation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GroupIdInformation]'}, + } + + def __init__( + self, + *, + value: Optional[List["GroupIdInformation"]] = None, + **kwargs + ): + super(PrivateLinkResources, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """The current state of a private endpoint connection. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. The status of a private endpoint connection. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :type status: str or ~azure.mgmt.iothub.v2021_07_01.models.PrivateLinkServiceConnectionStatus + :param description: Required. The description for the current state of a private endpoint + connection. + :type description: str + :param actions_required: Actions required for a private endpoint connection. + :type actions_required: str + """ + + _validation = { + 'status': {'required': True}, + 'description': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Union[str, "PrivateLinkServiceConnectionStatus"], + description: str, + actions_required: Optional[str] = None, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class RegistryStatistics(msrest.serialization.Model): + """Identity registry statistics. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar total_device_count: The total count of devices in the identity registry. + :vartype total_device_count: long + :ivar enabled_device_count: The count of enabled devices in the identity registry. + :vartype enabled_device_count: long + :ivar disabled_device_count: The count of disabled devices in the identity registry. + :vartype disabled_device_count: long + """ + + _validation = { + 'total_device_count': {'readonly': True}, + 'enabled_device_count': {'readonly': True}, + 'disabled_device_count': {'readonly': True}, + } + + _attribute_map = { + 'total_device_count': {'key': 'totalDeviceCount', 'type': 'long'}, + 'enabled_device_count': {'key': 'enabledDeviceCount', 'type': 'long'}, + 'disabled_device_count': {'key': 'disabledDeviceCount', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(RegistryStatistics, self).__init__(**kwargs) + self.total_device_count = None + self.enabled_device_count = None + self.disabled_device_count = None + + +class RouteCompilationError(msrest.serialization.Model): + """Compilation error when evaluating route. + + :param message: Route error message. + :type message: str + :param severity: Severity of the route error. Possible values include: "error", "warning". + :type severity: str or ~azure.mgmt.iothub.v2021_07_01.models.RouteErrorSeverity + :param location: Location where the route error happened. + :type location: ~azure.mgmt.iothub.v2021_07_01.models.RouteErrorRange + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'RouteErrorRange'}, + } + + def __init__( + self, + *, + message: Optional[str] = None, + severity: Optional[Union[str, "RouteErrorSeverity"]] = None, + location: Optional["RouteErrorRange"] = None, + **kwargs + ): + super(RouteCompilationError, self).__init__(**kwargs) + self.message = message + self.severity = severity + self.location = location + + +class RouteErrorPosition(msrest.serialization.Model): + """Position where the route error happened. + + :param line: Line where the route error happened. + :type line: int + :param column: Column where the route error happened. + :type column: int + """ + + _attribute_map = { + 'line': {'key': 'line', 'type': 'int'}, + 'column': {'key': 'column', 'type': 'int'}, + } + + def __init__( + self, + *, + line: Optional[int] = None, + column: Optional[int] = None, + **kwargs + ): + super(RouteErrorPosition, self).__init__(**kwargs) + self.line = line + self.column = column + + +class RouteErrorRange(msrest.serialization.Model): + """Range of route errors. + + :param start: Start where the route error happened. + :type start: ~azure.mgmt.iothub.v2021_07_01.models.RouteErrorPosition + :param end: End where the route error happened. + :type end: ~azure.mgmt.iothub.v2021_07_01.models.RouteErrorPosition + """ + + _attribute_map = { + 'start': {'key': 'start', 'type': 'RouteErrorPosition'}, + 'end': {'key': 'end', 'type': 'RouteErrorPosition'}, + } + + def __init__( + self, + *, + start: Optional["RouteErrorPosition"] = None, + end: Optional["RouteErrorPosition"] = None, + **kwargs + ): + super(RouteErrorRange, self).__init__(**kwargs) + self.start = start + self.end = end + + +class RouteProperties(msrest.serialization.Model): + """The properties of a routing rule that your IoT hub uses to route messages to endpoints. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the route. The name can only include alphanumeric + characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be + unique. + :type name: str + :param source: Required. The source that the routing rule is to be applied to, such as + DeviceMessages. Possible values include: "Invalid", "DeviceMessages", "TwinChangeEvents", + "DeviceLifecycleEvents", "DeviceJobLifecycleEvents", "DeviceConnectionStateEvents". + :type source: str or ~azure.mgmt.iothub.v2021_07_01.models.RoutingSource + :param condition: The condition that is evaluated to apply the routing rule. If no condition is + provided, it evaluates to true by default. For grammar, see: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. + :type condition: str + :param endpoint_names: Required. The list of endpoints to which messages that satisfy the + condition are routed. Currently only one endpoint is allowed. + :type endpoint_names: list[str] + :param is_enabled: Required. Used to specify whether a route is enabled. + :type is_enabled: bool + """ + + _validation = { + 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, + 'source': {'required': True}, + 'endpoint_names': {'required': True, 'max_items': 1, 'min_items': 1}, + 'is_enabled': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'condition': {'key': 'condition', 'type': 'str'}, + 'endpoint_names': {'key': 'endpointNames', 'type': '[str]'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: str, + source: Union[str, "RoutingSource"], + endpoint_names: List[str], + is_enabled: bool, + condition: Optional[str] = None, + **kwargs + ): + super(RouteProperties, self).__init__(**kwargs) + self.name = name + self.source = source + self.condition = condition + self.endpoint_names = endpoint_names + self.is_enabled = is_enabled + + +class RoutingEndpoints(msrest.serialization.Model): + """The properties related to the custom endpoints to which your IoT hub routes messages based on the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs and only 1 custom endpoint is allowed across all endpoint types for free hubs. + + :param service_bus_queues: The list of Service Bus queue endpoints that IoT hub routes the + messages to, based on the routing rules. + :type service_bus_queues: + list[~azure.mgmt.iothub.v2021_07_01.models.RoutingServiceBusQueueEndpointProperties] + :param service_bus_topics: The list of Service Bus topic endpoints that the IoT hub routes the + messages to, based on the routing rules. + :type service_bus_topics: + list[~azure.mgmt.iothub.v2021_07_01.models.RoutingServiceBusTopicEndpointProperties] + :param event_hubs: The list of Event Hubs endpoints that IoT hub routes messages to, based on + the routing rules. This list does not include the built-in Event Hubs endpoint. + :type event_hubs: list[~azure.mgmt.iothub.v2021_07_01.models.RoutingEventHubProperties] + :param storage_containers: The list of storage container endpoints that IoT hub routes messages + to, based on the routing rules. + :type storage_containers: + list[~azure.mgmt.iothub.v2021_07_01.models.RoutingStorageContainerProperties] + """ + + _attribute_map = { + 'service_bus_queues': {'key': 'serviceBusQueues', 'type': '[RoutingServiceBusQueueEndpointProperties]'}, + 'service_bus_topics': {'key': 'serviceBusTopics', 'type': '[RoutingServiceBusTopicEndpointProperties]'}, + 'event_hubs': {'key': 'eventHubs', 'type': '[RoutingEventHubProperties]'}, + 'storage_containers': {'key': 'storageContainers', 'type': '[RoutingStorageContainerProperties]'}, + } + + def __init__( + self, + *, + service_bus_queues: Optional[List["RoutingServiceBusQueueEndpointProperties"]] = None, + service_bus_topics: Optional[List["RoutingServiceBusTopicEndpointProperties"]] = None, + event_hubs: Optional[List["RoutingEventHubProperties"]] = None, + storage_containers: Optional[List["RoutingStorageContainerProperties"]] = None, + **kwargs + ): + super(RoutingEndpoints, self).__init__(**kwargs) + self.service_bus_queues = service_bus_queues + self.service_bus_topics = service_bus_topics + self.event_hubs = event_hubs + self.storage_containers = storage_containers + + +class RoutingEventHubProperties(msrest.serialization.Model): + """The properties related to an event hub endpoint. + + All required parameters must be populated in order to send to Azure. + + :param id: Id of the event hub endpoint. + :type id: str + :param connection_string: The connection string of the event hub endpoint. + :type connection_string: str + :param endpoint_uri: The url of the event hub endpoint. It must include the protocol sb://. + :type endpoint_uri: str + :param entity_path: Event hub name on the event hub namespace. + :type entity_path: str + :param authentication_type: Method used to authenticate against the event hub endpoint. + Possible values include: "keyBased", "identityBased". + :type authentication_type: str or ~azure.mgmt.iothub.v2021_07_01.models.AuthenticationType + :param identity: Managed identity properties of routing event hub endpoint. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ManagedIdentity + :param name: Required. The name that identifies this endpoint. The name can only include + alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 + characters. The following names are reserved: events, fileNotifications, $default. Endpoint + names must be unique across endpoint types. + :type name: str + :param subscription_id: The subscription identifier of the event hub endpoint. + :type subscription_id: str + :param resource_group: The name of the resource group of the event hub endpoint. + :type resource_group: str + """ + + _validation = { + 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + 'entity_path': {'key': 'entityPath', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + id: Optional[str] = None, + connection_string: Optional[str] = None, + endpoint_uri: Optional[str] = None, + entity_path: Optional[str] = None, + authentication_type: Optional[Union[str, "AuthenticationType"]] = None, + identity: Optional["ManagedIdentity"] = None, + subscription_id: Optional[str] = None, + resource_group: Optional[str] = None, + **kwargs + ): + super(RoutingEventHubProperties, self).__init__(**kwargs) + self.id = id + self.connection_string = connection_string + self.endpoint_uri = endpoint_uri + self.entity_path = entity_path + self.authentication_type = authentication_type + self.identity = identity + self.name = name + self.subscription_id = subscription_id + self.resource_group = resource_group + + +class RoutingMessage(msrest.serialization.Model): + """Routing message. + + :param body: Body of routing message. + :type body: str + :param app_properties: App properties. + :type app_properties: dict[str, str] + :param system_properties: System properties. + :type system_properties: dict[str, str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'str'}, + 'app_properties': {'key': 'appProperties', 'type': '{str}'}, + 'system_properties': {'key': 'systemProperties', 'type': '{str}'}, + } + + def __init__( + self, + *, + body: Optional[str] = None, + app_properties: Optional[Dict[str, str]] = None, + system_properties: Optional[Dict[str, str]] = None, + **kwargs + ): + super(RoutingMessage, self).__init__(**kwargs) + self.body = body + self.app_properties = app_properties + self.system_properties = system_properties + + +class RoutingProperties(msrest.serialization.Model): + """The routing related properties of the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging. + + :param endpoints: The properties related to the custom endpoints to which your IoT hub routes + messages based on the routing rules. A maximum of 10 custom endpoints are allowed across all + endpoint types for paid hubs and only 1 custom endpoint is allowed across all endpoint types + for free hubs. + :type endpoints: ~azure.mgmt.iothub.v2021_07_01.models.RoutingEndpoints + :param routes: The list of user-provided routing rules that the IoT hub uses to route messages + to built-in and custom endpoints. A maximum of 100 routing rules are allowed for paid hubs and + a maximum of 5 routing rules are allowed for free hubs. + :type routes: list[~azure.mgmt.iothub.v2021_07_01.models.RouteProperties] + :param fallback_route: The properties of the route that is used as a fall-back route when none + of the conditions specified in the 'routes' section are met. This is an optional parameter. + When this property is not set, the messages which do not meet any of the conditions specified + in the 'routes' section get routed to the built-in eventhub endpoint. + :type fallback_route: ~azure.mgmt.iothub.v2021_07_01.models.FallbackRouteProperties + :param enrichments: The list of user-provided enrichments that the IoT hub applies to messages + to be delivered to built-in and custom endpoints. See: https://aka.ms/telemetryoneventgrid. + :type enrichments: list[~azure.mgmt.iothub.v2021_07_01.models.EnrichmentProperties] + """ + + _attribute_map = { + 'endpoints': {'key': 'endpoints', 'type': 'RoutingEndpoints'}, + 'routes': {'key': 'routes', 'type': '[RouteProperties]'}, + 'fallback_route': {'key': 'fallbackRoute', 'type': 'FallbackRouteProperties'}, + 'enrichments': {'key': 'enrichments', 'type': '[EnrichmentProperties]'}, + } + + def __init__( + self, + *, + endpoints: Optional["RoutingEndpoints"] = None, + routes: Optional[List["RouteProperties"]] = None, + fallback_route: Optional["FallbackRouteProperties"] = None, + enrichments: Optional[List["EnrichmentProperties"]] = None, + **kwargs + ): + super(RoutingProperties, self).__init__(**kwargs) + self.endpoints = endpoints + self.routes = routes + self.fallback_route = fallback_route + self.enrichments = enrichments + + +class RoutingServiceBusQueueEndpointProperties(msrest.serialization.Model): + """The properties related to service bus queue endpoint types. + + All required parameters must be populated in order to send to Azure. + + :param id: Id of the service bus queue endpoint. + :type id: str + :param connection_string: The connection string of the service bus queue endpoint. + :type connection_string: str + :param endpoint_uri: The url of the service bus queue endpoint. It must include the protocol + sb://. + :type endpoint_uri: str + :param entity_path: Queue name on the service bus namespace. + :type entity_path: str + :param authentication_type: Method used to authenticate against the service bus queue endpoint. + Possible values include: "keyBased", "identityBased". + :type authentication_type: str or ~azure.mgmt.iothub.v2021_07_01.models.AuthenticationType + :param identity: Managed identity properties of routing service bus queue endpoint. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ManagedIdentity + :param name: Required. The name that identifies this endpoint. The name can only include + alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 + characters. The following names are reserved: events, fileNotifications, $default. Endpoint + names must be unique across endpoint types. The name need not be the same as the actual queue + name. + :type name: str + :param subscription_id: The subscription identifier of the service bus queue endpoint. + :type subscription_id: str + :param resource_group: The name of the resource group of the service bus queue endpoint. + :type resource_group: str + """ + + _validation = { + 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + 'entity_path': {'key': 'entityPath', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + id: Optional[str] = None, + connection_string: Optional[str] = None, + endpoint_uri: Optional[str] = None, + entity_path: Optional[str] = None, + authentication_type: Optional[Union[str, "AuthenticationType"]] = None, + identity: Optional["ManagedIdentity"] = None, + subscription_id: Optional[str] = None, + resource_group: Optional[str] = None, + **kwargs + ): + super(RoutingServiceBusQueueEndpointProperties, self).__init__(**kwargs) + self.id = id + self.connection_string = connection_string + self.endpoint_uri = endpoint_uri + self.entity_path = entity_path + self.authentication_type = authentication_type + self.identity = identity + self.name = name + self.subscription_id = subscription_id + self.resource_group = resource_group + + +class RoutingServiceBusTopicEndpointProperties(msrest.serialization.Model): + """The properties related to service bus topic endpoint types. + + All required parameters must be populated in order to send to Azure. + + :param id: Id of the service bus topic endpoint. + :type id: str + :param connection_string: The connection string of the service bus topic endpoint. + :type connection_string: str + :param endpoint_uri: The url of the service bus topic endpoint. It must include the protocol + sb://. + :type endpoint_uri: str + :param entity_path: Queue name on the service bus topic. + :type entity_path: str + :param authentication_type: Method used to authenticate against the service bus topic endpoint. + Possible values include: "keyBased", "identityBased". + :type authentication_type: str or ~azure.mgmt.iothub.v2021_07_01.models.AuthenticationType + :param identity: Managed identity properties of routing service bus topic endpoint. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ManagedIdentity + :param name: Required. The name that identifies this endpoint. The name can only include + alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 + characters. The following names are reserved: events, fileNotifications, $default. Endpoint + names must be unique across endpoint types. The name need not be the same as the actual topic + name. + :type name: str + :param subscription_id: The subscription identifier of the service bus topic endpoint. + :type subscription_id: str + :param resource_group: The name of the resource group of the service bus topic endpoint. + :type resource_group: str + """ + + _validation = { + 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + 'entity_path': {'key': 'entityPath', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + id: Optional[str] = None, + connection_string: Optional[str] = None, + endpoint_uri: Optional[str] = None, + entity_path: Optional[str] = None, + authentication_type: Optional[Union[str, "AuthenticationType"]] = None, + identity: Optional["ManagedIdentity"] = None, + subscription_id: Optional[str] = None, + resource_group: Optional[str] = None, + **kwargs + ): + super(RoutingServiceBusTopicEndpointProperties, self).__init__(**kwargs) + self.id = id + self.connection_string = connection_string + self.endpoint_uri = endpoint_uri + self.entity_path = entity_path + self.authentication_type = authentication_type + self.identity = identity + self.name = name + self.subscription_id = subscription_id + self.resource_group = resource_group + + +class RoutingStorageContainerProperties(msrest.serialization.Model): + """The properties related to a storage container endpoint. + + All required parameters must be populated in order to send to Azure. + + :param id: Id of the storage container endpoint. + :type id: str + :param connection_string: The connection string of the storage account. + :type connection_string: str + :param endpoint_uri: The url of the storage endpoint. It must include the protocol https://. + :type endpoint_uri: str + :param authentication_type: Method used to authenticate against the storage endpoint. Possible + values include: "keyBased", "identityBased". + :type authentication_type: str or ~azure.mgmt.iothub.v2021_07_01.models.AuthenticationType + :param identity: Managed identity properties of routing storage endpoint. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ManagedIdentity + :param name: Required. The name that identifies this endpoint. The name can only include + alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 + characters. The following names are reserved: events, fileNotifications, $default. Endpoint + names must be unique across endpoint types. + :type name: str + :param subscription_id: The subscription identifier of the storage account. + :type subscription_id: str + :param resource_group: The name of the resource group of the storage account. + :type resource_group: str + :param container_name: Required. The name of storage container in the storage account. + :type container_name: str + :param file_name_format: File name format for the blob. Default format is + {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are mandatory but can be + reordered. + :type file_name_format: str + :param batch_frequency_in_seconds: Time interval at which blobs are written to storage. Value + should be between 60 and 720 seconds. Default value is 300 seconds. + :type batch_frequency_in_seconds: int + :param max_chunk_size_in_bytes: Maximum number of bytes for each blob written to storage. Value + should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB). + :type max_chunk_size_in_bytes: int + :param encoding: Encoding that is used to serialize messages to blobs. Supported values are + 'avro', 'avrodeflate', and 'JSON'. Default value is 'avro'. Possible values include: "Avro", + "AvroDeflate", "JSON". + :type encoding: str or + ~azure.mgmt.iothub.v2021_07_01.models.RoutingStorageContainerPropertiesEncoding + """ + + _validation = { + 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, + 'container_name': {'required': True}, + 'batch_frequency_in_seconds': {'maximum': 720, 'minimum': 60}, + 'max_chunk_size_in_bytes': {'maximum': 524288000, 'minimum': 10485760}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'file_name_format': {'key': 'fileNameFormat', 'type': 'str'}, + 'batch_frequency_in_seconds': {'key': 'batchFrequencyInSeconds', 'type': 'int'}, + 'max_chunk_size_in_bytes': {'key': 'maxChunkSizeInBytes', 'type': 'int'}, + 'encoding': {'key': 'encoding', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + container_name: str, + id: Optional[str] = None, + connection_string: Optional[str] = None, + endpoint_uri: Optional[str] = None, + authentication_type: Optional[Union[str, "AuthenticationType"]] = None, + identity: Optional["ManagedIdentity"] = None, + subscription_id: Optional[str] = None, + resource_group: Optional[str] = None, + file_name_format: Optional[str] = None, + batch_frequency_in_seconds: Optional[int] = None, + max_chunk_size_in_bytes: Optional[int] = None, + encoding: Optional[Union[str, "RoutingStorageContainerPropertiesEncoding"]] = None, + **kwargs + ): + super(RoutingStorageContainerProperties, self).__init__(**kwargs) + self.id = id + self.connection_string = connection_string + self.endpoint_uri = endpoint_uri + self.authentication_type = authentication_type + self.identity = identity + self.name = name + self.subscription_id = subscription_id + self.resource_group = resource_group + self.container_name = container_name + self.file_name_format = file_name_format + self.batch_frequency_in_seconds = batch_frequency_in_seconds + self.max_chunk_size_in_bytes = max_chunk_size_in_bytes + self.encoding = encoding + + +class RoutingTwin(msrest.serialization.Model): + """Twin reference input parameter. This is an optional parameter. + + :param tags: A set of tags. Twin Tags. + :type tags: any + :param properties: + :type properties: ~azure.mgmt.iothub.v2021_07_01.models.RoutingTwinProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': 'object'}, + 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, + } + + def __init__( + self, + *, + tags: Optional[Any] = None, + properties: Optional["RoutingTwinProperties"] = None, + **kwargs + ): + super(RoutingTwin, self).__init__(**kwargs) + self.tags = tags + self.properties = properties + + +class RoutingTwinProperties(msrest.serialization.Model): + """RoutingTwinProperties. + + :param desired: Twin desired properties. + :type desired: any + :param reported: Twin desired properties. + :type reported: any + """ + + _attribute_map = { + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, + } + + def __init__( + self, + *, + desired: Optional[Any] = None, + reported: Optional[Any] = None, + **kwargs + ): + super(RoutingTwinProperties, self).__init__(**kwargs) + self.desired = desired + self.reported = reported + + +class SharedAccessSignatureAuthorizationRule(msrest.serialization.Model): + """The properties of an IoT hub shared access policy. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of the shared access policy. + :type key_name: str + :param primary_key: The primary key. + :type primary_key: str + :param secondary_key: The secondary key. + :type secondary_key: str + :param rights: Required. The permissions assigned to the shared access policy. Possible values + include: "RegistryRead", "RegistryWrite", "ServiceConnect", "DeviceConnect", "RegistryRead, + RegistryWrite", "RegistryRead, ServiceConnect", "RegistryRead, DeviceConnect", "RegistryWrite, + ServiceConnect", "RegistryWrite, DeviceConnect", "ServiceConnect, DeviceConnect", + "RegistryRead, RegistryWrite, ServiceConnect", "RegistryRead, RegistryWrite, DeviceConnect", + "RegistryRead, ServiceConnect, DeviceConnect", "RegistryWrite, ServiceConnect, DeviceConnect", + "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect". + :type rights: str or ~azure.mgmt.iothub.v2021_07_01.models.AccessRights + """ + + _validation = { + 'key_name': {'required': True}, + 'rights': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'rights': {'key': 'rights', 'type': 'str'}, + } + + def __init__( + self, + *, + key_name: str, + rights: Union[str, "AccessRights"], + primary_key: Optional[str] = None, + secondary_key: Optional[str] = None, + **kwargs + ): + super(SharedAccessSignatureAuthorizationRule, self).__init__(**kwargs) + self.key_name = key_name + self.primary_key = primary_key + self.secondary_key = secondary_key + self.rights = rights + + +class SharedAccessSignatureAuthorizationRuleListResult(msrest.serialization.Model): + """The list of shared access policies with a next link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of shared access policies. + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.SharedAccessSignatureAuthorizationRule] + :ivar next_link: The next link. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SharedAccessSignatureAuthorizationRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["SharedAccessSignatureAuthorizationRule"]] = None, + **kwargs + ): + super(SharedAccessSignatureAuthorizationRuleListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StorageEndpointProperties(msrest.serialization.Model): + """The properties of the Azure Storage endpoint for file upload. + + All required parameters must be populated in order to send to Azure. + + :param sas_ttl_as_iso8601: The period of time for which the SAS URI generated by IoT Hub for + file upload is valid. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options. + :type sas_ttl_as_iso8601: ~datetime.timedelta + :param connection_string: Required. The connection string for the Azure Storage account to + which files are uploaded. + :type connection_string: str + :param container_name: Required. The name of the root container where you upload files. The + container need not exist but should be creatable using the connectionString specified. + :type container_name: str + :param authentication_type: Specifies authentication type being used for connecting to the + storage account. Possible values include: "keyBased", "identityBased". + :type authentication_type: str or ~azure.mgmt.iothub.v2021_07_01.models.AuthenticationType + :param identity: Managed identity properties of storage endpoint for file upload. + :type identity: ~azure.mgmt.iothub.v2021_07_01.models.ManagedIdentity + """ + + _validation = { + 'connection_string': {'required': True}, + 'container_name': {'required': True}, + } + + _attribute_map = { + 'sas_ttl_as_iso8601': {'key': 'sasTtlAsIso8601', 'type': 'duration'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + } + + def __init__( + self, + *, + connection_string: str, + container_name: str, + sas_ttl_as_iso8601: Optional[datetime.timedelta] = None, + authentication_type: Optional[Union[str, "AuthenticationType"]] = None, + identity: Optional["ManagedIdentity"] = None, + **kwargs + ): + super(StorageEndpointProperties, self).__init__(**kwargs) + self.sas_ttl_as_iso8601 = sas_ttl_as_iso8601 + self.connection_string = connection_string + self.container_name = container_name + self.authentication_type = authentication_type + self.identity = identity + + +class TagsResource(msrest.serialization.Model): + """A container holding only the Tags for a resource, allowing the user to update the tags on an IoT Hub instance. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TagsResource, self).__init__(**kwargs) + self.tags = tags + + +class TestAllRoutesInput(msrest.serialization.Model): + """Input for testing all routes. + + :param routing_source: Routing source. Possible values include: "Invalid", "DeviceMessages", + "TwinChangeEvents", "DeviceLifecycleEvents", "DeviceJobLifecycleEvents", + "DeviceConnectionStateEvents". + :type routing_source: str or ~azure.mgmt.iothub.v2021_07_01.models.RoutingSource + :param message: Routing message. + :type message: ~azure.mgmt.iothub.v2021_07_01.models.RoutingMessage + :param twin: Routing Twin Reference. + :type twin: ~azure.mgmt.iothub.v2021_07_01.models.RoutingTwin + """ + + _attribute_map = { + 'routing_source': {'key': 'routingSource', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'RoutingMessage'}, + 'twin': {'key': 'twin', 'type': 'RoutingTwin'}, + } + + def __init__( + self, + *, + routing_source: Optional[Union[str, "RoutingSource"]] = None, + message: Optional["RoutingMessage"] = None, + twin: Optional["RoutingTwin"] = None, + **kwargs + ): + super(TestAllRoutesInput, self).__init__(**kwargs) + self.routing_source = routing_source + self.message = message + self.twin = twin + + +class TestAllRoutesResult(msrest.serialization.Model): + """Result of testing all routes. + + :param routes: JSON-serialized array of matched routes. + :type routes: list[~azure.mgmt.iothub.v2021_07_01.models.MatchedRoute] + """ + + _attribute_map = { + 'routes': {'key': 'routes', 'type': '[MatchedRoute]'}, + } + + def __init__( + self, + *, + routes: Optional[List["MatchedRoute"]] = None, + **kwargs + ): + super(TestAllRoutesResult, self).__init__(**kwargs) + self.routes = routes + + +class TestRouteInput(msrest.serialization.Model): + """Input for testing route. + + All required parameters must be populated in order to send to Azure. + + :param message: Routing message. + :type message: ~azure.mgmt.iothub.v2021_07_01.models.RoutingMessage + :param route: Required. Route properties. + :type route: ~azure.mgmt.iothub.v2021_07_01.models.RouteProperties + :param twin: Routing Twin Reference. + :type twin: ~azure.mgmt.iothub.v2021_07_01.models.RoutingTwin + """ + + _validation = { + 'route': {'required': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'RoutingMessage'}, + 'route': {'key': 'route', 'type': 'RouteProperties'}, + 'twin': {'key': 'twin', 'type': 'RoutingTwin'}, + } + + def __init__( + self, + *, + route: "RouteProperties", + message: Optional["RoutingMessage"] = None, + twin: Optional["RoutingTwin"] = None, + **kwargs + ): + super(TestRouteInput, self).__init__(**kwargs) + self.message = message + self.route = route + self.twin = twin + + +class TestRouteResult(msrest.serialization.Model): + """Result of testing one route. + + :param result: Result of testing route. Possible values include: "undefined", "false", "true". + :type result: str or ~azure.mgmt.iothub.v2021_07_01.models.TestResultStatus + :param details: Detailed result of testing route. + :type details: ~azure.mgmt.iothub.v2021_07_01.models.TestRouteResultDetails + """ + + _attribute_map = { + 'result': {'key': 'result', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'TestRouteResultDetails'}, + } + + def __init__( + self, + *, + result: Optional[Union[str, "TestResultStatus"]] = None, + details: Optional["TestRouteResultDetails"] = None, + **kwargs + ): + super(TestRouteResult, self).__init__(**kwargs) + self.result = result + self.details = details + + +class TestRouteResultDetails(msrest.serialization.Model): + """Detailed result of testing a route. + + :param compilation_errors: JSON-serialized list of route compilation errors. + :type compilation_errors: list[~azure.mgmt.iothub.v2021_07_01.models.RouteCompilationError] + """ + + _attribute_map = { + 'compilation_errors': {'key': 'compilationErrors', 'type': '[RouteCompilationError]'}, + } + + def __init__( + self, + *, + compilation_errors: Optional[List["RouteCompilationError"]] = None, + **kwargs + ): + super(TestRouteResultDetails, self).__init__(**kwargs) + self.compilation_errors = compilation_errors + + +class UserSubscriptionQuota(msrest.serialization.Model): + """User subscription quota response. + + :param id: IotHub type id. + :type id: str + :param type: Response type. + :type type: str + :param unit: Unit of IotHub type. + :type unit: str + :param current_value: Current number of IotHub type. + :type current_value: int + :param limit: Numerical limit on IotHub type. + :type limit: int + :param name: IotHub type. + :type name: ~azure.mgmt.iothub.v2021_07_01.models.Name + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'Name'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + type: Optional[str] = None, + unit: Optional[str] = None, + current_value: Optional[int] = None, + limit: Optional[int] = None, + name: Optional["Name"] = None, + **kwargs + ): + super(UserSubscriptionQuota, self).__init__(**kwargs) + self.id = id + self.type = type + self.unit = unit + self.current_value = current_value + self.limit = limit + self.name = name + + +class UserSubscriptionQuotaListResult(msrest.serialization.Model): + """Json-serialized array of User subscription quota response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: + :type value: list[~azure.mgmt.iothub.v2021_07_01.models.UserSubscriptionQuota] + :ivar next_link: + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UserSubscriptionQuota]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["UserSubscriptionQuota"]] = None, + **kwargs + ): + super(UserSubscriptionQuotaListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/__init__.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/__init__.py new file mode 100644 index 000000000000..3930a2f261c8 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._iot_hub_resource_operations import IotHubResourceOperations +from ._resource_provider_common_operations import ResourceProviderCommonOperations +from ._certificates_operations import CertificatesOperations +from ._iot_hub_operations import IotHubOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations + +__all__ = [ + 'Operations', + 'IotHubResourceOperations', + 'ResourceProviderCommonOperations', + 'CertificatesOperations', + 'IotHubOperations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionsOperations', +] diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_certificates_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_certificates_operations.py new file mode 100644 index 000000000000..cb70d45419e0 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_certificates_operations.py @@ -0,0 +1,474 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CertificatesOperations(object): + """CertificatesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.iothub.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_iot_hub( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CertificateListDescription" + """Get the certificate list. + + Returns the list of certificates. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateListDescription, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.CertificateListDescription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateListDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list_by_iot_hub.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CertificateListDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_iot_hub.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CertificateDescription" + """Get the certificate. + + Returns the certificate. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateDescription, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.CertificateDescription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[A-Za-z0-9-._]{1,64}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CertificateDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + resource_name, # type: str + certificate_name, # type: str + certificate_description, # type: "_models.CertificateDescription" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CertificateDescription" + """Upload the certificate to the IoT hub. + + Adds new or replaces existing certificate. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param certificate_description: The certificate body. + :type certificate_description: ~azure.mgmt.iothub.v2021_07_01.models.CertificateDescription + :param if_match: ETag of the Certificate. Do not specify for creating a brand new certificate. + Required to update an existing certificate. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateDescription, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.CertificateDescription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[A-Za-z0-9-._]{1,64}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_description, 'CertificateDescription') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('CertificateDescription', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CertificateDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + resource_name, # type: str + certificate_name, # type: str + if_match, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete an X509 certificate. + + Deletes an existing X509 certificate or does nothing if it does not exist. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param if_match: ETag of the Certificate. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[A-Za-z0-9-._]{1,64}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}'} # type: ignore + + def generate_verification_code( + self, + resource_group_name, # type: str + resource_name, # type: str + certificate_name, # type: str + if_match, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CertificateWithNonceDescription" + """Generate verification code for proof of possession flow. + + Generates verification code for proof of possession flow. The verification code will be used to + generate a leaf certificate. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param if_match: ETag of the Certificate. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateWithNonceDescription, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.CertificateWithNonceDescription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateWithNonceDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.generate_verification_code.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[A-Za-z0-9-._]{1,64}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CertificateWithNonceDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_verification_code.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/generateVerificationCode'} # type: ignore + + def verify( + self, + resource_group_name, # type: str + resource_name, # type: str + certificate_name, # type: str + if_match, # type: str + certificate_verification_body, # type: "_models.CertificateVerificationDescription" + **kwargs # type: Any + ): + # type: (...) -> "_models.CertificateDescription" + """Verify certificate's private key possession. + + Verifies the certificate's private key possession by providing the leaf cert issued by the + verifying pre uploaded certificate. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param if_match: ETag of the Certificate. + :type if_match: str + :param certificate_verification_body: The name of the certificate. + :type certificate_verification_body: ~azure.mgmt.iothub.v2021_07_01.models.CertificateVerificationDescription + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateDescription, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.CertificateDescription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.verify.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[A-Za-z0-9-._]{1,64}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_verification_body, 'CertificateVerificationDescription') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CertificateDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + verify.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify'} # type: ignore diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_iot_hub_operations.py new file mode 100644 index 000000000000..0c1633b87c2a --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_iot_hub_operations.py @@ -0,0 +1,173 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IotHubOperations(object): + """IotHubOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.iothub.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _manual_failover_initial( + self, + iot_hub_name, # type: str + resource_group_name, # type: str + failover_input, # type: "_models.FailoverInput" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._manual_failover_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'iotHubName': self._serialize.url("iot_hub_name", iot_hub_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(failover_input, 'FailoverInput') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _manual_failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover'} # type: ignore + + def begin_manual_failover( + self, + iot_hub_name, # type: str + resource_group_name, # type: str + failover_input, # type: "_models.FailoverInput" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Manually initiate a failover for the IoT Hub to its secondary region. + + Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see + https://aka.ms/manualfailover. + + :param iot_hub_name: Name of the IoT hub to failover. + :type iot_hub_name: str + :param resource_group_name: Name of the resource group containing the IoT hub resource. + :type resource_group_name: str + :param failover_input: Region to failover to. Must be the Azure paired region. Get the value + from the secondary location in the locations property. To learn more, see + https://aka.ms/manualfailover/region. + :type failover_input: ~azure.mgmt.iothub.v2021_07_01.models.FailoverInput + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._manual_failover_initial( + iot_hub_name=iot_hub_name, + resource_group_name=resource_group_name, + failover_input=failover_input, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'iotHubName': self._serialize.url("iot_hub_name", iot_hub_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_manual_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover'} # type: ignore diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_iot_hub_resource_operations.py new file mode 100644 index 000000000000..21d82dbf997a --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_iot_hub_resource_operations.py @@ -0,0 +1,1887 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IotHubResourceOperations(object): + """IotHubResourceOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.iothub.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.IotHubDescription" + """Get the non-security related metadata of an IoT hub. + + Get the non-security related metadata of an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IotHubDescription, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.IotHubDescription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + iot_hub_description, # type: "_models.IotHubDescription" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.IotHubDescription" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(iot_hub_description, 'IotHubDescription') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + resource_name, # type: str + iot_hub_description, # type: "_models.IotHubDescription" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.IotHubDescription"] + """Create or update the metadata of an IoT hub. + + Create or update the metadata of an Iot hub. The usual pattern to modify a property is to + retrieve the IoT hub metadata and security metadata, and then combine them with the modified + values in a new body to update the IoT hub. If certain properties are missing in the JSON, + updating IoT Hub may cause these values to fallback to default, which may lead to unexpected + behavior. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param iot_hub_description: The IoT hub metadata and security metadata. + :type iot_hub_description: ~azure.mgmt.iothub.v2021_07_01.models.IotHubDescription + :param if_match: ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required + to update an existing IoT Hub. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.iothub.v2021_07_01.models.IotHubDescription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + iot_hub_description=iot_hub_description, + if_match=if_match, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + iot_hub_tags, # type: "_models.TagsResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.IotHubDescription" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(iot_hub_tags, 'TagsResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + resource_name, # type: str + iot_hub_tags, # type: "_models.TagsResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.IotHubDescription"] + """Update an existing IoT Hubs tags. + + Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + + :param resource_group_name: Resource group identifier. + :type resource_group_name: str + :param resource_name: Name of iot hub to update. + :type resource_name: str + :param iot_hub_tags: Updated tag information to set into the iot hub instance. + :type iot_hub_tags: ~azure.mgmt.iothub.v2021_07_01.models.TagsResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.iothub.v2021_07_01.models.IotHubDescription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescription"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + iot_hub_tags=iot_hub_tags, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[Union["_models.IotHubDescription", "_models.ErrorDetails"]]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if response.status_code == 404: + deserialized = self._deserialize('ErrorDetails', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[Union["_models.IotHubDescription", "_models.ErrorDetails"]] + """Delete an IoT hub. + + Delete an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either IotHubDescription or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.iothub.v2021_07_01.models.IotHubDescription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.IotHubDescription", "_models.ErrorDetails"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('IotHubDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IotHubDescriptionListResult"] + """Get all the IoT hubs in a subscription. + + Get all the IoT hubs in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IotHubDescriptionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.iothub.v2021_07_01.models.IotHubDescriptionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescriptionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IotHubDescriptionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/IotHubs'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IotHubDescriptionListResult"] + """Get all the IoT hubs in a resource group. + + Get all the IoT hubs in a resource group. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IotHubDescriptionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.iothub.v2021_07_01.models.IotHubDescriptionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubDescriptionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IotHubDescriptionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs'} # type: ignore + + def get_stats( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RegistryStatistics" + """Get the statistics from an IoT hub. + + Get the statistics from an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RegistryStatistics, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.RegistryStatistics + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryStatistics"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_stats.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegistryStatistics', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats'} # type: ignore + + def get_valid_skus( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IotHubSkuDescriptionListResult"] + """Get the list of valid SKUs for an IoT hub. + + Get the list of valid SKUs for an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IotHubSkuDescriptionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.iothub.v2021_07_01.models.IotHubSkuDescriptionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubSkuDescriptionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_valid_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IotHubSkuDescriptionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_valid_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/skus'} # type: ignore + + def list_event_hub_consumer_groups( + self, + resource_group_name, # type: str + resource_name, # type: str + event_hub_endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.EventHubConsumerGroupsListResult"] + """Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + + Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an + IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param event_hub_endpoint_name: The name of the Event Hub-compatible endpoint. + :type event_hub_endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EventHubConsumerGroupsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.iothub.v2021_07_01.models.EventHubConsumerGroupsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubConsumerGroupsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_event_hub_consumer_groups.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'eventHubEndpointName': self._serialize.url("event_hub_endpoint_name", event_hub_endpoint_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('EventHubConsumerGroupsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_event_hub_consumer_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups'} # type: ignore + + def get_event_hub_consumer_group( + self, + resource_group_name, # type: str + resource_name, # type: str + event_hub_endpoint_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.EventHubConsumerGroupInfo" + """Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + + Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param event_hub_endpoint_name: The name of the Event Hub-compatible endpoint in the IoT hub. + :type event_hub_endpoint_name: str + :param name: The name of the consumer group to retrieve. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EventHubConsumerGroupInfo, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.EventHubConsumerGroupInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubConsumerGroupInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_event_hub_consumer_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'eventHubEndpointName': self._serialize.url("event_hub_endpoint_name", event_hub_endpoint_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EventHubConsumerGroupInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_event_hub_consumer_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'} # type: ignore + + def create_event_hub_consumer_group( + self, + resource_group_name, # type: str + resource_name, # type: str + event_hub_endpoint_name, # type: str + name, # type: str + consumer_group_body, # type: "_models.EventHubConsumerGroupBodyDescription" + **kwargs # type: Any + ): + # type: (...) -> "_models.EventHubConsumerGroupInfo" + """Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. + + Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param event_hub_endpoint_name: The name of the Event Hub-compatible endpoint in the IoT hub. + :type event_hub_endpoint_name: str + :param name: The name of the consumer group to add. + :type name: str + :param consumer_group_body: The consumer group to add. + :type consumer_group_body: ~azure.mgmt.iothub.v2021_07_01.models.EventHubConsumerGroupBodyDescription + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EventHubConsumerGroupInfo, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.EventHubConsumerGroupInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubConsumerGroupInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_event_hub_consumer_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'eventHubEndpointName': self._serialize.url("event_hub_endpoint_name", event_hub_endpoint_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(consumer_group_body, 'EventHubConsumerGroupBodyDescription') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EventHubConsumerGroupInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_event_hub_consumer_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'} # type: ignore + + def delete_event_hub_consumer_group( + self, + resource_group_name, # type: str + resource_name, # type: str + event_hub_endpoint_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + + Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param event_hub_endpoint_name: The name of the Event Hub-compatible endpoint in the IoT hub. + :type event_hub_endpoint_name: str + :param name: The name of the consumer group to delete. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.delete_event_hub_consumer_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'eventHubEndpointName': self._serialize.url("event_hub_endpoint_name", event_hub_endpoint_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_event_hub_consumer_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'} # type: ignore + + def list_jobs( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.JobResponseListResult"] + """Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + + Get a list of all the jobs in an IoT hub. For more information, see: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResponseListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.iothub.v2021_07_01.models.JobResponseListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResponseListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('JobResponseListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs'} # type: ignore + + def get_job( + self, + resource_group_name, # type: str + resource_name, # type: str + job_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.JobResponse" + """Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + + Get the details of a job from an IoT hub. For more information, see: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param job_id: The job identifier. + :type job_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResponse, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.JobResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_job.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'jobId': self._serialize.url("job_id", job_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs/{jobId}'} # type: ignore + + def get_quota_metrics( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IotHubQuotaMetricInfoListResult"] + """Get the quota metrics for an IoT hub. + + Get the quota metrics for an IoT hub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IotHubQuotaMetricInfoListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.iothub.v2021_07_01.models.IotHubQuotaMetricInfoListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubQuotaMetricInfoListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_quota_metrics.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IotHubQuotaMetricInfoListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_quota_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics'} # type: ignore + + def get_endpoint_health( + self, + resource_group_name, # type: str + iot_hub_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.EndpointHealthDataListResult"] + """Get the health for routing endpoints. + + Get the health for routing endpoints. + + :param resource_group_name: + :type resource_group_name: str + :param iot_hub_name: + :type iot_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EndpointHealthDataListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.iothub.v2021_07_01.models.EndpointHealthDataListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointHealthDataListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_endpoint_health.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'iotHubName': self._serialize.url("iot_hub_name", iot_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('EndpointHealthDataListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_endpoint_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routingEndpointsHealth'} # type: ignore + + def check_name_availability( + self, + operation_inputs, # type: "_models.OperationInputs" + **kwargs # type: Any + ): + # type: (...) -> "_models.IotHubNameAvailabilityInfo" + """Check if an IoT hub name is available. + + Check if an IoT hub name is available. + + :param operation_inputs: Set the name parameter in the OperationInputs structure to the name of + the IoT hub to check. + :type operation_inputs: ~azure.mgmt.iothub.v2021_07_01.models.OperationInputs + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IotHubNameAvailabilityInfo, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.IotHubNameAvailabilityInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IotHubNameAvailabilityInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(operation_inputs, 'OperationInputs') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IotHubNameAvailabilityInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability'} # type: ignore + + def test_all_routes( + self, + iot_hub_name, # type: str + resource_group_name, # type: str + input, # type: "_models.TestAllRoutesInput" + **kwargs # type: Any + ): + # type: (...) -> "_models.TestAllRoutesResult" + """Test all routes. + + Test all routes configured in this Iot Hub. + + :param iot_hub_name: IotHub to be tested. + :type iot_hub_name: str + :param resource_group_name: resource group which Iot Hub belongs to. + :type resource_group_name: str + :param input: Input for testing all routes. + :type input: ~azure.mgmt.iothub.v2021_07_01.models.TestAllRoutesInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TestAllRoutesResult, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.TestAllRoutesResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TestAllRoutesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.test_all_routes.metadata['url'] # type: ignore + path_format_arguments = { + 'iotHubName': self._serialize.url("iot_hub_name", iot_hub_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(input, 'TestAllRoutesInput') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TestAllRoutesResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + test_all_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall'} # type: ignore + + def test_route( + self, + iot_hub_name, # type: str + resource_group_name, # type: str + input, # type: "_models.TestRouteInput" + **kwargs # type: Any + ): + # type: (...) -> "_models.TestRouteResult" + """Test the new route. + + Test the new route for this Iot Hub. + + :param iot_hub_name: IotHub to be tested. + :type iot_hub_name: str + :param resource_group_name: resource group which Iot Hub belongs to. + :type resource_group_name: str + :param input: Route that needs to be tested. + :type input: ~azure.mgmt.iothub.v2021_07_01.models.TestRouteInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TestRouteResult, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.TestRouteResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TestRouteResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.test_route.metadata['url'] # type: ignore + path_format_arguments = { + 'iotHubName': self._serialize.url("iot_hub_name", iot_hub_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(input, 'TestRouteInput') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TestRouteResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + test_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testnew'} # type: ignore + + def list_keys( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SharedAccessSignatureAuthorizationRuleListResult"] + """Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + + Get the security metadata for an IoT hub. For more information, see: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SharedAccessSignatureAuthorizationRuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.iothub.v2021_07_01.models.SharedAccessSignatureAuthorizationRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessSignatureAuthorizationRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SharedAccessSignatureAuthorizationRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys'} # type: ignore + + def get_keys_for_key_name( + self, + resource_group_name, # type: str + resource_name, # type: str + key_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SharedAccessSignatureAuthorizationRule" + """Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + + Get a shared access policy by name from an IoT hub. For more information, see: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param key_name: The name of the shared access policy. + :type key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SharedAccessSignatureAuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.SharedAccessSignatureAuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessSignatureAuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_keys_for_key_name.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SharedAccessSignatureAuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_keys_for_key_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys'} # type: ignore + + def export_devices( + self, + resource_group_name, # type: str + resource_name, # type: str + export_devices_parameters, # type: "_models.ExportDevicesRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.JobResponse" + """Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + + Exports all the device identities in the IoT hub identity registry to an Azure Storage blob + container. For more information, see: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param export_devices_parameters: The parameters that specify the export devices operation. + :type export_devices_parameters: ~azure.mgmt.iothub.v2021_07_01.models.ExportDevicesRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResponse, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.JobResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.export_devices.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(export_devices_parameters, 'ExportDevicesRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + export_devices.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices'} # type: ignore + + def import_devices( + self, + resource_group_name, # type: str + resource_name, # type: str + import_devices_parameters, # type: "_models.ImportDevicesRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.JobResponse" + """Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + + Import, update, or delete device identities in the IoT hub identity registry from a blob. For + more information, see: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param import_devices_parameters: The parameters that specify the import devices operation. + :type import_devices_parameters: ~azure.mgmt.iothub.v2021_07_01.models.ImportDevicesRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResponse, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.JobResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.import_devices.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(import_devices_parameters, 'ImportDevicesRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + import_devices.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices'} # type: ignore diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_operations.py new file mode 100644 index 000000000000..1a1761258b1f --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.iothub.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationListResult"] + """Lists all of the available IoT Hub REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.iothub.v2021_07_01.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Devices/operations'} # type: ignore diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_private_endpoint_connections_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..201961a3f22c --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,446 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.iothub.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.PrivateEndpointConnection"] + """List private endpoint connections. + + List private endpoint connection properties. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of PrivateEndpointConnection, or the result of cls(response) + :rtype: list[~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpointConnection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.PrivateEndpointConnection"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[PrivateEndpointConnection]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Get private endpoint connection. + + Get private endpoint connection properties. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint_connection, # type: "_models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_connection, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint_connection, # type: "_models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PrivateEndpointConnection"] + """Update private endpoint connection. + + Update the status of a private endpoint connection with the specified name. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param private_endpoint_connection: The private endpoint connection with updated properties. + :type private_endpoint_connection: ~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_connection=private_endpoint_connection, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateEndpointConnection"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PrivateEndpointConnection"] + """Delete private endpoint connection. + + Delete private endpoint connection with the specified name. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.iothub.v2021_07_01.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_private_link_resources_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..fbd771d5cd42 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_private_link_resources_operations.py @@ -0,0 +1,173 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.iothub.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResources" + """List private link resources. + + List private link resources for the given IotHub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResources, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.PrivateLinkResources + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResources"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResources', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + group_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GroupIdInformation" + """Get the specified private link resource. + + Get the specified private link resource for the given IotHub. + + :param resource_group_name: The name of the resource group that contains the IoT hub. + :type resource_group_name: str + :param resource_name: The name of the IoT hub. + :type resource_name: str + :param group_id: The name of the private link resource. + :type group_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GroupIdInformation, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.GroupIdInformation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupIdInformation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'groupId': self._serialize.url("group_id", group_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GroupIdInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources/{groupId}'} # type: ignore diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_resource_provider_common_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_resource_provider_common_operations.py new file mode 100644 index 000000000000..3663daf69b22 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/operations/_resource_provider_common_operations.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ResourceProviderCommonOperations(object): + """ResourceProviderCommonOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.iothub.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_subscription_quota( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.UserSubscriptionQuotaListResult" + """Get the number of iot hubs in the subscription. + + Get the number of free and paid iot hubs in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UserSubscriptionQuotaListResult, or the result of cls(response) + :rtype: ~azure.mgmt.iothub.v2021_07_01.models.UserSubscriptionQuotaListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UserSubscriptionQuotaListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_subscription_quota.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorDetails, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UserSubscriptionQuotaListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_subscription_quota.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/usages'} # type: ignore diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/py.typed b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file