From e72cb1d020faeb2ea7504b5cc9ab78eeeecd391b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 2 Apr 2018 09:15:58 -0700 Subject: [PATCH] Generated from 3bbd0c484bc34bd20352ebe200384d3b3d73c035 (#2319) Add package-2018-01 to Go SDK build --- .../azure/mgmt/iothub/iot_hub_client.py | 6 +- .../azure/mgmt/iothub/models/__init__.py | 129 +++-- .../models/certificate_body_description.py | 5 +- .../certificate_body_description_py3.py | 29 + .../iothub/models/certificate_description.py | 8 +- .../models/certificate_description_py3.py | 54 ++ .../models/certificate_list_description.py | 8 +- .../certificate_list_description_py3.py | 28 + .../iothub/models/certificate_properties.py | 3 +- .../models/certificate_properties_py3.py | 60 ++ .../certificate_properties_with_nonce.py | 3 +- .../certificate_properties_with_nonce_py3.py | 67 +++ .../certificate_verification_description.py | 5 +- ...ertificate_verification_description_py3.py | 29 + .../certificate_with_nonce_description.py | 8 +- .../certificate_with_nonce_description_py3.py | 54 ++ .../models/cloud_to_device_properties.py | 12 +- .../models/cloud_to_device_properties_py3.py | 44 ++ .../azure/mgmt/iothub/models/error_details.py | 11 +- .../mgmt/iothub/models/error_details_py3.py | 63 ++ .../models/event_hub_consumer_group_info.py | 41 +- ...=> event_hub_consumer_group_info_paged.py} | 8 +- .../event_hub_consumer_group_info_py3.py | 54 ++ .../iothub/models/event_hub_properties.py | 9 +- .../iothub/models/event_hub_properties_py3.py | 59 ++ .../iothub/models/export_devices_request.py | 19 +- .../models/export_devices_request_py3.py | 41 ++ .../models/fallback_route_properties.py | 31 +- .../models/fallback_route_properties_py3.py | 66 +++ .../mgmt/iothub/models/feedback_properties.py | 9 +- .../iothub/models/feedback_properties_py3.py | 46 ++ .../iothub/models/import_devices_request.py | 17 +- .../models/import_devices_request_py3.py | 40 ++ .../mgmt/iothub/models/iot_hub_capacity.py | 6 +- .../iothub/models/iot_hub_capacity_py3.py | 51 ++ .../iothub/models/iot_hub_client_enums.py | 22 +- .../mgmt/iothub/models/iot_hub_description.py | 35 +- .../iothub/models/iot_hub_description_py3.py | 66 +++ .../models/iot_hub_name_availability_info.py | 9 +- .../iot_hub_name_availability_info_py3.py | 47 ++ .../mgmt/iothub/models/iot_hub_properties.py | 59 +- .../iothub/models/iot_hub_properties_py3.py | 106 ++++ .../models/iot_hub_quota_metric_info.py | 9 +- .../models/iot_hub_quota_metric_info_py3.py | 45 ++ .../iothub/models/iot_hub_sku_description.py | 18 +- .../models/iot_hub_sku_description_py3.py | 47 ++ .../mgmt/iothub/models/iot_hub_sku_info.py | 19 +- .../iothub/models/iot_hub_sku_info_py3.py | 49 ++ .../mgmt/iothub/models/ip_filter_rule.py | 24 +- .../mgmt/iothub/models/ip_filter_rule_py3.py | 46 ++ .../azure/mgmt/iothub/models/job_response.py | 8 +- .../mgmt/iothub/models/job_response_py3.py | 75 +++ .../models/messaging_endpoint_properties.py | 9 +- .../messaging_endpoint_properties_py3.py | 45 ++ .../azure/mgmt/iothub/models/operation.py | 8 +- .../mgmt/iothub/models/operation_display.py | 3 +- .../iothub/models/operation_display_py3.py | 45 ++ .../mgmt/iothub/models/operation_inputs.py | 11 +- .../iothub/models/operation_inputs_py3.py | 34 ++ .../azure/mgmt/iothub/models/operation_py3.py | 40 ++ .../operations_monitoring_properties.py | 8 +- .../operations_monitoring_properties_py3.py | 32 + .../mgmt/iothub/models/registry_statistics.py | 3 +- .../iothub/models/registry_statistics_py3.py | 48 ++ .../azure/mgmt/iothub/models/resource.py | 13 +- .../azure/mgmt/iothub/models/resource_py3.py | 56 ++ .../mgmt/iothub/models/route_properties.py | 37 +- .../iothub/models/route_properties_py3.py | 63 ++ .../mgmt/iothub/models/routing_endpoints.py | 30 +- .../iothub/models/routing_endpoints_py3.py | 52 ++ .../models/routing_event_hub_properties.py | 26 +- .../routing_event_hub_properties_py3.py | 54 ++ .../mgmt/iothub/models/routing_properties.py | 18 +- .../iothub/models/routing_properties_py3.py | 44 ++ ...g_service_bus_queue_endpoint_properties.py | 29 +- ...rvice_bus_queue_endpoint_properties_py3.py | 55 ++ ...g_service_bus_topic_endpoint_properties.py | 29 +- ...rvice_bus_topic_endpoint_properties_py3.py | 55 ++ .../routing_storage_container_properties.py | 40 +- ...outing_storage_container_properties_py3.py | 85 +++ ...red_access_signature_authorization_rule.py | 22 +- ...access_signature_authorization_rule_py3.py | 56 ++ .../models/storage_endpoint_properties.py | 21 +- .../models/storage_endpoint_properties_py3.py | 48 ++ .../azure/mgmt/iothub/models/tags_resource.py | 29 + .../mgmt/iothub/models/tags_resource_py3.py | 29 + .../operations/certificates_operations.py | 100 ++-- .../operations/iot_hub_resource_operations.py | 546 +++++++++++------- .../mgmt/iothub/operations/operations.py | 20 +- .../azure/mgmt/iothub/version.py | 2 +- 90 files changed, 2995 insertions(+), 657 deletions(-) create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_body_description_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_description_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_list_description_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties_with_nonce_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_verification_description_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_with_nonce_description_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/cloud_to_device_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/error_details_py3.py rename azure-mgmt-iothub/azure/mgmt/iothub/models/{str_paged.py => event_hub_consumer_group_info_paged.py} (65%) create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_consumer_group_info_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/export_devices_request_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/fallback_route_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/feedback_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/import_devices_request_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_capacity_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_description_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_name_availability_info_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_quota_metric_info_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_description_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_info_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/ip_filter_rule_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/job_response_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/messaging_endpoint_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/operation_display_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/operation_inputs_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/operation_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/operations_monitoring_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/registry_statistics_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/resource_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/route_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/routing_endpoints_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/routing_event_hub_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/routing_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_queue_endpoint_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_topic_endpoint_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/shared_access_signature_authorization_rule_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties_py3.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/tags_resource.py create mode 100644 azure-mgmt-iothub/azure/mgmt/iothub/models/tags_resource_py3.py diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/iot_hub_client.py b/azure-mgmt-iothub/azure/mgmt/iothub/iot_hub_client.py index 504395c459a4..f071e3e297b0 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/iot_hub_client.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/iot_hub_client.py @@ -39,14 +39,12 @@ def __init__( raise ValueError("Parameter 'credentials' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not isinstance(subscription_id, str): - raise TypeError("Parameter 'subscription_id' must be str.") if not base_url: base_url = 'https://management.azure.com' super(IotHubClientConfiguration, self).__init__(base_url) - self.add_user_agent('iothubclient/{}'.format(VERSION)) + self.add_user_agent('azure-mgmt-iothub/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials @@ -81,7 +79,7 @@ def __init__( self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2017-07-01' + self.api_version = '2018-01-22' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/__init__.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/__init__.py index c0dc0016be99..125031202c9f 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/__init__.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/__init__.py @@ -9,50 +9,94 @@ # regenerated. # -------------------------------------------------------------------------- -from .certificate_verification_description import CertificateVerificationDescription -from .certificate_body_description import CertificateBodyDescription -from .certificate_properties import CertificateProperties -from .certificate_description import CertificateDescription -from .certificate_list_description import CertificateListDescription -from .certificate_properties_with_nonce import CertificatePropertiesWithNonce -from .certificate_with_nonce_description import CertificateWithNonceDescription -from .shared_access_signature_authorization_rule import SharedAccessSignatureAuthorizationRule -from .ip_filter_rule import IpFilterRule -from .event_hub_properties import EventHubProperties -from .routing_service_bus_queue_endpoint_properties import RoutingServiceBusQueueEndpointProperties -from .routing_service_bus_topic_endpoint_properties import RoutingServiceBusTopicEndpointProperties -from .routing_event_hub_properties import RoutingEventHubProperties -from .routing_storage_container_properties import RoutingStorageContainerProperties -from .routing_endpoints import RoutingEndpoints -from .route_properties import RouteProperties -from .fallback_route_properties import FallbackRouteProperties -from .routing_properties import RoutingProperties -from .storage_endpoint_properties import StorageEndpointProperties -from .messaging_endpoint_properties import MessagingEndpointProperties -from .feedback_properties import FeedbackProperties -from .cloud_to_device_properties import CloudToDeviceProperties -from .operations_monitoring_properties import OperationsMonitoringProperties -from .iot_hub_properties import IotHubProperties -from .iot_hub_sku_info import IotHubSkuInfo -from .iot_hub_description import IotHubDescription -from .resource import Resource -from .operation_display import OperationDisplay -from .operation import Operation -from .error_details import ErrorDetails, ErrorDetailsException -from .iot_hub_quota_metric_info import IotHubQuotaMetricInfo -from .registry_statistics import RegistryStatistics -from .job_response import JobResponse -from .iot_hub_capacity import IotHubCapacity -from .iot_hub_sku_description import IotHubSkuDescription -from .event_hub_consumer_group_info import EventHubConsumerGroupInfo -from .operation_inputs import OperationInputs -from .iot_hub_name_availability_info import IotHubNameAvailabilityInfo -from .export_devices_request import ExportDevicesRequest -from .import_devices_request import ImportDevicesRequest +try: + from .certificate_verification_description_py3 import CertificateVerificationDescription + from .certificate_body_description_py3 import CertificateBodyDescription + from .certificate_properties_py3 import CertificateProperties + from .certificate_description_py3 import CertificateDescription + from .certificate_list_description_py3 import CertificateListDescription + from .certificate_properties_with_nonce_py3 import CertificatePropertiesWithNonce + from .certificate_with_nonce_description_py3 import CertificateWithNonceDescription + from .shared_access_signature_authorization_rule_py3 import SharedAccessSignatureAuthorizationRule + from .ip_filter_rule_py3 import IpFilterRule + from .event_hub_properties_py3 import EventHubProperties + from .routing_service_bus_queue_endpoint_properties_py3 import RoutingServiceBusQueueEndpointProperties + from .routing_service_bus_topic_endpoint_properties_py3 import RoutingServiceBusTopicEndpointProperties + from .routing_event_hub_properties_py3 import RoutingEventHubProperties + from .routing_storage_container_properties_py3 import RoutingStorageContainerProperties + from .routing_endpoints_py3 import RoutingEndpoints + from .route_properties_py3 import RouteProperties + from .fallback_route_properties_py3 import FallbackRouteProperties + from .routing_properties_py3 import RoutingProperties + from .storage_endpoint_properties_py3 import StorageEndpointProperties + from .messaging_endpoint_properties_py3 import MessagingEndpointProperties + from .feedback_properties_py3 import FeedbackProperties + from .cloud_to_device_properties_py3 import CloudToDeviceProperties + from .operations_monitoring_properties_py3 import OperationsMonitoringProperties + from .iot_hub_properties_py3 import IotHubProperties + from .iot_hub_sku_info_py3 import IotHubSkuInfo + from .iot_hub_description_py3 import IotHubDescription + from .resource_py3 import Resource + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .error_details_py3 import ErrorDetails, ErrorDetailsException + from .iot_hub_quota_metric_info_py3 import IotHubQuotaMetricInfo + from .registry_statistics_py3 import RegistryStatistics + from .job_response_py3 import JobResponse + from .iot_hub_capacity_py3 import IotHubCapacity + from .iot_hub_sku_description_py3 import IotHubSkuDescription + from .tags_resource_py3 import TagsResource + from .event_hub_consumer_group_info_py3 import EventHubConsumerGroupInfo + from .operation_inputs_py3 import OperationInputs + from .iot_hub_name_availability_info_py3 import IotHubNameAvailabilityInfo + from .export_devices_request_py3 import ExportDevicesRequest + from .import_devices_request_py3 import ImportDevicesRequest +except (SyntaxError, ImportError): + from .certificate_verification_description import CertificateVerificationDescription + from .certificate_body_description import CertificateBodyDescription + from .certificate_properties import CertificateProperties + from .certificate_description import CertificateDescription + from .certificate_list_description import CertificateListDescription + from .certificate_properties_with_nonce import CertificatePropertiesWithNonce + from .certificate_with_nonce_description import CertificateWithNonceDescription + from .shared_access_signature_authorization_rule import SharedAccessSignatureAuthorizationRule + from .ip_filter_rule import IpFilterRule + from .event_hub_properties import EventHubProperties + from .routing_service_bus_queue_endpoint_properties import RoutingServiceBusQueueEndpointProperties + from .routing_service_bus_topic_endpoint_properties import RoutingServiceBusTopicEndpointProperties + from .routing_event_hub_properties import RoutingEventHubProperties + from .routing_storage_container_properties import RoutingStorageContainerProperties + from .routing_endpoints import RoutingEndpoints + from .route_properties import RouteProperties + from .fallback_route_properties import FallbackRouteProperties + from .routing_properties import RoutingProperties + from .storage_endpoint_properties import StorageEndpointProperties + from .messaging_endpoint_properties import MessagingEndpointProperties + from .feedback_properties import FeedbackProperties + from .cloud_to_device_properties import CloudToDeviceProperties + from .operations_monitoring_properties import OperationsMonitoringProperties + from .iot_hub_properties import IotHubProperties + from .iot_hub_sku_info import IotHubSkuInfo + from .iot_hub_description import IotHubDescription + from .resource import Resource + from .operation_display import OperationDisplay + from .operation import Operation + from .error_details import ErrorDetails, ErrorDetailsException + from .iot_hub_quota_metric_info import IotHubQuotaMetricInfo + from .registry_statistics import RegistryStatistics + from .job_response import JobResponse + from .iot_hub_capacity import IotHubCapacity + from .iot_hub_sku_description import IotHubSkuDescription + from .tags_resource import TagsResource + from .event_hub_consumer_group_info import EventHubConsumerGroupInfo + from .operation_inputs import OperationInputs + from .iot_hub_name_availability_info import IotHubNameAvailabilityInfo + from .export_devices_request import ExportDevicesRequest + from .import_devices_request import ImportDevicesRequest from .operation_paged import OperationPaged from .iot_hub_description_paged import IotHubDescriptionPaged from .iot_hub_sku_description_paged import IotHubSkuDescriptionPaged -from .str_paged import StrPaged +from .event_hub_consumer_group_info_paged import EventHubConsumerGroupInfoPaged from .job_response_paged import JobResponsePaged from .iot_hub_quota_metric_info_paged import IotHubQuotaMetricInfoPaged from .shared_access_signature_authorization_rule_paged import SharedAccessSignatureAuthorizationRulePaged @@ -106,6 +150,7 @@ 'JobResponse', 'IotHubCapacity', 'IotHubSkuDescription', + 'TagsResource', 'EventHubConsumerGroupInfo', 'OperationInputs', 'IotHubNameAvailabilityInfo', @@ -114,7 +159,7 @@ 'OperationPaged', 'IotHubDescriptionPaged', 'IotHubSkuDescriptionPaged', - 'StrPaged', + 'EventHubConsumerGroupInfoPaged', 'JobResponsePaged', 'IotHubQuotaMetricInfoPaged', 'SharedAccessSignatureAuthorizationRulePaged', diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_body_description.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_body_description.py index 9cc66297d76b..5d5a6544d3dd 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_body_description.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_body_description.py @@ -24,5 +24,6 @@ class CertificateBodyDescription(Model): 'certificate': {'key': 'certificate', 'type': 'str'}, } - def __init__(self, certificate=None): - self.certificate = certificate + def __init__(self, **kwargs): + super(CertificateBodyDescription, self).__init__(**kwargs) + self.certificate = kwargs.get('certificate', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_body_description_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_body_description_py3.py new file mode 100644 index 000000000000..be4943779261 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_body_description_py3.py @@ -0,0 +1,29 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_description.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_description.py index 37f0f7360919..479940e33fd2 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_description.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_description.py @@ -19,8 +19,7 @@ class CertificateDescription(Model): sending a request. :param properties: - :type properties: :class:`CertificateProperties - ` + :type properties: ~azure.mgmt.iothub.models.CertificateProperties :ivar id: The resource identifier. :vartype id: str :ivar name: The name of the certificate. @@ -46,8 +45,9 @@ class CertificateDescription(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, properties=None): - self.properties = properties + def __init__(self, **kwargs): + super(CertificateDescription, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) self.id = None self.name = None self.etag = None diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_description_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_description_py3.py new file mode 100644 index 000000000000..2c96f61a5857 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_description_py3.py @@ -0,0 +1,54 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_list_description.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_list_description.py index d46a57f3336d..c52bf8439ba9 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_list_description.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_list_description.py @@ -16,13 +16,13 @@ class CertificateListDescription(Model): """The JSON-serialized array of Certificate objects. :param value: The array of Certificate objects. - :type value: list of :class:`CertificateDescription - ` + :type value: list[~azure.mgmt.iothub.models.CertificateDescription] """ _attribute_map = { 'value': {'key': 'value', 'type': '[CertificateDescription]'}, } - def __init__(self, value=None): - self.value = value + def __init__(self, **kwargs): + super(CertificateListDescription, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_list_description_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_list_description_py3.py new file mode 100644 index 000000000000..9047516be862 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_list_description_py3.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 msrest.serialization import Model + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties.py index cc209ab05508..d91afb9c0adb 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties.py @@ -50,7 +50,8 @@ class CertificateProperties(Model): 'updated': {'key': 'updated', 'type': 'rfc-1123'}, } - def __init__(self): + def __init__(self, **kwargs): + super(CertificateProperties, self).__init__(**kwargs) self.subject = None self.expiry = None self.thumbprint = None diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties_py3.py new file mode 100644 index 000000000000..334b0791a801 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties_py3.py @@ -0,0 +1,60 @@ +# 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 + + +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 + """ + + _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'}, + } + + def __init__(self, **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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties_with_nonce.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties_with_nonce.py index d1a196667e40..31d81c0e18b3 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties_with_nonce.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties_with_nonce.py @@ -56,7 +56,8 @@ class CertificatePropertiesWithNonce(Model): 'verification_code': {'key': 'verificationCode', 'type': 'str'}, } - def __init__(self): + def __init__(self, **kwargs): + super(CertificatePropertiesWithNonce, self).__init__(**kwargs) self.subject = None self.expiry = None self.thumbprint = None diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties_with_nonce_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties_with_nonce_py3.py new file mode 100644 index 000000000000..384b1533b1fd --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties_with_nonce_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +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 + """ + + _validation = { + 'subject': {'readonly': True}, + 'expiry': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'is_verified': {'readonly': True}, + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'verification_code': {'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'}, + } + + 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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_verification_description.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_verification_description.py index 7b7ee226536e..58611d8cf66d 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_verification_description.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_verification_description.py @@ -24,5 +24,6 @@ class CertificateVerificationDescription(Model): 'certificate': {'key': 'certificate', 'type': 'str'}, } - def __init__(self, certificate=None): - self.certificate = certificate + def __init__(self, **kwargs): + super(CertificateVerificationDescription, self).__init__(**kwargs) + self.certificate = kwargs.get('certificate', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_verification_description_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_verification_description_py3.py new file mode 100644 index 000000000000..7d243745f243 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_verification_description_py3.py @@ -0,0 +1,29 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_with_nonce_description.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_with_nonce_description.py index f7a2e9277fa7..67ccd1c69340 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_with_nonce_description.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_with_nonce_description.py @@ -19,8 +19,7 @@ class CertificateWithNonceDescription(Model): sending a request. :param properties: - :type properties: :class:`CertificatePropertiesWithNonce - ` + :type properties: ~azure.mgmt.iothub.models.CertificatePropertiesWithNonce :ivar id: The resource identifier. :vartype id: str :ivar name: The name of the certificate. @@ -46,8 +45,9 @@ class CertificateWithNonceDescription(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, properties=None): - self.properties = properties + def __init__(self, **kwargs): + super(CertificateWithNonceDescription, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) self.id = None self.name = None self.etag = None diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_with_nonce_description_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_with_nonce_description_py3.py new file mode 100644 index 000000000000..aeec07b9c021 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_with_nonce_description_py3.py @@ -0,0 +1,54 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/cloud_to_device_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/cloud_to_device_properties.py index ad326589da4a..9b2600c2cd7f 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/cloud_to_device_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/cloud_to_device_properties.py @@ -24,8 +24,7 @@ class CloudToDeviceProperties(Model): 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: :class:`FeedbackProperties - ` + :type feedback: ~azure.mgmt.iothub.models.FeedbackProperties """ _validation = { @@ -38,7 +37,8 @@ class CloudToDeviceProperties(Model): 'feedback': {'key': 'feedback', 'type': 'FeedbackProperties'}, } - def __init__(self, max_delivery_count=None, default_ttl_as_iso8601=None, feedback=None): - self.max_delivery_count = max_delivery_count - self.default_ttl_as_iso8601 = default_ttl_as_iso8601 - self.feedback = feedback + 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/cloud_to_device_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/cloud_to_device_properties_py3.py new file mode 100644 index 000000000000..60ee732c9492 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/cloud_to_device_properties_py3.py @@ -0,0 +1,44 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/error_details.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/error_details.py index d4bd7d95c6c1..77a408028562 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/error_details.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/error_details.py @@ -37,13 +37,14 @@ class ErrorDetails(Model): } _attribute_map = { - 'code': {'key': 'Code', 'type': 'str'}, - 'http_status_code': {'key': 'HttpStatusCode', 'type': 'str'}, - 'message': {'key': 'Message', 'type': 'str'}, - 'details': {'key': 'Details', 'type': 'str'}, + '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): + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) self.code = None self.http_status_code = None self.message = None diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/error_details_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/error_details_py3.py new file mode 100644 index 000000000000..a78684fab905 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/error_details_py3.py @@ -0,0 +1,63 @@ +# 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 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_consumer_group_info.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_consumer_group_info.py index 5ad8dc4e576f..b290422ca982 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_consumer_group_info.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_consumer_group_info.py @@ -15,21 +15,40 @@ class EventHubConsumerGroupInfo(Model): """The properties of the EventHubConsumerGroupInfo object. - :param tags: The tags. - :type tags: dict - :param id: The Event Hub-compatible consumer group identifier. - :type id: str - :param name: The Event Hub-compatible consumer group name. - :type name: str + 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 = { - 'tags': {'key': 'tags', 'type': '{str}'}, + '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, tags=None, id=None, name=None): - self.tags = tags - self.id = id - self.name = name + 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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/str_paged.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_consumer_group_info_paged.py similarity index 65% rename from azure-mgmt-iothub/azure/mgmt/iothub/models/str_paged.py rename to azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_consumer_group_info_paged.py index 32b5aa1f28af..260e39bc3032 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/str_paged.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_consumer_group_info_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class StrPaged(Paged): +class EventHubConsumerGroupInfoPaged(Paged): """ - A paging container for iterating over a list of str object + 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': '[str]'} + 'current_page': {'key': 'value', 'type': '[EventHubConsumerGroupInfo]'} } def __init__(self, *args, **kwargs): - super(StrPaged, self).__init__(*args, **kwargs) + super(EventHubConsumerGroupInfoPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_consumer_group_info_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_consumer_group_info_py3.py new file mode 100644 index 000000000000..c4ee4c17d78d --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_consumer_group_info_py3.py @@ -0,0 +1,54 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_properties.py index 71b9cf65c466..8bdf6ac53f20 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_properties.py @@ -29,7 +29,7 @@ class EventHubProperties(Model): :type partition_count: int :ivar partition_ids: The partition ids in the Event Hub-compatible endpoint. - :vartype partition_ids: list of str + :vartype partition_ids: list[str] :ivar path: The Event Hub-compatible name. :vartype path: str :ivar endpoint: The Event Hub-compatible endpoint. @@ -50,9 +50,10 @@ class EventHubProperties(Model): 'endpoint': {'key': 'endpoint', 'type': 'str'}, } - def __init__(self, retention_time_in_days=None, partition_count=None): - self.retention_time_in_days = retention_time_in_days - self.partition_count = partition_count + 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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_properties_py3.py new file mode 100644 index 000000000000..9a53091d02f8 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/event_hub_properties_py3.py @@ -0,0 +1,59 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/export_devices_request.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/export_devices_request.py index 81419e2e1b49..2ae6463c8681 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/export_devices_request.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/export_devices_request.py @@ -16,10 +16,12 @@ class ExportDevicesRequest(Model): """Use to provide parameters when requesting an export of all devices in the IoT hub. - :param export_blob_container_uri: The export blob container URI. + 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: The value indicating whether keys should be excluded - during export. + :param exclude_keys: Required. The value indicating whether keys should be + excluded during export. :type exclude_keys: bool """ @@ -29,10 +31,11 @@ class ExportDevicesRequest(Model): } _attribute_map = { - 'export_blob_container_uri': {'key': 'ExportBlobContainerUri', 'type': 'str'}, - 'exclude_keys': {'key': 'ExcludeKeys', 'type': 'bool'}, + 'export_blob_container_uri': {'key': 'exportBlobContainerUri', 'type': 'str'}, + 'exclude_keys': {'key': 'excludeKeys', 'type': 'bool'}, } - def __init__(self, export_blob_container_uri, exclude_keys): - self.export_blob_container_uri = export_blob_container_uri - self.exclude_keys = exclude_keys + 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/export_devices_request_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/export_devices_request_py3.py new file mode 100644 index 000000000000..1e616734a4ea --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/export_devices_request_py3.py @@ -0,0 +1,41 @@ +# 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 + + +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 + """ + + _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'}, + } + + def __init__(self, *, export_blob_container_uri: str, exclude_keys: bool, **kwargs) -> None: + super(ExportDevicesRequest, self).__init__(**kwargs) + self.export_blob_container_uri = export_blob_container_uri + self.exclude_keys = exclude_keys diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/fallback_route_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/fallback_route_properties.py index de652fa5409d..b93285c2a10b 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/fallback_route_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/fallback_route_properties.py @@ -19,18 +19,26 @@ class FallbackRouteProperties(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar source: The source to which the routing rule is to be applied to. - For example, DeviceMessages. Default value: "DeviceMessages" . + 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: 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 of str - :param is_enabled: Used to specify whether the fallback route is enabled. + :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 """ @@ -41,6 +49,7 @@ class FallbackRouteProperties(Model): } _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, 'source': {'key': 'source', 'type': 'str'}, 'condition': {'key': 'condition', 'type': 'str'}, 'endpoint_names': {'key': 'endpointNames', 'type': '[str]'}, @@ -49,7 +58,9 @@ class FallbackRouteProperties(Model): source = "DeviceMessages" - def __init__(self, endpoint_names, is_enabled, condition=None): - self.condition = condition - self.endpoint_names = endpoint_names - self.is_enabled = is_enabled + 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/fallback_route_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/fallback_route_properties_py3.py new file mode 100644 index 000000000000..f70e677c4932 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/fallback_route_properties_py3.py @@ -0,0 +1,66 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/feedback_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/feedback_properties.py index ffb46bb22e82..f1adc53ec853 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/feedback_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/feedback_properties.py @@ -39,7 +39,8 @@ class FeedbackProperties(Model): 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int'}, } - def __init__(self, lock_duration_as_iso8601=None, ttl_as_iso8601=None, max_delivery_count=None): - self.lock_duration_as_iso8601 = lock_duration_as_iso8601 - self.ttl_as_iso8601 = ttl_as_iso8601 - self.max_delivery_count = max_delivery_count + 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/feedback_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/feedback_properties_py3.py new file mode 100644 index 000000000000..b9b2e2bea2d1 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/feedback_properties_py3.py @@ -0,0 +1,46 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/import_devices_request.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/import_devices_request.py index bc77ca866c9f..2280c00ee4a0 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/import_devices_request.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/import_devices_request.py @@ -16,9 +16,11 @@ class ImportDevicesRequest(Model): """Use to provide parameters when requesting an import of all devices in the hub. - :param input_blob_container_uri: The input blob container URI. + 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: The output blob container URI. + :param output_blob_container_uri: Required. The output blob container URI. :type output_blob_container_uri: str """ @@ -28,10 +30,11 @@ class ImportDevicesRequest(Model): } _attribute_map = { - 'input_blob_container_uri': {'key': 'InputBlobContainerUri', 'type': 'str'}, - 'output_blob_container_uri': {'key': 'OutputBlobContainerUri', 'type': 'str'}, + 'input_blob_container_uri': {'key': 'inputBlobContainerUri', 'type': 'str'}, + 'output_blob_container_uri': {'key': 'outputBlobContainerUri', 'type': 'str'}, } - def __init__(self, input_blob_container_uri, output_blob_container_uri): - self.input_blob_container_uri = input_blob_container_uri - self.output_blob_container_uri = output_blob_container_uri + 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/import_devices_request_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/import_devices_request_py3.py new file mode 100644 index 000000000000..c97a6611d35a --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/import_devices_request_py3.py @@ -0,0 +1,40 @@ +# 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 + + +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 + """ + + _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'}, + } + + def __init__(self, *, input_blob_container_uri: str, output_blob_container_uri: str, **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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_capacity.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_capacity.py index 84841619bd11..c8bdfb3c51fc 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_capacity.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_capacity.py @@ -26,8 +26,7 @@ class IotHubCapacity(Model): :vartype default: long :ivar scale_type: The type of the scaling enabled. Possible values include: 'Automatic', 'Manual', 'None' - :vartype scale_type: str or :class:`IotHubScaleType - ` + :vartype scale_type: str or ~azure.mgmt.iothub.models.IotHubScaleType """ _validation = { @@ -44,7 +43,8 @@ class IotHubCapacity(Model): 'scale_type': {'key': 'scaleType', 'type': 'IotHubScaleType'}, } - def __init__(self): + def __init__(self, **kwargs): + super(IotHubCapacity, self).__init__(**kwargs) self.minimum = None self.maximum = None self.default = None diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_capacity_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_capacity_py3.py new file mode 100644 index 000000000000..9b2092edc2ec --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_capacity_py3.py @@ -0,0 +1,51 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_client_enums.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_client_enums.py index f9eb2ef27b63..85a83b2d5b43 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_client_enums.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class AccessRights(Enum): +class AccessRights(str, Enum): registry_read = "RegistryRead" registry_write = "RegistryWrite" @@ -31,13 +31,13 @@ class AccessRights(Enum): registry_read_registry_write_service_connect_device_connect = "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect" -class IpFilterActionType(Enum): +class IpFilterActionType(str, Enum): accept = "Accept" reject = "Reject" -class RoutingSource(Enum): +class RoutingSource(str, Enum): device_messages = "DeviceMessages" twin_change_events = "TwinChangeEvents" @@ -45,7 +45,7 @@ class RoutingSource(Enum): device_job_lifecycle_events = "DeviceJobLifecycleEvents" -class OperationMonitoringLevel(Enum): +class OperationMonitoringLevel(str, Enum): none = "None" error = "Error" @@ -53,13 +53,13 @@ class OperationMonitoringLevel(Enum): error_information = "Error, Information" -class Capabilities(Enum): +class Capabilities(str, Enum): none = "None" device_management = "DeviceManagement" -class IotHubSku(Enum): +class IotHubSku(str, Enum): f1 = "F1" s1 = "S1" @@ -67,13 +67,13 @@ class IotHubSku(Enum): s3 = "S3" -class IotHubSkuTier(Enum): +class IotHubSkuTier(str, Enum): free = "Free" standard = "Standard" -class JobType(Enum): +class JobType(str, Enum): unknown = "unknown" export = "export" @@ -87,7 +87,7 @@ class JobType(Enum): firmware_update = "firmwareUpdate" -class JobStatus(Enum): +class JobStatus(str, Enum): unknown = "unknown" enqueued = "enqueued" @@ -97,14 +97,14 @@ class JobStatus(Enum): cancelled = "cancelled" -class IotHubScaleType(Enum): +class IotHubScaleType(str, Enum): automatic = "Automatic" manual = "Manual" none = "None" -class IotHubNameUnavailabilityReason(Enum): +class IotHubNameUnavailabilityReason(str, Enum): invalid = "Invalid" already_exists = "AlreadyExists" diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_description.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_description.py index d278f9888632..aaac4a514926 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_description.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_description.py @@ -18,31 +18,26 @@ class IotHubDescription(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: The resource location. + :param location: Required. The resource location. :type location: str :param tags: The resource tags. - :type tags: dict - :param subscriptionid: The subscription identifier. - :type subscriptionid: str - :param resourcegroup: The name of the resource group that contains the IoT - hub. A resource group name uniquely identifies the resource group within - the subscription. - :type resourcegroup: str + :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: - :type properties: :class:`IotHubProperties - ` - :param sku: - :type sku: :class:`IotHubSkuInfo ` + :type properties: ~azure.mgmt.iothub.models.IotHubProperties + :param sku: Required. + :type sku: ~azure.mgmt.iothub.models.IotHubSkuInfo """ _validation = { @@ -50,8 +45,6 @@ class IotHubDescription(Resource): 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, 'type': {'readonly': True}, 'location': {'required': True}, - 'subscriptionid': {'required': True}, - 'resourcegroup': {'required': True}, 'sku': {'required': True}, } @@ -61,17 +54,13 @@ class IotHubDescription(Resource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'subscriptionid': {'key': 'subscriptionid', 'type': 'str'}, - 'resourcegroup': {'key': 'resourcegroup', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'IotHubProperties'}, 'sku': {'key': 'sku', 'type': 'IotHubSkuInfo'}, } - def __init__(self, location, subscriptionid, resourcegroup, sku, tags=None, etag=None, properties=None): - super(IotHubDescription, self).__init__(location=location, tags=tags) - self.subscriptionid = subscriptionid - self.resourcegroup = resourcegroup - self.etag = etag - self.properties = properties - self.sku = sku + 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_description_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_description_py3.py new file mode 100644 index 000000000000..84edd6c8d3bc --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_description_py3.py @@ -0,0 +1,66 @@ +# 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 .resource import Resource + + +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: + :type properties: ~azure.mgmt.iothub.models.IotHubProperties + :param sku: Required. + :type sku: ~azure.mgmt.iothub.models.IotHubSkuInfo + """ + + _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'}, + } + + def __init__(self, *, location: str, sku, tags=None, etag: str=None, properties=None, **kwargs) -> None: + super(IotHubDescription, self).__init__(location=location, tags=tags, **kwargs) + self.etag = etag + self.properties = properties + self.sku = sku diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_name_availability_info.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_name_availability_info.py index b8b8afbc12ed..83717c1fce1f 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_name_availability_info.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_name_availability_info.py @@ -23,8 +23,8 @@ class IotHubNameAvailabilityInfo(Model): :vartype name_available: bool :ivar reason: The reason for unavailability. Possible values include: 'Invalid', 'AlreadyExists' - :vartype reason: str or :class:`IotHubNameUnavailabilityReason - ` + :vartype reason: str or + ~azure.mgmt.iothub.models.IotHubNameUnavailabilityReason :param message: The detailed reason message. :type message: str """ @@ -40,7 +40,8 @@ class IotHubNameAvailabilityInfo(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, message=None): + def __init__(self, **kwargs): + super(IotHubNameAvailabilityInfo, self).__init__(**kwargs) self.name_available = None self.reason = None - self.message = message + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_name_availability_info_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_name_availability_info_py3.py new file mode 100644 index 000000000000..e782c872d683 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_name_availability_info_py3.py @@ -0,0 +1,47 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties.py index 49a4933881e2..1185275efca7 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties.py @@ -20,54 +20,54 @@ class IotHubProperties(Model): :param authorization_policies: The shared access policies you can use to secure a connection to the IoT hub. - :type authorization_policies: list of - :class:`SharedAccessSignatureAuthorizationRule - ` + :type authorization_policies: + list[~azure.mgmt.iothub.models.SharedAccessSignatureAuthorizationRule] :param ip_filter_rules: The IP filter rules. - :type ip_filter_rules: list of :class:`IpFilterRule - ` + :type ip_filter_rules: list[~azure.mgmt.iothub.models.IpFilterRule] :ivar provisioning_state: The provisioning state. :vartype provisioning_state: str + :ivar state: Thehub state 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 possible keys to this dictionary are events and operationsMonitoringEvents. Both of these keys have to be present in the dictionary while making create or update calls for the IoT hub. - :type event_hub_endpoints: dict + :type event_hub_endpoints: dict[str, + ~azure.mgmt.iothub.models.EventHubProperties] :param routing: - :type routing: :class:`RoutingProperties - ` + :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 + :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 + :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: :class:`CloudToDeviceProperties - ` + :type cloud_to_device: ~azure.mgmt.iothub.models.CloudToDeviceProperties :param comments: IoT hub comments. :type comments: str :param operations_monitoring_properties: :type operations_monitoring_properties: - :class:`OperationsMonitoringProperties - ` + ~azure.mgmt.iothub.models.OperationsMonitoringProperties :param features: The capabilities and features enabled for the IoT hub. Possible values include: 'None', 'DeviceManagement' - :type features: str or :class:`Capabilities - ` + :type features: str or ~azure.mgmt.iothub.models.Capabilities """ _validation = { 'provisioning_state': {'readonly': True}, + 'state': {'readonly': True}, 'host_name': {'readonly': True}, } @@ -75,6 +75,7 @@ class IotHubProperties(Model): 'authorization_policies': {'key': 'authorizationPolicies', 'type': '[SharedAccessSignatureAuthorizationRule]'}, 'ip_filter_rules': {'key': 'ipFilterRules', 'type': '[IpFilterRule]'}, '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'}, @@ -87,17 +88,19 @@ class IotHubProperties(Model): 'features': {'key': 'features', 'type': 'str'}, } - def __init__(self, authorization_policies=None, ip_filter_rules=None, event_hub_endpoints=None, routing=None, storage_endpoints=None, messaging_endpoints=None, enable_file_upload_notifications=None, cloud_to_device=None, comments=None, operations_monitoring_properties=None, features=None): - self.authorization_policies = authorization_policies - self.ip_filter_rules = ip_filter_rules + def __init__(self, **kwargs): + super(IotHubProperties, self).__init__(**kwargs) + self.authorization_policies = kwargs.get('authorization_policies', None) + self.ip_filter_rules = kwargs.get('ip_filter_rules', None) 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.operations_monitoring_properties = operations_monitoring_properties - self.features = features + 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.operations_monitoring_properties = kwargs.get('operations_monitoring_properties', None) + self.features = kwargs.get('features', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties_py3.py new file mode 100644 index 000000000000..bc89576ff01c --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties_py3.py @@ -0,0 +1,106 @@ +# 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 + + +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 ip_filter_rules: The IP filter rules. + :type ip_filter_rules: list[~azure.mgmt.iothub.models.IpFilterRule] + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + :ivar state: Thehub state 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 possible keys to this dictionary are events and + operationsMonitoringEvents. Both of these keys have 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 operations_monitoring_properties: + :type operations_monitoring_properties: + ~azure.mgmt.iothub.models.OperationsMonitoringProperties + :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 + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'state': {'readonly': True}, + 'host_name': {'readonly': True}, + } + + _attribute_map = { + 'authorization_policies': {'key': 'authorizationPolicies', 'type': '[SharedAccessSignatureAuthorizationRule]'}, + 'ip_filter_rules': {'key': 'ipFilterRules', 'type': '[IpFilterRule]'}, + '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'}, + 'operations_monitoring_properties': {'key': 'operationsMonitoringProperties', 'type': 'OperationsMonitoringProperties'}, + 'features': {'key': 'features', 'type': 'str'}, + } + + def __init__(self, *, authorization_policies=None, ip_filter_rules=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, operations_monitoring_properties=None, features=None, **kwargs) -> None: + super(IotHubProperties, self).__init__(**kwargs) + self.authorization_policies = authorization_policies + self.ip_filter_rules = ip_filter_rules + 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.operations_monitoring_properties = operations_monitoring_properties + self.features = features diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_quota_metric_info.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_quota_metric_info.py index 911cc10afcab..4f00a25913ee 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_quota_metric_info.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_quota_metric_info.py @@ -33,12 +33,13 @@ class IotHubQuotaMetricInfo(Model): } _attribute_map = { - 'name': {'key': 'Name', 'type': 'str'}, - 'current_value': {'key': 'CurrentValue', 'type': 'long'}, - 'max_value': {'key': 'MaxValue', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'max_value': {'key': 'maxValue', 'type': 'long'}, } - def __init__(self): + def __init__(self, **kwargs): + super(IotHubQuotaMetricInfo, self).__init__(**kwargs) self.name = None self.current_value = None self.max_value = None diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_quota_metric_info_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_quota_metric_info_py3.py new file mode 100644 index 000000000000..31d074c5f5e0 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_quota_metric_info_py3.py @@ -0,0 +1,45 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_description.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_description.py index 797935772d45..0837ddca79eb 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_description.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_description.py @@ -18,13 +18,14 @@ class IotHubSkuDescription(Model): 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: - :type sku: :class:`IotHubSkuInfo ` - :param capacity: - :type capacity: :class:`IotHubCapacity - ` + :param sku: Required. The type of the resource. + :type sku: ~azure.mgmt.iothub.models.IotHubSkuInfo + :param capacity: Required. + :type capacity: ~azure.mgmt.iothub.models.IotHubCapacity """ _validation = { @@ -39,7 +40,8 @@ class IotHubSkuDescription(Model): 'capacity': {'key': 'capacity', 'type': 'IotHubCapacity'}, } - def __init__(self, sku, capacity): + def __init__(self, **kwargs): + super(IotHubSkuDescription, self).__init__(**kwargs) self.resource_type = None - self.sku = sku - self.capacity = capacity + self.sku = kwargs.get('sku', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_description_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_description_py3.py new file mode 100644 index 000000000000..e2cf73c436cb --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_description_py3.py @@ -0,0 +1,47 @@ +# 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 + + +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. + :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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_info.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_info.py index 16ccbf25e418..70486220272e 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_info.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_info.py @@ -18,13 +18,14 @@ class IotHubSkuInfo(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: The name of the SKU. Possible values include: 'F1', 'S1', - 'S2', 'S3' - :type name: str or :class:`IotHubSku ` + 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' + :type name: str or ~azure.mgmt.iothub.models.IotHubSku :ivar tier: The billing tier for the IoT hub. Possible values include: 'Free', 'Standard' - :vartype tier: str or :class:`IotHubSkuTier - ` + :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 @@ -33,7 +34,6 @@ class IotHubSkuInfo(Model): _validation = { 'name': {'required': True}, 'tier': {'readonly': True}, - 'capacity': {'required': True}, } _attribute_map = { @@ -42,7 +42,8 @@ class IotHubSkuInfo(Model): 'capacity': {'key': 'capacity', 'type': 'long'}, } - def __init__(self, name, capacity): - self.name = name + def __init__(self, **kwargs): + super(IotHubSkuInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.tier = None - self.capacity = capacity + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_info_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_info_py3.py new file mode 100644 index 000000000000..bda97d8190d8 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_info_py3.py @@ -0,0 +1,49 @@ +# 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 + + +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' + :type name: str or ~azure.mgmt.iothub.models.IotHubSku + :ivar tier: The billing tier for the IoT hub. Possible values include: + 'Free', 'Standard' + :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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/ip_filter_rule.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/ip_filter_rule.py index 0d13cb8f666d..5a24c50dca0a 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/ip_filter_rule.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/ip_filter_rule.py @@ -15,14 +15,15 @@ class IpFilterRule(Model): """The IP filter rules for the IoT hub. - :param filter_name: The name of the IP filter rule. + 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: The desired action for requests captured by this rule. - Possible values include: 'Accept', 'Reject' - :type action: str or :class:`IpFilterActionType - ` - :param ip_mask: A string that contains the IP address range in CIDR - notation for the rule. + :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 """ @@ -38,7 +39,8 @@ class IpFilterRule(Model): 'ip_mask': {'key': 'ipMask', 'type': 'str'}, } - def __init__(self, filter_name, action, ip_mask): - self.filter_name = filter_name - self.action = action - self.ip_mask = ip_mask + 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/ip_filter_rule_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/ip_filter_rule_py3.py new file mode 100644 index 000000000000..595a36af4810 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/ip_filter_rule_py3.py @@ -0,0 +1,46 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/job_response.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/job_response.py index ef1d7b4e0491..59b82d247244 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/job_response.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/job_response.py @@ -28,11 +28,10 @@ class JobResponse(Model): 'export', 'import', 'backup', 'readDeviceProperties', 'writeDeviceProperties', 'updateDeviceConfiguration', 'rebootDevice', 'factoryResetDevice', 'firmwareUpdate' - :vartype type: str or :class:`JobType ` + :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 :class:`JobStatus - ` + :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 @@ -64,7 +63,8 @@ class JobResponse(Model): 'parent_job_id': {'key': 'parentJobId', 'type': 'str'}, } - def __init__(self): + def __init__(self, **kwargs): + super(JobResponse, self).__init__(**kwargs) self.job_id = None self.start_time_utc = None self.end_time_utc = None diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/job_response_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/job_response_py3.py new file mode 100644 index 000000000000..88415188e0a7 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/job_response_py3.py @@ -0,0 +1,75 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/messaging_endpoint_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/messaging_endpoint_properties.py index 776ded67e2c5..576bd3c0aa2a 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/messaging_endpoint_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/messaging_endpoint_properties.py @@ -38,7 +38,8 @@ class MessagingEndpointProperties(Model): 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int'}, } - def __init__(self, lock_duration_as_iso8601=None, ttl_as_iso8601=None, max_delivery_count=None): - self.lock_duration_as_iso8601 = lock_duration_as_iso8601 - self.ttl_as_iso8601 = ttl_as_iso8601 - self.max_delivery_count = max_delivery_count + 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/messaging_endpoint_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/messaging_endpoint_properties_py3.py new file mode 100644 index 000000000000..f3d0d8c5f122 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/messaging_endpoint_properties_py3.py @@ -0,0 +1,45 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/operation.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/operation.py index 3325677e6ea8..1730239229f4 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/operation.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/operation.py @@ -22,8 +22,7 @@ class Operation(Model): delete} :vartype name: str :param display: The object that represents the operation. - :type display: :class:`OperationDisplay - ` + :type display: ~azure.mgmt.iothub.models.OperationDisplay """ _validation = { @@ -35,6 +34,7 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, display=None): + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) self.name = None - self.display = display + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_display.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_display.py index f64097b09c4a..3f5abb359ff7 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_display.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_display.py @@ -38,7 +38,8 @@ class OperationDisplay(Model): 'operation': {'key': 'operation', 'type': 'str'}, } - def __init__(self): + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) self.provider = None self.resource = None self.operation = None diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_display_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_display_py3.py new file mode 100644 index 000000000000..fdf5a7812423 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_display_py3.py @@ -0,0 +1,45 @@ +# 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 + + +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 + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_inputs.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_inputs.py index 7443bab0e35e..206391142c95 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_inputs.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_inputs.py @@ -15,7 +15,9 @@ class OperationInputs(Model): """Input values. - :param name: The name of the IoT hub to check. + 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 """ @@ -24,8 +26,9 @@ class OperationInputs(Model): } _attribute_map = { - 'name': {'key': 'Name', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name): - self.name = name + def __init__(self, **kwargs): + super(OperationInputs, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_inputs_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_inputs_py3.py new file mode 100644 index 000000000000..9fc6f5468506 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_inputs_py3.py @@ -0,0 +1,34 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_py3.py new file mode 100644 index 000000000000..9915ab12b45e --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/operation_py3.py @@ -0,0 +1,40 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/operations_monitoring_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/operations_monitoring_properties.py index e5f7ddbc789c..6e68a8e7e223 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/operations_monitoring_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/operations_monitoring_properties.py @@ -19,12 +19,14 @@ class OperationsMonitoringProperties(Model): C2DTwinOperations, TwinQueries, JobsOperations, DirectMethods. :param events: - :type events: dict + :type events: dict[str, str or + ~azure.mgmt.iothub.models.OperationMonitoringLevel] """ _attribute_map = { 'events': {'key': 'events', 'type': '{str}'}, } - def __init__(self, events=None): - self.events = events + def __init__(self, **kwargs): + super(OperationsMonitoringProperties, self).__init__(**kwargs) + self.events = kwargs.get('events', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/operations_monitoring_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/operations_monitoring_properties_py3.py new file mode 100644 index 000000000000..4dc013d48874 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/operations_monitoring_properties_py3.py @@ -0,0 +1,32 @@ +# 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 + + +class OperationsMonitoringProperties(Model): + """The operations monitoring properties for the IoT hub. The possible keys to + the dictionary are Connections, DeviceTelemetry, C2DCommands, + DeviceIdentityOperations, FileUploadOperations, Routes, D2CTwinOperations, + C2DTwinOperations, TwinQueries, JobsOperations, DirectMethods. + + :param events: + :type events: dict[str, str or + ~azure.mgmt.iothub.models.OperationMonitoringLevel] + """ + + _attribute_map = { + 'events': {'key': 'events', 'type': '{str}'}, + } + + def __init__(self, *, events=None, **kwargs) -> None: + super(OperationsMonitoringProperties, self).__init__(**kwargs) + self.events = events diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/registry_statistics.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/registry_statistics.py index 86bf20977e9f..fc9d0e72cb40 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/registry_statistics.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/registry_statistics.py @@ -41,7 +41,8 @@ class RegistryStatistics(Model): 'disabled_device_count': {'key': 'disabledDeviceCount', 'type': 'long'}, } - def __init__(self): + def __init__(self, **kwargs): + super(RegistryStatistics, self).__init__(**kwargs) self.total_device_count = None self.enabled_device_count = None self.disabled_device_count = None diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/registry_statistics_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/registry_statistics_py3.py new file mode 100644 index 000000000000..7607caca6707 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/registry_statistics_py3.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 msrest.serialization import Model + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/resource.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/resource.py index be1dbb54d41c..e03d78711115 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/resource.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/resource.py @@ -18,16 +18,18 @@ class Resource(Model): 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: The resource location. + :param location: Required. The resource location. :type location: str :param tags: The resource tags. - :type tags: dict + :type tags: dict[str, str] """ _validation = { @@ -45,9 +47,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/resource_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/resource_py3.py new file mode 100644 index 000000000000..436710184586 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/resource_py3.py @@ -0,0 +1,56 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/route_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_properties.py index 55f5d62ab8bc..91c75e1d8c8b 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/route_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_properties.py @@ -16,24 +16,26 @@ class RouteProperties(Model): """The properties of a routing rule that your IoT hub uses to route messages to endpoints. - :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. + 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: The source that the routing rule is to be applied to, such - as DeviceMessages. Possible values include: 'DeviceMessages', + :param source: Required. The source that the routing rule is to be applied + to, such as DeviceMessages. Possible values include: 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents' - :type source: str or :class:`RoutingSource - ` + :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: The list of endpoints to which messages that - satisfy the condition are routed. Currently only one endpoint is allowed. - :type endpoint_names: list of str - :param is_enabled: Used to specify whether a route is enabled. + :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 """ @@ -52,9 +54,10 @@ class RouteProperties(Model): 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, } - def __init__(self, name, source, endpoint_names, is_enabled, condition=None): - self.name = name - self.source = source - self.condition = condition - self.endpoint_names = endpoint_names - self.is_enabled = is_enabled + 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/route_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_properties_py3.py new file mode 100644 index 000000000000..e66f0009a123 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_properties_py3.py @@ -0,0 +1,63 @@ +# 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 + + +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: 'DeviceMessages', + 'TwinChangeEvents', 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents' + :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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_endpoints.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_endpoints.py index 080892079629..cdd1114e883a 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_endpoints.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_endpoints.py @@ -20,24 +20,21 @@ class RoutingEndpoints(Model): :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 of - :class:`RoutingServiceBusQueueEndpointProperties - ` + :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 of - :class:`RoutingServiceBusTopicEndpointProperties - ` + :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 of :class:`RoutingEventHubProperties - ` + :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 of - :class:`RoutingStorageContainerProperties - ` + :type storage_containers: + list[~azure.mgmt.iothub.models.RoutingStorageContainerProperties] """ _attribute_map = { @@ -47,8 +44,9 @@ class RoutingEndpoints(Model): 'storage_containers': {'key': 'storageContainers', 'type': '[RoutingStorageContainerProperties]'}, } - def __init__(self, service_bus_queues=None, service_bus_topics=None, event_hubs=None, storage_containers=None): - self.service_bus_queues = service_bus_queues - self.service_bus_topics = service_bus_topics - self.event_hubs = event_hubs - self.storage_containers = storage_containers + 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_endpoints_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_endpoints_py3.py new file mode 100644 index 000000000000..518e57b44b16 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_endpoints_py3.py @@ -0,0 +1,52 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_event_hub_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_event_hub_properties.py index c248d821c22a..7269e41834d0 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_event_hub_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_event_hub_properties.py @@ -15,13 +15,16 @@ class RoutingEventHubProperties(Model): """The properties related to an event hub endpoint. - :param connection_string: The connection string of the event hub endpoint. + All required parameters must be populated in order to send to Azure. + + :param connection_string: Required. The connection string of the event hub + endpoint. :type connection_string: str - :param name: 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, operationsMonitoringEvents, fileNotifications, $default. Endpoint - names must be unique across endpoint types. + :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, operationsMonitoringEvents, fileNotifications, + $default. Endpoint names must be unique across endpoint types. :type name: str :param subscription_id: The subscription identifier of the event hub endpoint. @@ -43,8 +46,9 @@ class RoutingEventHubProperties(Model): 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, } - def __init__(self, connection_string, name, subscription_id=None, resource_group=None): - self.connection_string = connection_string - self.name = name - self.subscription_id = subscription_id - self.resource_group = resource_group + def __init__(self, **kwargs): + super(RoutingEventHubProperties, self).__init__(**kwargs) + self.connection_string = kwargs.get('connection_string', None) + self.name = kwargs.get('name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_event_hub_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_event_hub_properties_py3.py new file mode 100644 index 000000000000..dc0ddacb7b81 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_event_hub_properties_py3.py @@ -0,0 +1,54 @@ +# 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 + + +class RoutingEventHubProperties(Model): + """The properties related to an event hub endpoint. + + All required parameters must be populated in order to send to Azure. + + :param connection_string: Required. The connection string of the event hub + endpoint. + :type connection_string: str + :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, operationsMonitoringEvents, 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 = { + 'connection_string': {'required': True}, + 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, + } + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__(self, *, connection_string: str, name: str, subscription_id: str=None, resource_group: str=None, **kwargs) -> None: + super(RoutingEventHubProperties, self).__init__(**kwargs) + self.connection_string = connection_string + self.name = name + self.subscription_id = subscription_id + self.resource_group = resource_group diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_properties.py index b44db86d6ca9..0fd87632b071 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_properties.py @@ -17,21 +17,18 @@ class RoutingProperties(Model): https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging. :param endpoints: - :type endpoints: :class:`RoutingEndpoints - ` + :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 of :class:`RouteProperties - ` + :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: :class:`FallbackRouteProperties - ` + :type fallback_route: ~azure.mgmt.iothub.models.FallbackRouteProperties """ _attribute_map = { @@ -40,7 +37,8 @@ class RoutingProperties(Model): 'fallback_route': {'key': 'fallbackRoute', 'type': 'FallbackRouteProperties'}, } - def __init__(self, endpoints=None, routes=None, fallback_route=None): - self.endpoints = endpoints - self.routes = routes - self.fallback_route = fallback_route + 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_properties_py3.py new file mode 100644 index 000000000000..b2a7bd73d727 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_properties_py3.py @@ -0,0 +1,44 @@ +# 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 + + +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 + """ + + _attribute_map = { + 'endpoints': {'key': 'endpoints', 'type': 'RoutingEndpoints'}, + 'routes': {'key': 'routes', 'type': '[RouteProperties]'}, + 'fallback_route': {'key': 'fallbackRoute', 'type': 'FallbackRouteProperties'}, + } + + def __init__(self, *, endpoints=None, routes=None, fallback_route=None, **kwargs) -> None: + super(RoutingProperties, self).__init__(**kwargs) + self.endpoints = endpoints + self.routes = routes + self.fallback_route = fallback_route diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_queue_endpoint_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_queue_endpoint_properties.py index d55ff0945ff4..1cad4d72afde 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_queue_endpoint_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_queue_endpoint_properties.py @@ -15,15 +15,17 @@ class RoutingServiceBusQueueEndpointProperties(Model): """The properties related to service bus queue endpoint types. - :param connection_string: The connection string of the service bus queue - endpoint. + All required parameters must be populated in order to send to Azure. + + :param connection_string: Required. The connection string of the service + bus queue endpoint. :type connection_string: str - :param name: 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, operationsMonitoringEvents, fileNotifications, $default. Endpoint - names must be unique across endpoint types. The name need not be the same - as the actual queue name. + :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, operationsMonitoringEvents, 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. @@ -45,8 +47,9 @@ class RoutingServiceBusQueueEndpointProperties(Model): 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, } - def __init__(self, connection_string, name, subscription_id=None, resource_group=None): - self.connection_string = connection_string - self.name = name - self.subscription_id = subscription_id - self.resource_group = resource_group + def __init__(self, **kwargs): + super(RoutingServiceBusQueueEndpointProperties, self).__init__(**kwargs) + self.connection_string = kwargs.get('connection_string', None) + self.name = kwargs.get('name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_queue_endpoint_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_queue_endpoint_properties_py3.py new file mode 100644 index 000000000000..1a905cfb4535 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_queue_endpoint_properties_py3.py @@ -0,0 +1,55 @@ +# 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 + + +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 connection_string: Required. The connection string of the service + bus queue endpoint. + :type connection_string: str + :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, operationsMonitoringEvents, 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 = { + 'connection_string': {'required': True}, + 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, + } + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__(self, *, connection_string: str, name: str, subscription_id: str=None, resource_group: str=None, **kwargs) -> None: + super(RoutingServiceBusQueueEndpointProperties, self).__init__(**kwargs) + self.connection_string = connection_string + self.name = name + self.subscription_id = subscription_id + self.resource_group = resource_group diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_topic_endpoint_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_topic_endpoint_properties.py index 865904c57736..b0e1989a3528 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_topic_endpoint_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_topic_endpoint_properties.py @@ -15,15 +15,17 @@ class RoutingServiceBusTopicEndpointProperties(Model): """The properties related to service bus topic endpoint types. - :param connection_string: The connection string of the service bus topic - endpoint. + All required parameters must be populated in order to send to Azure. + + :param connection_string: Required. The connection string of the service + bus topic endpoint. :type connection_string: str - :param name: 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, operationsMonitoringEvents, fileNotifications, $default. Endpoint - names must be unique across endpoint types. The name need not be the same - as the actual topic name. + :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, operationsMonitoringEvents, 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. @@ -45,8 +47,9 @@ class RoutingServiceBusTopicEndpointProperties(Model): 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, } - def __init__(self, connection_string, name, subscription_id=None, resource_group=None): - self.connection_string = connection_string - self.name = name - self.subscription_id = subscription_id - self.resource_group = resource_group + def __init__(self, **kwargs): + super(RoutingServiceBusTopicEndpointProperties, self).__init__(**kwargs) + self.connection_string = kwargs.get('connection_string', None) + self.name = kwargs.get('name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_topic_endpoint_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_topic_endpoint_properties_py3.py new file mode 100644 index 000000000000..2eb2c9dbb097 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_service_bus_topic_endpoint_properties_py3.py @@ -0,0 +1,55 @@ +# 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 + + +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 connection_string: Required. The connection string of the service + bus topic endpoint. + :type connection_string: str + :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, operationsMonitoringEvents, 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 = { + 'connection_string': {'required': True}, + 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, + } + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__(self, *, connection_string: str, name: str, subscription_id: str=None, resource_group: str=None, **kwargs) -> None: + super(RoutingServiceBusTopicEndpointProperties, self).__init__(**kwargs) + self.connection_string = connection_string + self.name = name + self.subscription_id = subscription_id + self.resource_group = resource_group diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties.py index b5cfbd942c47..b8a5e9cbede9 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties.py @@ -15,13 +15,16 @@ class RoutingStorageContainerProperties(Model): """The properties related to a storage container endpoint. - :param connection_string: The connection string of the storage account. + All required parameters must be populated in order to send to Azure. + + :param connection_string: Required. The connection string of the storage + account. :type connection_string: str - :param name: 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, operationsMonitoringEvents, fileNotifications, $default. Endpoint - names must be unique across endpoint types. + :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, operationsMonitoringEvents, fileNotifications, + $default. Endpoint names must be unique across endpoint types. :type name: str :param subscription_id: The subscription identifier of the storage account. @@ -29,8 +32,8 @@ class RoutingStorageContainerProperties(Model): :param resource_group: The name of the resource group of the storage account. :type resource_group: str - :param container_name: The name of storage container in the storage - account. + :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 @@ -69,13 +72,14 @@ class RoutingStorageContainerProperties(Model): 'encoding': {'key': 'encoding', 'type': 'str'}, } - def __init__(self, connection_string, name, container_name, subscription_id=None, resource_group=None, file_name_format=None, batch_frequency_in_seconds=None, max_chunk_size_in_bytes=None, encoding=None): - self.connection_string = connection_string - 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 + def __init__(self, **kwargs): + super(RoutingStorageContainerProperties, self).__init__(**kwargs) + self.connection_string = kwargs.get('connection_string', 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties_py3.py new file mode 100644 index 000000000000..50b99f1fb73b --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties_py3.py @@ -0,0 +1,85 @@ +# 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 + + +class RoutingStorageContainerProperties(Model): + """The properties related to a storage container endpoint. + + All required parameters must be populated in order to send to Azure. + + :param connection_string: Required. The connection string of the storage + account. + :type connection_string: str + :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, operationsMonitoringEvents, 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' and 'avrodeflate'. Default value is 'avro'. + :type encoding: str + """ + + _validation = { + 'connection_string': {'required': True}, + '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 = { + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + '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, *, connection_string: str, name: str, container_name: str, 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: str=None, **kwargs) -> None: + super(RoutingStorageContainerProperties, self).__init__(**kwargs) + self.connection_string = connection_string + 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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/shared_access_signature_authorization_rule.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/shared_access_signature_authorization_rule.py index 04f9d28e2d37..be54ad8ab717 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/shared_access_signature_authorization_rule.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/shared_access_signature_authorization_rule.py @@ -15,14 +15,16 @@ class SharedAccessSignatureAuthorizationRule(Model): """The properties of an IoT hub shared access policy. - :param key_name: The name of the 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: The permissions assigned to the shared access policy. - Possible values include: 'RegistryRead', 'RegistryWrite', + :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', @@ -31,8 +33,7 @@ class SharedAccessSignatureAuthorizationRule(Model): 'RegistryRead, ServiceConnect, DeviceConnect', 'RegistryWrite, ServiceConnect, DeviceConnect', 'RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect' - :type rights: str or :class:`AccessRights - ` + :type rights: str or ~azure.mgmt.iothub.models.AccessRights """ _validation = { @@ -47,8 +48,9 @@ class SharedAccessSignatureAuthorizationRule(Model): 'rights': {'key': 'rights', 'type': 'AccessRights'}, } - def __init__(self, key_name, rights, primary_key=None, secondary_key=None): - self.key_name = key_name - self.primary_key = primary_key - self.secondary_key = secondary_key - self.rights = rights + 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/shared_access_signature_authorization_rule_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/shared_access_signature_authorization_rule_py3.py new file mode 100644 index 000000000000..e65028a6ec16 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/shared_access_signature_authorization_rule_py3.py @@ -0,0 +1,56 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties.py index 0ecbc0c1dd08..e9664199efa8 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties.py @@ -15,16 +15,18 @@ 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 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: The connection string for the Azure Storage - account to which files are uploaded. + :param connection_string: Required. The connection string for the Azure + Storage account to which files are uploaded. :type connection_string: str - :param container_name: The name of the root container where you upload - files. The container need not exist but should be creatable using the - connectionString specified. + :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 """ @@ -39,7 +41,8 @@ class StorageEndpointProperties(Model): 'container_name': {'key': 'containerName', 'type': 'str'}, } - def __init__(self, connection_string, container_name, sas_ttl_as_iso8601=None): - self.sas_ttl_as_iso8601 = sas_ttl_as_iso8601 - self.connection_string = connection_string - self.container_name = container_name + 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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties_py3.py new file mode 100644 index 000000000000..54193d3eaab8 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties_py3.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 msrest.serialization import Model + + +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 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 + """ + + _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'}, + } + + def __init__(self, *, connection_string: str, container_name: str, sas_ttl_as_iso8601=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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/tags_resource.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/tags_resource.py new file mode 100644 index 000000000000..76bbf8349862 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/tags_resource.py @@ -0,0 +1,29 @@ +# 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 + + +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) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/tags_resource_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/tags_resource_py3.py new file mode 100644 index 000000000000..d7b8c492a731 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/tags_resource_py3.py @@ -0,0 +1,29 @@ +# 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 + + +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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/operations/certificates_operations.py b/azure-mgmt-iothub/azure/mgmt/iothub/operations/certificates_operations.py index eb2cb887a60a..81ee4adf5f20 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/operations/certificates_operations.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/operations/certificates_operations.py @@ -21,16 +21,18 @@ class CertificatesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The version of the API. Constant value: "2017-07-01". + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API. Constant value: "2018-01-22". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-07-01" + self.api_version = "2018-01-22" self.config = config @@ -50,18 +52,14 @@ def list_by_iot_hub( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`CertificateListDescription - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`CertificateListDescription - ` or - :class:`ClientRawResponse` + :return: CertificateListDescription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.CertificateListDescription or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorDetailsException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates' + 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'), @@ -85,7 +83,7 @@ def list_by_iot_hub( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -100,6 +98,7 @@ def list_by_iot_hub( 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): @@ -119,18 +118,14 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`CertificateDescription - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`CertificateDescription - ` or - :class:`ClientRawResponse` + :return: CertificateDescription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.CertificateDescription or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorDetailsException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}' + 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'), @@ -155,7 +150,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -170,6 +165,7 @@ def get( 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, certificate=None, custom_headers=None, raw=False, **operation_config): @@ -195,20 +191,16 @@ def create_or_update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`CertificateDescription - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`CertificateDescription - ` or - :class:`ClientRawResponse` + :return: CertificateDescription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.CertificateDescription or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorDetailsException` """ certificate_description = models.CertificateBodyDescription(certificate=certificate) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}' + 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'), @@ -239,23 +231,24 @@ def create_or_update( # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) - if response.status_code not in [201, 200]: + if response.status_code not in [200, 201]: raise models.ErrorDetailsException(self._deserialize, response) deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('CertificateDescription', response) 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): @@ -278,16 +271,13 @@ def delete( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or - :class:`ClientRawResponse` if - raw=true - :rtype: None or - :class:`ClientRawResponse` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorDetailsException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}' + 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'), @@ -313,7 +303,7 @@ def delete( # Construct and send request request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200, 204]: raise models.ErrorDetailsException(self._deserialize, response) @@ -321,6 +311,7 @@ def delete( 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): @@ -343,18 +334,15 @@ def generate_verification_code( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`CertificateWithNonceDescription - ` or - :class:`ClientRawResponse` if + :return: CertificateWithNonceDescription or ClientRawResponse if raw=true - :rtype: :class:`CertificateWithNonceDescription - ` or - :class:`ClientRawResponse` + :rtype: ~azure.mgmt.iothub.models.CertificateWithNonceDescription or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorDetailsException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/generateVerificationCode' + 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'), @@ -380,7 +368,7 @@ def generate_verification_code( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -395,6 +383,7 @@ def generate_verification_code( 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): @@ -420,20 +409,16 @@ def verify( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`CertificateDescription - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`CertificateDescription - ` or - :class:`ClientRawResponse` + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify' + 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'), @@ -463,7 +448,7 @@ def verify( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -478,3 +463,4 @@ def verify( return client_raw_response return deserialized + verify.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify'} diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/operations/iot_hub_resource_operations.py b/azure-mgmt-iothub/azure/mgmt/iothub/operations/iot_hub_resource_operations.py index fc16f51ef8ad..bd88aa916beb 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/operations/iot_hub_resource_operations.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/operations/iot_hub_resource_operations.py @@ -11,7 +11,9 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_operation import AzureOperationPoller +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -22,16 +24,18 @@ class IotHubResourceOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The version of the API. Constant value: "2017-07-01". + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API. Constant value: "2018-01-22". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-07-01" + self.api_version = "2018-01-22" self.config = config @@ -51,18 +55,14 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`IotHubDescription - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`IotHubDescription - ` or - :class:`ClientRawResponse` + :return: IotHubDescription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.IotHubDescription or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorDetailsException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}' + 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'), @@ -86,7 +86,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -101,9 +101,62 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'} - def create_or_update( + + 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 @@ -118,28 +171,59 @@ def create_or_update( :type resource_name: str :param iot_hub_description: The IoT hub metadata and security metadata. - :type iot_hub_description: :class:`IotHubDescription - ` + :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: returns the direct response alongside the - deserialized response - :return: - :class:`AzureOperationPoller` - instance that returns :class:`IotHubDescription - ` or - :class:`ClientRawResponse` if - raw=true + :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: - :class:`AzureOperationPoller` - or :class:`ClientRawResponse` + ~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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}' + 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'), @@ -158,40 +242,70 @@ def create_or_update( 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') + body_content = self._serialize.body(iot_hub_tags, 'TagsResource') # Construct and send request - def long_running_send(): + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, 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 - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code == 200: + deserialized = self._deserialize('IotHubDescription', response) - def get_long_running_status(status_link, headers=None): + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + return deserialized - def get_long_running_output(response): + 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. - if response.status_code not in [201, 200]: - raise models.ErrorDetailsException(self._deserialize, response) + Update an existing IoT Hub tags. to update other fields use the + CreateOrUpdate method. - deserialized = None + :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 + ) - if response.status_code == 201: - deserialized = self._deserialize('IotHubDescription', response) - if response.status_code == 200: - deserialized = self._deserialize('IotHubDescription', response) + def get_long_running_output(response): + deserialized = self._deserialize('IotHubDescription', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -199,44 +313,20 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **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: returns the direct response alongside the - deserialized response - :return: - :class:`AzureOperationPoller` - instance that returns object or - :class:`ClientRawResponse` if - raw=true - :rtype: - :class:`AzureOperationPoller` - or :class:`ClientRawResponse` - :raises: - :class:`ErrorDetailsException` - """ + def _delete_initial( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}' + 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'), @@ -259,32 +349,60 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) + if response.status_code not in [200, 202, 204, 404]: + raise models.ErrorDetailsException(self._deserialize, response) - def get_long_running_status(status_link, headers=None): + deserialized = None - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + 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) - def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - if response.status_code not in [202, 200, 204, 404]: - raise models.ErrorDetailsException(self._deserialize, response) + return deserialized + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete an IoT hub. - deserialized = None + 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 + ) - if response.status_code == 202: - deserialized = self._deserialize('IotHubDescription', response) - if response.status_code == 200: - deserialized = self._deserialize('IotHubDescription', response) - if response.status_code == 404: - deserialized = self._deserialize('ErrorDetails', response) + def get_long_running_output(response): + deserialized = self._deserialize('object', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -292,16 +410,14 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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): @@ -314,10 +430,9 @@ def list_by_subscription( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`IotHubDescription - ` - :rtype: :class:`IotHubDescriptionPaged - ` + :return: An iterator like instance of IotHubDescription + :rtype: + ~azure.mgmt.iothub.models.IotHubDescriptionPaged[~azure.mgmt.iothub.models.IotHubDescription] :raises: :class:`ErrorDetailsException` """ @@ -325,7 +440,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/IotHubs' + url = self.list_by_subscription.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -352,7 +467,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -368,6 +483,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response 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): @@ -383,10 +499,9 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`IotHubDescription - ` - :rtype: :class:`IotHubDescriptionPaged - ` + :return: An iterator like instance of IotHubDescription + :rtype: + ~azure.mgmt.iothub.models.IotHubDescriptionPaged[~azure.mgmt.iothub.models.IotHubDescription] :raises: :class:`ErrorDetailsException` """ @@ -394,7 +509,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs' + 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') @@ -422,7 +537,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -438,6 +553,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response 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): @@ -455,18 +571,14 @@ def get_stats( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`RegistryStatistics - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`RegistryStatistics - ` or - :class:`ClientRawResponse` + :return: RegistryStatistics or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.RegistryStatistics or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorDetailsException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats' + 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'), @@ -490,7 +602,7 @@ def get_stats( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -505,6 +617,7 @@ def get_stats( 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): @@ -522,10 +635,9 @@ def get_valid_skus( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`IotHubSkuDescription - ` - :rtype: :class:`IotHubSkuDescriptionPaged - ` + :return: An iterator like instance of IotHubSkuDescription + :rtype: + ~azure.mgmt.iothub.models.IotHubSkuDescriptionPaged[~azure.mgmt.iothub.models.IotHubSkuDescription] :raises: :class:`ErrorDetailsException` """ @@ -533,7 +645,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/skus' + 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'), @@ -562,7 +674,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -578,6 +690,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response 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): @@ -600,8 +713,9 @@ def list_event_hub_consumer_groups( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of str - :rtype: :class:`StrPaged ` + :return: An iterator like instance of EventHubConsumerGroupInfo + :rtype: + ~azure.mgmt.iothub.models.EventHubConsumerGroupInfoPaged[~azure.mgmt.iothub.models.EventHubConsumerGroupInfo] :raises: :class:`ErrorDetailsException` """ @@ -609,7 +723,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups' + 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'), @@ -639,7 +753,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -647,14 +761,15 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.StrPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.EventHubConsumerGroupInfoPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.StrPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.EventHubConsumerGroupInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response 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): @@ -679,18 +794,14 @@ def get_event_hub_consumer_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`EventHubConsumerGroupInfo - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`EventHubConsumerGroupInfo - ` or - :class:`ClientRawResponse` + :return: EventHubConsumerGroupInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.EventHubConsumerGroupInfo or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorDetailsException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}' + 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'), @@ -716,7 +827,7 @@ def get_event_hub_consumer_group( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -731,6 +842,7 @@ def get_event_hub_consumer_group( 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, custom_headers=None, raw=False, **operation_config): @@ -753,18 +865,14 @@ def create_event_hub_consumer_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`EventHubConsumerGroupInfo - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`EventHubConsumerGroupInfo - ` or - :class:`ClientRawResponse` + :return: EventHubConsumerGroupInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.EventHubConsumerGroupInfo or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorDetailsException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}' + 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'), @@ -790,7 +898,7 @@ def create_event_hub_consumer_group( # Construct and send request request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -805,6 +913,7 @@ def create_event_hub_consumer_group( 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): @@ -829,16 +938,13 @@ def delete_event_hub_consumer_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or - :class:`ClientRawResponse` if - raw=true - :rtype: None or - :class:`ClientRawResponse` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorDetailsException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}' + 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'), @@ -864,7 +970,7 @@ def delete_event_hub_consumer_group( # Construct and send request request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -872,6 +978,7 @@ def delete_event_hub_consumer_group( 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): @@ -891,10 +998,9 @@ def list_jobs( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`JobResponse - ` - :rtype: :class:`JobResponsePaged - ` + :return: An iterator like instance of JobResponse + :rtype: + ~azure.mgmt.iothub.models.JobResponsePaged[~azure.mgmt.iothub.models.JobResponse] :raises: :class:`ErrorDetailsException` """ @@ -902,7 +1008,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs' + 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'), @@ -931,7 +1037,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -947,6 +1053,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response 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): @@ -968,16 +1075,14 @@ def get_job( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`JobResponse ` - or :class:`ClientRawResponse` if - raw=true - :rtype: :class:`JobResponse ` or - :class:`ClientRawResponse` + :return: JobResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.JobResponse or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorDetailsException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs/{jobId}' + 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'), @@ -1002,7 +1107,7 @@ def get_job( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1017,6 +1122,7 @@ def get_job( 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): @@ -1034,10 +1140,9 @@ def get_quota_metrics( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`IotHubQuotaMetricInfo - ` - :rtype: :class:`IotHubQuotaMetricInfoPaged - ` + :return: An iterator like instance of IotHubQuotaMetricInfo + :rtype: + ~azure.mgmt.iothub.models.IotHubQuotaMetricInfoPaged[~azure.mgmt.iothub.models.IotHubQuotaMetricInfo] :raises: :class:`ErrorDetailsException` """ @@ -1045,7 +1150,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics' + 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'), @@ -1074,7 +1179,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1090,6 +1195,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + get_quota_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics'} def check_name_availability( self, name, custom_headers=None, raw=False, **operation_config): @@ -1104,20 +1210,16 @@ def check_name_availability( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`IotHubNameAvailabilityInfo - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`IotHubNameAvailabilityInfo - ` or - :class:`ClientRawResponse` + :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 = '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability' + url = self.check_name_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -1143,7 +1245,7 @@ def check_name_availability( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1158,6 +1260,7 @@ def check_name_availability( return client_raw_response return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability'} def list_keys( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): @@ -1178,10 +1281,9 @@ def list_keys( :param operation_config: :ref:`Operation configuration overrides`. :return: An iterator like instance of - :class:`SharedAccessSignatureAuthorizationRule - ` - :rtype: :class:`SharedAccessSignatureAuthorizationRulePaged - ` + SharedAccessSignatureAuthorizationRule + :rtype: + ~azure.mgmt.iothub.models.SharedAccessSignatureAuthorizationRulePaged[~azure.mgmt.iothub.models.SharedAccessSignatureAuthorizationRule] :raises: :class:`ErrorDetailsException` """ @@ -1189,7 +1291,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys' + 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'), @@ -1218,7 +1320,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1234,6 +1336,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response 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): @@ -1257,18 +1360,16 @@ def get_keys_for_key_name( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`SharedAccessSignatureAuthorizationRule - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`SharedAccessSignatureAuthorizationRule - ` or - :class:`ClientRawResponse` + :return: SharedAccessSignatureAuthorizationRule or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.iothub.models.SharedAccessSignatureAuthorizationRule or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorDetailsException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys' + 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'), @@ -1293,7 +1394,7 @@ def get_keys_for_key_name( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1308,6 +1409,7 @@ def get_keys_for_key_name( 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_blob_container_uri, exclude_keys, custom_headers=None, raw=False, **operation_config): @@ -1334,18 +1436,16 @@ def export_devices( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`JobResponse ` - or :class:`ClientRawResponse` if - raw=true - :rtype: :class:`JobResponse ` or - :class:`ClientRawResponse` + :return: JobResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.JobResponse or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorDetailsException` """ export_devices_parameters = models.ExportDevicesRequest(export_blob_container_uri=export_blob_container_uri, exclude_keys=exclude_keys) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices' + 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'), @@ -1373,7 +1473,7 @@ def export_devices( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1388,6 +1488,7 @@ def export_devices( 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, input_blob_container_uri, output_blob_container_uri, custom_headers=None, raw=False, **operation_config): @@ -1413,18 +1514,16 @@ def import_devices( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`JobResponse ` - or :class:`ClientRawResponse` if - raw=true - :rtype: :class:`JobResponse ` or - :class:`ClientRawResponse` + :return: JobResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.JobResponse or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorDetailsException` """ import_devices_parameters = models.ImportDevicesRequest(input_blob_container_uri=input_blob_container_uri, output_blob_container_uri=output_blob_container_uri) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices' + 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'), @@ -1452,7 +1551,7 @@ def import_devices( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1467,3 +1566,4 @@ def import_devices( return client_raw_response return deserialized + import_devices.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices'} diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/operations/operations.py b/azure-mgmt-iothub/azure/mgmt/iothub/operations/operations.py index 860b65afabf6..4a8813c9700f 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/operations/operations.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/operations/operations.py @@ -21,16 +21,18 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The version of the API. Constant value: "2017-07-01". + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API. Constant value: "2018-01-22". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-07-01" + self.api_version = "2018-01-22" self.config = config @@ -43,10 +45,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`Operation - ` - :rtype: :class:`OperationPaged - ` + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.iothub.models.OperationPaged[~azure.mgmt.iothub.models.Operation] :raises: :class:`ErrorDetailsException` """ @@ -54,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Devices/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -77,7 +78,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -93,3 +94,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Devices/operations'} diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/version.py b/azure-mgmt-iothub/azure/mgmt/iothub/version.py index 85da2c00c1a6..d383aa0490a9 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/version.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.4.0" +VERSION = "2018-01-22"