diff --git a/azure-mgmt-iothub/HISTORY.rst b/azure-mgmt-iothub/HISTORY.rst index fae2e7497c24..a6f71dcaa2a4 100644 --- a/azure-mgmt-iothub/HISTORY.rst +++ b/azure-mgmt-iothub/HISTORY.rst @@ -3,6 +3,19 @@ Release History =============== +0.6.0 (2018-08-27) +++++++++++++++++++ + +**Features** + +- Model CertificatePropertiesWithNonce has a new parameter certificate +- Model CertificateProperties has a new parameter certificate +- Added operation IotHubResourceOperations.test_all_routes +- Added operation IotHubResourceOperations.test_route +- Added operation IotHubResourceOperations.get_endpoint_health +- Added operation group ResourceProviderCommonOperations +- Client class can be used as a context manager to keep the underlying HTTP session open for performance + 0.5.0 (2018-04-17) ++++++++++++++++++ @@ -24,7 +37,7 @@ This version uses a next-generation code generator that *might* introduce breaki - Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same. - Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used. - - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, + - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`. - New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`, the response of the initial call will be returned without polling. diff --git a/azure-mgmt-iothub/README.rst b/azure-mgmt-iothub/README.rst index bcf1a922c072..1b800cdaf83d 100644 --- a/azure-mgmt-iothub/README.rst +++ b/azure-mgmt-iothub/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure IoTHub Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. 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 b6a87665f44f..5875b7ed560f 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/iot_hub_client.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/iot_hub_client.py @@ -9,12 +9,13 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION from .operations.operations import Operations from .operations.iot_hub_resource_operations import IotHubResourceOperations +from .operations.resource_provider_common_operations import ResourceProviderCommonOperations from .operations.certificates_operations import CertificatesOperations from . import models @@ -51,7 +52,7 @@ def __init__( self.subscription_id = subscription_id -class IotHubClient(object): +class IotHubClient(SDKClient): """Use this API to manage the IoT hubs in your Azure subscription. :ivar config: Configuration for client. @@ -61,6 +62,8 @@ class IotHubClient(object): :vartype operations: azure.mgmt.iothub.operations.Operations :ivar iot_hub_resource: IotHubResource operations :vartype iot_hub_resource: azure.mgmt.iothub.operations.IotHubResourceOperations + :ivar resource_provider_common: ResourceProviderCommon operations + :vartype resource_provider_common: azure.mgmt.iothub.operations.ResourceProviderCommonOperations :ivar certificates: Certificates operations :vartype certificates: azure.mgmt.iothub.operations.CertificatesOperations @@ -76,7 +79,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = IotHubClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(IotHubClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2018-04-01' @@ -87,5 +90,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.iot_hub_resource = IotHubResourceOperations( self._client, self.config, self._serialize, self._deserialize) + self.resource_provider_common = ResourceProviderCommonOperations( + self._client, self.config, self._serialize, self._deserialize) self.certificates = CertificatesOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/__init__.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/__init__.py index 125031202c9f..c7db4806796e 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/__init__.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/__init__.py @@ -11,10 +11,10 @@ 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_body_description_py3 import CertificateBodyDescription 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 @@ -41,6 +41,7 @@ from .operation_py3 import Operation from .error_details_py3 import ErrorDetails, ErrorDetailsException from .iot_hub_quota_metric_info_py3 import IotHubQuotaMetricInfo + from .endpoint_health_data_py3 import EndpointHealthData from .registry_statistics_py3 import RegistryStatistics from .job_response_py3 import JobResponse from .iot_hub_capacity_py3 import IotHubCapacity @@ -49,14 +50,27 @@ 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 .name_py3 import Name + from .user_subscription_quota_py3 import UserSubscriptionQuota + from .user_subscription_quota_list_result_py3 import UserSubscriptionQuotaListResult + from .routing_message_py3 import RoutingMessage + from .test_all_routes_input_py3 import TestAllRoutesInput + from .matched_route_py3 import MatchedRoute + from .test_all_routes_result_py3 import TestAllRoutesResult + from .test_route_input_py3 import TestRouteInput + from .route_error_position_py3 import RouteErrorPosition + from .route_error_range_py3 import RouteErrorRange + from .route_compilation_error_py3 import RouteCompilationError + from .test_route_result_details_py3 import TestRouteResultDetails + from .test_route_result_py3 import TestRouteResult 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_body_description import CertificateBodyDescription from .certificate_properties_with_nonce import CertificatePropertiesWithNonce from .certificate_with_nonce_description import CertificateWithNonceDescription from .shared_access_signature_authorization_rule import SharedAccessSignatureAuthorizationRule @@ -83,6 +97,7 @@ from .operation import Operation from .error_details import ErrorDetails, ErrorDetailsException from .iot_hub_quota_metric_info import IotHubQuotaMetricInfo + from .endpoint_health_data import EndpointHealthData from .registry_statistics import RegistryStatistics from .job_response import JobResponse from .iot_hub_capacity import IotHubCapacity @@ -91,6 +106,19 @@ from .event_hub_consumer_group_info import EventHubConsumerGroupInfo from .operation_inputs import OperationInputs from .iot_hub_name_availability_info import IotHubNameAvailabilityInfo + from .name import Name + from .user_subscription_quota import UserSubscriptionQuota + from .user_subscription_quota_list_result import UserSubscriptionQuotaListResult + from .routing_message import RoutingMessage + from .test_all_routes_input import TestAllRoutesInput + from .matched_route import MatchedRoute + from .test_all_routes_result import TestAllRoutesResult + from .test_route_input import TestRouteInput + from .route_error_position import RouteErrorPosition + from .route_error_range import RouteErrorRange + from .route_compilation_error import RouteCompilationError + from .test_route_result_details import TestRouteResultDetails + from .test_route_result import TestRouteResult from .export_devices_request import ExportDevicesRequest from .import_devices_request import ImportDevicesRequest from .operation_paged import OperationPaged @@ -99,6 +127,7 @@ 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 .endpoint_health_data_paged import EndpointHealthDataPaged from .shared_access_signature_authorization_rule_paged import SharedAccessSignatureAuthorizationRulePaged from .iot_hub_client_enums import ( AccessRights, @@ -108,18 +137,21 @@ Capabilities, IotHubSku, IotHubSkuTier, + EndpointHealthStatus, JobType, JobStatus, IotHubScaleType, IotHubNameUnavailabilityReason, + TestResultStatus, + RouteErrorSeverity, ) __all__ = [ 'CertificateVerificationDescription', - 'CertificateBodyDescription', 'CertificateProperties', 'CertificateDescription', 'CertificateListDescription', + 'CertificateBodyDescription', 'CertificatePropertiesWithNonce', 'CertificateWithNonceDescription', 'SharedAccessSignatureAuthorizationRule', @@ -146,6 +178,7 @@ 'Operation', 'ErrorDetails', 'ErrorDetailsException', 'IotHubQuotaMetricInfo', + 'EndpointHealthData', 'RegistryStatistics', 'JobResponse', 'IotHubCapacity', @@ -154,6 +187,19 @@ 'EventHubConsumerGroupInfo', 'OperationInputs', 'IotHubNameAvailabilityInfo', + 'Name', + 'UserSubscriptionQuota', + 'UserSubscriptionQuotaListResult', + 'RoutingMessage', + 'TestAllRoutesInput', + 'MatchedRoute', + 'TestAllRoutesResult', + 'TestRouteInput', + 'RouteErrorPosition', + 'RouteErrorRange', + 'RouteCompilationError', + 'TestRouteResultDetails', + 'TestRouteResult', 'ExportDevicesRequest', 'ImportDevicesRequest', 'OperationPaged', @@ -162,6 +208,7 @@ 'EventHubConsumerGroupInfoPaged', 'JobResponsePaged', 'IotHubQuotaMetricInfoPaged', + 'EndpointHealthDataPaged', 'SharedAccessSignatureAuthorizationRulePaged', 'AccessRights', 'IpFilterActionType', @@ -170,8 +217,11 @@ 'Capabilities', 'IotHubSku', 'IotHubSkuTier', + 'EndpointHealthStatus', 'JobType', 'JobStatus', 'IotHubScaleType', 'IotHubNameUnavailabilityReason', + 'TestResultStatus', + 'RouteErrorSeverity', ] 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 d91afb9c0adb..eaf2548f0f76 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties.py @@ -30,6 +30,8 @@ class CertificateProperties(Model): :vartype created: datetime :ivar updated: The certificate's last update date and time. :vartype updated: datetime + :param certificate: The certificate content + :type certificate: str """ _validation = { @@ -48,6 +50,7 @@ class CertificateProperties(Model): 'is_verified': {'key': 'isVerified', 'type': 'bool'}, 'created': {'key': 'created', 'type': 'rfc-1123'}, 'updated': {'key': 'updated', 'type': 'rfc-1123'}, + 'certificate': {'key': 'certificate', 'type': 'str'}, } def __init__(self, **kwargs): @@ -58,3 +61,4 @@ def __init__(self, **kwargs): self.is_verified = None self.created = None self.updated = None + self.certificate = kwargs.get('certificate', 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 index 334b0791a801..d9ac812152ce 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties_py3.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/certificate_properties_py3.py @@ -30,6 +30,8 @@ class CertificateProperties(Model): :vartype created: datetime :ivar updated: The certificate's last update date and time. :vartype updated: datetime + :param certificate: The certificate content + :type certificate: str """ _validation = { @@ -48,9 +50,10 @@ class CertificateProperties(Model): 'is_verified': {'key': 'isVerified', 'type': 'bool'}, 'created': {'key': 'created', 'type': 'rfc-1123'}, 'updated': {'key': 'updated', 'type': 'rfc-1123'}, + 'certificate': {'key': 'certificate', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, certificate: str=None, **kwargs) -> None: super(CertificateProperties, self).__init__(**kwargs) self.subject = None self.expiry = None @@ -58,3 +61,4 @@ def __init__(self, **kwargs) -> None: self.is_verified = None self.created = None self.updated = None + self.certificate = certificate 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 31d81c0e18b3..b5c2e7eb3a5f 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 @@ -34,6 +34,8 @@ class CertificatePropertiesWithNonce(Model): :ivar verification_code: The certificate's verification code that will be used for proof of possession. :vartype verification_code: str + :ivar certificate: The certificate content + :vartype certificate: str """ _validation = { @@ -44,6 +46,7 @@ class CertificatePropertiesWithNonce(Model): 'created': {'readonly': True}, 'updated': {'readonly': True}, 'verification_code': {'readonly': True}, + 'certificate': {'readonly': True}, } _attribute_map = { @@ -54,6 +57,7 @@ class CertificatePropertiesWithNonce(Model): 'created': {'key': 'created', 'type': 'rfc-1123'}, 'updated': {'key': 'updated', 'type': 'rfc-1123'}, 'verification_code': {'key': 'verificationCode', 'type': 'str'}, + 'certificate': {'key': 'certificate', 'type': 'str'}, } def __init__(self, **kwargs): @@ -65,3 +69,4 @@ def __init__(self, **kwargs): self.created = None self.updated = None self.verification_code = None + self.certificate = 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 index 384b1533b1fd..019bbed44de5 100644 --- 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 @@ -34,6 +34,8 @@ class CertificatePropertiesWithNonce(Model): :ivar verification_code: The certificate's verification code that will be used for proof of possession. :vartype verification_code: str + :ivar certificate: The certificate content + :vartype certificate: str """ _validation = { @@ -44,6 +46,7 @@ class CertificatePropertiesWithNonce(Model): 'created': {'readonly': True}, 'updated': {'readonly': True}, 'verification_code': {'readonly': True}, + 'certificate': {'readonly': True}, } _attribute_map = { @@ -54,6 +57,7 @@ class CertificatePropertiesWithNonce(Model): 'created': {'key': 'created', 'type': 'rfc-1123'}, 'updated': {'key': 'updated', 'type': 'rfc-1123'}, 'verification_code': {'key': 'verificationCode', 'type': 'str'}, + 'certificate': {'key': 'certificate', 'type': 'str'}, } def __init__(self, **kwargs) -> None: @@ -65,3 +69,4 @@ def __init__(self, **kwargs) -> None: self.created = None self.updated = None self.verification_code = None + self.certificate = None diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/endpoint_health_data.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/endpoint_health_data.py new file mode 100644 index 000000000000..eccd8e602362 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/endpoint_health_data.py @@ -0,0 +1,33 @@ +# 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 EndpointHealthData(Model): + """The health data for an endpoint. + + :param endpoint_id: Id of the endpoint + :type endpoint_id: str + :param health_status: Health status. Possible values include: 'unknown', + 'healthy', 'unhealthy', 'dead' + :type health_status: str or ~azure.mgmt.iothub.models.EndpointHealthStatus + """ + + _attribute_map = { + 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EndpointHealthData, self).__init__(**kwargs) + self.endpoint_id = kwargs.get('endpoint_id', None) + self.health_status = kwargs.get('health_status', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/endpoint_health_data_paged.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/endpoint_health_data_paged.py new file mode 100644 index 000000000000..7f46f9c3517d --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/endpoint_health_data_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class EndpointHealthDataPaged(Paged): + """ + A paging container for iterating over a list of :class:`EndpointHealthData ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EndpointHealthData]'} + } + + def __init__(self, *args, **kwargs): + + super(EndpointHealthDataPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/endpoint_health_data_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/endpoint_health_data_py3.py new file mode 100644 index 000000000000..40432163cf1a --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/endpoint_health_data_py3.py @@ -0,0 +1,33 @@ +# 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 EndpointHealthData(Model): + """The health data for an endpoint. + + :param endpoint_id: Id of the endpoint + :type endpoint_id: str + :param health_status: Health status. Possible values include: 'unknown', + 'healthy', 'unhealthy', 'dead' + :type health_status: str or ~azure.mgmt.iothub.models.EndpointHealthStatus + """ + + _attribute_map = { + 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + } + + def __init__(self, *, endpoint_id: str=None, health_status=None, **kwargs) -> None: + super(EndpointHealthData, self).__init__(**kwargs) + self.endpoint_id = endpoint_id + self.health_status = health_status 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 66ebf1fc7592..8540e106c59b 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 @@ -39,6 +39,7 @@ class IpFilterActionType(str, Enum): class RoutingSource(str, Enum): + invalid = "Invalid" device_messages = "DeviceMessages" twin_change_events = "TwinChangeEvents" device_lifecycle_events = "DeviceLifecycleEvents" @@ -77,6 +78,14 @@ class IotHubSkuTier(str, Enum): basic = "Basic" +class EndpointHealthStatus(str, Enum): + + unknown = "unknown" + healthy = "healthy" + unhealthy = "unhealthy" + dead = "dead" + + class JobType(str, Enum): unknown = "unknown" @@ -112,3 +121,16 @@ class IotHubNameUnavailabilityReason(str, Enum): invalid = "Invalid" already_exists = "AlreadyExists" + + +class TestResultStatus(str, Enum): + + undefined = "undefined" + false = "false" + true = "true" + + +class RouteErrorSeverity(str, Enum): + + error = "error" + warning = "warning" diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_description.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_description.py index aaac4a514926..ce2fa05c9870 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 @@ -34,9 +34,9 @@ class IotHubDescription(Resource): response body, it must also be provided as a header per the normal ETag convention. :type etag: str - :param properties: + :param properties: IotHub properties :type properties: ~azure.mgmt.iothub.models.IotHubProperties - :param sku: Required. + :param sku: Required. IotHub SKU info :type sku: ~azure.mgmt.iothub.models.IotHubSkuInfo """ 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 index 84edd6c8d3bc..74b29768460e 100644 --- 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 @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class IotHubDescription(Resource): @@ -34,9 +34,9 @@ class IotHubDescription(Resource): response body, it must also be provided as a header per the normal ETag convention. :type etag: str - :param properties: + :param properties: IotHub properties :type properties: ~azure.mgmt.iothub.models.IotHubProperties - :param sku: Required. + :param sku: Required. IotHub SKU info :type sku: ~azure.mgmt.iothub.models.IotHubSkuInfo """ 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 0837ddca79eb..b21fec3001d0 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 @@ -24,7 +24,7 @@ class IotHubSkuDescription(Model): :vartype resource_type: str :param sku: Required. The type of the resource. :type sku: ~azure.mgmt.iothub.models.IotHubSkuInfo - :param capacity: Required. + :param capacity: Required. IotHub capacity :type capacity: ~azure.mgmt.iothub.models.IotHubCapacity """ 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 index e2cf73c436cb..7aa551a81b79 100644 --- 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 @@ -24,7 +24,7 @@ class IotHubSkuDescription(Model): :vartype resource_type: str :param sku: Required. The type of the resource. :type sku: ~azure.mgmt.iothub.models.IotHubSkuInfo - :param capacity: Required. + :param capacity: Required. IotHub capacity :type capacity: ~azure.mgmt.iothub.models.IotHubCapacity """ diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/matched_route.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/matched_route.py new file mode 100644 index 000000000000..c0734abfdece --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/matched_route.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 MatchedRoute(Model): + """Routes that matched. + + :param properties: Properties of routes that matched + :type properties: ~azure.mgmt.iothub.models.RouteProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'RouteProperties'}, + } + + def __init__(self, **kwargs): + super(MatchedRoute, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/matched_route_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/matched_route_py3.py new file mode 100644 index 000000000000..eecd24fd49b7 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/matched_route_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 MatchedRoute(Model): + """Routes that matched. + + :param properties: Properties of routes that matched + :type properties: ~azure.mgmt.iothub.models.RouteProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'RouteProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(MatchedRoute, self).__init__(**kwargs) + self.properties = properties diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/name.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/name.py new file mode 100644 index 000000000000..119fdb10cea5 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/name.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 Name(Model): + """Name of Iot Hub type. + + :param value: IotHub type + :type value: str + :param localized_value: Localized value of name + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Name, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/name_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/name_py3.py new file mode 100644 index 000000000000..d40236f73bc7 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/name_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 Name(Model): + """Name of Iot Hub type. + + :param value: IotHub type + :type value: str + :param localized_value: Localized value of name + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(Name, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/route_compilation_error.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_compilation_error.py new file mode 100644 index 000000000000..c11e230581d6 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_compilation_error.py @@ -0,0 +1,37 @@ +# 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 RouteCompilationError(Model): + """Compilation error when evaluating route. + + :param message: Route error message + :type message: str + :param severity: Severity of the route error. Possible values include: + 'error', 'warning' + :type severity: str or ~azure.mgmt.iothub.models.RouteErrorSeverity + :param location: Location where the route error happened + :type location: ~azure.mgmt.iothub.models.RouteErrorRange + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'RouteErrorRange'}, + } + + def __init__(self, **kwargs): + super(RouteCompilationError, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.severity = kwargs.get('severity', None) + self.location = kwargs.get('location', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/route_compilation_error_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_compilation_error_py3.py new file mode 100644 index 000000000000..f179c58b5f91 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_compilation_error_py3.py @@ -0,0 +1,37 @@ +# 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 RouteCompilationError(Model): + """Compilation error when evaluating route. + + :param message: Route error message + :type message: str + :param severity: Severity of the route error. Possible values include: + 'error', 'warning' + :type severity: str or ~azure.mgmt.iothub.models.RouteErrorSeverity + :param location: Location where the route error happened + :type location: ~azure.mgmt.iothub.models.RouteErrorRange + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'RouteErrorRange'}, + } + + def __init__(self, *, message: str=None, severity=None, location=None, **kwargs) -> None: + super(RouteCompilationError, self).__init__(**kwargs) + self.message = message + self.severity = severity + self.location = location diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/route_error_position.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_error_position.py new file mode 100644 index 000000000000..5c2c05a70195 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_error_position.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 RouteErrorPosition(Model): + """Position where the route error happened. + + :param line: Line where the route error happened + :type line: int + :param column: Column where the route error happened + :type column: int + """ + + _attribute_map = { + 'line': {'key': 'line', 'type': 'int'}, + 'column': {'key': 'column', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(RouteErrorPosition, self).__init__(**kwargs) + self.line = kwargs.get('line', None) + self.column = kwargs.get('column', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/route_error_position_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_error_position_py3.py new file mode 100644 index 000000000000..a8d6b7c139bf --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_error_position_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 RouteErrorPosition(Model): + """Position where the route error happened. + + :param line: Line where the route error happened + :type line: int + :param column: Column where the route error happened + :type column: int + """ + + _attribute_map = { + 'line': {'key': 'line', 'type': 'int'}, + 'column': {'key': 'column', 'type': 'int'}, + } + + def __init__(self, *, line: int=None, column: int=None, **kwargs) -> None: + super(RouteErrorPosition, self).__init__(**kwargs) + self.line = line + self.column = column diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/route_error_range.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_error_range.py new file mode 100644 index 000000000000..2bc28d2281f6 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_error_range.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 RouteErrorRange(Model): + """Range of route errors. + + :param start: Start where the route error happened + :type start: ~azure.mgmt.iothub.models.RouteErrorPosition + :param end: End where the route error happened + :type end: ~azure.mgmt.iothub.models.RouteErrorPosition + """ + + _attribute_map = { + 'start': {'key': 'start', 'type': 'RouteErrorPosition'}, + 'end': {'key': 'end', 'type': 'RouteErrorPosition'}, + } + + def __init__(self, **kwargs): + super(RouteErrorRange, self).__init__(**kwargs) + self.start = kwargs.get('start', None) + self.end = kwargs.get('end', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/route_error_range_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_error_range_py3.py new file mode 100644 index 000000000000..bcafcaa32fa4 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_error_range_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 RouteErrorRange(Model): + """Range of route errors. + + :param start: Start where the route error happened + :type start: ~azure.mgmt.iothub.models.RouteErrorPosition + :param end: End where the route error happened + :type end: ~azure.mgmt.iothub.models.RouteErrorPosition + """ + + _attribute_map = { + 'start': {'key': 'start', 'type': 'RouteErrorPosition'}, + 'end': {'key': 'end', 'type': 'RouteErrorPosition'}, + } + + def __init__(self, *, start=None, end=None, **kwargs) -> None: + super(RouteErrorRange, self).__init__(**kwargs) + self.start = start + self.end = end 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 91c75e1d8c8b..cb23780b6f71 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/route_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_properties.py @@ -23,8 +23,9 @@ class RouteProperties(Model): 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' + to, such as DeviceMessages. Possible values include: 'Invalid', + '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 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 index e66f0009a123..a913d4880714 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/route_properties_py3.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/route_properties_py3.py @@ -23,8 +23,9 @@ class RouteProperties(Model): 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' + to, such as DeviceMessages. Possible values include: 'Invalid', + '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 diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_message.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_message.py new file mode 100644 index 000000000000..542d091cd9d5 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_message.py @@ -0,0 +1,36 @@ +# 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 RoutingMessage(Model): + """Routing message. + + :param body: Body of routing message + :type body: str + :param app_properties: App properties + :type app_properties: dict[str, str] + :param system_properties: System properties + :type system_properties: dict[str, str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'str'}, + 'app_properties': {'key': 'appProperties', 'type': '{str}'}, + 'system_properties': {'key': 'systemProperties', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(RoutingMessage, self).__init__(**kwargs) + self.body = kwargs.get('body', None) + self.app_properties = kwargs.get('app_properties', None) + self.system_properties = kwargs.get('system_properties', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_message_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_message_py3.py new file mode 100644 index 000000000000..049f4a5a427b --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_message_py3.py @@ -0,0 +1,36 @@ +# 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 RoutingMessage(Model): + """Routing message. + + :param body: Body of routing message + :type body: str + :param app_properties: App properties + :type app_properties: dict[str, str] + :param system_properties: System properties + :type system_properties: dict[str, str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'str'}, + 'app_properties': {'key': 'appProperties', 'type': '{str}'}, + 'system_properties': {'key': 'systemProperties', 'type': '{str}'}, + } + + def __init__(self, *, body: str=None, app_properties=None, system_properties=None, **kwargs) -> None: + super(RoutingMessage, self).__init__(**kwargs) + self.body = body + self.app_properties = app_properties + self.system_properties = system_properties diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/test_all_routes_input.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_all_routes_input.py new file mode 100644 index 000000000000..a05ffeb7498f --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_all_routes_input.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 TestAllRoutesInput(Model): + """Input for testing all routes. + + :param routing_source: Routing source. Possible values include: 'Invalid', + 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', + 'DeviceJobLifecycleEvents' + :type routing_source: str or ~azure.mgmt.iothub.models.RoutingSource + :param message: Routing message + :type message: ~azure.mgmt.iothub.models.RoutingMessage + """ + + _attribute_map = { + 'routing_source': {'key': 'routingSource', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'RoutingMessage'}, + } + + def __init__(self, **kwargs): + super(TestAllRoutesInput, self).__init__(**kwargs) + self.routing_source = kwargs.get('routing_source', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/test_all_routes_input_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_all_routes_input_py3.py new file mode 100644 index 000000000000..b9b31d6efe97 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_all_routes_input_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 TestAllRoutesInput(Model): + """Input for testing all routes. + + :param routing_source: Routing source. Possible values include: 'Invalid', + 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', + 'DeviceJobLifecycleEvents' + :type routing_source: str or ~azure.mgmt.iothub.models.RoutingSource + :param message: Routing message + :type message: ~azure.mgmt.iothub.models.RoutingMessage + """ + + _attribute_map = { + 'routing_source': {'key': 'routingSource', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'RoutingMessage'}, + } + + def __init__(self, *, routing_source=None, message=None, **kwargs) -> None: + super(TestAllRoutesInput, self).__init__(**kwargs) + self.routing_source = routing_source + self.message = message diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/test_all_routes_result.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_all_routes_result.py new file mode 100644 index 000000000000..7d9488f8c551 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_all_routes_result.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 TestAllRoutesResult(Model): + """Result of testing all routes. + + :param routes: JSON-serialized array of matched routes + :type routes: list[~azure.mgmt.iothub.models.MatchedRoute] + """ + + _attribute_map = { + 'routes': {'key': 'routes', 'type': '[MatchedRoute]'}, + } + + def __init__(self, **kwargs): + super(TestAllRoutesResult, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/test_all_routes_result_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_all_routes_result_py3.py new file mode 100644 index 000000000000..da5c085f8e0a --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_all_routes_result_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 TestAllRoutesResult(Model): + """Result of testing all routes. + + :param routes: JSON-serialized array of matched routes + :type routes: list[~azure.mgmt.iothub.models.MatchedRoute] + """ + + _attribute_map = { + 'routes': {'key': 'routes', 'type': '[MatchedRoute]'}, + } + + def __init__(self, *, routes=None, **kwargs) -> None: + super(TestAllRoutesResult, self).__init__(**kwargs) + self.routes = routes diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_input.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_input.py new file mode 100644 index 000000000000..f89938514813 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_input.py @@ -0,0 +1,38 @@ +# 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 TestRouteInput(Model): + """Input for testing route. + + All required parameters must be populated in order to send to Azure. + + :param message: Routing message + :type message: ~azure.mgmt.iothub.models.RoutingMessage + :param route: Required. Route properties + :type route: ~azure.mgmt.iothub.models.RouteProperties + """ + + _validation = { + 'route': {'required': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'RoutingMessage'}, + 'route': {'key': 'route', 'type': 'RouteProperties'}, + } + + def __init__(self, **kwargs): + super(TestRouteInput, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.route = kwargs.get('route', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_input_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_input_py3.py new file mode 100644 index 000000000000..054145312070 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_input_py3.py @@ -0,0 +1,38 @@ +# 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 TestRouteInput(Model): + """Input for testing route. + + All required parameters must be populated in order to send to Azure. + + :param message: Routing message + :type message: ~azure.mgmt.iothub.models.RoutingMessage + :param route: Required. Route properties + :type route: ~azure.mgmt.iothub.models.RouteProperties + """ + + _validation = { + 'route': {'required': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'RoutingMessage'}, + 'route': {'key': 'route', 'type': 'RouteProperties'}, + } + + def __init__(self, *, route, message=None, **kwargs) -> None: + super(TestRouteInput, self).__init__(**kwargs) + self.message = message + self.route = route diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_result.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_result.py new file mode 100644 index 000000000000..5c0ae7ff8f1d --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_result.py @@ -0,0 +1,33 @@ +# 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 TestRouteResult(Model): + """Result of testing one route. + + :param result: Result of testing route. Possible values include: + 'undefined', 'false', 'true' + :type result: str or ~azure.mgmt.iothub.models.TestResultStatus + :param details: Detailed result of testing route + :type details: ~azure.mgmt.iothub.models.TestRouteResultDetails + """ + + _attribute_map = { + 'result': {'key': 'result', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'TestRouteResultDetails'}, + } + + def __init__(self, **kwargs): + super(TestRouteResult, self).__init__(**kwargs) + self.result = kwargs.get('result', None) + self.details = kwargs.get('details', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_result_details.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_result_details.py new file mode 100644 index 000000000000..53e3b99b6e8e --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_result_details.py @@ -0,0 +1,30 @@ +# 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 TestRouteResultDetails(Model): + """Detailed result of testing a route. + + :param compilation_errors: JSON-serialized list of route compilation + errors + :type compilation_errors: + list[~azure.mgmt.iothub.models.RouteCompilationError] + """ + + _attribute_map = { + 'compilation_errors': {'key': 'compilationErrors', 'type': '[RouteCompilationError]'}, + } + + def __init__(self, **kwargs): + super(TestRouteResultDetails, self).__init__(**kwargs) + self.compilation_errors = kwargs.get('compilation_errors', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_result_details_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_result_details_py3.py new file mode 100644 index 000000000000..6a1b850bb223 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_result_details_py3.py @@ -0,0 +1,30 @@ +# 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 TestRouteResultDetails(Model): + """Detailed result of testing a route. + + :param compilation_errors: JSON-serialized list of route compilation + errors + :type compilation_errors: + list[~azure.mgmt.iothub.models.RouteCompilationError] + """ + + _attribute_map = { + 'compilation_errors': {'key': 'compilationErrors', 'type': '[RouteCompilationError]'}, + } + + def __init__(self, *, compilation_errors=None, **kwargs) -> None: + super(TestRouteResultDetails, self).__init__(**kwargs) + self.compilation_errors = compilation_errors diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_result_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_result_py3.py new file mode 100644 index 000000000000..40bc12b3c63c --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/test_route_result_py3.py @@ -0,0 +1,33 @@ +# 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 TestRouteResult(Model): + """Result of testing one route. + + :param result: Result of testing route. Possible values include: + 'undefined', 'false', 'true' + :type result: str or ~azure.mgmt.iothub.models.TestResultStatus + :param details: Detailed result of testing route + :type details: ~azure.mgmt.iothub.models.TestRouteResultDetails + """ + + _attribute_map = { + 'result': {'key': 'result', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'TestRouteResultDetails'}, + } + + def __init__(self, *, result=None, details=None, **kwargs) -> None: + super(TestRouteResult, self).__init__(**kwargs) + self.result = result + self.details = details diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/user_subscription_quota.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/user_subscription_quota.py new file mode 100644 index 000000000000..5c5e474c74d4 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/user_subscription_quota.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 UserSubscriptionQuota(Model): + """User subscription quota response. + + :param id: IotHub type id + :type id: str + :param type: Response type + :type type: str + :param unit: Unit of IotHub type + :type unit: str + :param current_value: Current number of IotHub type + :type current_value: int + :param limit: Numerical limit on IotHub type + :type limit: int + :param name: IotHub type + :type name: ~azure.mgmt.iothub.models.Name + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'Name'}, + } + + def __init__(self, **kwargs): + super(UserSubscriptionQuota, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.unit = kwargs.get('unit', None) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/user_subscription_quota_list_result.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/user_subscription_quota_list_result.py new file mode 100644 index 000000000000..28595a1a5dbb --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/user_subscription_quota_list_result.py @@ -0,0 +1,39 @@ +# 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 UserSubscriptionQuotaListResult(Model): + """Json-serialized array of User subscription quota response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: + :type value: list[~azure.mgmt.iothub.models.UserSubscriptionQuota] + :ivar next_link: + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UserSubscriptionQuota]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserSubscriptionQuotaListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/user_subscription_quota_list_result_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/user_subscription_quota_list_result_py3.py new file mode 100644 index 000000000000..23ee4346bc48 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/user_subscription_quota_list_result_py3.py @@ -0,0 +1,39 @@ +# 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 UserSubscriptionQuotaListResult(Model): + """Json-serialized array of User subscription quota response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: + :type value: list[~azure.mgmt.iothub.models.UserSubscriptionQuota] + :ivar next_link: + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UserSubscriptionQuota]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(UserSubscriptionQuotaListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/user_subscription_quota_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/user_subscription_quota_py3.py new file mode 100644 index 000000000000..fb3011550948 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/user_subscription_quota_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 UserSubscriptionQuota(Model): + """User subscription quota response. + + :param id: IotHub type id + :type id: str + :param type: Response type + :type type: str + :param unit: Unit of IotHub type + :type unit: str + :param current_value: Current number of IotHub type + :type current_value: int + :param limit: Numerical limit on IotHub type + :type limit: int + :param name: IotHub type + :type name: ~azure.mgmt.iothub.models.Name + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'Name'}, + } + + def __init__(self, *, id: str=None, type: str=None, unit: str=None, current_value: int=None, limit: int=None, name=None, **kwargs) -> None: + super(UserSubscriptionQuota, self).__init__(**kwargs) + self.id = id + self.type = type + self.unit = unit + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/operations/__init__.py b/azure-mgmt-iothub/azure/mgmt/iothub/operations/__init__.py index 80ee066a9304..bee99168ebe3 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/operations/__init__.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/operations/__init__.py @@ -11,10 +11,12 @@ from .operations import Operations from .iot_hub_resource_operations import IotHubResourceOperations +from .resource_provider_common_operations import ResourceProviderCommonOperations from .certificates_operations import CertificatesOperations __all__ = [ 'Operations', 'IotHubResourceOperations', + 'ResourceProviderCommonOperations', 'CertificatesOperations', ] 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 7550e5328ca0..97425c41acd4 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/operations/certificates_operations.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/operations/certificates_operations.py @@ -73,7 +73,7 @@ def list_by_iot_hub( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -82,8 +82,8 @@ def list_by_iot_hub( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -140,7 +140,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -149,8 +149,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -215,6 +215,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -229,9 +230,8 @@ def create_or_update( body_content = self._serialize.body(certificate_description, 'CertificateBodyDescription') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: raise models.ErrorDetailsException(self._deserialize, response) @@ -292,7 +292,6 @@ def delete( # 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: @@ -302,8 +301,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: raise models.ErrorDetailsException(self._deserialize, response) @@ -357,7 +356,7 @@ def generate_verification_code( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -367,8 +366,8 @@ def generate_verification_code( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -433,6 +432,7 @@ def verify( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -446,9 +446,8 @@ def verify( body_content = self._serialize.body(certificate_verification_body, 'CertificateVerificationDescription') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) 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 26ee37a489db..9a5359e55915 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 @@ -76,7 +76,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -85,8 +85,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -121,6 +121,7 @@ def _create_or_update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -135,9 +136,8 @@ def _create_or_update_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: raise models.ErrorDetailsException(self._deserialize, response) @@ -237,6 +237,7 @@ def _update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -249,9 +250,8 @@ def _update_initial( body_content = self._serialize.body(iot_hub_tags, 'TagsResource') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -340,7 +340,7 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -349,8 +349,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204, 404]: raise models.ErrorDetailsException(self._deserialize, response) @@ -456,7 +456,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -465,9 +465,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -526,7 +525,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -535,9 +534,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -592,7 +590,7 @@ def get_stats( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -601,8 +599,8 @@ def get_stats( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -663,7 +661,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -672,9 +670,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -742,7 +739,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -751,9 +748,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -817,7 +813,7 @@ def get_event_hub_consumer_group( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -826,8 +822,8 @@ def get_event_hub_consumer_group( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -888,7 +884,7 @@ def create_event_hub_consumer_group( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -897,8 +893,8 @@ def create_event_hub_consumer_group( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -960,7 +956,6 @@ def delete_event_hub_consumer_group( # 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: @@ -969,8 +964,8 @@ def delete_event_hub_consumer_group( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1026,7 +1021,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -1035,9 +1030,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1097,7 +1091,7 @@ def get_job( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -1106,8 +1100,8 @@ def get_job( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1168,7 +1162,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -1177,9 +1171,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1197,6 +1190,77 @@ def internal_paging(next_link=None, raw=False): return deserialized get_quota_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics'} + def get_endpoint_health( + self, resource_group_name, iot_hub_name, custom_headers=None, raw=False, **operation_config): + """Get the health for routing endpoints. + + Get the health for routing endpoints. + + :param resource_group_name: + :type resource_group_name: str + :param iot_hub_name: + :type iot_hub_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EndpointHealthData + :rtype: + ~azure.mgmt.iothub.models.EndpointHealthDataPaged[~azure.mgmt.iothub.models.EndpointHealthData] + :raises: + :class:`ErrorDetailsException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_endpoint_health.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'iotHubName': self._serialize.url("iot_hub_name", iot_hub_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.EndpointHealthDataPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EndpointHealthDataPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_endpoint_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routingEndpointsHealth'} + def check_name_availability( self, name, custom_headers=None, raw=False, **operation_config): """Check if an IoT hub name is available. @@ -1231,6 +1295,7 @@ def check_name_availability( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -1243,9 +1308,8 @@ def check_name_availability( body_content = self._serialize.body(operation_inputs, 'OperationInputs') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1262,6 +1326,154 @@ def check_name_availability( return deserialized check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability'} + def test_all_routes( + self, iot_hub_name, resource_group_name, routing_source=None, message=None, custom_headers=None, raw=False, **operation_config): + """Test all routes. + + Test all routes configured in this Iot Hub. + + :param iot_hub_name: IotHub to be tested + :type iot_hub_name: str + :param resource_group_name: resource group which Iot Hub belongs to + :type resource_group_name: str + :param routing_source: Routing source. Possible values include: + 'Invalid', 'DeviceMessages', 'TwinChangeEvents', + 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents' + :type routing_source: str or ~azure.mgmt.iothub.models.RoutingSource + :param message: Routing message + :type message: ~azure.mgmt.iothub.models.RoutingMessage + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TestAllRoutesResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.TestAllRoutesResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + input = models.TestAllRoutesInput(routing_source=routing_source, message=message) + + # Construct URL + url = self.test_all_routes.metadata['url'] + path_format_arguments = { + 'iotHubName': self._serialize.url("iot_hub_name", iot_hub_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(input, 'TestAllRoutesInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TestAllRoutesResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + test_all_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall'} + + def test_route( + self, iot_hub_name, resource_group_name, route, message=None, custom_headers=None, raw=False, **operation_config): + """Test the new route. + + Test the new route for this Iot Hub. + + :param iot_hub_name: IotHub to be tested + :type iot_hub_name: str + :param resource_group_name: resource group which Iot Hub belongs to + :type resource_group_name: str + :param route: Route properties + :type route: ~azure.mgmt.iothub.models.RouteProperties + :param message: Routing message + :type message: ~azure.mgmt.iothub.models.RoutingMessage + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TestRouteResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.iothub.models.TestRouteResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + input = models.TestRouteInput(message=message, route=route) + + # Construct URL + url = self.test_route.metadata['url'] + path_format_arguments = { + 'iotHubName': self._serialize.url("iot_hub_name", iot_hub_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(input, 'TestRouteInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TestRouteResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + test_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testnew'} + def list_keys( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Get the security metadata for an IoT hub. For more information, see: @@ -1309,7 +1521,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -1318,9 +1530,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1384,7 +1595,7 @@ def get_keys_for_key_name( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -1393,8 +1604,8 @@ def get_keys_for_key_name( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1459,6 +1670,7 @@ def export_devices( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -1471,9 +1683,8 @@ def export_devices( body_content = self._serialize.body(export_devices_parameters, 'ExportDevicesRequest') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -1537,6 +1748,7 @@ def import_devices( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -1549,9 +1761,8 @@ def import_devices( body_content = self._serialize.body(import_devices_parameters, 'ImportDevicesRequest') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/operations/operations.py b/azure-mgmt-iothub/azure/mgmt/iothub/operations/operations.py index ebcdf5d1b068..d6bb6115948f 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/operations/operations.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/operations/operations.py @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/operations/resource_provider_common_operations.py b/azure-mgmt-iothub/azure/mgmt/iothub/operations/resource_provider_common_operations.py new file mode 100644 index 000000000000..78d3bb5be0c8 --- /dev/null +++ b/azure-mgmt-iothub/azure/mgmt/iothub/operations/resource_provider_common_operations.py @@ -0,0 +1,95 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ResourceProviderCommonOperations(object): + """ResourceProviderCommonOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API. Constant value: "2018-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-04-01" + + self.config = config + + def get_subscription_quota( + self, custom_headers=None, raw=False, **operation_config): + """Get the number of iot hubs in the subscription. + + Get the number of free and paid iot hubs in the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: UserSubscriptionQuotaListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.iothub.models.UserSubscriptionQuotaListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailsException` + """ + # Construct URL + url = self.get_subscription_quota.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('UserSubscriptionQuotaListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_subscription_quota.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/usages'} diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/version.py b/azure-mgmt-iothub/azure/mgmt/iothub/version.py index 266f5a486d79..5a7feab42d26 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.5.0" +VERSION = "0.6.0" diff --git a/azure-mgmt-iothub/build.json b/azure-mgmt-iothub/build.json deleted file mode 100644 index 9a4eaa711b59..000000000000 --- a/azure-mgmt-iothub/build.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "autorest": [ - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest-core", - "version": "2.0.4147", - "engines": { - "node": ">=7.10.0" - }, - "dependencies": {}, - "optionalDependencies": {}, - "devDependencies": { - "@microsoft.azure/async-io": "~1.0.21", - "@microsoft.azure/extension": "~1.1.5", - "@types/commonmark": "^0.27.0", - "@types/jsonpath": "^0.1.29", - "@types/node": "^8.0.28", - "@types/pify": "0.0.28", - "@types/source-map": "^0.5.0", - "@types/yargs": "^8.0.2", - "commonmark": "^0.27.0", - "file-url": "^2.0.2", - "get-uri": "^2.0.0", - "jsonpath": "^0.2.11", - "linq-es2015": "^2.4.25", - "mocha": "3.4.2", - "mocha-typescript": "1.1.5", - "pify": "^3.0.0", - "safe-eval": "^0.3.0", - "shx": "^0.2.2", - "source-map": "^0.5.6", - "source-map-support": "^0.4.15", - "strip-bom": "^3.0.0", - "typescript": "2.4.1", - "untildify": "^3.0.2", - "urijs": "^1.18.10", - "vscode-jsonrpc": "^3.3.1", - "yaml-ast-parser": "https://github.com/olydis/yaml-ast-parser/releases/download/0.0.34/yaml-ast-parser-0.0.34.tgz", - "yargs": "^8.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core", - "_shasum": "cfad16a831757f2f55e53bf56669d126cd36113a", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest-core@2.0.4147", - "_from": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core", - "_where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.modeler", - "version": "2.0.18", - "dependencies": { - "dotnet-2.0.0": "^1.1.0" - }, - "optionalDependencies": {}, - "devDependencies": { - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.1.1", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", - "_shasum": "b8e853f83b99b2a37ad534cb8463da5de4b11418", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.modeler@2.0.18", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", - "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.python", - "version": "2.0.13", - "dependencies": { - "dotnet-2.0.0": "^1.1.0" - }, - "optionalDependencies": {}, - "devDependencies": { - "@microsoft.azure/autorest.testserver": "^1.9.0", - "autorest": "^2.0.0", - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.1.1", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", - "_shasum": "ddbbf3e3f1f90ae4132b687cfa8450425ab4ffcd", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.python@2.0.13", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", - "_where": "/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - } - ], - "autorest_bootstrap": { - "dependencies": { - "autorest": { - "version": "2.0.4147", - "from": "autorest@latest", - "resolved": "https://registry.npmjs.org/autorest/-/autorest-2.0.4147.tgz" - } - } - }, - "date": "2017-10-04T18:07:02Z" -} \ No newline at end of file diff --git a/azure-mgmt-iothub/sdk_packaging.toml b/azure-mgmt-iothub/sdk_packaging.toml new file mode 100644 index 000000000000..04e30388fd54 --- /dev/null +++ b/azure-mgmt-iothub/sdk_packaging.toml @@ -0,0 +1,6 @@ +[packaging] +package_name = "azure-mgmt-iothub" +package_pprint_name = "IoTHub Management" +package_doc_id = "iot" +is_stable = false +is_arm = true diff --git a/azure-mgmt-iothub/setup.py b/azure-mgmt-iothub/setup.py index 504e113de5e8..e37489b5355f 100644 --- a/azure-mgmt-iothub/setup.py +++ b/azure-mgmt-iothub/setup.py @@ -72,12 +72,14 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'License :: OSI Approved :: MIT License', ], zip_safe=False, packages=find_packages(exclude=["tests"]), install_requires=[ - 'msrestazure>=0.4.20,<2.0.0', + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], cmdclass=cmdclass