From 90db147672b739c69de77354e523dff422c948e2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 20 Apr 2021 02:56:40 +0000 Subject: [PATCH] CodeGen from PR 13980 in Azure/azure-rest-api-specs iothub t2 readme config (#13980) * iothub t2 readme config * iothub readme t2 config * iothub t2 readme config --- sdk/iothub/azure-mgmt-iothub/MANIFEST.in | 1 + sdk/iothub/azure-mgmt-iothub/_meta.json | 8 + .../azure/mgmt/iothub/_iot_hub_client.py | 25 + .../iothub/v2021_03_01_preview/__init__.py | 19 + .../v2021_03_01_preview/_configuration.py | 48 + .../v2021_03_01_preview/_iot_hub_client.py | 79 + .../v2021_03_01_preview/models/__init__.py | 302 ++ .../models/_iot_hub_client_enums.py | 176 ++ .../v2021_03_01_preview/models/_models.py | 2733 +++++++++++++++++ .../v2021_03_01_preview/models/_models_py3.py | 2733 +++++++++++++++++ .../models/_paged_models.py | 118 + .../operations/__init__.py | 28 + .../operations/_certificates_operations.py | 461 +++ .../operations/_iot_hub_operations.py | 132 + .../_iot_hub_resource_operations.py | 1780 +++++++++++ .../operations/_operations.py | 100 + ...private_endpoint_connections_operations.py | 388 +++ .../_private_link_resources_operations.py | 168 + .../_resource_provider_common_operations.py | 96 + .../iothub/v2021_03_01_preview/version.py | 13 + 20 files changed, 9408 insertions(+) create mode 100644 sdk/iothub/azure-mgmt-iothub/_meta.json create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/__init__.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/_configuration.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/_iot_hub_client.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/__init__.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_iot_hub_client_enums.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_models.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_models_py3.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_paged_models.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/__init__.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_certificates_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_iot_hub_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_iot_hub_resource_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_private_link_resources_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_resource_provider_common_operations.py create mode 100644 sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/version.py diff --git a/sdk/iothub/azure-mgmt-iothub/MANIFEST.in b/sdk/iothub/azure-mgmt-iothub/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/iothub/azure-mgmt-iothub/MANIFEST.in +++ b/sdk/iothub/azure-mgmt-iothub/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/iothub/azure-mgmt-iothub/_meta.json b/sdk/iothub/azure-mgmt-iothub/_meta.json new file mode 100644 index 000000000000..e8245e0d2c67 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "da8568e4e87f5991c15dc75ff5d2890c99dd361c", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/iothub/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "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 82dd170f1c9c..cd6a03171f48 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 @@ -83,6 +83,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-07-01-preview: :mod:`v2019_07_01_preview.models` * 2019-11-04: :mod:`v2019_11_04.models` * 2020-03-01: :mod:`v2020_03_01.models` + * 2021-03-03-preview: :mod:`v2021_03_01_preview.models` """ if api_version == '2016-02-03': from .v2016_02_03 import models @@ -117,6 +118,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-03-01': from .v2020_03_01 import models return models + elif api_version == '2021-03-03-preview': + from .v2021_03_01_preview import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) @property @@ -132,6 +136,7 @@ def certificates(self): * 2019-07-01-preview: :class:`CertificatesOperations` * 2019-11-04: :class:`CertificatesOperations` * 2020-03-01: :class:`CertificatesOperations` + * 2021-03-03-preview: :class:`CertificatesOperations` """ api_version = self._get_api_version('certificates') if api_version == '2017-07-01': @@ -152,6 +157,8 @@ def certificates(self): from .v2019_11_04.operations import CertificatesOperations as OperationClass elif api_version == '2020-03-01': from .v2020_03_01.operations import CertificatesOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_01_preview.operations import CertificatesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -165,6 +172,7 @@ def iot_hub(self): * 2019-07-01-preview: :class:`IotHubOperations` * 2019-11-04: :class:`IotHubOperations` * 2020-03-01: :class:`IotHubOperations` + * 2021-03-03-preview: :class:`IotHubOperations` """ api_version = self._get_api_version('iot_hub') if api_version == '2019-03-22': @@ -177,6 +185,8 @@ def iot_hub(self): from .v2019_11_04.operations import IotHubOperations as OperationClass elif api_version == '2020-03-01': from .v2020_03_01.operations import IotHubOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_01_preview.operations import IotHubOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -196,6 +206,7 @@ def iot_hub_resource(self): * 2019-07-01-preview: :class:`IotHubResourceOperations` * 2019-11-04: :class:`IotHubResourceOperations` * 2020-03-01: :class:`IotHubResourceOperations` + * 2021-03-03-preview: :class:`IotHubResourceOperations` """ api_version = self._get_api_version('iot_hub_resource') if api_version == '2016-02-03': @@ -220,6 +231,8 @@ def iot_hub_resource(self): from .v2019_11_04.operations import IotHubResourceOperations as OperationClass elif api_version == '2020-03-01': from .v2020_03_01.operations import IotHubResourceOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_01_preview.operations import IotHubResourceOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -237,6 +250,7 @@ def operations(self): * 2019-07-01-preview: :class:`Operations` * 2019-11-04: :class:`Operations` * 2020-03-01: :class:`Operations` + * 2021-03-03-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-07-01': @@ -257,6 +271,8 @@ def operations(self): from .v2019_11_04.operations import Operations as OperationClass elif api_version == '2020-03-01': from .v2020_03_01.operations import Operations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_01_preview.operations import Operations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -266,10 +282,13 @@ def private_endpoint_connections(self): """Instance depends on the API version: * 2020-03-01: :class:`PrivateEndpointConnectionsOperations` + * 2021-03-03-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-03-01': from .v2020_03_01.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -279,10 +298,13 @@ def private_link_resources(self): """Instance depends on the API version: * 2020-03-01: :class:`PrivateLinkResourcesOperations` + * 2021-03-03-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-03-01': from .v2020_03_01.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_01_preview.operations import PrivateLinkResourcesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -298,6 +320,7 @@ def resource_provider_common(self): * 2019-07-01-preview: :class:`ResourceProviderCommonOperations` * 2019-11-04: :class:`ResourceProviderCommonOperations` * 2020-03-01: :class:`ResourceProviderCommonOperations` + * 2021-03-03-preview: :class:`ResourceProviderCommonOperations` """ api_version = self._get_api_version('resource_provider_common') if api_version == '2018-04-01': @@ -314,6 +337,8 @@ def resource_provider_common(self): from .v2019_11_04.operations import ResourceProviderCommonOperations as OperationClass elif api_version == '2020-03-01': from .v2020_03_01.operations import ResourceProviderCommonOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_01_preview.operations import ResourceProviderCommonOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".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/v2021_03_01_preview/__init__.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/__init__.py new file mode 100644 index 000000000000..867dea34192d --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/__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 ._configuration import IotHubClientConfiguration +from ._iot_hub_client import IotHubClient +__all__ = ['IotHubClient', 'IotHubClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/_configuration.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/_configuration.py new file mode 100644 index 000000000000..b2e8885bcfe2 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class IotHubClientConfiguration(AzureConfiguration): + """Configuration for IotHubClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription identifier. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(IotHubClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-iothub/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/_iot_hub_client.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/_iot_hub_client.py new file mode 100644 index 000000000000..abaedc05e403 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/_iot_hub_client.py @@ -0,0 +1,79 @@ +# 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 msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +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(SDKClient): + """Use this API to manage the IoT hubs in your Azure subscription. + + :ivar config: Configuration for client. + :vartype config: IotHubClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.iothub.operations.Operations + :ivar iot_hub_resource: IotHubResource operations + :vartype iot_hub_resource: azure.mgmt.iothub.operations.IotHubResourceOperations + :ivar resource_provider_common: ResourceProviderCommon operations + :vartype resource_provider_common: azure.mgmt.iothub.operations.ResourceProviderCommonOperations + :ivar certificates: Certificates operations + :vartype certificates: azure.mgmt.iothub.operations.CertificatesOperations + :ivar iot_hub: IotHub operations + :vartype iot_hub: azure.mgmt.iothub.operations.IotHubOperations + :ivar private_link_resources: PrivateLinkResources operations + :vartype private_link_resources: azure.mgmt.iothub.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connections: PrivateEndpointConnections operations + :vartype private_endpoint_connections: azure.mgmt.iothub.operations.PrivateEndpointConnectionsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription identifier. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = IotHubClientConfiguration(credentials, subscription_id, base_url) + super(IotHubClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2021-03-03-preview' + self._serialize = Serializer(client_models) + 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) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/__init__.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/__init__.py new file mode 100644 index 000000000000..5bafbc207bb3 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/__init__.py @@ -0,0 +1,302 @@ +# 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 EncryptionPropertiesDescription + from ._models_py3 import EndpointHealthData + from ._models_py3 import EnrichmentProperties + from ._models_py3 import ErrorDetails, ErrorDetailsException + from ._models_py3 import EventHubConsumerGroupBodyDescription + from ._models_py3 import EventHubConsumerGroupInfo + from ._models_py3 import EventHubConsumerGroupName + 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 IotHubLocationDescription + from ._models_py3 import IotHubNameAvailabilityInfo + from ._models_py3 import IotHubProperties + from ._models_py3 import IotHubPropertiesDeviceStreams + from ._models_py3 import IotHubQuotaMetricInfo + from ._models_py3 import IotHubSkuDescription + from ._models_py3 import IotHubSkuInfo + from ._models_py3 import IpFilterRule + from ._models_py3 import JobResponse + from ._models_py3 import KeyVaultKeyProperties + 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 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 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 + from ._models import ArmUserIdentity + from ._models import CertificateBodyDescription + from ._models import CertificateDescription + from ._models import CertificateListDescription + from ._models import CertificateProperties + from ._models import CertificatePropertiesWithNonce + from ._models import CertificateVerificationDescription + from ._models import CertificateWithNonceDescription + from ._models import CloudToDeviceProperties + from ._models import EncryptionPropertiesDescription + from ._models import EndpointHealthData + from ._models import EnrichmentProperties + from ._models import ErrorDetails, ErrorDetailsException + from ._models import EventHubConsumerGroupBodyDescription + from ._models import EventHubConsumerGroupInfo + from ._models import EventHubConsumerGroupName + from ._models import EventHubProperties + from ._models import ExportDevicesRequest + from ._models import FailoverInput + from ._models import FallbackRouteProperties + from ._models import FeedbackProperties + from ._models import GroupIdInformation + from ._models import GroupIdInformationProperties + from ._models import ImportDevicesRequest + from ._models import IotHubCapacity + from ._models import IotHubDescription + from ._models import IotHubLocationDescription + from ._models import IotHubNameAvailabilityInfo + from ._models import IotHubProperties + from ._models import IotHubPropertiesDeviceStreams + from ._models import IotHubQuotaMetricInfo + from ._models import IotHubSkuDescription + from ._models import IotHubSkuInfo + from ._models import IpFilterRule + from ._models import JobResponse + from ._models import KeyVaultKeyProperties + from ._models import ManagedIdentity + from ._models import MatchedRoute + from ._models import MessagingEndpointProperties + from ._models import Name + from ._models import NetworkRuleSetIpRule + from ._models import NetworkRuleSetProperties + from ._models import Operation + from ._models import OperationDisplay + from ._models import OperationInputs + from ._models import PrivateEndpoint + from ._models import PrivateEndpointConnection + from ._models import PrivateEndpointConnectionProperties + from ._models import PrivateLinkResources + from ._models import PrivateLinkServiceConnectionState + from ._models import RegistryStatistics + from ._models import Resource + from ._models import RouteCompilationError + from ._models import RouteErrorPosition + from ._models import RouteErrorRange + from ._models import RouteProperties + from ._models import RoutingEndpoints + from ._models import RoutingEventHubProperties + from ._models import RoutingMessage + from ._models import RoutingProperties + from ._models import RoutingServiceBusQueueEndpointProperties + from ._models import RoutingServiceBusTopicEndpointProperties + from ._models import RoutingStorageContainerProperties + from ._models import RoutingTwin + from ._models import RoutingTwinProperties + from ._models import SharedAccessSignatureAuthorizationRule + from ._models import StorageEndpointProperties + from ._models import TagsResource + from ._models import TestAllRoutesInput + from ._models import TestAllRoutesResult + from ._models import TestRouteInput + from ._models import TestRouteResult + from ._models import TestRouteResultDetails + from ._models import UserSubscriptionQuota + from ._models import UserSubscriptionQuotaListResult +from ._paged_models import EndpointHealthDataPaged +from ._paged_models import EventHubConsumerGroupInfoPaged +from ._paged_models import IotHubDescriptionPaged +from ._paged_models import IotHubQuotaMetricInfoPaged +from ._paged_models import IotHubSkuDescriptionPaged +from ._paged_models import JobResponsePaged +from ._paged_models import OperationPaged +from ._paged_models import SharedAccessSignatureAuthorizationRulePaged +from ._iot_hub_client_enums import ( + AccessRights, + PublicNetworkAccess, + IpFilterActionType, + DefaultAction, + NetworkRuleIPAction, + PrivateLinkServiceConnectionStatus, + AuthenticationType, + RoutingSource, + Capabilities, + IotHubReplicaRoleType, + IotHubSku, + IotHubSkuTier, + ResourceIdentityType, + EndpointHealthStatus, + JobType, + JobStatus, + IotHubScaleType, + IotHubNameUnavailabilityReason, + TestResultStatus, + RouteErrorSeverity, +) + +__all__ = [ + 'ArmIdentity', + 'ArmUserIdentity', + 'CertificateBodyDescription', + 'CertificateDescription', + 'CertificateListDescription', + 'CertificateProperties', + 'CertificatePropertiesWithNonce', + 'CertificateVerificationDescription', + 'CertificateWithNonceDescription', + 'CloudToDeviceProperties', + 'EncryptionPropertiesDescription', + 'EndpointHealthData', + 'EnrichmentProperties', + 'ErrorDetails', 'ErrorDetailsException', + 'EventHubConsumerGroupBodyDescription', + 'EventHubConsumerGroupInfo', + 'EventHubConsumerGroupName', + 'EventHubProperties', + 'ExportDevicesRequest', + 'FailoverInput', + 'FallbackRouteProperties', + 'FeedbackProperties', + 'GroupIdInformation', + 'GroupIdInformationProperties', + 'ImportDevicesRequest', + 'IotHubCapacity', + 'IotHubDescription', + 'IotHubLocationDescription', + 'IotHubNameAvailabilityInfo', + 'IotHubProperties', + 'IotHubPropertiesDeviceStreams', + 'IotHubQuotaMetricInfo', + 'IotHubSkuDescription', + 'IotHubSkuInfo', + 'IpFilterRule', + 'JobResponse', + 'KeyVaultKeyProperties', + 'ManagedIdentity', + 'MatchedRoute', + 'MessagingEndpointProperties', + 'Name', + 'NetworkRuleSetIpRule', + 'NetworkRuleSetProperties', + 'Operation', + 'OperationDisplay', + 'OperationInputs', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionProperties', + 'PrivateLinkResources', + 'PrivateLinkServiceConnectionState', + 'RegistryStatistics', + 'Resource', + 'RouteCompilationError', + 'RouteErrorPosition', + 'RouteErrorRange', + 'RouteProperties', + 'RoutingEndpoints', + 'RoutingEventHubProperties', + 'RoutingMessage', + 'RoutingProperties', + 'RoutingServiceBusQueueEndpointProperties', + 'RoutingServiceBusTopicEndpointProperties', + 'RoutingStorageContainerProperties', + 'RoutingTwin', + 'RoutingTwinProperties', + 'SharedAccessSignatureAuthorizationRule', + 'StorageEndpointProperties', + 'TagsResource', + 'TestAllRoutesInput', + 'TestAllRoutesResult', + 'TestRouteInput', + 'TestRouteResult', + 'TestRouteResultDetails', + 'UserSubscriptionQuota', + 'UserSubscriptionQuotaListResult', + 'OperationPaged', + 'IotHubDescriptionPaged', + 'IotHubSkuDescriptionPaged', + 'EventHubConsumerGroupInfoPaged', + 'JobResponsePaged', + 'IotHubQuotaMetricInfoPaged', + 'EndpointHealthDataPaged', + 'SharedAccessSignatureAuthorizationRulePaged', + 'AccessRights', + 'PublicNetworkAccess', + 'IpFilterActionType', + 'DefaultAction', + 'NetworkRuleIPAction', + 'PrivateLinkServiceConnectionStatus', + 'AuthenticationType', + 'RoutingSource', + 'Capabilities', + 'IotHubReplicaRoleType', + 'IotHubSku', + 'IotHubSkuTier', + 'ResourceIdentityType', + 'EndpointHealthStatus', + 'JobType', + 'JobStatus', + 'IotHubScaleType', + 'IotHubNameUnavailabilityReason', + 'TestResultStatus', + 'RouteErrorSeverity', +] diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_iot_hub_client_enums.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_iot_hub_client_enums.py new file mode 100644 index 000000000000..3b9f91e04035 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_iot_hub_client_enums.py @@ -0,0 +1,176 @@ +# 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 + + +class AccessRights(str, Enum): + + 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 PublicNetworkAccess(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class IpFilterActionType(str, Enum): + + accept = "Accept" + reject = "Reject" + + +class DefaultAction(str, Enum): + + deny = "Deny" + allow = "Allow" + + +class NetworkRuleIPAction(str, Enum): + + allow = "Allow" + + +class PrivateLinkServiceConnectionStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + disconnected = "Disconnected" + + +class AuthenticationType(str, Enum): + + key_based = "keyBased" + identity_based = "identityBased" + + +class RoutingSource(str, Enum): + + invalid = "Invalid" + device_messages = "DeviceMessages" + twin_change_events = "TwinChangeEvents" + device_lifecycle_events = "DeviceLifecycleEvents" + device_job_lifecycle_events = "DeviceJobLifecycleEvents" + digital_twin_change_events = "DigitalTwinChangeEvents" + device_connection_state_events = "DeviceConnectionStateEvents" + + +class Capabilities(str, Enum): + + none = "None" + device_management = "DeviceManagement" + + +class IotHubReplicaRoleType(str, Enum): + + primary = "primary" + secondary = "secondary" + + +class IotHubSku(str, Enum): + + f1 = "F1" + s1 = "S1" + s2 = "S2" + s3 = "S3" + b1 = "B1" + b2 = "B2" + b3 = "B3" + + +class IotHubSkuTier(str, Enum): + + free = "Free" + standard = "Standard" + basic = "Basic" + + +class ResourceIdentityType(str, Enum): + + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + system_assigned_user_assigned = "SystemAssigned, UserAssigned" + none = "None" + + +class EndpointHealthStatus(str, Enum): + + unknown = "unknown" + healthy = "healthy" + degraded = "degraded" + unhealthy = "unhealthy" + dead = "dead" + + +class JobType(str, Enum): + + 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 JobStatus(str, Enum): + + unknown = "unknown" + enqueued = "enqueued" + running = "running" + completed = "completed" + failed = "failed" + cancelled = "cancelled" + + +class IotHubScaleType(str, Enum): + + automatic = "Automatic" + manual = "Manual" + none = "None" + + +class IotHubNameUnavailabilityReason(str, Enum): + + invalid = "Invalid" + already_exists = "AlreadyExists" + + +class TestResultStatus(str, Enum): + + undefined = "undefined" + false = "false" + true = "true" + + +class RouteErrorSeverity(str, Enum): + + error = "error" + warning = "warning" diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_models.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_models.py new file mode 100644 index 000000000000..1f437f8184d2 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_models.py @@ -0,0 +1,2733 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ArmIdentity(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.models.ResourceIdentityType + :param user_assigned_identities: + :type user_assigned_identities: dict[str, + ~azure.mgmt.iothub.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': 'ResourceIdentityType'}, + '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(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(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 + """ + + _attribute_map = { + 'certificate': {'key': 'certificate', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CertificateBodyDescription, self).__init__(**kwargs) + self.certificate = kwargs.get('certificate', None) + + +class CertificateDescription(Model): + """The X509 Certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param properties: + :type properties: ~azure.mgmt.iothub.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(Model): + """The JSON-serialized array of Certificate objects. + + :param value: The array of Certificate objects. + :type value: list[~azure.mgmt.iothub.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(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 + :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 + :ivar updated: The certificate's last update date and time. + :vartype updated: datetime + :param certificate: The certificate content + :type certificate: str + """ + + _validation = { + 'subject': {'readonly': True}, + 'expiry': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'is_verified': {'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 = None + self.created = None + self.updated = None + self.certificate = kwargs.get('certificate', None) + + +class CertificatePropertiesWithNonce(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 + :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 + :ivar updated: The certificate's last update date and time. + :vartype updated: 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(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(Model): + """The X509 Certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param properties: + :type properties: ~azure.mgmt.iothub.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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CloudToDeviceProperties(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: timedelta + :param feedback: + :type feedback: ~azure.mgmt.iothub.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 EncryptionPropertiesDescription(Model): + """The encryption properties for the IoT hub. + + :param key_source: The source of the key. + :type key_source: str + :param key_vault_properties: The properties of the KeyVault key. + :type key_vault_properties: + list[~azure.mgmt.iothub.models.KeyVaultKeyProperties] + """ + + _attribute_map = { + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': '[KeyVaultKeyProperties]'}, + } + + def __init__(self, **kwargs): + super(EncryptionPropertiesDescription, self).__init__(**kwargs) + self.key_source = kwargs.get('key_source', None) + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EndpointHealthData(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.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 + :param last_successful_send_attempt_time: Last time iot hub successfully + sent a message to the endpoint + :type last_successful_send_attempt_time: datetime + :param last_send_attempt_time: Last time iot hub tried to send a message + to the endpoint + :type last_send_attempt_time: 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 EnrichmentProperties(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.get('key', None) + self.value = kwargs.get('value', None) + self.endpoint_names = kwargs.get('endpoint_names', None) + + +class ErrorDetails(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 ErrorDetailsException(HttpOperationError): + """Server responsed with exception of type: 'ErrorDetails'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorDetailsException, self).__init__(deserialize, response, 'ErrorDetails', *args) + + +class EventHubConsumerGroupBodyDescription(Model): + """The EventHub consumer group. + + :param properties: + :type properties: ~azure.mgmt.iothub.models.EventHubConsumerGroupName + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'EventHubConsumerGroupName'}, + } + + def __init__(self, **kwargs): + super(EventHubConsumerGroupBodyDescription, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class EventHubConsumerGroupInfo(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, str] + :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': '{str}'}, + '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(Model): + """The EventHub consumer group name. + + :param name: EventHub consumer group name + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventHubConsumerGroupName, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class EventHubProperties(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(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.models.AuthenticationType + :param identity: Managed identity properties of storage endpoint for + export devices. + :type identity: ~azure.mgmt.iothub.models.ManagedIdentity + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(ExportDevicesRequest, self).__init__(**kwargs) + self.export_blob_container_uri = kwargs.get('export_blob_container_uri', None) + self.exclude_keys = kwargs.get('exclude_keys', None) + self.export_blob_name = kwargs.get('export_blob_name', None) + self.authentication_type = kwargs.get('authentication_type', None) + self.identity = kwargs.get('identity', None) + + +class FailoverInput(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.get('failover_region', None) + + +class FallbackRouteProperties(Model): + """The properties of the fallback route. IoT Hub uses these properties when it + routes messages to the fallback endpoint. + + 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: 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 + :ivar source: Required. The source to which the routing rule is to be + applied to. For example, DeviceMessages. Default value: "DeviceMessages" . + :vartype source: str + :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, 'constant': 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'}, + } + + source = "DeviceMessages" + + def __init__(self, **kwargs): + super(FallbackRouteProperties, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.condition = kwargs.get('condition', None) + self.endpoint_names = kwargs.get('endpoint_names', None) + self.is_enabled = kwargs.get('is_enabled', None) + + +class FeedbackProperties(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: 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: 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(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. + :type properties: ~azure.mgmt.iothub.models.GroupIdInformationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + '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.get('properties', None) + + +class GroupIdInformationProperties(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(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.models.AuthenticationType + :param identity: Managed identity properties of storage endpoint for + import devices. + :type identity: ~azure.mgmt.iothub.models.ManagedIdentity + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(ImportDevicesRequest, self).__init__(**kwargs) + self.input_blob_container_uri = kwargs.get('input_blob_container_uri', None) + self.output_blob_container_uri = kwargs.get('output_blob_container_uri', None) + 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) + + +class IotHubCapacity(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.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': 'IotHubScaleType'}, + } + + def __init__(self, **kwargs): + super(IotHubCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default = None + self.scale_type = None + + +class Resource(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: 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.get('location', None) + 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: 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.models.IotHubProperties + :param sku: Required. IotHub SKU info + :type sku: ~azure.mgmt.iothub.models.IotHubSkuInfo + :param identity: The managed identities for the IotHub. + :type identity: ~azure.mgmt.iothub.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.get('sku', None) + self.identity = kwargs.get('identity', None) + + +class IotHubLocationDescription(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.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(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.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': 'IotHubNameUnavailabilityReason'}, + '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(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.models.SharedAccessSignatureAuthorizationRule] + :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.models.PublicNetworkAccess + :param ip_filter_rules: The IP filter rules. + :type ip_filter_rules: list[~azure.mgmt.iothub.models.IpFilterRule] + :param network_rule_sets: + :type network_rule_sets: + ~azure.mgmt.iothub.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.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.models.EventHubProperties] + :param routing: + :type routing: ~azure.mgmt.iothub.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.models.StorageEndpointProperties] + :param messaging_endpoints: The messaging endpoint properties for the file + upload notification queue. + :type messaging_endpoints: dict[str, + ~azure.mgmt.iothub.models.MessagingEndpointProperties] + :param enable_file_upload_notifications: If True, file upload + notifications are enabled. + :type enable_file_upload_notifications: bool + :param cloud_to_device: + :type cloud_to_device: ~azure.mgmt.iothub.models.CloudToDeviceProperties + :param comments: IoT hub comments. + :type comments: str + :param device_streams: The device streams properties of iothub. + :type device_streams: + ~azure.mgmt.iothub.models.IotHubPropertiesDeviceStreams + :param features: The capabilities and features enabled for the IoT hub. + Possible values include: 'None', 'DeviceManagement' + :type features: str or ~azure.mgmt.iothub.models.Capabilities + :param encryption: The encryption properties for the IoT hub. + :type encryption: + ~azure.mgmt.iothub.models.EncryptionPropertiesDescription + :ivar locations: Primary and secondary location for iot hub + :vartype locations: + list[~azure.mgmt.iothub.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]'}, + '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'}, + 'device_streams': {'key': 'deviceStreams', 'type': 'IotHubPropertiesDeviceStreams'}, + 'features': {'key': 'features', 'type': 'str'}, + 'encryption': {'key': 'encryption', 'type': 'EncryptionPropertiesDescription'}, + 'locations': {'key': 'locations', 'type': '[IotHubLocationDescription]'}, + } + + def __init__(self, **kwargs): + super(IotHubProperties, self).__init__(**kwargs) + self.authorization_policies = kwargs.get('authorization_policies', 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.device_streams = kwargs.get('device_streams', None) + self.features = kwargs.get('features', None) + self.encryption = kwargs.get('encryption', None) + self.locations = None + + +class IotHubPropertiesDeviceStreams(Model): + """The device streams properties of iothub. + + :param streaming_endpoints: List of Device Streams Endpoints. + :type streaming_endpoints: list[str] + """ + + _attribute_map = { + 'streaming_endpoints': {'key': 'streamingEndpoints', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(IotHubPropertiesDeviceStreams, self).__init__(**kwargs) + self.streaming_endpoints = kwargs.get('streaming_endpoints', None) + + +class IotHubQuotaMetricInfo(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 IotHubSkuDescription(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.models.IotHubSkuInfo + :param capacity: Required. IotHub capacity + :type capacity: ~azure.mgmt.iothub.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.get('sku', None) + self.capacity = kwargs.get('capacity', None) + + +class IotHubSkuInfo(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.models.IotHubSku + :ivar tier: The billing tier for the IoT hub. Possible values include: + 'Free', 'Standard', 'Basic' + :vartype tier: str or ~azure.mgmt.iothub.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': 'IotHubSkuTier'}, + 'capacity': {'key': 'capacity', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(IotHubSkuInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + self.capacity = kwargs.get('capacity', None) + + +class IpFilterRule(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.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': 'IpFilterActionType'}, + 'ip_mask': {'key': 'ipMask', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IpFilterRule, self).__init__(**kwargs) + self.filter_name = kwargs.get('filter_name', None) + self.action = kwargs.get('action', None) + self.ip_mask = kwargs.get('ip_mask', None) + + +class JobResponse(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 + :ivar end_time_utc: The time the job stopped processing. + :vartype end_time_utc: 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.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.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': 'JobStatus'}, + '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 KeyVaultKeyProperties(Model): + """The properties of the KeyVault key. + + :param key_identifier: The identifier of the key. + :type key_identifier: str + :param identity: Managed identity properties of KeyVault Key. + :type identity: ~azure.mgmt.iothub.models.ManagedIdentity + """ + + _attribute_map = { + 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + } + + def __init__(self, **kwargs): + super(KeyVaultKeyProperties, self).__init__(**kwargs) + self.key_identifier = kwargs.get('key_identifier', None) + self.identity = kwargs.get('identity', None) + + +class ManagedIdentity(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(Model): + """Routes that matched. + + :param properties: Properties of routes that matched + :type properties: ~azure.mgmt.iothub.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(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: 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: 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(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(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.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.get('filter_name', None) + self.action = kwargs.get('action', "Allow") + self.ip_mask = kwargs.get('ip_mask', None) + + +class NetworkRuleSetProperties(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.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.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.get('apply_to_built_in_event_hub_endpoint', None) + self.ip_rules = kwargs.get('ip_rules', None) + + +class Operation(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.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(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(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.get('name', None) + + +class PrivateEndpoint(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(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. + :type properties: + ~azure.mgmt.iothub.models.PrivateEndpointConnectionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + '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.get('properties', None) + + +class PrivateEndpointConnectionProperties(Model): + """The properties of a private endpoint connection. + + All required parameters must be populated in order to send to Azure. + + :param private_endpoint: + :type private_endpoint: ~azure.mgmt.iothub.models.PrivateEndpoint + :param private_link_service_connection_state: Required. + :type private_link_service_connection_state: + ~azure.mgmt.iothub.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.get('private_link_service_connection_state', None) + + +class PrivateLinkResources(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.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(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.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.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + +class RegistryStatistics(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(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.models.RouteErrorSeverity + :param location: Location where the route error happened + :type location: ~azure.mgmt.iothub.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(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(Model): + """Range of route errors. + + :param start: Start where the route error happened + :type start: ~azure.mgmt.iothub.models.RouteErrorPosition + :param end: End where the route error happened + :type end: ~azure.mgmt.iothub.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(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', 'DigitalTwinChangeEvents', + 'DeviceConnectionStateEvents' + :type source: str or ~azure.mgmt.iothub.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.get('name', None) + self.source = kwargs.get('source', None) + self.condition = kwargs.get('condition', None) + self.endpoint_names = kwargs.get('endpoint_names', None) + self.is_enabled = kwargs.get('is_enabled', None) + + +class RoutingEndpoints(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.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.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.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.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(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.models.AuthenticationType + :param identity: Managed identity properties of routing event hub + endpoint. + :type identity: ~azure.mgmt.iothub.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.get('name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + + +class RoutingMessage(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(Model): + """The routing related properties of the IoT hub. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging. + + :param endpoints: + :type endpoints: ~azure.mgmt.iothub.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.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.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.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(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.models.AuthenticationType + :param identity: Managed identity properties of routing service bus queue + endpoint. + :type identity: ~azure.mgmt.iothub.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.get('name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + + +class RoutingServiceBusTopicEndpointProperties(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.models.AuthenticationType + :param identity: Managed identity properties of routing service bus topic + endpoint. + :type identity: ~azure.mgmt.iothub.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.get('name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + + +class RoutingStorageContainerProperties(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.models.AuthenticationType + :param identity: Managed identity properties of routing storage endpoint. + :type identity: ~azure.mgmt.iothub.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.models.enum + """ + + _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.get('name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + self.container_name = kwargs.get('container_name', None) + 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(Model): + """Twin reference input parameter. This is an optional parameter. + + :param tags: Twin Tags + :type tags: object + :param properties: + :type properties: ~azure.mgmt.iothub.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(Model): + """RoutingTwinProperties. + + :param desired: Twin desired properties + :type desired: object + :param reported: Twin desired properties + :type reported: object + """ + + _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(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.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': 'AccessRights'}, + } + + def __init__(self, **kwargs): + super(SharedAccessSignatureAuthorizationRule, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.primary_key = kwargs.get('primary_key', None) + self.secondary_key = kwargs.get('secondary_key', None) + self.rights = kwargs.get('rights', None) + + +class StorageEndpointProperties(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: 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.models.AuthenticationType + :param identity: Managed identity properties of storage endpoint for file + upload. + :type identity: ~azure.mgmt.iothub.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.get('connection_string', None) + self.container_name = kwargs.get('container_name', None) + self.authentication_type = kwargs.get('authentication_type', None) + self.identity = kwargs.get('identity', None) + + +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on an IoT Hub instance. + + :param 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(Model): + """Input for testing all routes. + + :param routing_source: Routing source. Possible values include: 'Invalid', + 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', + 'DeviceJobLifecycleEvents', 'DigitalTwinChangeEvents', + 'DeviceConnectionStateEvents' + :type routing_source: str or ~azure.mgmt.iothub.models.RoutingSource + :param message: Routing message + :type message: ~azure.mgmt.iothub.models.RoutingMessage + :param twin: Routing Twin Reference + :type twin: ~azure.mgmt.iothub.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(Model): + """Result of testing all routes. + + :param routes: JSON-serialized array of matched routes + :type routes: list[~azure.mgmt.iothub.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(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.models.RoutingMessage + :param route: Required. Route properties + :type route: ~azure.mgmt.iothub.models.RouteProperties + :param twin: Routing Twin Reference + :type twin: ~azure.mgmt.iothub.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.get('route', None) + self.twin = kwargs.get('twin', None) + + +class TestRouteResult(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.models.TestResultStatus + :param details: Detailed result of testing route + :type details: ~azure.mgmt.iothub.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(Model): + """Detailed result of testing a route. + + :param compilation_errors: JSON-serialized list of route compilation + errors + :type compilation_errors: + list[~azure.mgmt.iothub.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(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.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(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.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_03_01_preview/models/_models_py3.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..7451aaf25a9b --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_models_py3.py @@ -0,0 +1,2733 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ArmIdentity(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.models.ResourceIdentityType + :param user_assigned_identities: + :type user_assigned_identities: dict[str, + ~azure.mgmt.iothub.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': 'ResourceIdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ArmUserIdentity}'}, + } + + def __init__(self, *, type=None, user_assigned_identities=None, **kwargs) -> None: + 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(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) -> None: + super(ArmUserIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class CertificateBodyDescription(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 + """ + + _attribute_map = { + 'certificate': {'key': 'certificate', 'type': 'str'}, + } + + def __init__(self, *, certificate: str=None, **kwargs) -> None: + super(CertificateBodyDescription, self).__init__(**kwargs) + self.certificate = certificate + + +class CertificateDescription(Model): + """The X509 Certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param properties: + :type properties: ~azure.mgmt.iothub.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=None, **kwargs) -> None: + super(CertificateDescription, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.name = None + self.etag = None + self.type = None + + +class CertificateListDescription(Model): + """The JSON-serialized array of Certificate objects. + + :param value: The array of Certificate objects. + :type value: list[~azure.mgmt.iothub.models.CertificateDescription] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CertificateDescription]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(CertificateListDescription, self).__init__(**kwargs) + self.value = value + + +class CertificateProperties(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 + :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 + :ivar updated: The certificate's last update date and time. + :vartype updated: datetime + :param certificate: The certificate content + :type certificate: str + """ + + _validation = { + 'subject': {'readonly': True}, + 'expiry': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'is_verified': {'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, *, certificate: str=None, **kwargs) -> None: + super(CertificateProperties, self).__init__(**kwargs) + self.subject = None + self.expiry = None + self.thumbprint = None + self.is_verified = None + self.created = None + self.updated = None + self.certificate = certificate + + +class CertificatePropertiesWithNonce(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 + :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 + :ivar updated: The certificate's last update date and time. + :vartype updated: 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) -> None: + 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(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: str=None, **kwargs) -> None: + super(CertificateVerificationDescription, self).__init__(**kwargs) + self.certificate = certificate + + +class CertificateWithNonceDescription(Model): + """The X509 Certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param properties: + :type properties: ~azure.mgmt.iothub.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=None, **kwargs) -> None: + super(CertificateWithNonceDescription, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.name = None + self.etag = None + self.type = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CloudToDeviceProperties(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: timedelta + :param feedback: + :type feedback: ~azure.mgmt.iothub.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: int=None, default_ttl_as_iso8601=None, feedback=None, **kwargs) -> None: + 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 EncryptionPropertiesDescription(Model): + """The encryption properties for the IoT hub. + + :param key_source: The source of the key. + :type key_source: str + :param key_vault_properties: The properties of the KeyVault key. + :type key_vault_properties: + list[~azure.mgmt.iothub.models.KeyVaultKeyProperties] + """ + + _attribute_map = { + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': '[KeyVaultKeyProperties]'}, + } + + def __init__(self, *, key_source: str=None, key_vault_properties=None, **kwargs) -> None: + super(EncryptionPropertiesDescription, self).__init__(**kwargs) + self.key_source = key_source + self.key_vault_properties = key_vault_properties + + +class EndpointHealthData(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.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 + :param last_successful_send_attempt_time: Last time iot hub successfully + sent a message to the endpoint + :type last_successful_send_attempt_time: datetime + :param last_send_attempt_time: Last time iot hub tried to send a message + to the endpoint + :type last_send_attempt_time: 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: str=None, health_status=None, last_known_error: str=None, last_known_error_time=None, last_successful_send_attempt_time=None, last_send_attempt_time=None, **kwargs) -> None: + 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 EnrichmentProperties(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, **kwargs) -> None: + super(EnrichmentProperties, self).__init__(**kwargs) + self.key = key + self.value = value + self.endpoint_names = endpoint_names + + +class ErrorDetails(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) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.http_status_code = None + self.message = None + self.details = None + + +class ErrorDetailsException(HttpOperationError): + """Server responsed with exception of type: 'ErrorDetails'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorDetailsException, self).__init__(deserialize, response, 'ErrorDetails', *args) + + +class EventHubConsumerGroupBodyDescription(Model): + """The EventHub consumer group. + + :param properties: + :type properties: ~azure.mgmt.iothub.models.EventHubConsumerGroupName + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'EventHubConsumerGroupName'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(EventHubConsumerGroupBodyDescription, self).__init__(**kwargs) + self.properties = properties + + +class EventHubConsumerGroupInfo(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, str] + :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': '{str}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(EventHubConsumerGroupInfo, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.name = None + self.type = None + self.etag = None + + +class EventHubConsumerGroupName(Model): + """The EventHub consumer group name. + + :param name: EventHub consumer group name + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(EventHubConsumerGroupName, self).__init__(**kwargs) + self.name = name + + +class EventHubProperties(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: int=None, partition_count: int=None, **kwargs) -> None: + 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(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.models.AuthenticationType + :param identity: Managed identity properties of storage endpoint for + export devices. + :type identity: ~azure.mgmt.iothub.models.ManagedIdentity + """ + + _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'}, + } + + def __init__(self, *, export_blob_container_uri: str, exclude_keys: bool, export_blob_name: str=None, authentication_type=None, identity=None, **kwargs) -> None: + 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 + + +class FailoverInput(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) -> None: + super(FailoverInput, self).__init__(**kwargs) + self.failover_region = failover_region + + +class FallbackRouteProperties(Model): + """The properties of the fallback route. IoT Hub uses these properties when it + routes messages to the fallback endpoint. + + 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: 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 + :ivar source: Required. The source to which the routing rule is to be + applied to. For example, DeviceMessages. Default value: "DeviceMessages" . + :vartype source: str + :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, 'constant': 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'}, + } + + source = "DeviceMessages" + + def __init__(self, *, endpoint_names, is_enabled: bool, name: str=None, condition: str=None, **kwargs) -> None: + super(FallbackRouteProperties, self).__init__(**kwargs) + self.name = name + self.condition = condition + self.endpoint_names = endpoint_names + self.is_enabled = is_enabled + + +class FeedbackProperties(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: 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: 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=None, ttl_as_iso8601=None, max_delivery_count: int=None, **kwargs) -> None: + 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(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. + :type properties: ~azure.mgmt.iothub.models.GroupIdInformationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + '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, **kwargs) -> None: + super(GroupIdInformation, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + + +class GroupIdInformationProperties(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: str=None, required_members=None, required_zone_names=None, **kwargs) -> None: + super(GroupIdInformationProperties, self).__init__(**kwargs) + self.group_id = group_id + self.required_members = required_members + self.required_zone_names = required_zone_names + + +class ImportDevicesRequest(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.models.AuthenticationType + :param identity: Managed identity properties of storage endpoint for + import devices. + :type identity: ~azure.mgmt.iothub.models.ManagedIdentity + """ + + _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'}, + } + + def __init__(self, *, input_blob_container_uri: str, output_blob_container_uri: str, input_blob_name: str=None, output_blob_name: str=None, authentication_type=None, identity=None, **kwargs) -> None: + 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 + + +class IotHubCapacity(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.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': 'IotHubScaleType'}, + } + + def __init__(self, **kwargs) -> None: + super(IotHubCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default = None + self.scale_type = None + + +class Resource(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: 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=None, **kwargs) -> None: + 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: 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.models.IotHubProperties + :param sku: Required. IotHub SKU info + :type sku: ~azure.mgmt.iothub.models.IotHubSkuInfo + :param identity: The managed identities for the IotHub. + :type identity: ~azure.mgmt.iothub.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, tags=None, etag: str=None, properties=None, identity=None, **kwargs) -> None: + super(IotHubDescription, self).__init__(location=location, tags=tags, **kwargs) + self.etag = etag + self.properties = properties + self.sku = sku + self.identity = identity + + +class IotHubLocationDescription(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.models.IotHubReplicaRoleType + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'role': {'key': 'role', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, role=None, **kwargs) -> None: + super(IotHubLocationDescription, self).__init__(**kwargs) + self.location = location + self.role = role + + +class IotHubNameAvailabilityInfo(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.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': 'IotHubNameUnavailabilityReason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, message: str=None, **kwargs) -> None: + super(IotHubNameAvailabilityInfo, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = message + + +class IotHubProperties(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.models.SharedAccessSignatureAuthorizationRule] + :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.models.PublicNetworkAccess + :param ip_filter_rules: The IP filter rules. + :type ip_filter_rules: list[~azure.mgmt.iothub.models.IpFilterRule] + :param network_rule_sets: + :type network_rule_sets: + ~azure.mgmt.iothub.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.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.models.EventHubProperties] + :param routing: + :type routing: ~azure.mgmt.iothub.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.models.StorageEndpointProperties] + :param messaging_endpoints: The messaging endpoint properties for the file + upload notification queue. + :type messaging_endpoints: dict[str, + ~azure.mgmt.iothub.models.MessagingEndpointProperties] + :param enable_file_upload_notifications: If True, file upload + notifications are enabled. + :type enable_file_upload_notifications: bool + :param cloud_to_device: + :type cloud_to_device: ~azure.mgmt.iothub.models.CloudToDeviceProperties + :param comments: IoT hub comments. + :type comments: str + :param device_streams: The device streams properties of iothub. + :type device_streams: + ~azure.mgmt.iothub.models.IotHubPropertiesDeviceStreams + :param features: The capabilities and features enabled for the IoT hub. + Possible values include: 'None', 'DeviceManagement' + :type features: str or ~azure.mgmt.iothub.models.Capabilities + :param encryption: The encryption properties for the IoT hub. + :type encryption: + ~azure.mgmt.iothub.models.EncryptionPropertiesDescription + :ivar locations: Primary and secondary location for iot hub + :vartype locations: + list[~azure.mgmt.iothub.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]'}, + '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'}, + 'device_streams': {'key': 'deviceStreams', 'type': 'IotHubPropertiesDeviceStreams'}, + 'features': {'key': 'features', 'type': 'str'}, + 'encryption': {'key': 'encryption', 'type': 'EncryptionPropertiesDescription'}, + 'locations': {'key': 'locations', 'type': '[IotHubLocationDescription]'}, + } + + def __init__(self, *, authorization_policies=None, public_network_access=None, ip_filter_rules=None, network_rule_sets=None, min_tls_version: str=None, private_endpoint_connections=None, event_hub_endpoints=None, routing=None, storage_endpoints=None, messaging_endpoints=None, enable_file_upload_notifications: bool=None, cloud_to_device=None, comments: str=None, device_streams=None, features=None, encryption=None, **kwargs) -> None: + super(IotHubProperties, self).__init__(**kwargs) + self.authorization_policies = authorization_policies + 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.device_streams = device_streams + self.features = features + self.encryption = encryption + self.locations = None + + +class IotHubPropertiesDeviceStreams(Model): + """The device streams properties of iothub. + + :param streaming_endpoints: List of Device Streams Endpoints. + :type streaming_endpoints: list[str] + """ + + _attribute_map = { + 'streaming_endpoints': {'key': 'streamingEndpoints', 'type': '[str]'}, + } + + def __init__(self, *, streaming_endpoints=None, **kwargs) -> None: + super(IotHubPropertiesDeviceStreams, self).__init__(**kwargs) + self.streaming_endpoints = streaming_endpoints + + +class IotHubQuotaMetricInfo(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) -> None: + super(IotHubQuotaMetricInfo, self).__init__(**kwargs) + self.name = None + self.current_value = None + self.max_value = None + + +class IotHubSkuDescription(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.models.IotHubSkuInfo + :param capacity: Required. IotHub capacity + :type capacity: ~azure.mgmt.iothub.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, capacity, **kwargs) -> None: + super(IotHubSkuDescription, self).__init__(**kwargs) + self.resource_type = None + self.sku = sku + self.capacity = capacity + + +class IotHubSkuInfo(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.models.IotHubSku + :ivar tier: The billing tier for the IoT hub. Possible values include: + 'Free', 'Standard', 'Basic' + :vartype tier: str or ~azure.mgmt.iothub.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': 'IotHubSkuTier'}, + 'capacity': {'key': 'capacity', 'type': 'long'}, + } + + def __init__(self, *, name, capacity: int=None, **kwargs) -> None: + super(IotHubSkuInfo, self).__init__(**kwargs) + self.name = name + self.tier = None + self.capacity = capacity + + +class IpFilterRule(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.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': 'IpFilterActionType'}, + 'ip_mask': {'key': 'ipMask', 'type': 'str'}, + } + + def __init__(self, *, filter_name: str, action, ip_mask: str, **kwargs) -> None: + super(IpFilterRule, self).__init__(**kwargs) + self.filter_name = filter_name + self.action = action + self.ip_mask = ip_mask + + +class JobResponse(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 + :ivar end_time_utc: The time the job stopped processing. + :vartype end_time_utc: 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.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.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': 'JobStatus'}, + 'failure_reason': {'key': 'failureReason', 'type': 'str'}, + 'status_message': {'key': 'statusMessage', 'type': 'str'}, + 'parent_job_id': {'key': 'parentJobId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + 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 KeyVaultKeyProperties(Model): + """The properties of the KeyVault key. + + :param key_identifier: The identifier of the key. + :type key_identifier: str + :param identity: Managed identity properties of KeyVault Key. + :type identity: ~azure.mgmt.iothub.models.ManagedIdentity + """ + + _attribute_map = { + 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + } + + def __init__(self, *, key_identifier: str=None, identity=None, **kwargs) -> None: + super(KeyVaultKeyProperties, self).__init__(**kwargs) + self.key_identifier = key_identifier + self.identity = identity + + +class ManagedIdentity(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: str=None, **kwargs) -> None: + super(ManagedIdentity, self).__init__(**kwargs) + self.user_assigned_identity = user_assigned_identity + + +class MatchedRoute(Model): + """Routes that matched. + + :param properties: Properties of routes that matched + :type properties: ~azure.mgmt.iothub.models.RouteProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'RouteProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(MatchedRoute, self).__init__(**kwargs) + self.properties = properties + + +class MessagingEndpointProperties(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: 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: 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=None, ttl_as_iso8601=None, max_delivery_count: int=None, **kwargs) -> None: + 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(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: str=None, localized_value: str=None, **kwargs) -> None: + super(Name, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value + + +class NetworkRuleSetIpRule(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.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="Allow", **kwargs) -> None: + super(NetworkRuleSetIpRule, self).__init__(**kwargs) + self.filter_name = filter_name + self.action = action + self.ip_mask = ip_mask + + +class NetworkRuleSetProperties(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.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.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, default_action="Deny", **kwargs) -> None: + 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(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.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display + + +class OperationDisplay(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) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationInputs(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) -> None: + super(OperationInputs, self).__init__(**kwargs) + self.name = name + + +class PrivateEndpoint(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) -> None: + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(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. + :type properties: + ~azure.mgmt.iothub.models.PrivateEndpointConnectionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + '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, **kwargs) -> None: + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + + +class PrivateEndpointConnectionProperties(Model): + """The properties of a private endpoint connection. + + All required parameters must be populated in order to send to Azure. + + :param private_endpoint: + :type private_endpoint: ~azure.mgmt.iothub.models.PrivateEndpoint + :param private_link_service_connection_state: Required. + :type private_link_service_connection_state: + ~azure.mgmt.iothub.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, private_endpoint=None, **kwargs) -> None: + super(PrivateEndpointConnectionProperties, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateLinkResources(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.models.GroupIdInformation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GroupIdInformation]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(PrivateLinkResources, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(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.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, description: str, actions_required: str=None, **kwargs) -> None: + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class RegistryStatistics(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) -> None: + super(RegistryStatistics, self).__init__(**kwargs) + self.total_device_count = None + self.enabled_device_count = None + self.disabled_device_count = None + + +class RouteCompilationError(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.models.RouteErrorSeverity + :param location: Location where the route error happened + :type location: ~azure.mgmt.iothub.models.RouteErrorRange + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'RouteErrorRange'}, + } + + def __init__(self, *, message: str=None, severity=None, location=None, **kwargs) -> None: + super(RouteCompilationError, self).__init__(**kwargs) + self.message = message + self.severity = severity + self.location = location + + +class RouteErrorPosition(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: int=None, column: int=None, **kwargs) -> None: + super(RouteErrorPosition, self).__init__(**kwargs) + self.line = line + self.column = column + + +class RouteErrorRange(Model): + """Range of route errors. + + :param start: Start where the route error happened + :type start: ~azure.mgmt.iothub.models.RouteErrorPosition + :param end: End where the route error happened + :type end: ~azure.mgmt.iothub.models.RouteErrorPosition + """ + + _attribute_map = { + 'start': {'key': 'start', 'type': 'RouteErrorPosition'}, + 'end': {'key': 'end', 'type': 'RouteErrorPosition'}, + } + + def __init__(self, *, start=None, end=None, **kwargs) -> None: + super(RouteErrorRange, self).__init__(**kwargs) + self.start = start + self.end = end + + +class RouteProperties(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', 'DigitalTwinChangeEvents', + 'DeviceConnectionStateEvents' + :type source: str or ~azure.mgmt.iothub.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, endpoint_names, is_enabled: bool, condition: str=None, **kwargs) -> None: + 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(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.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.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.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.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=None, service_bus_topics=None, event_hubs=None, storage_containers=None, **kwargs) -> None: + 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(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.models.AuthenticationType + :param identity: Managed identity properties of routing event hub + endpoint. + :type identity: ~azure.mgmt.iothub.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: str=None, connection_string: str=None, endpoint_uri: str=None, entity_path: str=None, authentication_type=None, identity=None, subscription_id: str=None, resource_group: str=None, **kwargs) -> None: + 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(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: str=None, app_properties=None, system_properties=None, **kwargs) -> None: + super(RoutingMessage, self).__init__(**kwargs) + self.body = body + self.app_properties = app_properties + self.system_properties = system_properties + + +class RoutingProperties(Model): + """The routing related properties of the IoT hub. See: + https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging. + + :param endpoints: + :type endpoints: ~azure.mgmt.iothub.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.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.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.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=None, routes=None, fallback_route=None, enrichments=None, **kwargs) -> None: + super(RoutingProperties, self).__init__(**kwargs) + self.endpoints = endpoints + self.routes = routes + self.fallback_route = fallback_route + self.enrichments = enrichments + + +class RoutingServiceBusQueueEndpointProperties(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.models.AuthenticationType + :param identity: Managed identity properties of routing service bus queue + endpoint. + :type identity: ~azure.mgmt.iothub.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: str=None, connection_string: str=None, endpoint_uri: str=None, entity_path: str=None, authentication_type=None, identity=None, subscription_id: str=None, resource_group: str=None, **kwargs) -> None: + 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(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.models.AuthenticationType + :param identity: Managed identity properties of routing service bus topic + endpoint. + :type identity: ~azure.mgmt.iothub.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: str=None, connection_string: str=None, endpoint_uri: str=None, entity_path: str=None, authentication_type=None, identity=None, subscription_id: str=None, resource_group: str=None, **kwargs) -> None: + 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(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.models.AuthenticationType + :param identity: Managed identity properties of routing storage endpoint. + :type identity: ~azure.mgmt.iothub.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.models.enum + """ + + _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: str=None, connection_string: str=None, endpoint_uri: str=None, authentication_type=None, identity=None, subscription_id: str=None, resource_group: str=None, file_name_format: str=None, batch_frequency_in_seconds: int=None, max_chunk_size_in_bytes: int=None, encoding=None, **kwargs) -> None: + 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(Model): + """Twin reference input parameter. This is an optional parameter. + + :param tags: Twin Tags + :type tags: object + :param properties: + :type properties: ~azure.mgmt.iothub.models.RoutingTwinProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': 'object'}, + 'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'}, + } + + def __init__(self, *, tags=None, properties=None, **kwargs) -> None: + super(RoutingTwin, self).__init__(**kwargs) + self.tags = tags + self.properties = properties + + +class RoutingTwinProperties(Model): + """RoutingTwinProperties. + + :param desired: Twin desired properties + :type desired: object + :param reported: Twin desired properties + :type reported: object + """ + + _attribute_map = { + 'desired': {'key': 'desired', 'type': 'object'}, + 'reported': {'key': 'reported', 'type': 'object'}, + } + + def __init__(self, *, desired=None, reported=None, **kwargs) -> None: + super(RoutingTwinProperties, self).__init__(**kwargs) + self.desired = desired + self.reported = reported + + +class SharedAccessSignatureAuthorizationRule(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.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': 'AccessRights'}, + } + + def __init__(self, *, key_name: str, rights, primary_key: str=None, secondary_key: str=None, **kwargs) -> None: + super(SharedAccessSignatureAuthorizationRule, self).__init__(**kwargs) + self.key_name = key_name + self.primary_key = primary_key + self.secondary_key = secondary_key + self.rights = rights + + +class StorageEndpointProperties(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: 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.models.AuthenticationType + :param identity: Managed identity properties of storage endpoint for file + upload. + :type identity: ~azure.mgmt.iothub.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=None, authentication_type=None, identity=None, **kwargs) -> None: + 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(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on an IoT Hub instance. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsResource, self).__init__(**kwargs) + self.tags = tags + + +class TestAllRoutesInput(Model): + """Input for testing all routes. + + :param routing_source: Routing source. Possible values include: 'Invalid', + 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', + 'DeviceJobLifecycleEvents', 'DigitalTwinChangeEvents', + 'DeviceConnectionStateEvents' + :type routing_source: str or ~azure.mgmt.iothub.models.RoutingSource + :param message: Routing message + :type message: ~azure.mgmt.iothub.models.RoutingMessage + :param twin: Routing Twin Reference + :type twin: ~azure.mgmt.iothub.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=None, message=None, twin=None, **kwargs) -> None: + super(TestAllRoutesInput, self).__init__(**kwargs) + self.routing_source = routing_source + self.message = message + self.twin = twin + + +class TestAllRoutesResult(Model): + """Result of testing all routes. + + :param routes: JSON-serialized array of matched routes + :type routes: list[~azure.mgmt.iothub.models.MatchedRoute] + """ + + _attribute_map = { + 'routes': {'key': 'routes', 'type': '[MatchedRoute]'}, + } + + def __init__(self, *, routes=None, **kwargs) -> None: + super(TestAllRoutesResult, self).__init__(**kwargs) + self.routes = routes + + +class TestRouteInput(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.models.RoutingMessage + :param route: Required. Route properties + :type route: ~azure.mgmt.iothub.models.RouteProperties + :param twin: Routing Twin Reference + :type twin: ~azure.mgmt.iothub.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, message=None, twin=None, **kwargs) -> None: + super(TestRouteInput, self).__init__(**kwargs) + self.message = message + self.route = route + self.twin = twin + + +class TestRouteResult(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.models.TestResultStatus + :param details: Detailed result of testing route + :type details: ~azure.mgmt.iothub.models.TestRouteResultDetails + """ + + _attribute_map = { + 'result': {'key': 'result', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'TestRouteResultDetails'}, + } + + def __init__(self, *, result=None, details=None, **kwargs) -> None: + super(TestRouteResult, self).__init__(**kwargs) + self.result = result + self.details = details + + +class TestRouteResultDetails(Model): + """Detailed result of testing a route. + + :param compilation_errors: JSON-serialized list of route compilation + errors + :type compilation_errors: + list[~azure.mgmt.iothub.models.RouteCompilationError] + """ + + _attribute_map = { + 'compilation_errors': {'key': 'compilationErrors', 'type': '[RouteCompilationError]'}, + } + + def __init__(self, *, compilation_errors=None, **kwargs) -> None: + super(TestRouteResultDetails, self).__init__(**kwargs) + self.compilation_errors = compilation_errors + + +class UserSubscriptionQuota(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.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: str=None, type: str=None, unit: str=None, current_value: int=None, limit: int=None, name=None, **kwargs) -> None: + 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(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.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=None, **kwargs) -> None: + super(UserSubscriptionQuotaListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_paged_models.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_paged_models.py new file mode 100644 index 000000000000..9efc5c83f755 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/models/_paged_models.py @@ -0,0 +1,118 @@ +# 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 msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class IotHubDescriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`IotHubDescription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IotHubDescription]'} + } + + def __init__(self, *args, **kwargs): + + super(IotHubDescriptionPaged, self).__init__(*args, **kwargs) +class IotHubSkuDescriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`IotHubSkuDescription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IotHubSkuDescription]'} + } + + def __init__(self, *args, **kwargs): + + super(IotHubSkuDescriptionPaged, self).__init__(*args, **kwargs) +class EventHubConsumerGroupInfoPaged(Paged): + """ + A paging container for iterating over a list of :class:`EventHubConsumerGroupInfo ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EventHubConsumerGroupInfo]'} + } + + def __init__(self, *args, **kwargs): + + super(EventHubConsumerGroupInfoPaged, self).__init__(*args, **kwargs) +class JobResponsePaged(Paged): + """ + A paging container for iterating over a list of :class:`JobResponse ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JobResponse]'} + } + + def __init__(self, *args, **kwargs): + + super(JobResponsePaged, self).__init__(*args, **kwargs) +class IotHubQuotaMetricInfoPaged(Paged): + """ + A paging container for iterating over a list of :class:`IotHubQuotaMetricInfo ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IotHubQuotaMetricInfo]'} + } + + def __init__(self, *args, **kwargs): + + super(IotHubQuotaMetricInfoPaged, self).__init__(*args, **kwargs) +class EndpointHealthDataPaged(Paged): + """ + A paging container for iterating over a list of :class:`EndpointHealthData ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EndpointHealthData]'} + } + + def __init__(self, *args, **kwargs): + + super(EndpointHealthDataPaged, self).__init__(*args, **kwargs) +class SharedAccessSignatureAuthorizationRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`SharedAccessSignatureAuthorizationRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SharedAccessSignatureAuthorizationRule]'} + } + + def __init__(self, *args, **kwargs): + + super(SharedAccessSignatureAuthorizationRulePaged, self).__init__(*args, **kwargs) diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/__init__.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/__init__.py new file mode 100644 index 000000000000..8d256fde0f59 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/__init__.py @@ -0,0 +1,28 @@ +# 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_03_01_preview/operations/_certificates_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_certificates_operations.py new file mode 100644 index 000000000000..c144bd05b1ce --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_certificates_operations.py @@ -0,0 +1,461 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class CertificatesOperations(object): + """CertificatesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def list_by_iot_hub( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateListDescription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.CertificateListDescription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.list_by_iot_hub.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CertificateListDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_iot_hub.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates'} + + def get( + self, resource_group_name, resource_name, certificate_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateDescription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.CertificateDescription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CertificateDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}'} + + def create_or_update( + self, resource_group_name, resource_name, certificate_name, if_match=None, properties=None, custom_headers=None, raw=False, **operation_config): + """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 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 + :param properties: + :type properties: ~azure.mgmt.iothub.models.CertificateProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateDescription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.CertificateDescription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + certificate_description = models.CertificateDescription(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(certificate_description, 'CertificateDescription') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CertificateDescription', response) + if response.status_code == 201: + deserialized = self._deserialize('CertificateDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}'} + + def delete( + self, resource_group_name, resource_name, certificate_name, if_match, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.delete.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}'} + + def generate_verification_code( + self, resource_group_name, resource_name, certificate_name, if_match, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateWithNonceDescription or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.iothub.models.CertificateWithNonceDescription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.generate_verification_code.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CertificateWithNonceDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + generate_verification_code.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/generateVerificationCode'} + + def verify( + self, resource_group_name, resource_name, certificate_name, if_match, certificate=None, custom_headers=None, raw=False, **operation_config): + """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: base-64 representation of X509 certificate .cer + file or just .pem file content. + :type certificate: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateDescription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.CertificateDescription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + certificate_verification_body = models.CertificateVerificationDescription(certificate=certificate) + + # Construct URL + url = self.verify.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(certificate_verification_body, 'CertificateVerificationDescription') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CertificateDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + verify.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify'} diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_iot_hub_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_iot_hub_operations.py new file mode 100644 index 000000000000..cb8a8f1db82c --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_iot_hub_operations.py @@ -0,0 +1,132 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class IotHubOperations(object): + """IotHubOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + + def _manual_failover_initial( + self, iot_hub_name, resource_group_name, failover_region, custom_headers=None, raw=False, **operation_config): + failover_input = models.FailoverInput(failover_region=failover_region) + + # Construct URL + url = self.manual_failover.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(failover_input, 'FailoverInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def manual_failover( + self, iot_hub_name, resource_group_name, failover_region, custom_headers=None, raw=False, polling=True, **operation_config): + """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_region: Region the hub will be failed over to + :type failover_region: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._manual_failover_initial( + iot_hub_name=iot_hub_name, + resource_group_name=resource_group_name, + failover_region=failover_region, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + manual_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover'} diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_iot_hub_resource_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_iot_hub_resource_operations.py new file mode 100644 index 000000000000..5adfee4fb120 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_iot_hub_resource_operations.py @@ -0,0 +1,1780 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class IotHubResourceOperations(object): + """IotHubResourceOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IotHubDescription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.IotHubDescription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IotHubDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} + + + def _create_or_update_initial( + self, resource_group_name, resource_name, iot_hub_description, if_match=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(iot_hub_description, 'IotHubDescription') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IotHubDescription', response) + if response.status_code == 201: + deserialized = self._deserialize('IotHubDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, iot_hub_description, if_match=None, custom_headers=None, raw=False, polling=True, **operation_config): + """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. + + :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.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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns IotHubDescription or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.iothub.models.IotHubDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.iothub.models.IotHubDescription]] + :raises: + :class:`ErrorDetailsException` + """ + 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, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('IotHubDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} + + + def _update_initial( + self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): + iot_hub_tags = models.TagsResource(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(iot_hub_tags, 'TagsResource') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IotHubDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """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 tags: Resource tags + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns IotHubDescription or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.iothub.models.IotHubDescription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.iothub.models.IotHubDescription]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('IotHubDescription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204, 404]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IotHubDescription', response) + if response.status_code == 202: + deserialized = self._deserialize('IotHubDescription', response) + if response.status_code == 404: + deserialized = self._deserialize('ErrorDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns object or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('object', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Get all the IoT hubs in a subscription. + + Get all the IoT hubs in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IotHubDescription + :rtype: + ~azure.mgmt.iothub.models.IotHubDescriptionPaged[~azure.mgmt.iothub.models.IotHubDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.IotHubDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/IotHubs'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IotHubDescription + :rtype: + ~azure.mgmt.iothub.models.IotHubDescriptionPaged[~azure.mgmt.iothub.models.IotHubDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.IotHubDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs'} + + def get_stats( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RegistryStatistics or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.RegistryStatistics or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get_stats.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RegistryStatistics', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats'} + + def get_valid_skus( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IotHubSkuDescription + :rtype: + ~azure.mgmt.iothub.models.IotHubSkuDescriptionPaged[~azure.mgmt.iothub.models.IotHubSkuDescription] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.get_valid_skus.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.IotHubSkuDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + get_valid_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/skus'} + + def list_event_hub_consumer_groups( + self, resource_group_name, resource_name, event_hub_endpoint_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventHubConsumerGroupInfo + :rtype: + ~azure.mgmt.iothub.models.EventHubConsumerGroupInfoPaged[~azure.mgmt.iothub.models.EventHubConsumerGroupInfo] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_event_hub_consumer_groups.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.EventHubConsumerGroupInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_event_hub_consumer_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups'} + + def get_event_hub_consumer_group( + self, resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EventHubConsumerGroupInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.EventHubConsumerGroupInfo or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get_event_hub_consumer_group.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EventHubConsumerGroupInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_event_hub_consumer_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'} + + def create_event_hub_consumer_group( + self, resource_group_name, resource_name, event_hub_endpoint_name, name, properties=None, custom_headers=None, raw=False, **operation_config): + """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 properties: + :type properties: ~azure.mgmt.iothub.models.EventHubConsumerGroupName + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EventHubConsumerGroupInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.EventHubConsumerGroupInfo or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + consumer_group_body = models.EventHubConsumerGroupBodyDescription(properties=properties) + + # Construct URL + url = self.create_event_hub_consumer_group.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(consumer_group_body, 'EventHubConsumerGroupBodyDescription') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EventHubConsumerGroupInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_event_hub_consumer_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'} + + def delete_event_hub_consumer_group( + self, resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.delete_event_hub_consumer_group.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_event_hub_consumer_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'} + + def list_jobs( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobResponse + :rtype: + ~azure.mgmt.iothub.models.JobResponsePaged[~azure.mgmt.iothub.models.JobResponse] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_jobs.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.JobResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs'} + + def get_job( + self, resource_group_name, resource_name, job_id, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.JobResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get_job.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs/{jobId}'} + + def get_quota_metrics( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IotHubQuotaMetricInfo + :rtype: + ~azure.mgmt.iothub.models.IotHubQuotaMetricInfoPaged[~azure.mgmt.iothub.models.IotHubQuotaMetricInfo] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.get_quota_metrics.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.IotHubQuotaMetricInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + get_quota_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics'} + + def get_endpoint_health( + self, resource_group_name, iot_hub_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EndpointHealthData + :rtype: + ~azure.mgmt.iothub.models.EndpointHealthDataPaged[~azure.mgmt.iothub.models.EndpointHealthData] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.get_endpoint_health.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.EndpointHealthDataPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + get_endpoint_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routingEndpointsHealth'} + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Check if an IoT hub name is available. + + Check if an IoT hub name is available. + + :param name: The name of the IoT hub to check. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IotHubNameAvailabilityInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.IotHubNameAvailabilityInfo or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + operation_inputs = models.OperationInputs(name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(operation_inputs, 'OperationInputs') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IotHubNameAvailabilityInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability'} + + def test_all_routes( + self, input, iot_hub_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Test all routes. + + Test all routes configured in this Iot Hub. + + :param input: Input for testing all routes + :type input: ~azure.mgmt.iothub.models.TestAllRoutesInput + :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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TestAllRoutesResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.TestAllRoutesResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.test_all_routes.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(input, 'TestAllRoutesInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TestAllRoutesResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + test_all_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall'} + + def test_route( + self, input, iot_hub_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Test the new route. + + Test the new route for this Iot Hub. + + :param input: Route that needs to be tested + :type input: ~azure.mgmt.iothub.models.TestRouteInput + :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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TestRouteResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.TestRouteResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.test_route.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(input, 'TestRouteInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TestRouteResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + test_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testnew'} + + def list_keys( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + SharedAccessSignatureAuthorizationRule + :rtype: + ~azure.mgmt.iothub.models.SharedAccessSignatureAuthorizationRulePaged[~azure.mgmt.iothub.models.SharedAccessSignatureAuthorizationRule] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_keys.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SharedAccessSignatureAuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys'} + + def get_keys_for_key_name( + self, resource_group_name, resource_name, key_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SharedAccessSignatureAuthorizationRule or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.iothub.models.SharedAccessSignatureAuthorizationRule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get_keys_for_key_name.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SharedAccessSignatureAuthorizationRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_keys_for_key_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys'} + + def export_devices( + self, resource_group_name, resource_name, export_devices_parameters, custom_headers=None, raw=False, **operation_config): + """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.models.ExportDevicesRequest + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.JobResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.export_devices.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(export_devices_parameters, 'ExportDevicesRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_devices.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices'} + + def import_devices( + self, resource_group_name, resource_name, import_devices_parameters, custom_headers=None, raw=False, **operation_config): + """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.models.ImportDevicesRequest + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.JobResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.import_devices.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(import_devices_parameters, 'ImportDevicesRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + import_devices.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices'} diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_operations.py new file mode 100644 index 000000000000..d2e0b8f8f46e --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_operations.py @@ -0,0 +1,100 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available IoT Hub REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.iothub.models.OperationPaged[~azure.mgmt.iothub.models.Operation] + :raises: + :class:`ErrorDetailsException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Devices/operations'} diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..659685b57fc3 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,388 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def list( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.iothub.models.PrivateEndpointConnection] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[PrivateEndpointConnection]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections'} + + def get( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.PrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _update_initial( + self, resource_group_name, resource_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, **operation_config): + private_endpoint_connection = models.PrivateEndpointConnection(properties=properties) + + # Construct URL + url = self.update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(private_endpoint_connection, 'PrivateEndpointConnection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, resource_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, polling=True, **operation_config): + """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 properties: + :type properties: + ~azure.mgmt.iothub.models.PrivateEndpointConnectionProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateEndpointConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.iothub.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.iothub.models.PrivateEndpointConnection]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + if response.status_code == 202: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, resource_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateEndpointConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.iothub.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.iothub.models.PrivateEndpointConnection]] + :raises: + :class:`ErrorDetailsException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_private_link_resources_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..d949f6524f6d --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_private_link_resources_operations.py @@ -0,0 +1,168 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def list( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateLinkResources or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.PrivateLinkResources or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResources', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources'} + + def get( + self, resource_group_name, resource_name, group_id, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GroupIdInformation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.GroupIdInformation or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GroupIdInformation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources/{groupId}'} diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_resource_provider_common_operations.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_resource_provider_common_operations.py new file mode 100644 index 000000000000..3fa3f1b86902 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/operations/_resource_provider_common_operations.py @@ -0,0 +1,96 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ResourceProviderCommonOperations(object): + """ResourceProviderCommonOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def get_subscription_quota( + self, custom_headers=None, raw=False, **operation_config): + """Get the number of iot hubs in the subscription. + + Get the number of free and paid iot hubs in the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: UserSubscriptionQuotaListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.iothub.models.UserSubscriptionQuotaListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get_subscription_quota.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('UserSubscriptionQuotaListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_subscription_quota.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/usages'} diff --git a/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/version.py b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/version.py new file mode 100644 index 000000000000..0a72a39badd5 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_01_preview/version.py @@ -0,0 +1,13 @@ +# 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 = "0.8.2" +