diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/MANIFEST.in b/sdk/iothub/azure-mgmt-iothubprovisioningservices/MANIFEST.in index a3cb07df8765..efa752eaff96 100644 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/MANIFEST.in +++ b/sdk/iothub/azure-mgmt-iothubprovisioningservices/MANIFEST.in @@ -1,5 +1 @@ -recursive-include tests *.py *.yaml include *.md -include azure/__init__.py -include azure/mgmt/__init__.py - diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/README.md b/sdk/iothub/azure-mgmt-iothubprovisioningservices/README.md index 653f0a3c9600..979e57bbbdcb 100644 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/README.md +++ b/sdk/iothub/azure-mgmt-iothubprovisioningservices/README.md @@ -1,21 +1,47 @@ -# Microsoft Azure SDK for Python +## Microsoft Azure SDK for Python This is the Microsoft Azure IoTHub Provisioning Services Client Library. -This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. -For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) +Azure Resource Manager (ARM) is the next generation of management APIs +that replace the old Azure Service Management (ASM). -# Usage +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. -For code examples, see [IoTHub Provisioning Services](https://docs.microsoft.com/python/api/overview/azure/iot) -on docs.microsoft.com. +For the older Azure Service Management (ASM) libraries, see +[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) +library. +For a more complete set of Azure libraries, see the +[azure](https://pypi.python.org/pypi/azure) bundle package. -# Provide Feedback +## Compatibility -If you encounter any bugs or have suggestions, please file an issue in the -[Issues](https://github.com/Azure/azure-sdk-for-python/issues) -section of the project. +**IMPORTANT**: If you have an earlier version of the azure package +(version < 1.0), you should uninstall it before installing this +package. + +You can check the version using pip: + +``` shell +pip freeze +``` + +If you see azure==0.11.0 (or any version below 1.0), uninstall it first: + +``` shell +pip uninstall azure +``` +## Usage + +For code examples, see [IoTHub Provisioning +Services](https://docs.microsoft.com/python/api/overview/azure/iot) on +docs.microsoft.com. + +## Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in +the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-iothubprovisioningservices%2FREADME.png) +![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-iothubprovisioningservices%2FREADME.png) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/__init__.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/__init__.py index 908617c53e25..58106cbe3f33 100644 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/__init__.py +++ b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .iot_dps_client import IotDpsClient -from .version import VERSION +from ._configuration import IotDpsClientConfiguration +from ._iot_dps_client import IotDpsClient +__all__ = ['IotDpsClient', 'IotDpsClientConfiguration'] -__all__ = ['IotDpsClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/_configuration.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/_configuration.py new file mode 100644 index 000000000000..3aafe980b767 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/_configuration.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class IotDpsClientConfiguration(AzureConfiguration): + """Configuration for IotDpsClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription identifier. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(IotDpsClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-iothubprovisioningservices/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/iot_dps_client.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/_iot_dps_client.py similarity index 58% rename from sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/iot_dps_client.py rename to sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/_iot_dps_client.py index c5adb4f0be3e..6851663eb971 100644 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/iot_dps_client.py +++ b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/_iot_dps_client.py @@ -9,49 +9,17 @@ # 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.dps_certificate_operations import DpsCertificateOperations -from .operations.iot_dps_resource_operations import IotDpsResourceOperations -from . import models - - -class IotDpsClientConfiguration(AzureConfiguration): - """Configuration for IotDpsClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The subscription identifier. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(IotDpsClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-iothubprovisioningservices/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id +from ._configuration import IotDpsClientConfiguration +from .operations import Operations +from .operations import DpsCertificateOperations +from .operations import IotDpsResourceOperations +from . import models -class IotDpsClient(object): +class IotDpsClient(SDKClient): """API for using the Azure IoT Hub Device Provisioning Service features. :ivar config: Configuration for client. @@ -76,7 +44,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = IotDpsClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(IotDpsClient, 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-01-22' diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/__init__.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/__init__.py index 6bfa525ee9ab..d3fefc45237c 100644 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/__init__.py +++ b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/__init__.py @@ -10,56 +10,56 @@ # -------------------------------------------------------------------------- try: - from .error_messsage_py3 import ErrorMesssage - from .async_operation_result_py3 import AsyncOperationResult - from .certificate_properties_py3 import CertificateProperties - from .certificate_response_py3 import CertificateResponse - from .certificate_list_description_py3 import CertificateListDescription - from .certificate_body_description_py3 import CertificateBodyDescription - from .iot_dps_sku_info_py3 import IotDpsSkuInfo - from .iot_hub_definition_description_py3 import IotHubDefinitionDescription - from .shared_access_signature_authorization_rule_access_rights_description_py3 import SharedAccessSignatureAuthorizationRuleAccessRightsDescription - from .iot_dps_properties_description_py3 import IotDpsPropertiesDescription - from .provisioning_service_description_py3 import ProvisioningServiceDescription - from .resource_py3 import Resource - from .operation_display_py3 import OperationDisplay - from .operation_py3 import Operation - from .error_details_py3 import ErrorDetails, ErrorDetailsException - from .iot_dps_sku_definition_py3 import IotDpsSkuDefinition - from .operation_inputs_py3 import OperationInputs - from .name_availability_info_py3 import NameAvailabilityInfo - from .tags_resource_py3 import TagsResource - from .verification_code_response_properties_py3 import VerificationCodeResponseProperties - from .verification_code_response_py3 import VerificationCodeResponse - from .verification_code_request_py3 import VerificationCodeRequest + from ._models_py3 import AsyncOperationResult + from ._models_py3 import CertificateBodyDescription + from ._models_py3 import CertificateListDescription + from ._models_py3 import CertificateProperties + from ._models_py3 import CertificateResponse + from ._models_py3 import ErrorDetails, ErrorDetailsException + from ._models_py3 import ErrorMesssage + from ._models_py3 import IotDpsPropertiesDescription + from ._models_py3 import IotDpsSkuDefinition + from ._models_py3 import IotDpsSkuInfo + from ._models_py3 import IotHubDefinitionDescription + from ._models_py3 import NameAvailabilityInfo + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationInputs + from ._models_py3 import ProvisioningServiceDescription + from ._models_py3 import Resource + from ._models_py3 import SharedAccessSignatureAuthorizationRuleAccessRightsDescription + from ._models_py3 import TagsResource + from ._models_py3 import VerificationCodeRequest + from ._models_py3 import VerificationCodeResponse + from ._models_py3 import VerificationCodeResponseProperties except (SyntaxError, ImportError): - from .error_messsage import ErrorMesssage - from .async_operation_result import AsyncOperationResult - from .certificate_properties import CertificateProperties - from .certificate_response import CertificateResponse - from .certificate_list_description import CertificateListDescription - from .certificate_body_description import CertificateBodyDescription - from .iot_dps_sku_info import IotDpsSkuInfo - from .iot_hub_definition_description import IotHubDefinitionDescription - from .shared_access_signature_authorization_rule_access_rights_description import SharedAccessSignatureAuthorizationRuleAccessRightsDescription - from .iot_dps_properties_description import IotDpsPropertiesDescription - from .provisioning_service_description import ProvisioningServiceDescription - from .resource import Resource - from .operation_display import OperationDisplay - from .operation import Operation - from .error_details import ErrorDetails, ErrorDetailsException - from .iot_dps_sku_definition import IotDpsSkuDefinition - from .operation_inputs import OperationInputs - from .name_availability_info import NameAvailabilityInfo - from .tags_resource import TagsResource - from .verification_code_response_properties import VerificationCodeResponseProperties - from .verification_code_response import VerificationCodeResponse - from .verification_code_request import VerificationCodeRequest -from .operation_paged import OperationPaged -from .provisioning_service_description_paged import ProvisioningServiceDescriptionPaged -from .iot_dps_sku_definition_paged import IotDpsSkuDefinitionPaged -from .shared_access_signature_authorization_rule_access_rights_description_paged import SharedAccessSignatureAuthorizationRuleAccessRightsDescriptionPaged -from .iot_dps_client_enums import ( + from ._models import AsyncOperationResult + from ._models import CertificateBodyDescription + from ._models import CertificateListDescription + from ._models import CertificateProperties + from ._models import CertificateResponse + from ._models import ErrorDetails, ErrorDetailsException + from ._models import ErrorMesssage + from ._models import IotDpsPropertiesDescription + from ._models import IotDpsSkuDefinition + from ._models import IotDpsSkuInfo + from ._models import IotHubDefinitionDescription + from ._models import NameAvailabilityInfo + from ._models import Operation + from ._models import OperationDisplay + from ._models import OperationInputs + from ._models import ProvisioningServiceDescription + from ._models import Resource + from ._models import SharedAccessSignatureAuthorizationRuleAccessRightsDescription + from ._models import TagsResource + from ._models import VerificationCodeRequest + from ._models import VerificationCodeResponse + from ._models import VerificationCodeResponseProperties +from ._paged_models import IotDpsSkuDefinitionPaged +from ._paged_models import OperationPaged +from ._paged_models import ProvisioningServiceDescriptionPaged +from ._paged_models import SharedAccessSignatureAuthorizationRuleAccessRightsDescriptionPaged +from ._iot_dps_client_enums import ( IotDpsSku, State, AllocationPolicy, @@ -69,28 +69,28 @@ ) __all__ = [ - 'ErrorMesssage', 'AsyncOperationResult', + 'CertificateBodyDescription', + 'CertificateListDescription', 'CertificateProperties', 'CertificateResponse', - 'CertificateListDescription', - 'CertificateBodyDescription', + 'ErrorDetails', 'ErrorDetailsException', + 'ErrorMesssage', + 'IotDpsPropertiesDescription', + 'IotDpsSkuDefinition', 'IotDpsSkuInfo', 'IotHubDefinitionDescription', - 'SharedAccessSignatureAuthorizationRuleAccessRightsDescription', - 'IotDpsPropertiesDescription', - 'ProvisioningServiceDescription', - 'Resource', - 'OperationDisplay', + 'NameAvailabilityInfo', 'Operation', - 'ErrorDetails', 'ErrorDetailsException', - 'IotDpsSkuDefinition', + 'OperationDisplay', 'OperationInputs', - 'NameAvailabilityInfo', + 'ProvisioningServiceDescription', + 'Resource', + 'SharedAccessSignatureAuthorizationRuleAccessRightsDescription', 'TagsResource', - 'VerificationCodeResponseProperties', - 'VerificationCodeResponse', 'VerificationCodeRequest', + 'VerificationCodeResponse', + 'VerificationCodeResponseProperties', 'OperationPaged', 'ProvisioningServiceDescriptionPaged', 'IotDpsSkuDefinitionPaged', diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_client_enums.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/_iot_dps_client_enums.py similarity index 100% rename from sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_client_enums.py rename to sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/_iot_dps_client_enums.py diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/_models.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/_models.py new file mode 100644 index 000000000000..d203f08b8251 --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/_models.py @@ -0,0 +1,766 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AsyncOperationResult(Model): + """Result of a long running operation. + + :param status: current status of a long running operation. + :type status: str + :param error: Error message containing code, description and details + :type error: ~azure.mgmt.iothubprovisioningservices.models.ErrorMesssage + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorMesssage'}, + } + + def __init__(self, **kwargs): + super(AsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) + + +class CertificateBodyDescription(Model): + """The JSON-serialized X509 Certificate. + + :param certificate: Base-64 representation of the X509 leaf certificate + .cer file or just .pem file content. + :type certificate: str + """ + + _attribute_map = { + 'certificate': {'key': 'certificate', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CertificateBodyDescription, self).__init__(**kwargs) + self.certificate = kwargs.get('certificate', None) + + +class CertificateListDescription(Model): + """The JSON-serialized array of Certificate objects. + + :param value: The array of Certificate objects. + :type value: + list[~azure.mgmt.iothubprovisioningservices.models.CertificateResponse] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CertificateResponse]'}, + } + + def __init__(self, **kwargs): + super(CertificateListDescription, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class CertificateProperties(Model): + """The description of an X509 CA Certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar subject: The certificate's subject name. + :vartype subject: str + :ivar expiry: The certificate's expiration date and time. + :vartype expiry: datetime + :ivar thumbprint: The certificate's thumbprint. + :vartype thumbprint: str + :ivar is_verified: Determines whether certificate has been verified. + :vartype is_verified: bool + :ivar created: The certificate's creation date and time. + :vartype created: datetime + :ivar updated: The certificate's last update date and time. + :vartype updated: datetime + """ + + _validation = { + 'subject': {'readonly': True}, + 'expiry': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'is_verified': {'readonly': True}, + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + } + + _attribute_map = { + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiry': {'key': 'expiry', 'type': 'rfc-1123'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'is_verified': {'key': 'isVerified', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'rfc-1123'}, + 'updated': {'key': 'updated', 'type': 'rfc-1123'}, + } + + def __init__(self, **kwargs): + super(CertificateProperties, self).__init__(**kwargs) + self.subject = None + self.expiry = None + self.thumbprint = None + self.is_verified = None + self.created = None + self.updated = None + + +class CertificateResponse(Model): + """The X509 Certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param properties: properties of a certificate + :type properties: + ~azure.mgmt.iothubprovisioningservices.models.CertificateProperties + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The name of the certificate. + :vartype name: str + :ivar etag: The entity tag. + :vartype etag: str + :ivar type: The resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'CertificateProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CertificateResponse, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.id = None + self.name = None + self.etag = None + self.type = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorDetails(Model): + """Error details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar http_status_code: The HTTP status code. + :vartype http_status_code: str + :ivar message: The error message. + :vartype message: str + :ivar details: The error details. + :vartype details: str + """ + + _validation = { + 'code': {'readonly': True}, + 'http_status_code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'http_status_code': {'key': 'httpStatusCode', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.http_status_code = None + self.message = None + self.details = None + + +class ErrorDetailsException(HttpOperationError): + """Server responsed with exception of type: 'ErrorDetails'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorDetailsException, self).__init__(deserialize, response, 'ErrorDetails', *args) + + +class ErrorMesssage(Model): + """Error response containing message and code. + + :param code: standard error code + :type code: str + :param message: standard error description + :type message: str + :param details: detailed summary of error + :type details: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorMesssage, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class IotDpsPropertiesDescription(Model): + """the service specific properties of a provisioning service, including keys, + linked iot hubs, current state, and system generated properties such as + hostname and idScope. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param state: Current state of the provisioning service. Possible values + include: 'Activating', 'Active', 'Deleting', 'Deleted', + 'ActivationFailed', 'DeletionFailed', 'Transitioning', 'Suspending', + 'Suspended', 'Resuming', 'FailingOver', 'FailoverFailed' + :type state: str or ~azure.mgmt.iothubprovisioningservices.models.State + :param provisioning_state: The ARM provisioning state of the provisioning + service. + :type provisioning_state: str + :param iot_hubs: List of IoT hubs associated with this provisioning + service. + :type iot_hubs: + list[~azure.mgmt.iothubprovisioningservices.models.IotHubDefinitionDescription] + :param allocation_policy: Allocation policy to be used by this + provisioning service. Possible values include: 'Hashed', 'GeoLatency', + 'Static' + :type allocation_policy: str or + ~azure.mgmt.iothubprovisioningservices.models.AllocationPolicy + :ivar service_operations_host_name: Service endpoint for provisioning + service. + :vartype service_operations_host_name: str + :ivar device_provisioning_host_name: Device endpoint for this provisioning + service. + :vartype device_provisioning_host_name: str + :ivar id_scope: Unique identifier of this provisioning service. + :vartype id_scope: str + :param authorization_policies: List of authorization keys for a + provisioning service. + :type authorization_policies: + list[~azure.mgmt.iothubprovisioningservices.models.SharedAccessSignatureAuthorizationRuleAccessRightsDescription] + """ + + _validation = { + 'service_operations_host_name': {'readonly': True}, + 'device_provisioning_host_name': {'readonly': True}, + 'id_scope': {'readonly': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'iot_hubs': {'key': 'iotHubs', 'type': '[IotHubDefinitionDescription]'}, + 'allocation_policy': {'key': 'allocationPolicy', 'type': 'str'}, + 'service_operations_host_name': {'key': 'serviceOperationsHostName', 'type': 'str'}, + 'device_provisioning_host_name': {'key': 'deviceProvisioningHostName', 'type': 'str'}, + 'id_scope': {'key': 'idScope', 'type': 'str'}, + 'authorization_policies': {'key': 'authorizationPolicies', 'type': '[SharedAccessSignatureAuthorizationRuleAccessRightsDescription]'}, + } + + def __init__(self, **kwargs): + super(IotDpsPropertiesDescription, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.iot_hubs = kwargs.get('iot_hubs', None) + self.allocation_policy = kwargs.get('allocation_policy', None) + self.service_operations_host_name = None + self.device_provisioning_host_name = None + self.id_scope = None + self.authorization_policies = kwargs.get('authorization_policies', None) + + +class IotDpsSkuDefinition(Model): + """Available SKUs of tier and units. + + :param name: Sku name. Possible values include: 'S1' + :type name: str or ~azure.mgmt.iothubprovisioningservices.models.IotDpsSku + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IotDpsSkuDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class IotDpsSkuInfo(Model): + """List of possible provisioning service SKUs. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: Sku name. Possible values include: 'S1' + :type name: str or ~azure.mgmt.iothubprovisioningservices.models.IotDpsSku + :ivar tier: Pricing tier name of the provisioning service. + :vartype tier: str + :param capacity: The number of units to provision + :type capacity: long + """ + + _validation = { + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(IotDpsSkuInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + self.capacity = kwargs.get('capacity', None) + + +class IotHubDefinitionDescription(Model): + """Description of the IoT hub. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param apply_allocation_policy: flag for applying allocationPolicy or not + for a given iot hub. + :type apply_allocation_policy: bool + :param allocation_weight: weight to apply for a given iot h. + :type allocation_weight: int + :ivar name: Host name of the IoT hub. + :vartype name: str + :param connection_string: Required. Connection string og the IoT hub. + :type connection_string: str + :param location: Required. ARM region of the IoT hub. + :type location: str + """ + + _validation = { + 'name': {'readonly': True}, + 'connection_string': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'apply_allocation_policy': {'key': 'applyAllocationPolicy', 'type': 'bool'}, + 'allocation_weight': {'key': 'allocationWeight', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IotHubDefinitionDescription, self).__init__(**kwargs) + self.apply_allocation_policy = kwargs.get('apply_allocation_policy', None) + self.allocation_weight = kwargs.get('allocation_weight', None) + self.name = None + self.connection_string = kwargs.get('connection_string', None) + self.location = kwargs.get('location', None) + + +class NameAvailabilityInfo(Model): + """Description of name availability. + + :param name_available: specifies if a name is available or not + :type name_available: bool + :param reason: specifies the reason a name is unavailable. Possible values + include: 'Invalid', 'AlreadyExists' + :type reason: str or + ~azure.mgmt.iothubprovisioningservices.models.NameUnavailabilityReason + :param message: message containing a detailed reason name is unavailable + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NameAvailabilityInfo, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) + + +class Operation(Model): + """IoT Hub REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{read | write | action | + delete} + :vartype name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.iothubprovisioningservices.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft Devices. + :vartype provider: str + :ivar resource: Resource Type: ProvisioningServices. + :vartype resource: str + :ivar operation: Name of the operation. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + + +class OperationInputs(Model): + """Input values for operation results call. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the Provisioning Service to check. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationInputs, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class Resource(Model): + """The common properties of an Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class ProvisioningServiceDescription(Resource): + """The description of the provisioning service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: The Etag field is *not* required. If it is provided in the + response body, it must also be provided as a header per the normal ETag + convention. + :type etag: str + :param properties: Required. Service specific properties for a + provisioning service + :type properties: + ~azure.mgmt.iothubprovisioningservices.models.IotDpsPropertiesDescription + :param sku: Required. Sku info for a provisioning Service. + :type sku: ~azure.mgmt.iothubprovisioningservices.models.IotDpsSkuInfo + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'properties': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'IotDpsPropertiesDescription'}, + 'sku': {'key': 'sku', 'type': 'IotDpsSkuInfo'}, + } + + def __init__(self, **kwargs): + super(ProvisioningServiceDescription, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.properties = kwargs.get('properties', None) + self.sku = kwargs.get('sku', None) + + +class SharedAccessSignatureAuthorizationRuleAccessRightsDescription(Model): + """Description of the shared access key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. Name of the key. + :type key_name: str + :param primary_key: Primary SAS key value. + :type primary_key: str + :param secondary_key: Secondary SAS key value. + :type secondary_key: str + :param rights: Required. Rights that this key has. Possible values + include: 'ServiceConfig', 'EnrollmentRead', 'EnrollmentWrite', + 'DeviceConnect', 'RegistrationStatusRead', 'RegistrationStatusWrite' + :type rights: str or + ~azure.mgmt.iothubprovisioningservices.models.AccessRightsDescription + """ + + _validation = { + 'key_name': {'required': True}, + 'rights': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'rights': {'key': 'rights', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SharedAccessSignatureAuthorizationRuleAccessRightsDescription, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.primary_key = kwargs.get('primary_key', None) + self.secondary_key = kwargs.get('secondary_key', None) + self.rights = kwargs.get('rights', None) + + +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a Provisioning Service instance. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TagsResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class VerificationCodeRequest(Model): + """The JSON-serialized leaf certificate. + + :param certificate: base-64 representation of X509 certificate .cer file + or just .pem file content. + :type certificate: str + """ + + _attribute_map = { + 'certificate': {'key': 'certificate', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VerificationCodeRequest, self).__init__(**kwargs) + self.certificate = kwargs.get('certificate', None) + + +class VerificationCodeResponse(Model): + """Description of the response of the verification code. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of certificate. + :vartype name: str + :ivar etag: Request etag. + :vartype etag: str + :ivar id: The resource identifier. + :vartype id: str + :ivar type: The resource type. + :vartype type: str + :param properties: + :type properties: + ~azure.mgmt.iothubprovisioningservices.models.VerificationCodeResponseProperties + """ + + _validation = { + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'VerificationCodeResponseProperties'}, + } + + def __init__(self, **kwargs): + super(VerificationCodeResponse, self).__init__(**kwargs) + self.name = None + self.etag = None + self.id = None + self.type = None + self.properties = kwargs.get('properties', None) + + +class VerificationCodeResponseProperties(Model): + """VerificationCodeResponseProperties. + + :param verification_code: Verification code. + :type verification_code: str + :param subject: Certificate subject. + :type subject: str + :param expiry: Code expiry. + :type expiry: str + :param thumbprint: Certificate thumbprint. + :type thumbprint: str + :param is_verified: Indicate if the certificate is verified by owner of + private key. + :type is_verified: bool + :param created: Certificate created time. + :type created: str + :param updated: Certificate updated time. + :type updated: str + """ + + _attribute_map = { + 'verification_code': {'key': 'verificationCode', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiry': {'key': 'expiry', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'is_verified': {'key': 'isVerified', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'str'}, + 'updated': {'key': 'updated', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VerificationCodeResponseProperties, self).__init__(**kwargs) + self.verification_code = kwargs.get('verification_code', None) + self.subject = kwargs.get('subject', None) + self.expiry = kwargs.get('expiry', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.is_verified = kwargs.get('is_verified', None) + self.created = kwargs.get('created', None) + self.updated = kwargs.get('updated', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/_models_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/_models_py3.py new file mode 100644 index 000000000000..c78d58dae22e --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/_models_py3.py @@ -0,0 +1,766 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AsyncOperationResult(Model): + """Result of a long running operation. + + :param status: current status of a long running operation. + :type status: str + :param error: Error message containing code, description and details + :type error: ~azure.mgmt.iothubprovisioningservices.models.ErrorMesssage + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorMesssage'}, + } + + def __init__(self, *, status: str=None, error=None, **kwargs) -> None: + super(AsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error + + +class CertificateBodyDescription(Model): + """The JSON-serialized X509 Certificate. + + :param certificate: Base-64 representation of the X509 leaf certificate + .cer file or just .pem file content. + :type certificate: str + """ + + _attribute_map = { + 'certificate': {'key': 'certificate', 'type': 'str'}, + } + + def __init__(self, *, certificate: str=None, **kwargs) -> None: + super(CertificateBodyDescription, self).__init__(**kwargs) + self.certificate = certificate + + +class CertificateListDescription(Model): + """The JSON-serialized array of Certificate objects. + + :param value: The array of Certificate objects. + :type value: + list[~azure.mgmt.iothubprovisioningservices.models.CertificateResponse] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CertificateResponse]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(CertificateListDescription, self).__init__(**kwargs) + self.value = value + + +class CertificateProperties(Model): + """The description of an X509 CA Certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar subject: The certificate's subject name. + :vartype subject: str + :ivar expiry: The certificate's expiration date and time. + :vartype expiry: datetime + :ivar thumbprint: The certificate's thumbprint. + :vartype thumbprint: str + :ivar is_verified: Determines whether certificate has been verified. + :vartype is_verified: bool + :ivar created: The certificate's creation date and time. + :vartype created: datetime + :ivar updated: The certificate's last update date and time. + :vartype updated: datetime + """ + + _validation = { + 'subject': {'readonly': True}, + 'expiry': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'is_verified': {'readonly': True}, + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + } + + _attribute_map = { + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiry': {'key': 'expiry', 'type': 'rfc-1123'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'is_verified': {'key': 'isVerified', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'rfc-1123'}, + 'updated': {'key': 'updated', 'type': 'rfc-1123'}, + } + + def __init__(self, **kwargs) -> None: + super(CertificateProperties, self).__init__(**kwargs) + self.subject = None + self.expiry = None + self.thumbprint = None + self.is_verified = None + self.created = None + self.updated = None + + +class CertificateResponse(Model): + """The X509 Certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param properties: properties of a certificate + :type properties: + ~azure.mgmt.iothubprovisioningservices.models.CertificateProperties + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The name of the certificate. + :vartype name: str + :ivar etag: The entity tag. + :vartype etag: str + :ivar type: The resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'CertificateProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(CertificateResponse, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.name = None + self.etag = None + self.type = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorDetails(Model): + """Error details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar http_status_code: The HTTP status code. + :vartype http_status_code: str + :ivar message: The error message. + :vartype message: str + :ivar details: The error details. + :vartype details: str + """ + + _validation = { + 'code': {'readonly': True}, + 'http_status_code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'http_status_code': {'key': 'httpStatusCode', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.http_status_code = None + self.message = None + self.details = None + + +class ErrorDetailsException(HttpOperationError): + """Server responsed with exception of type: 'ErrorDetails'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorDetailsException, self).__init__(deserialize, response, 'ErrorDetails', *args) + + +class ErrorMesssage(Model): + """Error response containing message and code. + + :param code: standard error code + :type code: str + :param message: standard error description + :type message: str + :param details: detailed summary of error + :type details: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, details: str=None, **kwargs) -> None: + super(ErrorMesssage, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class IotDpsPropertiesDescription(Model): + """the service specific properties of a provisioning service, including keys, + linked iot hubs, current state, and system generated properties such as + hostname and idScope. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param state: Current state of the provisioning service. Possible values + include: 'Activating', 'Active', 'Deleting', 'Deleted', + 'ActivationFailed', 'DeletionFailed', 'Transitioning', 'Suspending', + 'Suspended', 'Resuming', 'FailingOver', 'FailoverFailed' + :type state: str or ~azure.mgmt.iothubprovisioningservices.models.State + :param provisioning_state: The ARM provisioning state of the provisioning + service. + :type provisioning_state: str + :param iot_hubs: List of IoT hubs associated with this provisioning + service. + :type iot_hubs: + list[~azure.mgmt.iothubprovisioningservices.models.IotHubDefinitionDescription] + :param allocation_policy: Allocation policy to be used by this + provisioning service. Possible values include: 'Hashed', 'GeoLatency', + 'Static' + :type allocation_policy: str or + ~azure.mgmt.iothubprovisioningservices.models.AllocationPolicy + :ivar service_operations_host_name: Service endpoint for provisioning + service. + :vartype service_operations_host_name: str + :ivar device_provisioning_host_name: Device endpoint for this provisioning + service. + :vartype device_provisioning_host_name: str + :ivar id_scope: Unique identifier of this provisioning service. + :vartype id_scope: str + :param authorization_policies: List of authorization keys for a + provisioning service. + :type authorization_policies: + list[~azure.mgmt.iothubprovisioningservices.models.SharedAccessSignatureAuthorizationRuleAccessRightsDescription] + """ + + _validation = { + 'service_operations_host_name': {'readonly': True}, + 'device_provisioning_host_name': {'readonly': True}, + 'id_scope': {'readonly': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'iot_hubs': {'key': 'iotHubs', 'type': '[IotHubDefinitionDescription]'}, + 'allocation_policy': {'key': 'allocationPolicy', 'type': 'str'}, + 'service_operations_host_name': {'key': 'serviceOperationsHostName', 'type': 'str'}, + 'device_provisioning_host_name': {'key': 'deviceProvisioningHostName', 'type': 'str'}, + 'id_scope': {'key': 'idScope', 'type': 'str'}, + 'authorization_policies': {'key': 'authorizationPolicies', 'type': '[SharedAccessSignatureAuthorizationRuleAccessRightsDescription]'}, + } + + def __init__(self, *, state=None, provisioning_state: str=None, iot_hubs=None, allocation_policy=None, authorization_policies=None, **kwargs) -> None: + super(IotDpsPropertiesDescription, self).__init__(**kwargs) + self.state = state + self.provisioning_state = provisioning_state + self.iot_hubs = iot_hubs + self.allocation_policy = allocation_policy + self.service_operations_host_name = None + self.device_provisioning_host_name = None + self.id_scope = None + self.authorization_policies = authorization_policies + + +class IotDpsSkuDefinition(Model): + """Available SKUs of tier and units. + + :param name: Sku name. Possible values include: 'S1' + :type name: str or ~azure.mgmt.iothubprovisioningservices.models.IotDpsSku + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(IotDpsSkuDefinition, self).__init__(**kwargs) + self.name = name + + +class IotDpsSkuInfo(Model): + """List of possible provisioning service SKUs. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: Sku name. Possible values include: 'S1' + :type name: str or ~azure.mgmt.iothubprovisioningservices.models.IotDpsSku + :ivar tier: Pricing tier name of the provisioning service. + :vartype tier: str + :param capacity: The number of units to provision + :type capacity: long + """ + + _validation = { + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'long'}, + } + + def __init__(self, *, name=None, capacity: int=None, **kwargs) -> None: + super(IotDpsSkuInfo, self).__init__(**kwargs) + self.name = name + self.tier = None + self.capacity = capacity + + +class IotHubDefinitionDescription(Model): + """Description of the IoT hub. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param apply_allocation_policy: flag for applying allocationPolicy or not + for a given iot hub. + :type apply_allocation_policy: bool + :param allocation_weight: weight to apply for a given iot h. + :type allocation_weight: int + :ivar name: Host name of the IoT hub. + :vartype name: str + :param connection_string: Required. Connection string og the IoT hub. + :type connection_string: str + :param location: Required. ARM region of the IoT hub. + :type location: str + """ + + _validation = { + 'name': {'readonly': True}, + 'connection_string': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'apply_allocation_policy': {'key': 'applyAllocationPolicy', 'type': 'bool'}, + 'allocation_weight': {'key': 'allocationWeight', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, connection_string: str, location: str, apply_allocation_policy: bool=None, allocation_weight: int=None, **kwargs) -> None: + super(IotHubDefinitionDescription, self).__init__(**kwargs) + self.apply_allocation_policy = apply_allocation_policy + self.allocation_weight = allocation_weight + self.name = None + self.connection_string = connection_string + self.location = location + + +class NameAvailabilityInfo(Model): + """Description of name availability. + + :param name_available: specifies if a name is available or not + :type name_available: bool + :param reason: specifies the reason a name is unavailable. Possible values + include: 'Invalid', 'AlreadyExists' + :type reason: str or + ~azure.mgmt.iothubprovisioningservices.models.NameUnavailabilityReason + :param message: message containing a detailed reason name is unavailable + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, reason=None, message: str=None, **kwargs) -> None: + super(NameAvailabilityInfo, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message + + +class Operation(Model): + """IoT Hub REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{read | write | action | + delete} + :vartype name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.iothubprovisioningservices.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft Devices. + :vartype provider: str + :ivar resource: Resource Type: ProvisioningServices. + :vartype resource: str + :ivar operation: Name of the operation. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + + +class OperationInputs(Model): + """Input values for operation results call. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the Provisioning Service to check. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(OperationInputs, self).__init__(**kwargs) + self.name = name + + +class Resource(Model): + """The common properties of an Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class ProvisioningServiceDescription(Resource): + """The description of the provisioning service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource identifier. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param location: Required. The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param etag: The Etag field is *not* required. If it is provided in the + response body, it must also be provided as a header per the normal ETag + convention. + :type etag: str + :param properties: Required. Service specific properties for a + provisioning service + :type properties: + ~azure.mgmt.iothubprovisioningservices.models.IotDpsPropertiesDescription + :param sku: Required. Sku info for a provisioning Service. + :type sku: ~azure.mgmt.iothubprovisioningservices.models.IotDpsSkuInfo + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'properties': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'IotDpsPropertiesDescription'}, + 'sku': {'key': 'sku', 'type': 'IotDpsSkuInfo'}, + } + + def __init__(self, *, location: str, properties, sku, tags=None, etag: str=None, **kwargs) -> None: + super(ProvisioningServiceDescription, self).__init__(location=location, tags=tags, **kwargs) + self.etag = etag + self.properties = properties + self.sku = sku + + +class SharedAccessSignatureAuthorizationRuleAccessRightsDescription(Model): + """Description of the shared access key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. Name of the key. + :type key_name: str + :param primary_key: Primary SAS key value. + :type primary_key: str + :param secondary_key: Secondary SAS key value. + :type secondary_key: str + :param rights: Required. Rights that this key has. Possible values + include: 'ServiceConfig', 'EnrollmentRead', 'EnrollmentWrite', + 'DeviceConnect', 'RegistrationStatusRead', 'RegistrationStatusWrite' + :type rights: str or + ~azure.mgmt.iothubprovisioningservices.models.AccessRightsDescription + """ + + _validation = { + 'key_name': {'required': True}, + 'rights': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'rights': {'key': 'rights', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, rights, primary_key: str=None, secondary_key: str=None, **kwargs) -> None: + super(SharedAccessSignatureAuthorizationRuleAccessRightsDescription, self).__init__(**kwargs) + self.key_name = key_name + self.primary_key = primary_key + self.secondary_key = secondary_key + self.rights = rights + + +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a Provisioning Service instance. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsResource, self).__init__(**kwargs) + self.tags = tags + + +class VerificationCodeRequest(Model): + """The JSON-serialized leaf certificate. + + :param certificate: base-64 representation of X509 certificate .cer file + or just .pem file content. + :type certificate: str + """ + + _attribute_map = { + 'certificate': {'key': 'certificate', 'type': 'str'}, + } + + def __init__(self, *, certificate: str=None, **kwargs) -> None: + super(VerificationCodeRequest, self).__init__(**kwargs) + self.certificate = certificate + + +class VerificationCodeResponse(Model): + """Description of the response of the verification code. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of certificate. + :vartype name: str + :ivar etag: Request etag. + :vartype etag: str + :ivar id: The resource identifier. + :vartype id: str + :ivar type: The resource type. + :vartype type: str + :param properties: + :type properties: + ~azure.mgmt.iothubprovisioningservices.models.VerificationCodeResponseProperties + """ + + _validation = { + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'VerificationCodeResponseProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(VerificationCodeResponse, self).__init__(**kwargs) + self.name = None + self.etag = None + self.id = None + self.type = None + self.properties = properties + + +class VerificationCodeResponseProperties(Model): + """VerificationCodeResponseProperties. + + :param verification_code: Verification code. + :type verification_code: str + :param subject: Certificate subject. + :type subject: str + :param expiry: Code expiry. + :type expiry: str + :param thumbprint: Certificate thumbprint. + :type thumbprint: str + :param is_verified: Indicate if the certificate is verified by owner of + private key. + :type is_verified: bool + :param created: Certificate created time. + :type created: str + :param updated: Certificate updated time. + :type updated: str + """ + + _attribute_map = { + 'verification_code': {'key': 'verificationCode', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiry': {'key': 'expiry', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'is_verified': {'key': 'isVerified', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'str'}, + 'updated': {'key': 'updated', 'type': 'str'}, + } + + def __init__(self, *, verification_code: str=None, subject: str=None, expiry: str=None, thumbprint: str=None, is_verified: bool=None, created: str=None, updated: str=None, **kwargs) -> None: + super(VerificationCodeResponseProperties, self).__init__(**kwargs) + self.verification_code = verification_code + self.subject = subject + self.expiry = expiry + self.thumbprint = thumbprint + self.is_verified = is_verified + self.created = created + self.updated = updated diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/_paged_models.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/_paged_models.py new file mode 100644 index 000000000000..a43497d90f8c --- /dev/null +++ b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/_paged_models.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class ProvisioningServiceDescriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ProvisioningServiceDescription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ProvisioningServiceDescription]'} + } + + def __init__(self, *args, **kwargs): + + super(ProvisioningServiceDescriptionPaged, self).__init__(*args, **kwargs) +class IotDpsSkuDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`IotDpsSkuDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IotDpsSkuDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(IotDpsSkuDefinitionPaged, self).__init__(*args, **kwargs) +class SharedAccessSignatureAuthorizationRuleAccessRightsDescriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`SharedAccessSignatureAuthorizationRuleAccessRightsDescription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SharedAccessSignatureAuthorizationRuleAccessRightsDescription]'} + } + + def __init__(self, *args, **kwargs): + + super(SharedAccessSignatureAuthorizationRuleAccessRightsDescriptionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/async_operation_result.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/async_operation_result.py deleted file mode 100644 index d220a92098f5..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/async_operation_result.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 AsyncOperationResult(Model): - """Result of a long running operation. - - :param status: current status of a long running operation. - :type status: str - :param error: Error message containing code, description and details - :type error: ~azure.mgmt.iothubprovisioningservices.models.ErrorMesssage - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ErrorMesssage'}, - } - - def __init__(self, **kwargs): - super(AsyncOperationResult, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.error = kwargs.get('error', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/async_operation_result_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/async_operation_result_py3.py deleted file mode 100644 index d4365e11a55b..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/async_operation_result_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 AsyncOperationResult(Model): - """Result of a long running operation. - - :param status: current status of a long running operation. - :type status: str - :param error: Error message containing code, description and details - :type error: ~azure.mgmt.iothubprovisioningservices.models.ErrorMesssage - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ErrorMesssage'}, - } - - def __init__(self, *, status: str=None, error=None, **kwargs) -> None: - super(AsyncOperationResult, self).__init__(**kwargs) - self.status = status - self.error = error diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_body_description.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_body_description.py deleted file mode 100644 index a35e4c3fa2dd..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_body_description.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CertificateBodyDescription(Model): - """The JSON-serialized X509 Certificate. - - :param certificate: Base-64 representation of the X509 leaf certificate - .cer file or just .pem file content. - :type certificate: str - """ - - _attribute_map = { - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CertificateBodyDescription, self).__init__(**kwargs) - self.certificate = kwargs.get('certificate', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_body_description_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_body_description_py3.py deleted file mode 100644 index 0383312e8b38..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_body_description_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CertificateBodyDescription(Model): - """The JSON-serialized X509 Certificate. - - :param certificate: Base-64 representation of the X509 leaf certificate - .cer file or just .pem file content. - :type certificate: str - """ - - _attribute_map = { - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__(self, *, certificate: str=None, **kwargs) -> None: - super(CertificateBodyDescription, self).__init__(**kwargs) - self.certificate = certificate diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_list_description.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_list_description.py deleted file mode 100644 index e48e46d87abc..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_list_description.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CertificateListDescription(Model): - """The JSON-serialized array of Certificate objects. - - :param value: The array of Certificate objects. - :type value: - list[~azure.mgmt.iothubprovisioningservices.models.CertificateResponse] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[CertificateResponse]'}, - } - - def __init__(self, **kwargs): - super(CertificateListDescription, self).__init__(**kwargs) - self.value = kwargs.get('value', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_list_description_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_list_description_py3.py deleted file mode 100644 index 3c86d0ce38e6..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_list_description_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CertificateListDescription(Model): - """The JSON-serialized array of Certificate objects. - - :param value: The array of Certificate objects. - :type value: - list[~azure.mgmt.iothubprovisioningservices.models.CertificateResponse] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[CertificateResponse]'}, - } - - def __init__(self, *, value=None, **kwargs) -> None: - super(CertificateListDescription, self).__init__(**kwargs) - self.value = value diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_properties.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_properties.py deleted file mode 100644 index d38a4e83a28c..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_properties.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CertificateProperties(Model): - """The description of an X509 CA Certificate. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar subject: The certificate's subject name. - :vartype subject: str - :ivar expiry: The certificate's expiration date and time. - :vartype expiry: datetime - :ivar thumbprint: The certificate's thumbprint. - :vartype thumbprint: str - :ivar is_verified: Determines whether certificate has been verified. - :vartype is_verified: bool - :ivar created: The certificate's creation date and time. - :vartype created: datetime - :ivar updated: The certificate's last update date and time. - :vartype updated: datetime - """ - - _validation = { - 'subject': {'readonly': True}, - 'expiry': {'readonly': True}, - 'thumbprint': {'readonly': True}, - 'is_verified': {'readonly': True}, - 'created': {'readonly': True}, - 'updated': {'readonly': True}, - } - - _attribute_map = { - 'subject': {'key': 'subject', 'type': 'str'}, - 'expiry': {'key': 'expiry', 'type': 'rfc-1123'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - 'is_verified': {'key': 'isVerified', 'type': 'bool'}, - 'created': {'key': 'created', 'type': 'rfc-1123'}, - 'updated': {'key': 'updated', 'type': 'rfc-1123'}, - } - - def __init__(self, **kwargs): - super(CertificateProperties, self).__init__(**kwargs) - self.subject = None - self.expiry = None - self.thumbprint = None - self.is_verified = None - self.created = None - self.updated = None diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_properties_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_properties_py3.py deleted file mode 100644 index c7bdf10c5550..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_properties_py3.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CertificateProperties(Model): - """The description of an X509 CA Certificate. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar subject: The certificate's subject name. - :vartype subject: str - :ivar expiry: The certificate's expiration date and time. - :vartype expiry: datetime - :ivar thumbprint: The certificate's thumbprint. - :vartype thumbprint: str - :ivar is_verified: Determines whether certificate has been verified. - :vartype is_verified: bool - :ivar created: The certificate's creation date and time. - :vartype created: datetime - :ivar updated: The certificate's last update date and time. - :vartype updated: datetime - """ - - _validation = { - 'subject': {'readonly': True}, - 'expiry': {'readonly': True}, - 'thumbprint': {'readonly': True}, - 'is_verified': {'readonly': True}, - 'created': {'readonly': True}, - 'updated': {'readonly': True}, - } - - _attribute_map = { - 'subject': {'key': 'subject', 'type': 'str'}, - 'expiry': {'key': 'expiry', 'type': 'rfc-1123'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - 'is_verified': {'key': 'isVerified', 'type': 'bool'}, - 'created': {'key': 'created', 'type': 'rfc-1123'}, - 'updated': {'key': 'updated', 'type': 'rfc-1123'}, - } - - def __init__(self, **kwargs) -> None: - super(CertificateProperties, self).__init__(**kwargs) - self.subject = None - self.expiry = None - self.thumbprint = None - self.is_verified = None - self.created = None - self.updated = None diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_response.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_response.py deleted file mode 100644 index 6a4ff8db3d87..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 CertificateResponse(Model): - """The X509 Certificate. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param properties: properties of a certificate - :type properties: - ~azure.mgmt.iothubprovisioningservices.models.CertificateProperties - :ivar id: The resource identifier. - :vartype id: str - :ivar name: The name of the certificate. - :vartype name: str - :ivar etag: The entity tag. - :vartype etag: str - :ivar type: The resource type. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'etag': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'CertificateProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CertificateResponse, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.id = None - self.name = None - self.etag = None - self.type = None diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_response_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_response_py3.py deleted file mode 100644 index a551bc58c285..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/certificate_response_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 CertificateResponse(Model): - """The X509 Certificate. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param properties: properties of a certificate - :type properties: - ~azure.mgmt.iothubprovisioningservices.models.CertificateProperties - :ivar id: The resource identifier. - :vartype id: str - :ivar name: The name of the certificate. - :vartype name: str - :ivar etag: The entity tag. - :vartype etag: str - :ivar type: The resource type. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'etag': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'CertificateProperties'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, *, properties=None, **kwargs) -> None: - super(CertificateResponse, self).__init__(**kwargs) - self.properties = properties - self.id = None - self.name = None - self.etag = None - self.type = None diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/error_details.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/error_details.py deleted file mode 100644 index 77a408028562..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/error_details.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorDetails(Model): - """Error details. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar http_status_code: The HTTP status code. - :vartype http_status_code: str - :ivar message: The error message. - :vartype message: str - :ivar details: The error details. - :vartype details: str - """ - - _validation = { - 'code': {'readonly': True}, - 'http_status_code': {'readonly': True}, - 'message': {'readonly': True}, - 'details': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'http_status_code': {'key': 'httpStatusCode', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorDetails, self).__init__(**kwargs) - self.code = None - self.http_status_code = None - self.message = None - self.details = None - - -class ErrorDetailsException(HttpOperationError): - """Server responsed with exception of type: 'ErrorDetails'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorDetailsException, self).__init__(deserialize, response, 'ErrorDetails', *args) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/error_details_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/error_details_py3.py deleted file mode 100644 index a78684fab905..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/error_details_py3.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorDetails(Model): - """Error details. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar http_status_code: The HTTP status code. - :vartype http_status_code: str - :ivar message: The error message. - :vartype message: str - :ivar details: The error details. - :vartype details: str - """ - - _validation = { - 'code': {'readonly': True}, - 'http_status_code': {'readonly': True}, - 'message': {'readonly': True}, - 'details': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'http_status_code': {'key': 'httpStatusCode', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ErrorDetails, self).__init__(**kwargs) - self.code = None - self.http_status_code = None - self.message = None - self.details = None - - -class ErrorDetailsException(HttpOperationError): - """Server responsed with exception of type: 'ErrorDetails'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorDetailsException, self).__init__(deserialize, response, 'ErrorDetails', *args) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/error_messsage.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/error_messsage.py deleted file mode 100644 index ecec0bf5636a..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/error_messsage.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ErrorMesssage(Model): - """Error response containing message and code. - - :param code: standard error code - :type code: str - :param message: standard error description - :type message: str - :param details: detailed summary of error - :type details: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorMesssage, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.details = kwargs.get('details', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/error_messsage_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/error_messsage_py3.py deleted file mode 100644 index c430f625fe45..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/error_messsage_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ErrorMesssage(Model): - """Error response containing message and code. - - :param code: standard error code - :type code: str - :param message: standard error description - :type message: str - :param details: detailed summary of error - :type details: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'str'}, - } - - def __init__(self, *, code: str=None, message: str=None, details: str=None, **kwargs) -> None: - super(ErrorMesssage, self).__init__(**kwargs) - self.code = code - self.message = message - self.details = details diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_properties_description.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_properties_description.py deleted file mode 100644 index 1dadb948a1ab..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_properties_description.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 IotDpsPropertiesDescription(Model): - """the service specific properties of a provisoning service, including keys, - linked iot hubs, current state, and system generated properties such as - hostname and idScope. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param state: Current state of the provisioning service. Possible values - include: 'Activating', 'Active', 'Deleting', 'Deleted', - 'ActivationFailed', 'DeletionFailed', 'Transitioning', 'Suspending', - 'Suspended', 'Resuming', 'FailingOver', 'FailoverFailed' - :type state: str or ~azure.mgmt.iothubprovisioningservices.models.State - :param provisioning_state: The ARM provisioning state of the provisioning - service. - :type provisioning_state: str - :param iot_hubs: List of IoT hubs assosciated with this provisioning - service. - :type iot_hubs: - list[~azure.mgmt.iothubprovisioningservices.models.IotHubDefinitionDescription] - :param allocation_policy: Allocation policy to be used by this - provisioning service. Possible values include: 'Hashed', 'GeoLatency', - 'Static' - :type allocation_policy: str or - ~azure.mgmt.iothubprovisioningservices.models.AllocationPolicy - :ivar service_operations_host_name: Service endpoint for provisioning - service. - :vartype service_operations_host_name: str - :ivar device_provisioning_host_name: Device endpoint for this provisioning - service. - :vartype device_provisioning_host_name: str - :ivar id_scope: Unique identifier of this provisioning service. - :vartype id_scope: str - :param authorization_policies: List of authorization keys for a - provisioning service. - :type authorization_policies: - list[~azure.mgmt.iothubprovisioningservices.models.SharedAccessSignatureAuthorizationRuleAccessRightsDescription] - """ - - _validation = { - 'service_operations_host_name': {'readonly': True}, - 'device_provisioning_host_name': {'readonly': True}, - 'id_scope': {'readonly': True}, - } - - _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'iot_hubs': {'key': 'iotHubs', 'type': '[IotHubDefinitionDescription]'}, - 'allocation_policy': {'key': 'allocationPolicy', 'type': 'str'}, - 'service_operations_host_name': {'key': 'serviceOperationsHostName', 'type': 'str'}, - 'device_provisioning_host_name': {'key': 'deviceProvisioningHostName', 'type': 'str'}, - 'id_scope': {'key': 'idScope', 'type': 'str'}, - 'authorization_policies': {'key': 'authorizationPolicies', 'type': '[SharedAccessSignatureAuthorizationRuleAccessRightsDescription]'}, - } - - def __init__(self, **kwargs): - super(IotDpsPropertiesDescription, self).__init__(**kwargs) - self.state = kwargs.get('state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - self.iot_hubs = kwargs.get('iot_hubs', None) - self.allocation_policy = kwargs.get('allocation_policy', None) - self.service_operations_host_name = None - self.device_provisioning_host_name = None - self.id_scope = None - self.authorization_policies = kwargs.get('authorization_policies', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_properties_description_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_properties_description_py3.py deleted file mode 100644 index c8f57abf3473..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_properties_description_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 IotDpsPropertiesDescription(Model): - """the service specific properties of a provisoning service, including keys, - linked iot hubs, current state, and system generated properties such as - hostname and idScope. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param state: Current state of the provisioning service. Possible values - include: 'Activating', 'Active', 'Deleting', 'Deleted', - 'ActivationFailed', 'DeletionFailed', 'Transitioning', 'Suspending', - 'Suspended', 'Resuming', 'FailingOver', 'FailoverFailed' - :type state: str or ~azure.mgmt.iothubprovisioningservices.models.State - :param provisioning_state: The ARM provisioning state of the provisioning - service. - :type provisioning_state: str - :param iot_hubs: List of IoT hubs assosciated with this provisioning - service. - :type iot_hubs: - list[~azure.mgmt.iothubprovisioningservices.models.IotHubDefinitionDescription] - :param allocation_policy: Allocation policy to be used by this - provisioning service. Possible values include: 'Hashed', 'GeoLatency', - 'Static' - :type allocation_policy: str or - ~azure.mgmt.iothubprovisioningservices.models.AllocationPolicy - :ivar service_operations_host_name: Service endpoint for provisioning - service. - :vartype service_operations_host_name: str - :ivar device_provisioning_host_name: Device endpoint for this provisioning - service. - :vartype device_provisioning_host_name: str - :ivar id_scope: Unique identifier of this provisioning service. - :vartype id_scope: str - :param authorization_policies: List of authorization keys for a - provisioning service. - :type authorization_policies: - list[~azure.mgmt.iothubprovisioningservices.models.SharedAccessSignatureAuthorizationRuleAccessRightsDescription] - """ - - _validation = { - 'service_operations_host_name': {'readonly': True}, - 'device_provisioning_host_name': {'readonly': True}, - 'id_scope': {'readonly': True}, - } - - _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'iot_hubs': {'key': 'iotHubs', 'type': '[IotHubDefinitionDescription]'}, - 'allocation_policy': {'key': 'allocationPolicy', 'type': 'str'}, - 'service_operations_host_name': {'key': 'serviceOperationsHostName', 'type': 'str'}, - 'device_provisioning_host_name': {'key': 'deviceProvisioningHostName', 'type': 'str'}, - 'id_scope': {'key': 'idScope', 'type': 'str'}, - 'authorization_policies': {'key': 'authorizationPolicies', 'type': '[SharedAccessSignatureAuthorizationRuleAccessRightsDescription]'}, - } - - def __init__(self, *, state=None, provisioning_state: str=None, iot_hubs=None, allocation_policy=None, authorization_policies=None, **kwargs) -> None: - super(IotDpsPropertiesDescription, self).__init__(**kwargs) - self.state = state - self.provisioning_state = provisioning_state - self.iot_hubs = iot_hubs - self.allocation_policy = allocation_policy - self.service_operations_host_name = None - self.device_provisioning_host_name = None - self.id_scope = None - self.authorization_policies = authorization_policies diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_definition.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_definition.py deleted file mode 100644 index 02960e4abff9..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_definition.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 IotDpsSkuDefinition(Model): - """Available Sku's of tier and units. - - :param name: Sku name. Possible values include: 'S1' - :type name: str or ~azure.mgmt.iothubprovisioningservices.models.IotDpsSku - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(IotDpsSkuDefinition, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_definition_paged.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_definition_paged.py deleted file mode 100644 index 981f1fb2599a..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_definition_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 IotDpsSkuDefinitionPaged(Paged): - """ - A paging container for iterating over a list of :class:`IotDpsSkuDefinition ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[IotDpsSkuDefinition]'} - } - - def __init__(self, *args, **kwargs): - - super(IotDpsSkuDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_definition_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_definition_py3.py deleted file mode 100644 index e7b2c7c86a39..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_definition_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 IotDpsSkuDefinition(Model): - """Available Sku's of tier and units. - - :param name: Sku name. Possible values include: 'S1' - :type name: str or ~azure.mgmt.iothubprovisioningservices.models.IotDpsSku - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name=None, **kwargs) -> None: - super(IotDpsSkuDefinition, self).__init__(**kwargs) - self.name = name diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_info.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_info.py deleted file mode 100644 index a83fefe71efa..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_info.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 IotDpsSkuInfo(Model): - """List of possible provisoning service SKUs. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param name: Sku name. Possible values include: 'S1' - :type name: str or ~azure.mgmt.iothubprovisioningservices.models.IotDpsSku - :ivar tier: Pricing tier name of the provisioning service. - :vartype tier: str - :param capacity: The number of units to provision - :type capacity: long - """ - - _validation = { - 'tier': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'long'}, - } - - def __init__(self, **kwargs): - super(IotDpsSkuInfo, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None - self.capacity = kwargs.get('capacity', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_info_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_info_py3.py deleted file mode 100644 index d1b9a9dbb967..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_dps_sku_info_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 IotDpsSkuInfo(Model): - """List of possible provisoning service SKUs. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param name: Sku name. Possible values include: 'S1' - :type name: str or ~azure.mgmt.iothubprovisioningservices.models.IotDpsSku - :ivar tier: Pricing tier name of the provisioning service. - :vartype tier: str - :param capacity: The number of units to provision - :type capacity: long - """ - - _validation = { - 'tier': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'long'}, - } - - def __init__(self, *, name=None, capacity: int=None, **kwargs) -> None: - super(IotDpsSkuInfo, self).__init__(**kwargs) - self.name = name - self.tier = None - self.capacity = capacity diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_hub_definition_description.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_hub_definition_description.py deleted file mode 100644 index a5ec8e232bf0..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_hub_definition_description.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 IotHubDefinitionDescription(Model): - """Description of the IoT hub. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param apply_allocation_policy: flag for applying allocationPolicy or not - for a given iot hub. - :type apply_allocation_policy: bool - :param allocation_weight: weight to apply for a given iot h. - :type allocation_weight: int - :ivar name: Host name of the IoT hub. - :vartype name: str - :param connection_string: Required. Connection string og the IoT hub. - :type connection_string: str - :param location: Required. ARM region of the IoT hub. - :type location: str - """ - - _validation = { - 'name': {'readonly': True}, - 'connection_string': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'apply_allocation_policy': {'key': 'applyAllocationPolicy', 'type': 'bool'}, - 'allocation_weight': {'key': 'allocationWeight', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'connection_string': {'key': 'connectionString', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(IotHubDefinitionDescription, self).__init__(**kwargs) - self.apply_allocation_policy = kwargs.get('apply_allocation_policy', None) - self.allocation_weight = kwargs.get('allocation_weight', None) - self.name = None - self.connection_string = kwargs.get('connection_string', None) - self.location = kwargs.get('location', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_hub_definition_description_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_hub_definition_description_py3.py deleted file mode 100644 index 939dcf435091..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/iot_hub_definition_description_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 IotHubDefinitionDescription(Model): - """Description of the IoT hub. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param apply_allocation_policy: flag for applying allocationPolicy or not - for a given iot hub. - :type apply_allocation_policy: bool - :param allocation_weight: weight to apply for a given iot h. - :type allocation_weight: int - :ivar name: Host name of the IoT hub. - :vartype name: str - :param connection_string: Required. Connection string og the IoT hub. - :type connection_string: str - :param location: Required. ARM region of the IoT hub. - :type location: str - """ - - _validation = { - 'name': {'readonly': True}, - 'connection_string': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'apply_allocation_policy': {'key': 'applyAllocationPolicy', 'type': 'bool'}, - 'allocation_weight': {'key': 'allocationWeight', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'connection_string': {'key': 'connectionString', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, *, connection_string: str, location: str, apply_allocation_policy: bool=None, allocation_weight: int=None, **kwargs) -> None: - super(IotHubDefinitionDescription, self).__init__(**kwargs) - self.apply_allocation_policy = apply_allocation_policy - self.allocation_weight = allocation_weight - self.name = None - self.connection_string = connection_string - self.location = location diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/name_availability_info.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/name_availability_info.py deleted file mode 100644 index 1238f282b280..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/name_availability_info.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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 NameAvailabilityInfo(Model): - """Description of name availability. - - :param name_available: specifies if a name is available or not - :type name_available: bool - :param reason: specifies the reason a name is unavailable. Possible values - include: 'Invalid', 'AlreadyExists' - :type reason: str or - ~azure.mgmt.iothubprovisioningservices.models.NameUnavailabilityReason - :param message: message containing a etailed reason name is unavailable - :type message: str - """ - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(NameAvailabilityInfo, self).__init__(**kwargs) - self.name_available = kwargs.get('name_available', None) - self.reason = kwargs.get('reason', None) - self.message = kwargs.get('message', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/name_availability_info_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/name_availability_info_py3.py deleted file mode 100644 index 3f0a3ba82210..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/name_availability_info_py3.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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 NameAvailabilityInfo(Model): - """Description of name availability. - - :param name_available: specifies if a name is available or not - :type name_available: bool - :param reason: specifies the reason a name is unavailable. Possible values - include: 'Invalid', 'AlreadyExists' - :type reason: str or - ~azure.mgmt.iothubprovisioningservices.models.NameUnavailabilityReason - :param message: message containing a etailed reason name is unavailable - :type message: str - """ - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, *, name_available: bool=None, reason=None, message: str=None, **kwargs) -> None: - super(NameAvailabilityInfo, self).__init__(**kwargs) - self.name_available = name_available - self.reason = reason - self.message = message diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation.py deleted file mode 100644 index 6ef6ac9cb76e..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Operation(Model): - """IoT Hub REST API operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Operation name: {provider}/{resource}/{read | write | action | - delete} - :vartype name: str - :param display: The object that represents the operation. - :type display: - ~azure.mgmt.iothubprovisioningservices.models.OperationDisplay - """ - - _validation = { - 'name': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = kwargs.get('display', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_display.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_display.py deleted file mode 100644 index d198f80a81c1..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_display.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationDisplay(Model): - """The object that represents the operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar provider: Service provider: Microsoft Devices. - :vartype provider: str - :ivar resource: Resource Type: ProvisioningServices. - :vartype resource: str - :ivar operation: Name of the operation. - :vartype operation: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_display_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_display_py3.py deleted file mode 100644 index a1add8843a0a..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_display_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationDisplay(Model): - """The object that represents the operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar provider: Service provider: Microsoft Devices. - :vartype provider: str - :ivar resource: Resource Type: ProvisioningServices. - :vartype resource: str - :ivar operation: Name of the operation. - :vartype operation: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_inputs.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_inputs.py deleted file mode 100644 index 09ee8b535542..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_inputs.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationInputs(Model): - """Input values for operation results call. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the Provisioning Service to check. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationInputs, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_inputs_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_inputs_py3.py deleted file mode 100644 index f0e2e45af4f7..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_inputs_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationInputs(Model): - """Input values for operation results call. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the Provisioning Service to check. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str, **kwargs) -> None: - super(OperationInputs, self).__init__(**kwargs) - self.name = name diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_paged.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_paged.py deleted file mode 100644 index 3f6c7fbeb755..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_py3.py deleted file mode 100644 index e25e19d1f294..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/operation_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Operation(Model): - """IoT Hub REST API operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Operation name: {provider}/{resource}/{read | write | action | - delete} - :vartype name: str - :param display: The object that represents the operation. - :type display: - ~azure.mgmt.iothubprovisioningservices.models.OperationDisplay - """ - - _validation = { - 'name': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, *, display=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = display diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/provisioning_service_description.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/provisioning_service_description.py deleted file mode 100644 index 1cb1ca6d0178..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/provisioning_service_description.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class ProvisioningServiceDescription(Resource): - """The description of the provisioning service. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: The resource identifier. - :vartype id: str - :ivar name: The resource name. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :param location: Required. The resource location. - :type location: str - :param tags: The resource tags. - :type tags: dict[str, str] - :param etag: The Etag field is *not* required. If it is provided in the - response body, it must also be provided as a header per the normal ETag - convention. - :type etag: str - :param properties: Required. Service specific properties for a - provisioning service - :type properties: - ~azure.mgmt.iothubprovisioningservices.models.IotDpsPropertiesDescription - :param sku: Required. Sku info for a provisioning Service. - :type sku: ~azure.mgmt.iothubprovisioningservices.models.IotDpsSkuInfo - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - 'sku': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'IotDpsPropertiesDescription'}, - 'sku': {'key': 'sku', 'type': 'IotDpsSkuInfo'}, - } - - def __init__(self, **kwargs): - super(ProvisioningServiceDescription, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/provisioning_service_description_paged.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/provisioning_service_description_paged.py deleted file mode 100644 index 3f10e4fdb0d5..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/provisioning_service_description_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 ProvisioningServiceDescriptionPaged(Paged): - """ - A paging container for iterating over a list of :class:`ProvisioningServiceDescription ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ProvisioningServiceDescription]'} - } - - def __init__(self, *args, **kwargs): - - super(ProvisioningServiceDescriptionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/provisioning_service_description_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/provisioning_service_description_py3.py deleted file mode 100644 index 6097e7818e5a..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/provisioning_service_description_py3.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class ProvisioningServiceDescription(Resource): - """The description of the provisioning service. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: The resource identifier. - :vartype id: str - :ivar name: The resource name. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :param location: Required. The resource location. - :type location: str - :param tags: The resource tags. - :type tags: dict[str, str] - :param etag: The Etag field is *not* required. If it is provided in the - response body, it must also be provided as a header per the normal ETag - convention. - :type etag: str - :param properties: Required. Service specific properties for a - provisioning service - :type properties: - ~azure.mgmt.iothubprovisioningservices.models.IotDpsPropertiesDescription - :param sku: Required. Sku info for a provisioning Service. - :type sku: ~azure.mgmt.iothubprovisioningservices.models.IotDpsSkuInfo - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - 'sku': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'IotDpsPropertiesDescription'}, - 'sku': {'key': 'sku', 'type': 'IotDpsSkuInfo'}, - } - - def __init__(self, *, location: str, properties, sku, tags=None, etag: str=None, **kwargs) -> None: - super(ProvisioningServiceDescription, self).__init__(location=location, tags=tags, **kwargs) - self.etag = etag - self.properties = properties - self.sku = sku diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/resource.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/resource.py deleted file mode 100644 index e03d78711115..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/resource.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Resource(Model): - """The common properties of an Azure resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: The resource identifier. - :vartype id: str - :ivar name: The resource name. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :param location: Required. The resource location. - :type location: str - :param tags: The resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/resource_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/resource_py3.py deleted file mode 100644 index 436710184586..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/resource_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Resource(Model): - """The common properties of an Azure resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: The resource identifier. - :vartype id: str - :ivar name: The resource name. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :param location: Required. The resource location. - :type location: str - :param tags: The resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/shared_access_signature_authorization_rule_access_rights_description.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/shared_access_signature_authorization_rule_access_rights_description.py deleted file mode 100644 index d89bb6c46acf..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/shared_access_signature_authorization_rule_access_rights_description.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 SharedAccessSignatureAuthorizationRuleAccessRightsDescription(Model): - """Description of the shared access key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. Name of the key. - :type key_name: str - :param primary_key: Primary SAS key value. - :type primary_key: str - :param secondary_key: Secondary SAS key value. - :type secondary_key: str - :param rights: Required. Rights that this key has. Possible values - include: 'ServiceConfig', 'EnrollmentRead', 'EnrollmentWrite', - 'DeviceConnect', 'RegistrationStatusRead', 'RegistrationStatusWrite' - :type rights: str or - ~azure.mgmt.iothubprovisioningservices.models.AccessRightsDescription - """ - - _validation = { - 'key_name': {'required': True}, - 'rights': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - 'rights': {'key': 'rights', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SharedAccessSignatureAuthorizationRuleAccessRightsDescription, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) - self.rights = kwargs.get('rights', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/shared_access_signature_authorization_rule_access_rights_description_paged.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/shared_access_signature_authorization_rule_access_rights_description_paged.py deleted file mode 100644 index 3223713a25e7..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/shared_access_signature_authorization_rule_access_rights_description_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 SharedAccessSignatureAuthorizationRuleAccessRightsDescriptionPaged(Paged): - """ - A paging container for iterating over a list of :class:`SharedAccessSignatureAuthorizationRuleAccessRightsDescription ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SharedAccessSignatureAuthorizationRuleAccessRightsDescription]'} - } - - def __init__(self, *args, **kwargs): - - super(SharedAccessSignatureAuthorizationRuleAccessRightsDescriptionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/shared_access_signature_authorization_rule_access_rights_description_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/shared_access_signature_authorization_rule_access_rights_description_py3.py deleted file mode 100644 index 36235ef85249..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/shared_access_signature_authorization_rule_access_rights_description_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 SharedAccessSignatureAuthorizationRuleAccessRightsDescription(Model): - """Description of the shared access key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. Name of the key. - :type key_name: str - :param primary_key: Primary SAS key value. - :type primary_key: str - :param secondary_key: Secondary SAS key value. - :type secondary_key: str - :param rights: Required. Rights that this key has. Possible values - include: 'ServiceConfig', 'EnrollmentRead', 'EnrollmentWrite', - 'DeviceConnect', 'RegistrationStatusRead', 'RegistrationStatusWrite' - :type rights: str or - ~azure.mgmt.iothubprovisioningservices.models.AccessRightsDescription - """ - - _validation = { - 'key_name': {'required': True}, - 'rights': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - 'rights': {'key': 'rights', 'type': 'str'}, - } - - def __init__(self, *, key_name: str, rights, primary_key: str=None, secondary_key: str=None, **kwargs) -> None: - super(SharedAccessSignatureAuthorizationRuleAccessRightsDescription, self).__init__(**kwargs) - self.key_name = key_name - self.primary_key = primary_key - self.secondary_key = secondary_key - self.rights = rights diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/tags_resource.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/tags_resource.py deleted file mode 100644 index 16f684053142..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/tags_resource.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class TagsResource(Model): - """A container holding only the Tags for a resource, allowing the user to - update the tags on a Provisioning Service instance. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(TagsResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/tags_resource_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/tags_resource_py3.py deleted file mode 100644 index 5afbce93d8c0..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/tags_resource_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class TagsResource(Model): - """A container holding only the Tags for a resource, allowing the user to - update the tags on a Provisioning Service instance. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(TagsResource, self).__init__(**kwargs) - self.tags = tags diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_request.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_request.py deleted file mode 100644 index 1602cc58f886..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_request.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 VerificationCodeRequest(Model): - """The JSON-serialized leaf certificate. - - :param certificate: base-64 representation of X509 certificate .cer file - or just .pem file content. - :type certificate: str - """ - - _attribute_map = { - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VerificationCodeRequest, self).__init__(**kwargs) - self.certificate = kwargs.get('certificate', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_request_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_request_py3.py deleted file mode 100644 index 058544415d4b..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_request_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 VerificationCodeRequest(Model): - """The JSON-serialized leaf certificate. - - :param certificate: base-64 representation of X509 certificate .cer file - or just .pem file content. - :type certificate: str - """ - - _attribute_map = { - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__(self, *, certificate: str=None, **kwargs) -> None: - super(VerificationCodeRequest, self).__init__(**kwargs) - self.certificate = certificate diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_response.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_response.py deleted file mode 100644 index 39d2ae14a87f..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 VerificationCodeResponse(Model): - """Description of the response of the verification code. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Name of certificate. - :vartype name: str - :ivar etag: Request etag. - :vartype etag: str - :ivar id: The resource identifier. - :vartype id: str - :ivar type: The resource type. - :vartype type: str - :param properties: - :type properties: - ~azure.mgmt.iothubprovisioningservices.models.VerificationCodeResponseProperties - """ - - _validation = { - 'name': {'readonly': True}, - 'etag': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'VerificationCodeResponseProperties'}, - } - - def __init__(self, **kwargs): - super(VerificationCodeResponse, self).__init__(**kwargs) - self.name = None - self.etag = None - self.id = None - self.type = None - self.properties = kwargs.get('properties', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_response_properties.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_response_properties.py deleted file mode 100644 index db5b81439493..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_response_properties.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 VerificationCodeResponseProperties(Model): - """VerificationCodeResponseProperties. - - :param verification_code: Verification code. - :type verification_code: str - :param subject: Certificate subject. - :type subject: str - :param expiry: Code expiry. - :type expiry: str - :param thumbprint: Certificate thumbprint. - :type thumbprint: str - :param is_verified: Indicate if the certificate is verified by owner of - private key. - :type is_verified: bool - :param created: Certificate created time. - :type created: str - :param updated: Certificate updated time. - :type updated: str - """ - - _attribute_map = { - 'verification_code': {'key': 'verificationCode', 'type': 'str'}, - 'subject': {'key': 'subject', 'type': 'str'}, - 'expiry': {'key': 'expiry', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - 'is_verified': {'key': 'isVerified', 'type': 'bool'}, - 'created': {'key': 'created', 'type': 'str'}, - 'updated': {'key': 'updated', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VerificationCodeResponseProperties, self).__init__(**kwargs) - self.verification_code = kwargs.get('verification_code', None) - self.subject = kwargs.get('subject', None) - self.expiry = kwargs.get('expiry', None) - self.thumbprint = kwargs.get('thumbprint', None) - self.is_verified = kwargs.get('is_verified', None) - self.created = kwargs.get('created', None) - self.updated = kwargs.get('updated', None) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_response_properties_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_response_properties_py3.py deleted file mode 100644 index ed93c35fb395..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_response_properties_py3.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 VerificationCodeResponseProperties(Model): - """VerificationCodeResponseProperties. - - :param verification_code: Verification code. - :type verification_code: str - :param subject: Certificate subject. - :type subject: str - :param expiry: Code expiry. - :type expiry: str - :param thumbprint: Certificate thumbprint. - :type thumbprint: str - :param is_verified: Indicate if the certificate is verified by owner of - private key. - :type is_verified: bool - :param created: Certificate created time. - :type created: str - :param updated: Certificate updated time. - :type updated: str - """ - - _attribute_map = { - 'verification_code': {'key': 'verificationCode', 'type': 'str'}, - 'subject': {'key': 'subject', 'type': 'str'}, - 'expiry': {'key': 'expiry', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - 'is_verified': {'key': 'isVerified', 'type': 'bool'}, - 'created': {'key': 'created', 'type': 'str'}, - 'updated': {'key': 'updated', 'type': 'str'}, - } - - def __init__(self, *, verification_code: str=None, subject: str=None, expiry: str=None, thumbprint: str=None, is_verified: bool=None, created: str=None, updated: str=None, **kwargs) -> None: - super(VerificationCodeResponseProperties, self).__init__(**kwargs) - self.verification_code = verification_code - self.subject = subject - self.expiry = expiry - self.thumbprint = thumbprint - self.is_verified = is_verified - self.created = created - self.updated = updated diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_response_py3.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_response_py3.py deleted file mode 100644 index bf0ead104a47..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/verification_code_response_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 VerificationCodeResponse(Model): - """Description of the response of the verification code. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Name of certificate. - :vartype name: str - :ivar etag: Request etag. - :vartype etag: str - :ivar id: The resource identifier. - :vartype id: str - :ivar type: The resource type. - :vartype type: str - :param properties: - :type properties: - ~azure.mgmt.iothubprovisioningservices.models.VerificationCodeResponseProperties - """ - - _validation = { - 'name': {'readonly': True}, - 'etag': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'VerificationCodeResponseProperties'}, - } - - def __init__(self, *, properties=None, **kwargs) -> None: - super(VerificationCodeResponse, self).__init__(**kwargs) - self.name = None - self.etag = None - self.id = None - self.type = None - self.properties = properties diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/__init__.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/__init__.py index fb15e05ea1bd..951e8ea29e81 100644 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/__init__.py +++ b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/__init__.py @@ -9,9 +9,9 @@ # regenerated. # -------------------------------------------------------------------------- -from .operations import Operations -from .dps_certificate_operations import DpsCertificateOperations -from .iot_dps_resource_operations import IotDpsResourceOperations +from ._operations import Operations +from ._dps_certificate_operations import DpsCertificateOperations +from ._iot_dps_resource_operations import IotDpsResourceOperations __all__ = [ 'Operations', diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/dps_certificate_operations.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/_dps_certificate_operations.py similarity index 95% rename from sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/dps_certificate_operations.py rename to sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/_dps_certificate_operations.py index 92b173849272..d622b9c19344 100644 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/dps_certificate_operations.py +++ b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/_dps_certificate_operations.py @@ -18,6 +18,8 @@ class DpsCertificateOperations(object): """DpsCertificateOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -77,7 +79,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: @@ -88,14 +90,13 @@ 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) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('CertificateResponse', response) @@ -156,6 +157,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()) @@ -170,15 +172,13 @@ 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]: raise models.ErrorDetailsException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('CertificateResponse', response) @@ -193,7 +193,7 @@ def delete( self, resource_group_name, if_match, provisioning_service_name, certificate_name, certificatename=None, certificateraw_bytes=None, certificateis_verified=None, certificatepurpose=None, certificatecreated=None, certificatelast_updated=None, certificatehas_private_key=None, certificatenonce=None, custom_headers=None, raw=False, **operation_config): """Delete the Provisioning Service Certificate. - Deletes the specified certificate assosciated with the Provisioning + Deletes the specified certificate associated with the Provisioning Service. :param resource_group_name: Resource group identifier. @@ -271,7 +271,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: @@ -281,8 +280,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) @@ -328,7 +327,7 @@ def list( # 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: @@ -337,14 +336,13 @@ def list( 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) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('CertificateListDescription', response) @@ -436,7 +434,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: @@ -446,14 +444,13 @@ 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) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('VerificationCodeResponse', response) @@ -551,6 +548,7 @@ def verify_certificate( # 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()) @@ -564,15 +562,13 @@ def verify_certificate( body_content = self._serialize.body(request, 'VerificationCodeRequest') # 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) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('CertificateResponse', response) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/iot_dps_resource_operations.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/_iot_dps_resource_operations.py similarity index 91% rename from sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/iot_dps_resource_operations.py rename to sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/_iot_dps_resource_operations.py index 05eb37ed4b3c..e758e756c437 100644 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/iot_dps_resource_operations.py +++ b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/_iot_dps_resource_operations.py @@ -21,6 +21,8 @@ class IotDpsResourceOperations(object): """IotDpsResourceOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -78,7 +80,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: @@ -87,14 +89,13 @@ 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) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ProvisioningServiceDescription', response) @@ -123,6 +124,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 +137,8 @@ def _create_or_update_initial( body_content = self._serialize.body(iot_dps_description, 'ProvisioningServiceDescription') # 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) @@ -235,6 +236,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()) @@ -247,9 +249,8 @@ def _update_initial( body_content = self._serialize.body(provisioning_service_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 +341,6 @@ def _delete_initial( # 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: @@ -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) @@ -421,8 +421,7 @@ def list_by_subscription( :raises: :class:`ErrorDetailsException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] @@ -441,7 +440,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: @@ -450,9 +449,13 @@ 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -460,12 +463,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.ProvisioningServiceDescriptionPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.ProvisioningServiceDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.ProvisioningServiceDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/provisioningServices'} @@ -487,8 +488,7 @@ def list_by_resource_group( :raises: :class:`ErrorDetailsException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] @@ -508,7 +508,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: @@ -517,9 +517,13 @@ 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -527,12 +531,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.ProvisioningServiceDescriptionPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.ProvisioningServiceDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.ProvisioningServiceDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices'} @@ -582,7 +584,7 @@ def get_operation_result( # 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: @@ -591,14 +593,13 @@ def get_operation_result( 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) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('AsyncOperationResult', response) @@ -630,8 +631,7 @@ def list_valid_skus( :raises: :class:`ErrorDetailsException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_valid_skus.metadata['url'] @@ -652,7 +652,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: @@ -661,9 +661,13 @@ 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -671,12 +675,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.IotDpsSkuDefinitionPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.IotDpsSkuDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.IotDpsSkuDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_valid_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/skus'} @@ -717,6 +719,7 @@ def check_provisioning_service_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()) @@ -729,15 +732,13 @@ def check_provisioning_service_name_availability( body_content = self._serialize.body(arguments, '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) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('NameAvailabilityInfo', response) @@ -771,8 +772,7 @@ def list_keys( :raises: :class:`ErrorDetailsException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_keys.metadata['url'] @@ -793,7 +793,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: @@ -802,9 +802,13 @@ 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -812,12 +816,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.SharedAccessSignatureAuthorizationRuleAccessRightsDescriptionPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.SharedAccessSignatureAuthorizationRuleAccessRightsDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.SharedAccessSignatureAuthorizationRuleAccessRightsDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/listkeys'} @@ -864,7 +866,7 @@ def list_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: @@ -873,14 +875,13 @@ def list_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) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('SharedAccessSignatureAuthorizationRuleAccessRightsDescription', response) diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/operations.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/_operations.py similarity index 84% rename from sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/operations.py rename to sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/_operations.py index d317e51009a8..5a28b397b06d 100644 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/operations.py +++ b/sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/_operations.py @@ -18,6 +18,8 @@ class Operations(object): """Operations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -51,8 +53,7 @@ def list( :raises: :class:`ErrorDetailsException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list.metadata['url'] @@ -67,7 +68,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 +77,13 @@ 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorDetailsException(self._deserialize, response) @@ -86,12 +91,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/providers/Microsoft.Devices/operations'} diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/setup.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/setup.py index 4773a03c3a48..e467a24a00cd 100644 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/setup.py +++ b/sdk/iothub/azure-mgmt-iothubprovisioningservices/setup.py @@ -36,9 +36,7 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py') - if os.path.exists(os.path.join(package_folder_path, 'version.py')) - else os.path.join(package_folder_path, '_version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) @@ -66,10 +64,10 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ], zip_safe=False, diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/tests/recordings/test_cli_mgmt_iothubprovisioningservices.test_iothubprovisioningservices.yaml b/sdk/iothub/azure-mgmt-iothubprovisioningservices/tests/recordings/test_cli_mgmt_iothubprovisioningservices.test_iothubprovisioningservices.yaml deleted file mode 100644 index e14b66a79ae6..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/tests/recordings/test_cli_mgmt_iothubprovisioningservices.test_iothubprovisioningservices.yaml +++ /dev/null @@ -1,473 +0,0 @@ -interactions: -- request: - body: '{"location": "East US", "properties": {}, "sku": {"name": "S1", "capacity": - 1}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '79' - Content-Type: - - application/json; charset=utf-8 - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-iothubprovisioningservices/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND?api-version=2018-01-22 - response: - body: - string: '{"name":"myProvisioningServiceRND","location":"East US","properties":{"state":"Activating","provisioningState":"Accepted","allocationPolicy":"Hashed","idScope":null},"resourcegroup":"test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44","type":"Microsoft.Devices/provisioningServices","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND","subscriptionid":"00000000-0000-0000-0000-000000000000","tags":{},"sku":{"name":"S1","tier":"Standard","capacity":1}}' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND/operationResults/b3NfaWRfZjcwOTRiZjctNzQ4OC00MTE0LTg0MDctNTA5NjMwNTQ5NDMx?api-version=2018-01-22&asyncinfo - cache-control: - - no-cache - content-length: - - '659' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 01 May 2020 20:16:40 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-resource-requests: - - '4999' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-iothubprovisioningservices/0.2.0 Azure-SDK-For-Python - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND/operationResults/b3NfaWRfZjcwOTRiZjctNzQ4OC00MTE0LTg0MDctNTA5NjMwNTQ5NDMx?api-version=2018-01-22&asyncinfo - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 01 May 2020 20:17:10 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-iothubprovisioningservices/0.2.0 Azure-SDK-For-Python - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND/operationResults/b3NfaWRfZjcwOTRiZjctNzQ4OC00MTE0LTg0MDctNTA5NjMwNTQ5NDMx?api-version=2018-01-22&asyncinfo - response: - body: - string: '{"status":"Succeeded"}' - headers: - cache-control: - - no-cache - content-length: - - '22' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 01 May 2020 20:17:41 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-iothubprovisioningservices/0.2.0 Azure-SDK-For-Python - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND?api-version=2018-01-22 - response: - body: - string: '{"etag":"AAAAAALwwXo=","name":"myProvisioningServiceRND","location":"East - US","properties":{"state":"Active","provisioningState":"Succeeded","iotHubs":[],"allocationPolicy":"Hashed","serviceOperationsHostName":"myProvisioningServiceRND.azure-devices-provisioning.net","deviceProvisioningHostName":"global.azure-devices-provisioning.net","idScope":"0ne000F9208"},"resourcegroup":"test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44","type":"Microsoft.Devices/provisioningServices","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND","subscriptionid":"00000000-0000-0000-0000-000000000000","tags":{},"sku":{"name":"S1","tier":"Standard","capacity":1}}' - headers: - cache-control: - - no-cache - content-length: - - '855' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 01 May 2020 20:17:46 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Type: - - application/json; charset=utf-8 - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-iothubprovisioningservices/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND/certificates?api-version=2018-01-22 - response: - body: - string: '{"value":[]}' - headers: - cache-control: - - no-cache - content-length: - - '12' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 01 May 2020 20:17:46 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Type: - - application/json; charset=utf-8 - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-iothubprovisioningservices/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND?api-version=2018-01-22 - response: - body: - string: '{"etag":"AAAAAALwwXo=","name":"myProvisioningServiceRND","location":"East - US","properties":{"state":"Active","provisioningState":"Succeeded","iotHubs":[],"allocationPolicy":"Hashed","serviceOperationsHostName":"myProvisioningServiceRND.azure-devices-provisioning.net","deviceProvisioningHostName":"global.azure-devices-provisioning.net","idScope":"0ne000F9208"},"resourcegroup":"test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44","type":"Microsoft.Devices/provisioningServices","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND","subscriptionid":"00000000-0000-0000-0000-000000000000","tags":{},"sku":{"name":"S1","tier":"Standard","capacity":1}}' - headers: - cache-control: - - no-cache - content-length: - - '855' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 01 May 2020 20:17:47 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json; charset=utf-8 - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-iothubprovisioningservices/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US - method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND?api-version=2018-01-22 - response: - body: - string: '{"etag":"","name":"myProvisioningServiceRND","location":"East US","properties":{"state":"Active","provisioningState":"Succeeded","iotHubs":[],"allocationPolicy":"Hashed","serviceOperationsHostName":"myProvisioningServiceRND.azure-devices-provisioning.net","deviceProvisioningHostName":"global.azure-devices-provisioning.net","idScope":"0ne000F9208"},"resourcegroup":"test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44","type":"Microsoft.Devices/provisioningServices","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND","subscriptionid":"00000000-0000-0000-0000-000000000000","tags":{},"sku":{"name":"S1","tier":"Standard","capacity":1}}' - headers: - cache-control: - - no-cache - content-length: - - '843' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 01 May 2020 20:17:49 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-resource-requests: - - '4999' - status: - code: 200 - message: OK -- request: - body: '{"name": "test213123"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '22' - Content-Type: - - application/json; charset=utf-8 - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-iothubprovisioningservices/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability?api-version=2018-01-22 - response: - body: - string: '{"nameAvailable":true,"reason":"Invalid","message":null}' - headers: - cache-control: - - no-cache - content-length: - - '56' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 01 May 2020 20:17:49 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/json; charset=utf-8 - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-iothubprovisioningservices/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND?api-version=2018-01-22 - response: - body: - string: 'null' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND/operationResults/b3NfaWRfNTk5NjE4ZjUtY2Q1Yy00ZTUwLTlmMDEtNTljOGFjNDdmMzlm?api-version=2018-01-22&asyncinfo - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 01 May 2020 20:17:51 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND/operationResults/b3NfaWRfNTk5NjE4ZjUtY2Q1Yy00ZTUwLTlmMDEtNTljOGFjNDdmMzlm?api-version=2018-01-22 - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-deletes: - - '14998' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-iothubprovisioningservices/0.2.0 Azure-SDK-For-Python - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_iothubprovisioningservices_test_iothubprovisioningservices4ed01e44/providers/Microsoft.Devices/provisioningServices/myProvisioningServiceRND/operationResults/b3NfaWRfNTk5NjE4ZjUtY2Q1Yy00ZTUwLTlmMDEtNTljOGFjNDdmMzlm?api-version=2018-01-22&asyncinfo - response: - body: - string: '{"status":"Succeeded"}' - headers: - cache-control: - - no-cache - content-length: - - '22' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 01 May 2020 20:18:07 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/iothub/azure-mgmt-iothubprovisioningservices/tests/test_cli_mgmt_iothubprovisioningservices.py b/sdk/iothub/azure-mgmt-iothubprovisioningservices/tests/test_cli_mgmt_iothubprovisioningservices.py deleted file mode 100644 index 648f7ae8127b..000000000000 --- a/sdk/iothub/azure-mgmt-iothubprovisioningservices/tests/test_cli_mgmt_iothubprovisioningservices.py +++ /dev/null @@ -1,139 +0,0 @@ -# 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. -#-------------------------------------------------------------------------- - - -# TEST SCENARIO COVERAGE -# ---------------------- -# Methods Total : 18 -# Methods Covered : 18 -# Examples Total : 18 -# Examples Tested : 11 -# Coverage % : 61 -# ---------------------- - -import unittest - -import azure.mgmt.iothubprovisioningservices -from devtools_testutils import AzureMgmtTestCase, ResourceGroupPreparer - -AZURE_LOCATION = 'eastus' - -class MgmtIotDpsClientTest(AzureMgmtTestCase): - - def setUp(self): - super(MgmtIotDpsClientTest, self).setUp() - self.mgmt_client = self.create_mgmt_client( - azure.mgmt.iothubprovisioningservices.IotDpsClient - ) - - @ResourceGroupPreparer(location=AZURE_LOCATION) - def test_iothubprovisioningservices(self, resource_group): - - SUBSCRIPTION_ID = self.settings.SUBSCRIPTION_ID - TENANT_ID = self.settings.TENANT_ID - RESOURCE_GROUP = resource_group.name - PROVISIONING_SERVICE_NAME = "myProvisioningServiceRND" - CERTIFICATE_NAME = "myCertificate" - OPERATION_ID = "myOperationId" - KEY_NAME = "myKey" - - # /IotDpsResource/put/DPSCreate[put] - BODY = { - "location": "East US", - "type": "Microsoft.Devices/ProvisioningServices", - "sku": { - "name": "S1", - "tier": "Standard", - "capacity": "1" - }, - "properties": {} - } - result = self.mgmt_client.iot_dps_resource.create_or_update(resource_group_name=RESOURCE_GROUP, provisioning_service_name=PROVISIONING_SERVICE_NAME, iot_dps_description=BODY) - result = result.result() - - # /DpsCertificate/put/DPSCreateOrUpdateCertificate[put] - BODY = { - "certificate": "############################################" - } - # result = self.mgmt_client.dps_certificate.create_or_update(resource_group_name=RESOURCE_GROUP, provisioning_service_name=PROVISIONING_SERVICE_NAME, certificate_name=CERTIFICATE_NAME, certificate_description=BODY) - - # Certificates not tested yet - # /DpsCertificate/get/DPSGetCertificate[get] - # result = self.mgmt_client.dps_certificate.get(resource_group_name=RESOURCE_GROUP, provisioning_service_name=PROVISIONING_SERVICE_NAME, certificate_name=CERTIFICATE_NAME) - - # Certificates not tested yet - # /IotDpsResource/get/DPSGetOperationResult[get] - # result = self.mgmt_client.iot_dps_resource.get_operation_result(resource_group_name=RESOURCE_GROUP, provisioning_service_name=PROVISIONING_SERVICE_NAME, operation_id=OPERATION_ID, asyncinfo="1508265712453") - - # /DpsCertificate/get/DPSGetCertificates[get] - result = self.mgmt_client.dps_certificate.list(resource_group_name=RESOURCE_GROUP, provisioning_service_name=PROVISIONING_SERVICE_NAME) - - # /IotDpsResource/get/DPSGetValidSku[get] - result = self.mgmt_client.iot_dps_resource.list_valid_skus(resource_group_name=RESOURCE_GROUP, provisioning_service_name=PROVISIONING_SERVICE_NAME) - - # /IotDpsResource/get/DPSGet[get] - result = self.mgmt_client.iot_dps_resource.get(resource_group_name=RESOURCE_GROUP, provisioning_service_name=PROVISIONING_SERVICE_NAME) - - # /IotDpsResource/get/DPSListByResourceGroup[get] - result = self.mgmt_client.iot_dps_resource.list_by_resource_group(resource_group_name=RESOURCE_GROUP) - - # /IotDpsResource/get/DPSListBySubscription[get] - result = self.mgmt_client.iot_dps_resource.list_by_subscription() - - # /Operations/get/DPSOperations[get] - result = self.mgmt_client.operations.list() - - # Certificates not tested yet - # /DpsCertificate/post/DPSGenerateVerificationCode[post] - # result = self.mgmt_client.dps_certificate.generate_verification_code(resource_group_name=RESOURCE_GROUP, provisioning_service_name=PROVISIONING_SERVICE_NAME, certificate_name=CERTIFICATE_NAME) - - # Certificates not tested yet - # /DpsCertificate/post/DPSVerifyCertificate[post] - BODY = { - "certificate": "#####################################" - } - # result = self.mgmt_client.dps_certificate.verify_certificate(resource_group_name=RESOURCE_GROUP, provisioning_service_name=PROVISIONING_SERVICE_NAME, certificate_name=CERTIFICATE_NAME, request=BODY) - - # Certificates not tested yet - # /IotDpsResource/post/DPSGetKey[post] - # result = self.mgmt_client.iot_dps_resource.list_keys_for_key_name(resource_group_name=RESOURCE_GROUP, provisioning_service_name=PROVISIONING_SERVICE_NAME, key_name=KEY_NAME) - - # /IotDpsResource/post/DPSListKeys[post] - result = self.mgmt_client.iot_dps_resource.list_keys(resource_group_name=RESOURCE_GROUP, provisioning_service_name=PROVISIONING_SERVICE_NAME) - - # /IotDpsResource/patch/DPSPatch[patch] - BODY = { - "tags": { - "foo": "bar" - } - } - result = self.mgmt_client.iot_dps_resource.update(resource_group_name=RESOURCE_GROUP, provisioning_service_name=PROVISIONING_SERVICE_NAME, provisioning_service_tags=BODY) - result = result.result() - - # /IotDpsResource/post/DPSCheckName[post] - BODY = { - "name": "test213123" - } - result = self.mgmt_client.iot_dps_resource.check_provisioning_service_name_availability(name="test213123") - - # Certificates not tested yet - # /DpsCertificate/delete/DPSDeleteCertificate[delete] - # result = self.mgmt_client.dps_certificate.delete(resource_group_name=RESOURCE_GROUP, provisioning_service_name=PROVISIONING_SERVICE_NAME, certificate_name=CERTIFICATE_NAME) - - # /IotDpsResource/delete/DPSDelete[delete] - result = self.mgmt_client.iot_dps_resource.delete(resource_group_name=RESOURCE_GROUP, provisioning_service_name=PROVISIONING_SERVICE_NAME) - - try: - result = result.result() - except: - print("poller failing") - - -#------------------------------------------------------------------------------ -if __name__ == '__main__': - unittest.main()