diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/feature_client.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/feature_client.py index ebf41ab29b36..3dfaec20c691 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/feature_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/feature_client.py @@ -9,7 +9,7 @@ # 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 @@ -49,7 +49,7 @@ def __init__( self.subscription_id = subscription_id -class FeatureClient(object): +class FeatureClient(SDKClient): """Azure Feature Exposure Control (AFEC) provides a mechanism for the resource providers to control feature exposure to users. Resource providers typically use this mechanism to provide public/private preview for new features prior to making them generally available. Users need to explicitly register for AFEC features to get access to such functionality. :ivar config: Configuration for client. @@ -70,7 +70,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = FeatureClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(FeatureClient, 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 = '2015-12-01' diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py index e78be06f1f4a..28315e2f7522 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py @@ -9,12 +9,25 @@ # regenerated. # -------------------------------------------------------------------------- -from .feature_properties import FeatureProperties -from .feature_result import FeatureResult +try: + from .feature_properties_py3 import FeatureProperties + from .feature_result_py3 import FeatureResult + from .operation_display_py3 import OperationDisplay + from .operation_definition_py3 import OperationDefinition + from .operations_list_py3 import OperationsList +except (SyntaxError, ImportError): + from .feature_properties import FeatureProperties + from .feature_result import FeatureResult + from .operation_display import OperationDisplay + from .operation_definition import OperationDefinition + from .operations_list import OperationsList from .feature_result_paged import FeatureResultPaged __all__ = [ 'FeatureProperties', 'FeatureResult', + 'OperationDisplay', + 'OperationDefinition', + 'OperationsList', 'FeatureResultPaged', ] diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/feature_properties.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/feature_properties.py index dd53c0a74620..63421212ff4b 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/feature_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/feature_properties.py @@ -23,6 +23,6 @@ class FeatureProperties(Model): 'state': {'key': 'state', 'type': 'str'}, } - def __init__(self, state=None): - super(FeatureProperties, self).__init__() - self.state = state + def __init__(self, **kwargs): + super(FeatureProperties, self).__init__(**kwargs) + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/feature_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/feature_properties_py3.py new file mode 100644 index 000000000000..9779ede3f50d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/feature_properties_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FeatureProperties(Model): + """Information about feature. + + :param state: The registration state of the feature for the subscription. + :type state: str + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, state: str=None, **kwargs) -> None: + super(FeatureProperties, self).__init__(**kwargs) + self.state = state diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/feature_result.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/feature_result.py index 84a0143003af..60f25ee88ee4 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/feature_result.py +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/feature_result.py @@ -33,9 +33,9 @@ class FeatureResult(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, name=None, properties=None, id=None, type=None): - super(FeatureResult, self).__init__() - self.name = name - self.properties = properties - self.id = id - self.type = type + def __init__(self, **kwargs): + super(FeatureResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/feature_result_py3.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/feature_result_py3.py new file mode 100644 index 000000000000..cd27b1a43316 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/feature_result_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FeatureResult(Model): + """Previewed feature information. + + :param name: The name of the feature. + :type name: str + :param properties: Properties of the previewed feature. + :type properties: + ~azure.mgmt.resource.features.v2015_12_01.models.FeatureProperties + :param id: The resource ID of the feature. + :type id: str + :param type: The resource type of the feature. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, properties=None, id: str=None, type: str=None, **kwargs) -> None: + super(FeatureResult, self).__init__(**kwargs) + self.name = name + self.properties = properties + self.id = id + self.type = type diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_definition.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_definition.py new file mode 100644 index 000000000000..a982fcce7dcc --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_definition.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDefinition(Model): + """OperationDefinition. + + :param name: The name of the operation. + :type name: str + :param display: The operation display definition. + :type display: + ~azure.mgmt.resource.features.v2015_12_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_definition_py3.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_definition_py3.py new file mode 100644 index 000000000000..6dafa7009023 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_definition_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDefinition(Model): + """OperationDefinition. + + :param name: The name of the operation. + :type name: str + :param display: The operation display definition. + :type display: + ~azure.mgmt.resource.features.v2015_12_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(OperationDefinition, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display.py new file mode 100644 index 000000000000..8ba502a243f8 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """OperationDisplay. + + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display_py3.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display_py3.py new file mode 100644 index 000000000000..c8f686362819 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """OperationDisplay. + + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operations_list.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operations_list.py new file mode 100644 index 000000000000..183d556b18aa --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operations_list.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationsList(Model): + """OperationsList. + + :param operations: The array of feature operations. + :type operations: + list[~azure.mgmt.resource.features.v2015_12_01.models.OperationDefinition] + """ + + _attribute_map = { + 'operations': {'key': 'operations', 'type': '[OperationDefinition]'}, + } + + def __init__(self, **kwargs): + super(OperationsList, self).__init__(**kwargs) + self.operations = kwargs.get('operations', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operations_list_py3.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operations_list_py3.py new file mode 100644 index 000000000000..196d1a41f756 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operations_list_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationsList(Model): + """OperationsList. + + :param operations: The array of feature operations. + :type operations: + list[~azure.mgmt.resource.features.v2015_12_01.models.OperationDefinition] + """ + + _attribute_map = { + 'operations': {'key': 'operations', 'type': '[OperationDefinition]'}, + } + + def __init__(self, *, operations=None, **kwargs) -> None: + super(OperationsList, self).__init__(**kwargs) + self.operations = operations diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/features_operations.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/features_operations.py index dc13aa490301..5d7d290838a8 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/features_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/features_operations.py @@ -103,6 +103,58 @@ def internal_paging(next_link=None, raw=False): return deserialized list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Features/features'} + def operations( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the preview feature operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationsList or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.features.v2015_12_01.models.OperationsList or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.operations.metadata['url'] + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationsList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + operations.metadata = {'url': '/providers/Microsoft.Features/operations'} + def list( self, resource_provider_namespace, custom_headers=None, raw=False, **operation_config): """Gets all the preview features in a provider namespace that are diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/management_link_client.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/management_link_client.py index 1e42f86e274b..9820f661c595 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/management_link_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/management_link_client.py @@ -9,7 +9,7 @@ # 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 @@ -49,7 +49,7 @@ def __init__( self.subscription_id = subscription_id -class ManagementLinkClient(object): +class ManagementLinkClient(SDKClient): """Azure resources can be linked together to form logical relationships. You can establish links between resources belonging to different resource groups. However, all the linked resources must belong to the same subscription. Each resource can be linked to 50 other resources. If any of the linked resources are deleted or moved, the link owner must clean up the remaining link. :ivar config: Configuration for client. @@ -70,7 +70,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = ManagementLinkClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(ManagementLinkClient, 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 = '2016-09-01' diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/__init__.py index f8e9ed689efa..80cdd1f9217a 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/__init__.py @@ -9,9 +9,14 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource_link_filter import ResourceLinkFilter -from .resource_link_properties import ResourceLinkProperties -from .resource_link import ResourceLink +try: + from .resource_link_filter_py3 import ResourceLinkFilter + from .resource_link_properties_py3 import ResourceLinkProperties + from .resource_link_py3 import ResourceLink +except (SyntaxError, ImportError): + from .resource_link_filter import ResourceLinkFilter + from .resource_link_properties import ResourceLinkProperties + from .resource_link import ResourceLink from .resource_link_paged import ResourceLinkPaged from .management_link_client_enums import ( Filter, diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/management_link_client_enums.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/management_link_client_enums.py index 3c136e57d8c0..79b4af6dde2e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/management_link_client_enums.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/management_link_client_enums.py @@ -12,6 +12,6 @@ from enum import Enum -class Filter(Enum): +class Filter(str, Enum): at_scope = "atScope()" diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link.py index c699207db324..1c5c5b143719 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link.py @@ -38,8 +38,8 @@ class ResourceLink(Model): 'properties': {'key': 'properties', 'type': 'ResourceLinkProperties'}, } - def __init__(self, properties=None): - super(ResourceLink, self).__init__() + def __init__(self, **kwargs): + super(ResourceLink, self).__init__(**kwargs) self.id = None self.name = None - self.properties = properties + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_filter.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_filter.py index f8980ed996a6..0af23f0e704b 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_filter.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_filter.py @@ -15,7 +15,9 @@ class ResourceLinkFilter(Model): """Resource link filter. - :param target_id: The ID of the target resource. + All required parameters must be populated in order to send to Azure. + + :param target_id: Required. The ID of the target resource. :type target_id: str """ @@ -27,6 +29,6 @@ class ResourceLinkFilter(Model): 'target_id': {'key': 'targetId', 'type': 'str'}, } - def __init__(self, target_id): - super(ResourceLinkFilter, self).__init__() - self.target_id = target_id + def __init__(self, **kwargs): + super(ResourceLinkFilter, self).__init__(**kwargs) + self.target_id = kwargs.get('target_id', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_filter_py3.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_filter_py3.py new file mode 100644 index 000000000000..b74ebd346c03 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_filter_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceLinkFilter(Model): + """Resource link filter. + + All required parameters must be populated in order to send to Azure. + + :param target_id: Required. The ID of the target resource. + :type target_id: str + """ + + _validation = { + 'target_id': {'required': True}, + } + + _attribute_map = { + 'target_id': {'key': 'targetId', 'type': 'str'}, + } + + def __init__(self, *, target_id: str, **kwargs) -> None: + super(ResourceLinkFilter, self).__init__(**kwargs) + self.target_id = target_id diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_properties.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_properties.py index ba28f1f3fb55..a97018ee74ab 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_properties.py @@ -18,11 +18,13 @@ class ResourceLinkProperties(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar source_id: The fully qualified ID of the source resource in the link. :vartype source_id: str - :param target_id: The fully qualified ID of the target resource in the - link. + :param target_id: Required. The fully qualified ID of the target resource + in the link. :type target_id: str :param notes: Notes about the resource link. :type notes: str @@ -39,8 +41,8 @@ class ResourceLinkProperties(Model): 'notes': {'key': 'notes', 'type': 'str'}, } - def __init__(self, target_id, notes=None): - super(ResourceLinkProperties, self).__init__() + def __init__(self, **kwargs): + super(ResourceLinkProperties, self).__init__(**kwargs) self.source_id = None - self.target_id = target_id - self.notes = notes + self.target_id = kwargs.get('target_id', None) + self.notes = kwargs.get('notes', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_properties_py3.py new file mode 100644 index 000000000000..4540e6ca4d07 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_properties_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceLinkProperties(Model): + """The resource link properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar source_id: The fully qualified ID of the source resource in the + link. + :vartype source_id: str + :param target_id: Required. The fully qualified ID of the target resource + in the link. + :type target_id: str + :param notes: Notes about the resource link. + :type notes: str + """ + + _validation = { + 'source_id': {'readonly': True}, + 'target_id': {'required': True}, + } + + _attribute_map = { + 'source_id': {'key': 'sourceId', 'type': 'str'}, + 'target_id': {'key': 'targetId', 'type': 'str'}, + 'notes': {'key': 'notes', 'type': 'str'}, + } + + def __init__(self, *, target_id: str, notes: str=None, **kwargs) -> None: + super(ResourceLinkProperties, self).__init__(**kwargs) + self.source_id = None + self.target_id = target_id + self.notes = notes diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_py3.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_py3.py new file mode 100644 index 000000000000..ec2bdd48ca70 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceLink(Model): + """The resource link. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID of the resource link. + :vartype id: str + :ivar name: The name of the resource link. + :vartype name: str + :param properties: Properties for resource link. + :type properties: + ~azure.mgmt.resource.links.v2016_09_01.models.ResourceLinkProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceLinkProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(ResourceLink, self).__init__(**kwargs) + self.id = None + self.name = None + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/management_lock_client.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/management_lock_client.py index 180930003d4b..6fc53b2fae11 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/management_lock_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/management_lock_client.py @@ -9,7 +9,7 @@ # 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 @@ -51,7 +51,7 @@ def __init__( self.subscription_id = subscription_id -class ManagementLockClient(object): +class ManagementLockClient(SDKClient): """ManagementLockClient :ivar config: Configuration for client. @@ -74,7 +74,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = ManagementLockClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(ManagementLockClient, 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 = '2015-01-01' diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/__init__.py index b2d9b1d1487b..476ef2c36ec1 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/__init__.py @@ -9,7 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .management_lock_object import ManagementLockObject +try: + from .management_lock_object_py3 import ManagementLockObject +except (SyntaxError, ImportError): + from .management_lock_object import ManagementLockObject from .management_lock_object_paged import ManagementLockObjectPaged from .management_lock_client_enums import ( LockLevel, diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/management_lock_client_enums.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/management_lock_client_enums.py index 6c23e9f983ce..296c12a6a3e3 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/management_lock_client_enums.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/management_lock_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class LockLevel(Enum): +class LockLevel(str, Enum): not_specified = "NotSpecified" can_not_delete = "CanNotDelete" diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/management_lock_object.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/management_lock_object.py index 85bd9981870c..16e83fa3c348 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/management_lock_object.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/management_lock_object.py @@ -15,20 +15,28 @@ class ManagementLockObject(Model): """Management lock information. + Variables are only populated by the server, and will be ignored when + sending a request. + :param level: The lock level of the management lock. Possible values include: 'NotSpecified', 'CanNotDelete', 'ReadOnly' :type level: str or ~azure.mgmt.resource.locks.v2015_01_01.models.LockLevel :param notes: The notes of the management lock. :type notes: str - :param id: The Id of the lock. - :type id: str - :param type: The type of the lock. - :type type: str + :ivar id: The Id of the lock. + :vartype id: str + :ivar type: The type of the lock. + :vartype type: str :param name: The name of the lock. :type name: str """ + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + _attribute_map = { 'level': {'key': 'properties.level', 'type': 'str'}, 'notes': {'key': 'properties.notes', 'type': 'str'}, @@ -37,10 +45,10 @@ class ManagementLockObject(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, level=None, notes=None, id=None, type=None, name=None): - super(ManagementLockObject, self).__init__() - self.level = level - self.notes = notes - self.id = id - self.type = type - self.name = name + def __init__(self, **kwargs): + super(ManagementLockObject, self).__init__(**kwargs) + self.level = kwargs.get('level', None) + self.notes = kwargs.get('notes', None) + self.id = None + self.type = None + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/management_lock_object_py3.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/management_lock_object_py3.py new file mode 100644 index 000000000000..b4bf4f8016b3 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/management_lock_object_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ManagementLockObject(Model): + """Management lock information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param level: The lock level of the management lock. Possible values + include: 'NotSpecified', 'CanNotDelete', 'ReadOnly' + :type level: str or + ~azure.mgmt.resource.locks.v2015_01_01.models.LockLevel + :param notes: The notes of the management lock. + :type notes: str + :ivar id: The Id of the lock. + :vartype id: str + :ivar type: The type of the lock. + :vartype type: str + :param name: The name of the lock. + :type name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'level': {'key': 'properties.level', 'type': 'str'}, + 'notes': {'key': 'properties.notes', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, level=None, notes: str=None, name: str=None, **kwargs) -> None: + super(ManagementLockObject, self).__init__(**kwargs) + self.level = level + self.notes = notes + self.id = None + self.type = None + self.name = name diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/management_lock_client.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/management_lock_client.py index 9a2502a24577..193ccb0fe905 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/management_lock_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/management_lock_client.py @@ -9,7 +9,7 @@ # 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 @@ -49,7 +49,7 @@ def __init__( self.subscription_id = subscription_id -class ManagementLockClient(object): +class ManagementLockClient(SDKClient): """Azure resources can be locked to prevent other users in your organization from deleting or modifying resources. :ivar config: Configuration for client. @@ -70,7 +70,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = ManagementLockClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(ManagementLockClient, 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 = '2016-09-01' diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/__init__.py index 7040873b4929..c87415874da2 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/__init__.py @@ -9,8 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- -from .management_lock_owner import ManagementLockOwner -from .management_lock_object import ManagementLockObject +try: + from .management_lock_owner_py3 import ManagementLockOwner + from .management_lock_object_py3 import ManagementLockObject +except (SyntaxError, ImportError): + from .management_lock_owner import ManagementLockOwner + from .management_lock_object import ManagementLockObject from .management_lock_object_paged import ManagementLockObjectPaged from .management_lock_client_enums import ( LockLevel, diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_client_enums.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_client_enums.py index 6c23e9f983ce..296c12a6a3e3 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_client_enums.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class LockLevel(Enum): +class LockLevel(str, Enum): not_specified = "NotSpecified" can_not_delete = "CanNotDelete" diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_object.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_object.py index 459eea82dd2f..662bdeb7cd65 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_object.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_object.py @@ -18,11 +18,14 @@ class ManagementLockObject(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param level: The level of the lock. Possible values are: NotSpecified, - CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to - read and modify the resources, but not delete. ReadOnly means authorized - users can only read from a resource, but they can't modify or delete it. - Possible values include: 'NotSpecified', 'CanNotDelete', 'ReadOnly' + All required parameters must be populated in order to send to Azure. + + :param level: Required. The level of the lock. Possible values are: + NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users + are able to read and modify the resources, but not delete. ReadOnly means + authorized users can only read from a resource, but they can't modify or + delete it. Possible values include: 'NotSpecified', 'CanNotDelete', + 'ReadOnly' :type level: str or ~azure.mgmt.resource.locks.v2016_09_01.models.LockLevel :param notes: Notes about the lock. Maximum of 512 characters. @@ -53,11 +56,11 @@ class ManagementLockObject(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, level, notes=None, owners=None, name=None): - super(ManagementLockObject, self).__init__() - self.level = level - self.notes = notes - self.owners = owners + def __init__(self, **kwargs): + super(ManagementLockObject, self).__init__(**kwargs) + self.level = kwargs.get('level', None) + self.notes = kwargs.get('notes', None) + self.owners = kwargs.get('owners', None) self.id = None self.type = None - self.name = name + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_object_py3.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_object_py3.py new file mode 100644 index 000000000000..29a159d75456 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_object_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ManagementLockObject(Model): + """The lock information. + + 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 level: Required. The level of the lock. Possible values are: + NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users + are able to read and modify the resources, but not delete. ReadOnly means + authorized users can only read from a resource, but they can't modify or + delete it. Possible values include: 'NotSpecified', 'CanNotDelete', + 'ReadOnly' + :type level: str or + ~azure.mgmt.resource.locks.v2016_09_01.models.LockLevel + :param notes: Notes about the lock. Maximum of 512 characters. + :type notes: str + :param owners: The owners of the lock. + :type owners: + list[~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockOwner] + :ivar id: The resource ID of the lock. + :vartype id: str + :ivar type: The resource type of the lock - Microsoft.Authorization/locks. + :vartype type: str + :param name: The name of the lock. + :type name: str + """ + + _validation = { + 'level': {'required': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'level': {'key': 'properties.level', 'type': 'str'}, + 'notes': {'key': 'properties.notes', 'type': 'str'}, + 'owners': {'key': 'properties.owners', 'type': '[ManagementLockOwner]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, level, notes: str=None, owners=None, name: str=None, **kwargs) -> None: + super(ManagementLockObject, self).__init__(**kwargs) + self.level = level + self.notes = notes + self.owners = owners + self.id = None + self.type = None + self.name = name diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_owner.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_owner.py index 314caa8385db..370b52740c4e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_owner.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_owner.py @@ -23,6 +23,6 @@ class ManagementLockOwner(Model): 'application_id': {'key': 'applicationId', 'type': 'str'}, } - def __init__(self, application_id=None): - super(ManagementLockOwner, self).__init__() - self.application_id = application_id + def __init__(self, **kwargs): + super(ManagementLockOwner, self).__init__(**kwargs) + self.application_id = kwargs.get('application_id', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_owner_py3.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_owner_py3.py new file mode 100644 index 000000000000..130b54fefc52 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/management_lock_owner_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ManagementLockOwner(Model): + """Lock owner properties. + + :param application_id: The application ID of the lock owner. + :type application_id: str + """ + + _attribute_map = { + 'application_id': {'key': 'applicationId', 'type': 'str'}, + } + + def __init__(self, *, application_id: str=None, **kwargs) -> None: + super(ManagementLockOwner, self).__init__(**kwargs) + self.application_id = application_id diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/application_client.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/application_client.py index a42f5253e331..363051e82b15 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/application_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/application_client.py @@ -9,12 +9,13 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION from .operations.applications_operations import ApplicationsOperations from .operations.application_definitions_operations import ApplicationDefinitionsOperations +from .operations.solutions_operations import SolutionsOperations from . import models @@ -50,7 +51,7 @@ def __init__( self.subscription_id = subscription_id -class ApplicationClient(object): +class ApplicationClient(SDKClient): """ARM applications :ivar config: Configuration for client. @@ -60,6 +61,8 @@ class ApplicationClient(object): :vartype applications: azure.mgmt.resource.managedapplications.operations.ApplicationsOperations :ivar application_definitions: ApplicationDefinitions operations :vartype application_definitions: azure.mgmt.resource.managedapplications.operations.ApplicationDefinitionsOperations + :ivar solutions: Solutions operations + :vartype solutions: azure.mgmt.resource.managedapplications.operations.SolutionsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -73,7 +76,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = ApplicationClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(ApplicationClient, 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 = '2017-09-01' @@ -84,3 +87,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.application_definitions = ApplicationDefinitionsOperations( self._client, self.config, self._serialize, self._deserialize) + self.solutions = SolutionsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/__init__.py index af7eb12ce63f..1f2a37d3eaba 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/__init__.py @@ -9,18 +9,38 @@ # regenerated. # -------------------------------------------------------------------------- -from .plan import Plan -from .application import Application -from .plan_patchable import PlanPatchable -from .application_patchable import ApplicationPatchable -from .application_provider_authorization import ApplicationProviderAuthorization -from .application_artifact import ApplicationArtifact -from .application_definition import ApplicationDefinition -from .sku import Sku -from .identity import Identity -from .generic_resource import GenericResource -from .resource import Resource -from .error_response import ErrorResponse, ErrorResponseException +try: + from .plan_py3 import Plan + from .application_py3 import Application + from .plan_patchable_py3 import PlanPatchable + from .application_patchable_py3 import ApplicationPatchable + from .application_provider_authorization_py3 import ApplicationProviderAuthorization + from .application_artifact_py3 import ApplicationArtifact + from .application_definition_py3 import ApplicationDefinition + from .sku_py3 import Sku + from .identity_py3 import Identity + from .generic_resource_py3 import GenericResource + from .resource_py3 import Resource + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .operation_display_py3 import OperationDisplay + from .operation_definition_py3 import OperationDefinition + from .operations_list_py3 import OperationsList +except (SyntaxError, ImportError): + from .plan import Plan + from .application import Application + from .plan_patchable import PlanPatchable + from .application_patchable import ApplicationPatchable + from .application_provider_authorization import ApplicationProviderAuthorization + from .application_artifact import ApplicationArtifact + from .application_definition import ApplicationDefinition + from .sku import Sku + from .identity import Identity + from .generic_resource import GenericResource + from .resource import Resource + from .error_response import ErrorResponse, ErrorResponseException + from .operation_display import OperationDisplay + from .operation_definition import OperationDefinition + from .operations_list import OperationsList from .application_paged import ApplicationPaged from .application_definition_paged import ApplicationDefinitionPaged from .application_client_enums import ( @@ -43,6 +63,9 @@ 'GenericResource', 'Resource', 'ErrorResponse', 'ErrorResponseException', + 'OperationDisplay', + 'OperationDefinition', + 'OperationsList', 'ApplicationPaged', 'ApplicationDefinitionPaged', 'ProvisioningState', diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application.py index 986f76417676..ff019c504316 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application.py @@ -18,6 +18,8 @@ class Application(GenericResource): 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: Resource ID :vartype id: str :ivar name: Resource name @@ -34,7 +36,7 @@ class Application(GenericResource): :type sku: ~azure.mgmt.resource.managedapplications.models.Sku :param identity: The identity of the resource. :type identity: ~azure.mgmt.resource.managedapplications.models.Identity - :param managed_resource_group_id: The managed resource group Id. + :param managed_resource_group_id: Required. The managed resource group Id. :type managed_resource_group_id: str :param application_definition_id: The fully qualified path of managed application definition Id. @@ -56,8 +58,8 @@ class Application(GenericResource): :type ui_definition_uri: str :param plan: The plan information. :type plan: ~azure.mgmt.resource.managedapplications.models.Plan - :param kind: The kind of the managed application. Allowed values are - MarketPlace and ServiceCatalog. + :param kind: Required. The kind of the managed application. Allowed values + are MarketPlace and ServiceCatalog. :type kind: str """ @@ -90,13 +92,13 @@ class Application(GenericResource): 'kind': {'key': 'kind', 'type': 'str'}, } - def __init__(self, managed_resource_group_id, kind, location=None, tags=None, managed_by=None, sku=None, identity=None, application_definition_id=None, parameters=None, ui_definition_uri=None, plan=None): - super(Application, self).__init__(location=location, tags=tags, managed_by=managed_by, sku=sku, identity=identity) - self.managed_resource_group_id = managed_resource_group_id - self.application_definition_id = application_definition_id - self.parameters = parameters + def __init__(self, **kwargs): + super(Application, self).__init__(**kwargs) + self.managed_resource_group_id = kwargs.get('managed_resource_group_id', None) + self.application_definition_id = kwargs.get('application_definition_id', None) + self.parameters = kwargs.get('parameters', None) self.outputs = None self.provisioning_state = None - self.ui_definition_uri = ui_definition_uri - self.plan = plan - self.kind = kind + self.ui_definition_uri = kwargs.get('ui_definition_uri', None) + self.plan = kwargs.get('plan', None) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_artifact.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_artifact.py index 94c3aac7b425..6caa8c256b27 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_artifact.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_artifact.py @@ -31,8 +31,8 @@ class ApplicationArtifact(Model): 'type': {'key': 'type', 'type': 'ApplicationArtifactType'}, } - def __init__(self, name=None, uri=None, type=None): - super(ApplicationArtifact, self).__init__() - self.name = name - self.uri = uri - self.type = type + def __init__(self, **kwargs): + super(ApplicationArtifact, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.uri = kwargs.get('uri', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_artifact_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_artifact_py3.py new file mode 100644 index 000000000000..cac6dc7961ae --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_artifact_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationArtifact(Model): + """Managed application artifact. + + :param name: The managed application artifact name. + :type name: str + :param uri: The managed application artifact blob uri. + :type uri: str + :param type: The managed application artifact type. Possible values + include: 'Template', 'Custom' + :type type: str or + ~azure.mgmt.resource.managedapplications.models.ApplicationArtifactType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ApplicationArtifactType'}, + } + + def __init__(self, *, name: str=None, uri: str=None, type=None, **kwargs) -> None: + super(ApplicationArtifact, self).__init__(**kwargs) + self.name = name + self.uri = uri + self.type = type diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_client_enums.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_client_enums.py index aa888cb65d48..3f80fb3f4566 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_client_enums.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): accepted = "Accepted" running = "Running" @@ -27,19 +27,19 @@ class ProvisioningState(Enum): updating = "Updating" -class ApplicationLockLevel(Enum): +class ApplicationLockLevel(str, Enum): can_not_delete = "CanNotDelete" read_only = "ReadOnly" none = "None" -class ApplicationArtifactType(Enum): +class ApplicationArtifactType(str, Enum): template = "Template" custom = "Custom" -class ResourceIdentityType(Enum): +class ResourceIdentityType(str, Enum): system_assigned = "SystemAssigned" diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_definition.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_definition.py index 866b45a6050d..140082a806c6 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_definition.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_definition.py @@ -18,6 +18,8 @@ class ApplicationDefinition(GenericResource): 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: Resource ID :vartype id: str :ivar name: Resource name @@ -34,8 +36,8 @@ class ApplicationDefinition(GenericResource): :type sku: ~azure.mgmt.resource.managedapplications.models.Sku :param identity: The identity of the resource. :type identity: ~azure.mgmt.resource.managedapplications.models.Identity - :param lock_level: The managed application lock level. Possible values - include: 'CanNotDelete', 'ReadOnly', 'None' + :param lock_level: Required. The managed application lock level. Possible + values include: 'CanNotDelete', 'ReadOnly', 'None' :type lock_level: str or ~azure.mgmt.resource.managedapplications.models.ApplicationLockLevel :param display_name: The managed application definition display name. @@ -43,7 +45,8 @@ class ApplicationDefinition(GenericResource): :param is_enabled: A value indicating whether the package is enabled or not. :type is_enabled: str - :param authorizations: The managed application provider authorizations. + :param authorizations: Required. The managed application provider + authorizations. :type authorizations: list[~azure.mgmt.resource.managedapplications.models.ApplicationProviderAuthorization] :param artifacts: The collection of managed application artifacts. The @@ -94,14 +97,14 @@ class ApplicationDefinition(GenericResource): 'create_ui_definition': {'key': 'properties.createUiDefinition', 'type': 'object'}, } - def __init__(self, lock_level, authorizations, location=None, tags=None, managed_by=None, sku=None, identity=None, display_name=None, is_enabled=None, artifacts=None, description=None, package_file_uri=None, main_template=None, create_ui_definition=None): - super(ApplicationDefinition, self).__init__(location=location, tags=tags, managed_by=managed_by, sku=sku, identity=identity) - self.lock_level = lock_level - self.display_name = display_name - self.is_enabled = is_enabled - self.authorizations = authorizations - self.artifacts = artifacts - self.description = description - self.package_file_uri = package_file_uri - self.main_template = main_template - self.create_ui_definition = create_ui_definition + def __init__(self, **kwargs): + super(ApplicationDefinition, self).__init__(**kwargs) + self.lock_level = kwargs.get('lock_level', None) + self.display_name = kwargs.get('display_name', None) + self.is_enabled = kwargs.get('is_enabled', None) + self.authorizations = kwargs.get('authorizations', None) + self.artifacts = kwargs.get('artifacts', None) + self.description = kwargs.get('description', None) + self.package_file_uri = kwargs.get('package_file_uri', None) + self.main_template = kwargs.get('main_template', None) + self.create_ui_definition = kwargs.get('create_ui_definition', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_definition_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_definition_py3.py new file mode 100644 index 000000000000..11bac23bbd07 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_definition_py3.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .generic_resource import GenericResource + + +class ApplicationDefinition(GenericResource): + """Information about managed application definition. + + 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: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.managedapplications.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.managedapplications.models.Identity + :param lock_level: Required. The managed application lock level. Possible + values include: 'CanNotDelete', 'ReadOnly', 'None' + :type lock_level: str or + ~azure.mgmt.resource.managedapplications.models.ApplicationLockLevel + :param display_name: The managed application definition display name. + :type display_name: str + :param is_enabled: A value indicating whether the package is enabled or + not. + :type is_enabled: str + :param authorizations: Required. The managed application provider + authorizations. + :type authorizations: + list[~azure.mgmt.resource.managedapplications.models.ApplicationProviderAuthorization] + :param artifacts: The collection of managed application artifacts. The + portal will use the files specified as artifacts to construct the user + experience of creating a managed application from a managed application + definition. + :type artifacts: + list[~azure.mgmt.resource.managedapplications.models.ApplicationArtifact] + :param description: The managed application definition description. + :type description: str + :param package_file_uri: The managed application definition package file + Uri. Use this element + :type package_file_uri: str + :param main_template: The inline main template json which has resources to + be provisioned. It can be a JObject or well-formed JSON string. + :type main_template: object + :param create_ui_definition: The createUiDefinition json for the backing + template with Microsoft.Solutions/applications resource. It can be a + JObject or well-formed JSON string. + :type create_ui_definition: object + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'lock_level': {'required': True}, + 'authorizations': {'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}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'lock_level': {'key': 'properties.lockLevel', 'type': 'ApplicationLockLevel'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[ApplicationProviderAuthorization]'}, + 'artifacts': {'key': 'properties.artifacts', 'type': '[ApplicationArtifact]'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'package_file_uri': {'key': 'properties.packageFileUri', 'type': 'str'}, + 'main_template': {'key': 'properties.mainTemplate', 'type': 'object'}, + 'create_ui_definition': {'key': 'properties.createUiDefinition', 'type': 'object'}, + } + + def __init__(self, *, lock_level, authorizations, location: str=None, tags=None, managed_by: str=None, sku=None, identity=None, display_name: str=None, is_enabled: str=None, artifacts=None, description: str=None, package_file_uri: str=None, main_template=None, create_ui_definition=None, **kwargs) -> None: + super(ApplicationDefinition, self).__init__(location=location, tags=tags, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.lock_level = lock_level + self.display_name = display_name + self.is_enabled = is_enabled + self.authorizations = authorizations + self.artifacts = artifacts + self.description = description + self.package_file_uri = package_file_uri + self.main_template = main_template + self.create_ui_definition = create_ui_definition diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_patchable.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_patchable.py index 8f3612347150..2aa0d3f4ab8a 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_patchable.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_patchable.py @@ -89,13 +89,13 @@ class ApplicationPatchable(GenericResource): 'kind': {'key': 'kind', 'type': 'str'}, } - def __init__(self, location=None, tags=None, managed_by=None, sku=None, identity=None, managed_resource_group_id=None, application_definition_id=None, parameters=None, ui_definition_uri=None, plan=None, kind=None): - super(ApplicationPatchable, self).__init__(location=location, tags=tags, managed_by=managed_by, sku=sku, identity=identity) - self.managed_resource_group_id = managed_resource_group_id - self.application_definition_id = application_definition_id - self.parameters = parameters + def __init__(self, **kwargs): + super(ApplicationPatchable, self).__init__(**kwargs) + self.managed_resource_group_id = kwargs.get('managed_resource_group_id', None) + self.application_definition_id = kwargs.get('application_definition_id', None) + self.parameters = kwargs.get('parameters', None) self.outputs = None self.provisioning_state = None - self.ui_definition_uri = ui_definition_uri - self.plan = plan - self.kind = kind + self.ui_definition_uri = kwargs.get('ui_definition_uri', None) + self.plan = kwargs.get('plan', None) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_patchable_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_patchable_py3.py new file mode 100644 index 000000000000..882c0087b12d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_patchable_py3.py @@ -0,0 +1,101 @@ +# 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 .generic_resource import GenericResource + + +class ApplicationPatchable(GenericResource): + """Information about managed application. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.managedapplications.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.managedapplications.models.Identity + :param managed_resource_group_id: The managed resource group Id. + :type managed_resource_group_id: str + :param application_definition_id: The fully qualified path of managed + application definition Id. + :type application_definition_id: str + :param parameters: Name and value pairs that define the managed + application parameters. It can be a JObject or a well formed JSON string. + :type parameters: object + :ivar outputs: Name and value pairs that define the managed application + outputs. + :vartype outputs: object + :ivar provisioning_state: The managed application provisioning state. + Possible values include: 'Accepted', 'Running', 'Ready', 'Creating', + 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', + 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.resource.managedapplications.models.ProvisioningState + :param ui_definition_uri: The blob URI where the UI definition file is + located. + :type ui_definition_uri: str + :param plan: The plan information. + :type plan: ~azure.mgmt.resource.managedapplications.models.PlanPatchable + :param kind: The kind of the managed application. Allowed values are + MarketPlace and ServiceCatalog. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'outputs': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + } + + _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}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'managed_resource_group_id': {'key': 'properties.managedResourceGroupId', 'type': 'str'}, + 'application_definition_id': {'key': 'properties.applicationDefinitionId', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': 'object'}, + 'outputs': {'key': 'properties.outputs', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'ui_definition_uri': {'key': 'properties.uiDefinitionUri', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'PlanPatchable'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, managed_by: str=None, sku=None, identity=None, managed_resource_group_id: str=None, application_definition_id: str=None, parameters=None, ui_definition_uri: str=None, plan=None, kind: str=None, **kwargs) -> None: + super(ApplicationPatchable, self).__init__(location=location, tags=tags, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.managed_resource_group_id = managed_resource_group_id + self.application_definition_id = application_definition_id + self.parameters = parameters + self.outputs = None + self.provisioning_state = None + self.ui_definition_uri = ui_definition_uri + self.plan = plan + self.kind = kind diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_provider_authorization.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_provider_authorization.py index e188836af26f..24efef4adb19 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_provider_authorization.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_provider_authorization.py @@ -15,14 +15,16 @@ class ApplicationProviderAuthorization(Model): """The managed application provider authorization. - :param principal_id: The provider's principal identifier. This is the - identity that the provider will use to call ARM to manage the managed - application resources. + All required parameters must be populated in order to send to Azure. + + :param principal_id: Required. The provider's principal identifier. This + is the identity that the provider will use to call ARM to manage the + managed application resources. :type principal_id: str - :param role_definition_id: The provider's role definition identifier. This - role will define all the permissions that the provider must have on the - managed application's container resource group. This role definition - cannot have permission to delete the resource group. + :param role_definition_id: Required. The provider's role definition + identifier. This role will define all the permissions that the provider + must have on the managed application's container resource group. This role + definition cannot have permission to delete the resource group. :type role_definition_id: str """ @@ -36,7 +38,7 @@ class ApplicationProviderAuthorization(Model): 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, } - def __init__(self, principal_id, role_definition_id): - super(ApplicationProviderAuthorization, self).__init__() - self.principal_id = principal_id - self.role_definition_id = role_definition_id + def __init__(self, **kwargs): + super(ApplicationProviderAuthorization, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.role_definition_id = kwargs.get('role_definition_id', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_provider_authorization_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_provider_authorization_py3.py new file mode 100644 index 000000000000..98cbd662faa9 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_provider_authorization_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationProviderAuthorization(Model): + """The managed application provider authorization. + + All required parameters must be populated in order to send to Azure. + + :param principal_id: Required. The provider's principal identifier. This + is the identity that the provider will use to call ARM to manage the + managed application resources. + :type principal_id: str + :param role_definition_id: Required. The provider's role definition + identifier. This role will define all the permissions that the provider + must have on the managed application's container resource group. This role + definition cannot have permission to delete the resource group. + :type role_definition_id: str + """ + + _validation = { + 'principal_id': {'required': True}, + 'role_definition_id': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str, role_definition_id: str, **kwargs) -> None: + super(ApplicationProviderAuthorization, self).__init__(**kwargs) + self.principal_id = principal_id + self.role_definition_id = role_definition_id diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_py3.py new file mode 100644 index 000000000000..5dfe3859a209 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_py3.py @@ -0,0 +1,104 @@ +# 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 .generic_resource import GenericResource + + +class Application(GenericResource): + """Information about managed application. + + 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: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.managedapplications.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.managedapplications.models.Identity + :param managed_resource_group_id: Required. The managed resource group Id. + :type managed_resource_group_id: str + :param application_definition_id: The fully qualified path of managed + application definition Id. + :type application_definition_id: str + :param parameters: Name and value pairs that define the managed + application parameters. It can be a JObject or a well formed JSON string. + :type parameters: object + :ivar outputs: Name and value pairs that define the managed application + outputs. + :vartype outputs: object + :ivar provisioning_state: The managed application provisioning state. + Possible values include: 'Accepted', 'Running', 'Ready', 'Creating', + 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', + 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.resource.managedapplications.models.ProvisioningState + :param ui_definition_uri: The blob URI where the UI definition file is + located. + :type ui_definition_uri: str + :param plan: The plan information. + :type plan: ~azure.mgmt.resource.managedapplications.models.Plan + :param kind: Required. The kind of the managed application. Allowed values + are MarketPlace and ServiceCatalog. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'managed_resource_group_id': {'required': True}, + 'outputs': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'kind': {'required': True, 'pattern': r'^[-\w\._,\(\)]+$'}, + } + + _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}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'managed_resource_group_id': {'key': 'properties.managedResourceGroupId', 'type': 'str'}, + 'application_definition_id': {'key': 'properties.applicationDefinitionId', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': 'object'}, + 'outputs': {'key': 'properties.outputs', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'ui_definition_uri': {'key': 'properties.uiDefinitionUri', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, managed_resource_group_id: str, kind: str, location: str=None, tags=None, managed_by: str=None, sku=None, identity=None, application_definition_id: str=None, parameters=None, ui_definition_uri: str=None, plan=None, **kwargs) -> None: + super(Application, self).__init__(location=location, tags=tags, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.managed_resource_group_id = managed_resource_group_id + self.application_definition_id = application_definition_id + self.parameters = parameters + self.outputs = None + self.provisioning_state = None + self.ui_definition_uri = ui_definition_uri + self.plan = plan + self.kind = kind diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/error_response.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/error_response.py index 16ef096328a1..be8461254a2f 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/error_response.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/error_response.py @@ -31,11 +31,11 @@ class ErrorResponse(Model): 'error_message': {'key': 'errorMessage', 'type': 'str'}, } - def __init__(self, http_status=None, error_code=None, error_message=None): - super(ErrorResponse, self).__init__() - self.http_status = http_status - self.error_code = error_code - self.error_message = error_message + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.http_status = kwargs.get('http_status', None) + self.error_code = kwargs.get('error_code', None) + self.error_message = kwargs.get('error_message', None) class ErrorResponseException(HttpOperationError): diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/error_response_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/error_response_py3.py new file mode 100644 index 000000000000..b04c8da8f669 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/error_response_py3.py @@ -0,0 +1,50 @@ +# 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 ErrorResponse(Model): + """Error reponse indicates managed application is not able to process the + incoming request. The reason is provided in the error message. + + :param http_status: Http status code. + :type http_status: str + :param error_code: Error code. + :type error_code: str + :param error_message: Error message indicating why the operation failed. + :type error_message: str + """ + + _attribute_map = { + 'http_status': {'key': 'httpStatus', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, *, http_status: str=None, error_code: str=None, error_message: str=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.http_status = http_status + self.error_code = error_code + self.error_message = error_message + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/generic_resource.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/generic_resource.py index a03bff5c7f90..6fe832dadb70 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/generic_resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/generic_resource.py @@ -53,8 +53,8 @@ class GenericResource(Resource): 'identity': {'key': 'identity', 'type': 'Identity'}, } - def __init__(self, location=None, tags=None, managed_by=None, sku=None, identity=None): - super(GenericResource, self).__init__(location=location, tags=tags) - self.managed_by = managed_by - self.sku = sku - self.identity = identity + def __init__(self, **kwargs): + super(GenericResource, self).__init__(**kwargs) + self.managed_by = kwargs.get('managed_by', None) + self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/generic_resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/generic_resource_py3.py new file mode 100644 index 000000000000..67dcf9cb2f4f --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/generic_resource_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class GenericResource(Resource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.managedapplications.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.managedapplications.models.Identity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': 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}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + def __init__(self, *, location: str=None, tags=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResource, self).__init__(location=location, tags=tags, **kwargs) + self.managed_by = managed_by + self.sku = sku + self.identity = identity diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/identity.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/identity.py index d77d8592fa98..30f30cfa6871 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/identity.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/identity.py @@ -38,8 +38,8 @@ class Identity(Model): 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, } - def __init__(self, type=None): - super(Identity, self).__init__() + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = type + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/identity_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/identity_py3.py new file mode 100644 index 000000000000..9d8a734fdd16 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/identity_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned' + :type type: str or + ~azure.mgmt.resource.managedapplications.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_definition.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_definition.py new file mode 100644 index 000000000000..b7d8024f1e87 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_definition.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDefinition(Model): + """OperationDefinition. + + :param name: The name of the operation. + :type name: str + :param display: The operation display definition. + :type display: + ~azure.mgmt.resource.managedapplications.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_definition_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_definition_py3.py new file mode 100644 index 000000000000..65a915233b49 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_definition_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDefinition(Model): + """OperationDefinition. + + :param name: The name of the operation. + :type name: str + :param display: The operation display definition. + :type display: + ~azure.mgmt.resource.managedapplications.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(OperationDefinition, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_display.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_display.py new file mode 100644 index 000000000000..8ba502a243f8 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_display.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """OperationDisplay. + + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_display_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_display_py3.py new file mode 100644 index 000000000000..c8f686362819 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """OperationDisplay. + + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operations_list.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operations_list.py new file mode 100644 index 000000000000..1b51bf014a4d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operations_list.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationsList(Model): + """OperationsList. + + :param operations: The array of solution operations. + :type operations: + list[~azure.mgmt.resource.managedapplications.models.OperationDefinition] + """ + + _attribute_map = { + 'operations': {'key': 'operations', 'type': '[OperationDefinition]'}, + } + + def __init__(self, **kwargs): + super(OperationsList, self).__init__(**kwargs) + self.operations = kwargs.get('operations', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operations_list_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operations_list_py3.py new file mode 100644 index 000000000000..02adf7630943 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/operations_list_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationsList(Model): + """OperationsList. + + :param operations: The array of solution operations. + :type operations: + list[~azure.mgmt.resource.managedapplications.models.OperationDefinition] + """ + + _attribute_map = { + 'operations': {'key': 'operations', 'type': '[OperationDefinition]'}, + } + + def __init__(self, *, operations=None, **kwargs) -> None: + super(OperationsList, self).__init__(**kwargs) + self.operations = operations diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/plan.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/plan.py index cb530b184a16..c204fe4f234f 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/plan.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/plan.py @@ -15,15 +15,17 @@ class Plan(Model): """Plan for the managed application. - :param name: The plan name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The plan name. :type name: str - :param publisher: The publisher ID. + :param publisher: Required. The publisher ID. :type publisher: str - :param product: The product code. + :param product: Required. The product code. :type product: str :param promotion_code: The promotion code. :type promotion_code: str - :param version: The plan's version. + :param version: Required. The plan's version. :type version: str """ @@ -42,10 +44,10 @@ class Plan(Model): 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, name, publisher, product, version, promotion_code=None): - super(Plan, self).__init__() - self.name = name - self.publisher = publisher - self.product = product - self.promotion_code = promotion_code - self.version = version + def __init__(self, **kwargs): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/plan_patchable.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/plan_patchable.py index c037f1c80cb0..1b1a3c6299fd 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/plan_patchable.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/plan_patchable.py @@ -35,10 +35,10 @@ class PlanPatchable(Model): 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, name=None, publisher=None, product=None, promotion_code=None, version=None): - super(PlanPatchable, self).__init__() - self.name = name - self.publisher = publisher - self.product = product - self.promotion_code = promotion_code - self.version = version + def __init__(self, **kwargs): + super(PlanPatchable, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/plan_patchable_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/plan_patchable_py3.py new file mode 100644 index 000000000000..cf52c56e8077 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/plan_patchable_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PlanPatchable(Model): + """Plan for the managed application. + + :param name: The plan name. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The product code. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + :param version: The plan's version. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, product: str=None, promotion_code: str=None, version: str=None, **kwargs) -> None: + super(PlanPatchable, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code + self.version = version diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/plan_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/plan_py3.py new file mode 100644 index 000000000000..9ba487214887 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/plan_py3.py @@ -0,0 +1,53 @@ +# 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 Plan(Model): + """Plan for the managed application. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The plan name. + :type name: str + :param publisher: Required. The publisher ID. + :type publisher: str + :param product: Required. The product code. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + :param version: Required. The plan's version. + :type version: str + """ + + _validation = { + 'name': {'required': True}, + 'publisher': {'required': True}, + 'product': {'required': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, name: str, publisher: str, product: str, version: str, promotion_code: str=None, **kwargs) -> None: + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code + self.version = version diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/resource.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/resource.py index 719a39df9c53..59731b2803cc 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/resource.py @@ -44,10 +44,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/resource_py3.py new file mode 100644 index 000000000000..5de1d2d3bb94 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/resource_py3.py @@ -0,0 +1,53 @@ +# 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): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': 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=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/sku.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/sku.py index 8237ab526d78..24866582a6c6 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/sku.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/sku.py @@ -15,7 +15,9 @@ class Sku(Model): """SKU for the resource. - :param name: The SKU name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name. :type name: str :param tier: The SKU tier. :type tier: str @@ -42,11 +44,11 @@ class Sku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name, tier=None, size=None, family=None, model=None, capacity=None): - super(Sku, self).__init__() - self.name = name - self.tier = tier - self.size = size - self.family = family - self.model = model - self.capacity = capacity + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.model = kwargs.get('model', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/sku_py3.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/sku_py3.py new file mode 100644 index 000000000000..ce9a39a37a8d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/sku_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """SKU for the resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name. + :type name: str + :param tier: The SKU tier. + :type tier: str + :param size: The SKU size. + :type size: str + :param family: The SKU family. + :type family: str + :param model: The SKU model. + :type model: str + :param capacity: The SKU capacity. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'model': {'key': 'model', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name: str, tier: str=None, size: str=None, family: str=None, model: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.model = model + self.capacity = capacity diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/__init__.py index 8dde81835052..7a0f8fec8ca5 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/__init__.py @@ -11,8 +11,10 @@ from .applications_operations import ApplicationsOperations from .application_definitions_operations import ApplicationDefinitionsOperations +from .solutions_operations import SolutionsOperations __all__ = [ 'ApplicationsOperations', 'ApplicationDefinitionsOperations', + 'SolutionsOperations', ] diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/application_definitions_operations.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/application_definitions_operations.py index b9246c7c85cd..a616ee52355a 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/application_definitions_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/application_definitions_operations.py @@ -11,8 +11,8 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -140,7 +140,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, application_definition_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_definition_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the managed application definition. :param resource_group_name: The name of the resource group. The name @@ -150,12 +150,14 @@ def delete( application definition to delete. :type application_definition_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`ErrorResponseException` """ @@ -166,38 +168,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}'} @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, application_definition_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_definition_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates a new managed application definition. :param resource_group_name: The name of the resource group. The name @@ -265,13 +248,16 @@ def create_or_update( :type parameters: ~azure.mgmt.resource.managedapplications.models.ApplicationDefinition :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationDefinition or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationDefinition + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.managedapplications.models.ApplicationDefinition] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.managedapplications.models.ApplicationDefinition]] :raises: :class:`ErrorResponseException` """ @@ -283,28 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - deserialized = self._deserialize('ApplicationDefinition', response) if raw: @@ -313,12 +279,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}'} def list_by_resource_group( @@ -486,7 +453,7 @@ def _delete_by_id_initial( return client_raw_response def delete_by_id( - self, application_definition_id, custom_headers=None, raw=False, **operation_config): + self, application_definition_id, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the managed application definition. :param application_definition_id: The fully qualified ID of the @@ -495,12 +462,14 @@ def delete_by_id( /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applicationDefinitions/{applicationDefinition-name} :type application_definition_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`ErrorResponseException` """ @@ -510,38 +479,19 @@ def delete_by_id( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete_by_id.metadata = {'url': '/{applicationDefinitionId}'} @@ -593,7 +543,7 @@ def _create_or_update_by_id_initial( return deserialized def create_or_update_by_id( - self, application_definition_id, parameters, custom_headers=None, raw=False, **operation_config): + self, application_definition_id, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates a new managed application definition. :param application_definition_id: The fully qualified ID of the @@ -606,13 +556,16 @@ def create_or_update_by_id( :type parameters: ~azure.mgmt.resource.managedapplications.models.ApplicationDefinition :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationDefinition or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationDefinition + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.managedapplications.models.ApplicationDefinition] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.managedapplications.models.ApplicationDefinition]] :raises: :class:`ErrorResponseException` """ @@ -623,28 +576,8 @@ def create_or_update_by_id( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - deserialized = self._deserialize('ApplicationDefinition', response) if raw: @@ -653,10 +586,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update_by_id.metadata = {'url': '/{applicationDefinitionId}'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/applications_operations.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/applications_operations.py index f2866e9dcd24..50f878dae235 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/applications_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/applications_operations.py @@ -11,8 +11,8 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -138,7 +138,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, application_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the managed application. :param resource_group_name: The name of the resource group. The name @@ -147,12 +147,14 @@ def delete( :param application_name: The name of the managed application. :type application_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`ErrorResponseException` """ @@ -163,38 +165,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}'} @@ -248,7 +231,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, application_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates a new managed application. :param resource_group_name: The name of the resource group. The name @@ -261,13 +244,16 @@ def create_or_update( :type parameters: ~azure.mgmt.resource.managedapplications.models.Application :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Application - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Application or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.managedapplications.models.Application] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.managedapplications.models.Application]] :raises: :class:`ErrorResponseException` """ @@ -279,28 +265,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - deserialized = self._deserialize('Application', response) if raw: @@ -309,12 +275,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}'} def update( @@ -619,7 +586,7 @@ def _delete_by_id_initial( return client_raw_response def delete_by_id( - self, application_id, custom_headers=None, raw=False, **operation_config): + self, application_id, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the managed application. :param application_id: The fully qualified ID of the managed @@ -628,12 +595,14 @@ def delete_by_id( /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} :type application_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`ErrorResponseException` """ @@ -643,38 +612,19 @@ def delete_by_id( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete_by_id.metadata = {'url': '/{applicationId}'} @@ -726,7 +676,7 @@ def _create_or_update_by_id_initial( return deserialized def create_or_update_by_id( - self, application_id, parameters, custom_headers=None, raw=False, **operation_config): + self, application_id, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates a new managed application. :param application_id: The fully qualified ID of the managed @@ -739,13 +689,16 @@ def create_or_update_by_id( :type parameters: ~azure.mgmt.resource.managedapplications.models.Application :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Application - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Application or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.managedapplications.models.Application] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.managedapplications.models.Application]] :raises: :class:`ErrorResponseException` """ @@ -756,28 +709,8 @@ def create_or_update_by_id( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - deserialized = self._deserialize('Application', response) if raw: @@ -786,12 +719,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update_by_id.metadata = {'url': '/{applicationId}'} def update_by_id( diff --git a/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/solutions_operations.py b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/solutions_operations.py new file mode 100644 index 000000000000..575927240b1e --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/managedapplications/operations/solutions_operations.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SolutionsOperations(object): + """SolutionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def operations( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the preview solution operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationsList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.managedapplications.models.OperationsList + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.operations.metadata['url'] + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationsList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + operations.metadata = {'url': '/providers/Microsoft.Solutions/operations'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/__init__.py index 754d2f3a1a0d..d911de39e82d 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/__init__.py @@ -9,8 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- -from .policy_definition import PolicyDefinition -from .policy_assignment import PolicyAssignment +try: + from .policy_definition_py3 import PolicyDefinition + from .policy_assignment_py3 import PolicyAssignment +except (SyntaxError, ImportError): + from .policy_definition import PolicyDefinition + from .policy_assignment import PolicyAssignment from .policy_assignment_paged import PolicyAssignmentPaged from .policy_definition_paged import PolicyDefinitionPaged from .policy_client_enums import ( diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_assignment.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_assignment.py index 9f5d781216cb..24c27b17db71 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_assignment.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_assignment.py @@ -38,11 +38,11 @@ class PolicyAssignment(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, display_name=None, policy_definition_id=None, scope=None, id=None, type=None, name=None): - super(PolicyAssignment, self).__init__() - self.display_name = display_name - self.policy_definition_id = policy_definition_id - self.scope = scope - self.id = id - self.type = type - self.name = name + def __init__(self, **kwargs): + super(PolicyAssignment, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.policy_definition_id = kwargs.get('policy_definition_id', None) + self.scope = kwargs.get('scope', None) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_assignment_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_assignment_py3.py new file mode 100644 index 000000000000..cf34cb502d7c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_assignment_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyAssignment(Model): + """The policy assignment. + + :param display_name: The display name of the policy assignment. + :type display_name: str + :param policy_definition_id: The ID of the policy definition. + :type policy_definition_id: str + :param scope: The scope for the policy assignment. + :type scope: str + :param id: The ID of the policy assignment. + :type id: str + :param type: The type of the policy assignment. + :type type: str + :param name: The name of the policy assignment. + :type name: str + """ + + _attribute_map = { + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, policy_definition_id: str=None, scope: str=None, id: str=None, type: str=None, name: str=None, **kwargs) -> None: + super(PolicyAssignment, self).__init__(**kwargs) + self.display_name = display_name + self.policy_definition_id = policy_definition_id + self.scope = scope + self.id = id + self.type = type + self.name = name diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_client_enums.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_client_enums.py index 5fd78eef9846..1f86f6a3029a 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_client_enums.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class PolicyType(Enum): +class PolicyType(str, Enum): not_specified = "NotSpecified" built_in = "BuiltIn" diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_definition.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_definition.py index d396337254f2..660b4691373d 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_definition.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_definition.py @@ -15,6 +15,9 @@ class PolicyDefinition(Model): """The policy definition. + Variables are only populated by the server, and will be ignored when + sending a request. + :param policy_type: The type of policy definition. Possible values are NotSpecified, BuiltIn, and Custom. Possible values include: 'NotSpecified', 'BuiltIn', 'Custom' @@ -26,14 +29,18 @@ class PolicyDefinition(Model): :type description: str :param policy_rule: The policy rule. :type policy_rule: object - :param id: The ID of the policy definition. - :type id: str + :ivar id: The ID of the policy definition. + :vartype id: str :param name: The name of the policy definition. If you do not specify a value for name, the value is inferred from the name value in the request URI. :type name: str """ + _validation = { + 'id': {'readonly': True}, + } + _attribute_map = { 'policy_type': {'key': 'properties.policyType', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, @@ -43,11 +50,11 @@ class PolicyDefinition(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, policy_type=None, display_name=None, description=None, policy_rule=None, id=None, name=None): - super(PolicyDefinition, self).__init__() - self.policy_type = policy_type - self.display_name = display_name - self.description = description - self.policy_rule = policy_rule - self.id = id - self.name = name + def __init__(self, **kwargs): + super(PolicyDefinition, self).__init__(**kwargs) + self.policy_type = kwargs.get('policy_type', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.policy_rule = kwargs.get('policy_rule', None) + self.id = None + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_definition_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_definition_py3.py new file mode 100644 index 000000000000..1e9be8b0e919 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/policy_definition_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyDefinition(Model): + """The policy definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param policy_type: The type of policy definition. Possible values are + NotSpecified, BuiltIn, and Custom. Possible values include: + 'NotSpecified', 'BuiltIn', 'Custom' + :type policy_type: str or + ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyType + :param display_name: The display name of the policy definition. + :type display_name: str + :param description: The policy definition description. + :type description: str + :param policy_rule: The policy rule. + :type policy_rule: object + :ivar id: The ID of the policy definition. + :vartype id: str + :param name: The name of the policy definition. If you do not specify a + value for name, the value is inferred from the name value in the request + URI. + :type name: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'policy_type': {'key': 'properties.policyType', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'policy_rule': {'key': 'properties.policyRule', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, policy_type=None, display_name: str=None, description: str=None, policy_rule=None, name: str=None, **kwargs) -> None: + super(PolicyDefinition, self).__init__(**kwargs) + self.policy_type = policy_type + self.display_name = display_name + self.description = description + self.policy_rule = policy_rule + self.id = None + self.name = name diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/policy_client.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/policy_client.py index 95fb4ad75635..3ba02a11d719 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/policy_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/policy_client.py @@ -9,7 +9,7 @@ # 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 @@ -50,7 +50,7 @@ def __init__( self.subscription_id = subscription_id -class PolicyClient(object): +class PolicyClient(SDKClient): """To manage and control access to your resources, you can define customized policies and assign them at a scope. :ivar config: Configuration for client. @@ -73,7 +73,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = PolicyClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(PolicyClient, 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 = '2015-10-01-preview' diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/__init__.py index 754d2f3a1a0d..d911de39e82d 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/__init__.py @@ -9,8 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- -from .policy_definition import PolicyDefinition -from .policy_assignment import PolicyAssignment +try: + from .policy_definition_py3 import PolicyDefinition + from .policy_assignment_py3 import PolicyAssignment +except (SyntaxError, ImportError): + from .policy_definition import PolicyDefinition + from .policy_assignment import PolicyAssignment from .policy_assignment_paged import PolicyAssignmentPaged from .policy_definition_paged import PolicyDefinitionPaged from .policy_client_enums import ( diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_assignment.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_assignment.py index 9f5d781216cb..24c27b17db71 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_assignment.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_assignment.py @@ -38,11 +38,11 @@ class PolicyAssignment(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, display_name=None, policy_definition_id=None, scope=None, id=None, type=None, name=None): - super(PolicyAssignment, self).__init__() - self.display_name = display_name - self.policy_definition_id = policy_definition_id - self.scope = scope - self.id = id - self.type = type - self.name = name + def __init__(self, **kwargs): + super(PolicyAssignment, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.policy_definition_id = kwargs.get('policy_definition_id', None) + self.scope = kwargs.get('scope', None) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_assignment_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_assignment_py3.py new file mode 100644 index 000000000000..cf34cb502d7c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_assignment_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyAssignment(Model): + """The policy assignment. + + :param display_name: The display name of the policy assignment. + :type display_name: str + :param policy_definition_id: The ID of the policy definition. + :type policy_definition_id: str + :param scope: The scope for the policy assignment. + :type scope: str + :param id: The ID of the policy assignment. + :type id: str + :param type: The type of the policy assignment. + :type type: str + :param name: The name of the policy assignment. + :type name: str + """ + + _attribute_map = { + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, policy_definition_id: str=None, scope: str=None, id: str=None, type: str=None, name: str=None, **kwargs) -> None: + super(PolicyAssignment, self).__init__(**kwargs) + self.display_name = display_name + self.policy_definition_id = policy_definition_id + self.scope = scope + self.id = id + self.type = type + self.name = name diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_client_enums.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_client_enums.py index 5fd78eef9846..1f86f6a3029a 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_client_enums.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class PolicyType(Enum): +class PolicyType(str, Enum): not_specified = "NotSpecified" built_in = "BuiltIn" diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_definition.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_definition.py index 92c1b555c9a5..5cb7ecff7590 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_definition.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_definition.py @@ -15,6 +15,9 @@ class PolicyDefinition(Model): """The policy definition. + Variables are only populated by the server, and will be ignored when + sending a request. + :param policy_type: The type of policy definition. Possible values are NotSpecified, BuiltIn, and Custom. Possible values include: 'NotSpecified', 'BuiltIn', 'Custom' @@ -26,14 +29,18 @@ class PolicyDefinition(Model): :type description: str :param policy_rule: The policy rule. :type policy_rule: object - :param id: The ID of the policy definition. - :type id: str + :ivar id: The ID of the policy definition. + :vartype id: str :param name: The name of the policy definition. If you do not specify a value for name, the value is inferred from the name value in the request URI. :type name: str """ + _validation = { + 'id': {'readonly': True}, + } + _attribute_map = { 'policy_type': {'key': 'properties.policyType', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, @@ -43,11 +50,11 @@ class PolicyDefinition(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, policy_type=None, display_name=None, description=None, policy_rule=None, id=None, name=None): - super(PolicyDefinition, self).__init__() - self.policy_type = policy_type - self.display_name = display_name - self.description = description - self.policy_rule = policy_rule - self.id = id - self.name = name + def __init__(self, **kwargs): + super(PolicyDefinition, self).__init__(**kwargs) + self.policy_type = kwargs.get('policy_type', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.policy_rule = kwargs.get('policy_rule', None) + self.id = None + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_definition_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_definition_py3.py new file mode 100644 index 000000000000..d5905119d3cc --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/policy_definition_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyDefinition(Model): + """The policy definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param policy_type: The type of policy definition. Possible values are + NotSpecified, BuiltIn, and Custom. Possible values include: + 'NotSpecified', 'BuiltIn', 'Custom' + :type policy_type: str or + ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyType + :param display_name: The display name of the policy definition. + :type display_name: str + :param description: The policy definition description. + :type description: str + :param policy_rule: The policy rule. + :type policy_rule: object + :ivar id: The ID of the policy definition. + :vartype id: str + :param name: The name of the policy definition. If you do not specify a + value for name, the value is inferred from the name value in the request + URI. + :type name: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'policy_type': {'key': 'properties.policyType', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'policy_rule': {'key': 'properties.policyRule', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, policy_type=None, display_name: str=None, description: str=None, policy_rule=None, name: str=None, **kwargs) -> None: + super(PolicyDefinition, self).__init__(**kwargs) + self.policy_type = policy_type + self.display_name = display_name + self.description = description + self.policy_rule = policy_rule + self.id = None + self.name = name diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/policy_client.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/policy_client.py index 58b00af11d08..c136e74d1831 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/policy_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/policy_client.py @@ -9,7 +9,7 @@ # 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 @@ -50,7 +50,7 @@ def __init__( self.subscription_id = subscription_id -class PolicyClient(object): +class PolicyClient(SDKClient): """To manage and control access to your resources, you can define customized policies and assign them at a scope. :ivar config: Configuration for client. @@ -73,7 +73,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = PolicyClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(PolicyClient, 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 = '2016-04-01' diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/__init__.py index 3dce603258a9..3f3ff6bcef32 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/__init__.py @@ -9,8 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- -from .policy_definition import PolicyDefinition -from .policy_assignment import PolicyAssignment +try: + from .policy_definition_py3 import PolicyDefinition + from .policy_assignment_py3 import PolicyAssignment +except (SyntaxError, ImportError): + from .policy_definition import PolicyDefinition + from .policy_assignment import PolicyAssignment from .policy_definition_paged import PolicyDefinitionPaged from .policy_assignment_paged import PolicyAssignmentPaged from .policy_client_enums import ( diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_assignment.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_assignment.py index 692848b61746..225d2807e589 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_assignment.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_assignment.py @@ -52,13 +52,13 @@ class PolicyAssignment(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, display_name=None, policy_definition_id=None, scope=None, parameters=None, description=None, type=None, name=None): - super(PolicyAssignment, self).__init__() - self.display_name = display_name - self.policy_definition_id = policy_definition_id - self.scope = scope - self.parameters = parameters - self.description = description + def __init__(self, **kwargs): + super(PolicyAssignment, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.policy_definition_id = kwargs.get('policy_definition_id', None) + self.scope = kwargs.get('scope', None) + self.parameters = kwargs.get('parameters', None) + self.description = kwargs.get('description', None) self.id = None - self.type = type - self.name = name + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_assignment_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_assignment_py3.py new file mode 100644 index 000000000000..cef46871ca79 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_assignment_py3.py @@ -0,0 +1,64 @@ +# 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 PolicyAssignment(Model): + """The policy assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param display_name: The display name of the policy assignment. + :type display_name: str + :param policy_definition_id: The ID of the policy definition. + :type policy_definition_id: str + :param scope: The scope for the policy assignment. + :type scope: str + :param parameters: Required if a parameter is used in policy rule. + :type parameters: object + :param description: This message will be part of response in case of + policy violation. + :type description: str + :ivar id: The ID of the policy assignment. + :vartype id: str + :param type: The type of the policy assignment. + :type type: str + :param name: The name of the policy assignment. + :type name: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': 'object'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, policy_definition_id: str=None, scope: str=None, parameters=None, description: str=None, type: str=None, name: str=None, **kwargs) -> None: + super(PolicyAssignment, self).__init__(**kwargs) + self.display_name = display_name + self.policy_definition_id = policy_definition_id + self.scope = scope + self.parameters = parameters + self.description = description + self.id = None + self.type = type + self.name = name diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_client_enums.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_client_enums.py index 9f65411d7ce5..a9dcf44c1e7c 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_client_enums.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_client_enums.py @@ -12,14 +12,14 @@ from enum import Enum -class PolicyType(Enum): +class PolicyType(str, Enum): not_specified = "NotSpecified" built_in = "BuiltIn" custom = "Custom" -class PolicyMode(Enum): +class PolicyMode(str, Enum): not_specified = "NotSpecified" indexed = "Indexed" diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_definition.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_definition.py index d42021f94cc7..76cbeab23aa6 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_definition.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_definition.py @@ -61,14 +61,14 @@ class PolicyDefinition(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, policy_type=None, mode=None, display_name=None, description=None, policy_rule=None, metadata=None, parameters=None): - super(PolicyDefinition, self).__init__() - self.policy_type = policy_type - self.mode = mode - self.display_name = display_name - self.description = description - self.policy_rule = policy_rule - self.metadata = metadata - self.parameters = parameters + def __init__(self, **kwargs): + super(PolicyDefinition, self).__init__(**kwargs) + self.policy_type = kwargs.get('policy_type', None) + self.mode = kwargs.get('mode', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.policy_rule = kwargs.get('policy_rule', None) + self.metadata = kwargs.get('metadata', None) + self.parameters = kwargs.get('parameters', None) self.id = None self.name = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_definition_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_definition_py3.py new file mode 100644 index 000000000000..0d02eaeb67be --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/policy_definition_py3.py @@ -0,0 +1,74 @@ +# 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 PolicyDefinition(Model): + """The policy definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param policy_type: The type of policy definition. Possible values are + NotSpecified, BuiltIn, and Custom. Possible values include: + 'NotSpecified', 'BuiltIn', 'Custom' + :type policy_type: str or + ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyType + :param mode: The policy definition mode. Possible values are NotSpecified, + Indexed, and All. Possible values include: 'NotSpecified', 'Indexed', + 'All' + :type mode: str or + ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyMode + :param display_name: The display name of the policy definition. + :type display_name: str + :param description: The policy definition description. + :type description: str + :param policy_rule: The policy rule. + :type policy_rule: object + :param metadata: The policy definition metadata. + :type metadata: object + :param parameters: Required if a parameter is used in policy rule. + :type parameters: object + :ivar id: The ID of the policy definition. + :vartype id: str + :ivar name: The name of the policy definition. + :vartype name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'policy_type': {'key': 'properties.policyType', 'type': 'str'}, + 'mode': {'key': 'properties.mode', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'policy_rule': {'key': 'properties.policyRule', 'type': 'object'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'parameters': {'key': 'properties.parameters', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, policy_type=None, mode=None, display_name: str=None, description: str=None, policy_rule=None, metadata=None, parameters=None, **kwargs) -> None: + super(PolicyDefinition, self).__init__(**kwargs) + self.policy_type = policy_type + self.mode = mode + self.display_name = display_name + self.description = description + self.policy_rule = policy_rule + self.metadata = metadata + self.parameters = parameters + self.id = None + self.name = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/policy_client.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/policy_client.py index 33b6e7a11ba0..16d57610fef0 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/policy_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/policy_client.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- import warnings -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 @@ -51,7 +51,7 @@ def __init__( self.subscription_id = subscription_id -class PolicyClient(object): +class PolicyClient(SDKClient): """To manage and control access to your resources, you can define customized policies and assign them at a scope. :ivar config: Configuration for client. @@ -74,7 +74,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = PolicyClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(PolicyClient, 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 = '2016-12-01' diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/__init__.py index 9feea1c6fc05..6da1b02582b9 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/__init__.py @@ -9,12 +9,20 @@ # regenerated. # -------------------------------------------------------------------------- -from .policy_sku import PolicySku -from .policy_assignment import PolicyAssignment -from .error_response import ErrorResponse, ErrorResponseException -from .policy_definition_reference import PolicyDefinitionReference -from .policy_set_definition import PolicySetDefinition -from .policy_definition import PolicyDefinition +try: + from .policy_sku_py3 import PolicySku + from .policy_assignment_py3 import PolicyAssignment + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .policy_definition_reference_py3 import PolicyDefinitionReference + from .policy_set_definition_py3 import PolicySetDefinition + from .policy_definition_py3 import PolicyDefinition +except (SyntaxError, ImportError): + from .policy_sku import PolicySku + from .policy_assignment import PolicyAssignment + from .error_response import ErrorResponse, ErrorResponseException + from .policy_definition_reference import PolicyDefinitionReference + from .policy_set_definition import PolicySetDefinition + from .policy_definition import PolicyDefinition from .policy_assignment_paged import PolicyAssignmentPaged from .policy_set_definition_paged import PolicySetDefinitionPaged from .policy_definition_paged import PolicyDefinitionPaged diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/error_response.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/error_response.py index 540441644bce..c3ee3aad7f21 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/error_response.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/error_response.py @@ -31,11 +31,11 @@ class ErrorResponse(Model): 'error_message': {'key': 'errorMessage', 'type': 'str'}, } - def __init__(self, http_status=None, error_code=None, error_message=None): - super(ErrorResponse, self).__init__() - self.http_status = http_status - self.error_code = error_code - self.error_message = error_message + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.http_status = kwargs.get('http_status', None) + self.error_code = kwargs.get('error_code', None) + self.error_message = kwargs.get('error_message', None) class ErrorResponseException(HttpOperationError): diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/error_response_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/error_response_py3.py new file mode 100644 index 000000000000..b65d2136f8d4 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/error_response_py3.py @@ -0,0 +1,50 @@ +# 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 ErrorResponse(Model): + """Error reponse indicates ARM is not able to process the incoming request. + The reason is provided in the error message. + + :param http_status: Http status code. + :type http_status: str + :param error_code: Error code. + :type error_code: str + :param error_message: Error message indicating why the operation failed. + :type error_message: str + """ + + _attribute_map = { + 'http_status': {'key': 'httpStatus', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, *, http_status: str=None, error_code: str=None, error_message: str=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.http_status = http_status + self.error_code = error_code + self.error_message = error_message + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_assignment.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_assignment.py index d0570d2430d4..2accdb75d3d3 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_assignment.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_assignment.py @@ -64,16 +64,16 @@ class PolicyAssignment(Model): 'sku': {'key': 'sku', 'type': 'PolicySku'}, } - def __init__(self, display_name=None, policy_definition_id=None, scope=None, not_scopes=None, parameters=None, description=None, metadata=None, sku=None): - super(PolicyAssignment, self).__init__() - self.display_name = display_name - self.policy_definition_id = policy_definition_id - self.scope = scope - self.not_scopes = not_scopes - self.parameters = parameters - self.description = description - self.metadata = metadata + def __init__(self, **kwargs): + super(PolicyAssignment, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.policy_definition_id = kwargs.get('policy_definition_id', None) + self.scope = kwargs.get('scope', None) + self.not_scopes = kwargs.get('not_scopes', None) + self.parameters = kwargs.get('parameters', None) + self.description = kwargs.get('description', None) + self.metadata = kwargs.get('metadata', None) self.id = None self.type = None self.name = None - self.sku = sku + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_assignment_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_assignment_py3.py new file mode 100644 index 000000000000..5a0050ad04cd --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_assignment_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyAssignment(Model): + """The policy assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param display_name: The display name of the policy assignment. + :type display_name: str + :param policy_definition_id: The ID of the policy definition. + :type policy_definition_id: str + :param scope: The scope for the policy assignment. + :type scope: str + :param not_scopes: The policy's excluded scopes. + :type not_scopes: list[str] + :param parameters: Required if a parameter is used in policy rule. + :type parameters: object + :param description: This message will be part of response in case of + policy violation. + :type description: str + :param metadata: The policy assignment metadata. + :type metadata: object + :ivar id: The ID of the policy assignment. + :vartype id: str + :ivar type: The type of the policy assignment. + :vartype type: str + :ivar name: The name of the policy assignment. + :vartype name: str + :param sku: The policy sku. + :type sku: + ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicySku + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'not_scopes': {'key': 'properties.notScopes', 'type': '[str]'}, + 'parameters': {'key': 'properties.parameters', 'type': 'object'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'PolicySku'}, + } + + def __init__(self, *, display_name: str=None, policy_definition_id: str=None, scope: str=None, not_scopes=None, parameters=None, description: str=None, metadata=None, sku=None, **kwargs) -> None: + super(PolicyAssignment, self).__init__(**kwargs) + self.display_name = display_name + self.policy_definition_id = policy_definition_id + self.scope = scope + self.not_scopes = not_scopes + self.parameters = parameters + self.description = description + self.metadata = metadata + self.id = None + self.type = None + self.name = None + self.sku = sku diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_client_enums.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_client_enums.py index 9f65411d7ce5..a9dcf44c1e7c 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_client_enums.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_client_enums.py @@ -12,14 +12,14 @@ from enum import Enum -class PolicyType(Enum): +class PolicyType(str, Enum): not_specified = "NotSpecified" built_in = "BuiltIn" custom = "Custom" -class PolicyMode(Enum): +class PolicyMode(str, Enum): not_specified = "NotSpecified" indexed = "Indexed" diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_definition.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_definition.py index 850c2cd97388..84ea23f76832 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_definition.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_definition.py @@ -61,14 +61,14 @@ class PolicyDefinition(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, policy_type=None, mode=None, display_name=None, description=None, policy_rule=None, metadata=None, parameters=None): - super(PolicyDefinition, self).__init__() - self.policy_type = policy_type - self.mode = mode - self.display_name = display_name - self.description = description - self.policy_rule = policy_rule - self.metadata = metadata - self.parameters = parameters + def __init__(self, **kwargs): + super(PolicyDefinition, self).__init__(**kwargs) + self.policy_type = kwargs.get('policy_type', None) + self.mode = kwargs.get('mode', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.policy_rule = kwargs.get('policy_rule', None) + self.metadata = kwargs.get('metadata', None) + self.parameters = kwargs.get('parameters', None) self.id = None self.name = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_definition_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_definition_py3.py new file mode 100644 index 000000000000..34b21e1e1586 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_definition_py3.py @@ -0,0 +1,74 @@ +# 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 PolicyDefinition(Model): + """The policy definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param policy_type: The type of policy definition. Possible values are + NotSpecified, BuiltIn, and Custom. Possible values include: + 'NotSpecified', 'BuiltIn', 'Custom' + :type policy_type: str or + ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyType + :param mode: The policy definition mode. Possible values are NotSpecified, + Indexed, and All. Possible values include: 'NotSpecified', 'Indexed', + 'All' + :type mode: str or + ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyMode + :param display_name: The display name of the policy definition. + :type display_name: str + :param description: The policy definition description. + :type description: str + :param policy_rule: The policy rule. + :type policy_rule: object + :param metadata: The policy definition metadata. + :type metadata: object + :param parameters: Required if a parameter is used in policy rule. + :type parameters: object + :ivar id: The ID of the policy definition. + :vartype id: str + :ivar name: The name of the policy definition. + :vartype name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'policy_type': {'key': 'properties.policyType', 'type': 'str'}, + 'mode': {'key': 'properties.mode', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'policy_rule': {'key': 'properties.policyRule', 'type': 'object'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'parameters': {'key': 'properties.parameters', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, policy_type=None, mode=None, display_name: str=None, description: str=None, policy_rule=None, metadata=None, parameters=None, **kwargs) -> None: + super(PolicyDefinition, self).__init__(**kwargs) + self.policy_type = policy_type + self.mode = mode + self.display_name = display_name + self.description = description + self.policy_rule = policy_rule + self.metadata = metadata + self.parameters = parameters + self.id = None + self.name = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_definition_reference.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_definition_reference.py index 93eb0b01d9c1..cf0be3729831 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_definition_reference.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_definition_reference.py @@ -27,7 +27,7 @@ class PolicyDefinitionReference(Model): 'parameters': {'key': 'parameters', 'type': 'object'}, } - def __init__(self, policy_definition_id=None, parameters=None): - super(PolicyDefinitionReference, self).__init__() - self.policy_definition_id = policy_definition_id - self.parameters = parameters + def __init__(self, **kwargs): + super(PolicyDefinitionReference, self).__init__(**kwargs) + self.policy_definition_id = kwargs.get('policy_definition_id', None) + self.parameters = kwargs.get('parameters', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_definition_reference_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_definition_reference_py3.py new file mode 100644 index 000000000000..e9aac83dc16e --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_definition_reference_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyDefinitionReference(Model): + """The policy definition reference. + + :param policy_definition_id: The ID of the policy definition or policy set + definition. + :type policy_definition_id: str + :param parameters: Required if a parameter is used in policy rule. + :type parameters: object + """ + + _attribute_map = { + 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + } + + def __init__(self, *, policy_definition_id: str=None, parameters=None, **kwargs) -> None: + super(PolicyDefinitionReference, self).__init__(**kwargs) + self.policy_definition_id = policy_definition_id + self.parameters = parameters diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_set_definition.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_set_definition.py index dc17f69082e5..bc5146745c70 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_set_definition.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_set_definition.py @@ -18,6 +18,8 @@ class PolicySetDefinition(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param policy_type: The type of policy definition. Possible values are NotSpecified, BuiltIn, and Custom. Possible values include: 'NotSpecified', 'BuiltIn', 'Custom' @@ -32,7 +34,8 @@ class PolicySetDefinition(Model): :param parameters: The policy set definition parameters that can be used in policy definition references. :type parameters: object - :param policy_definitions: An array of policy definition references. + :param policy_definitions: Required. An array of policy definition + references. :type policy_definitions: list[~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyDefinitionReference] :ivar id: The ID of the policy set definition. @@ -63,14 +66,14 @@ class PolicySetDefinition(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, policy_definitions, policy_type=None, display_name=None, description=None, metadata=None, parameters=None): - super(PolicySetDefinition, self).__init__() - self.policy_type = policy_type - self.display_name = display_name - self.description = description - self.metadata = metadata - self.parameters = parameters - self.policy_definitions = policy_definitions + def __init__(self, **kwargs): + super(PolicySetDefinition, self).__init__(**kwargs) + self.policy_type = kwargs.get('policy_type', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.metadata = kwargs.get('metadata', None) + self.parameters = kwargs.get('parameters', None) + self.policy_definitions = kwargs.get('policy_definitions', None) self.id = None self.name = None self.type = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_set_definition_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_set_definition_py3.py new file mode 100644 index 000000000000..bcdf80529bda --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_set_definition_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicySetDefinition(Model): + """The policy set definition. + + 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 policy_type: The type of policy definition. Possible values are + NotSpecified, BuiltIn, and Custom. Possible values include: + 'NotSpecified', 'BuiltIn', 'Custom' + :type policy_type: str or + ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyType + :param display_name: The display name of the policy set definition. + :type display_name: str + :param description: The policy set definition description. + :type description: str + :param metadata: The policy set definition metadata. + :type metadata: object + :param parameters: The policy set definition parameters that can be used + in policy definition references. + :type parameters: object + :param policy_definitions: Required. An array of policy definition + references. + :type policy_definitions: + list[~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyDefinitionReference] + :ivar id: The ID of the policy set definition. + :vartype id: str + :ivar name: The name of the policy set definition. + :vartype name: str + :ivar type: The type of the resource + (Microsoft.Authorization/policySetDefinitions). + :vartype type: str + """ + + _validation = { + 'policy_definitions': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'policy_type': {'key': 'properties.policyType', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'parameters': {'key': 'properties.parameters', 'type': 'object'}, + 'policy_definitions': {'key': 'properties.policyDefinitions', 'type': '[PolicyDefinitionReference]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, policy_definitions, policy_type=None, display_name: str=None, description: str=None, metadata=None, parameters=None, **kwargs) -> None: + super(PolicySetDefinition, self).__init__(**kwargs) + self.policy_type = policy_type + self.display_name = display_name + self.description = description + self.metadata = metadata + self.parameters = parameters + self.policy_definitions = policy_definitions + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_sku.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_sku.py index 048b6e7a0313..8e3dfbbd60e5 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_sku.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_sku.py @@ -15,7 +15,10 @@ class PolicySku(Model): """The policy sku. - :param name: The name of the policy sku. Possible values are A0 and A1. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the policy sku. Possible values are A0 + and A1. :type name: str :param tier: The policy sku tier. Possible values are Free and Standard. :type tier: str @@ -30,7 +33,7 @@ class PolicySku(Model): 'tier': {'key': 'tier', 'type': 'str'}, } - def __init__(self, name, tier=None): - super(PolicySku, self).__init__() - self.name = name - self.tier = tier + def __init__(self, **kwargs): + super(PolicySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_sku_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_sku_py3.py new file mode 100644 index 000000000000..8015144450cc --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/policy_sku_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicySku(Model): + """The policy sku. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the policy sku. Possible values are A0 + and A1. + :type name: str + :param tier: The policy sku tier. Possible values are Free and Standard. + :type tier: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name: str, tier: str=None, **kwargs) -> None: + super(PolicySku, self).__init__(**kwargs) + self.name = name + self.tier = tier diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/policy_client.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/policy_client.py index c976879d6745..381f4f713ac5 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/policy_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/policy_client.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- import warnings -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 @@ -52,7 +52,7 @@ def __init__( self.subscription_id = subscription_id -class PolicyClient(object): +class PolicyClient(SDKClient): """To manage and control access to your resources, you can define customized policies and assign them at a scope. :ivar config: Configuration for client. @@ -77,7 +77,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = PolicyClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(PolicyClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/resource_management_client.py b/azure-mgmt-resource/azure/mgmt/resource/resources/resource_management_client.py index 198e87390202..14be9eb8cc44 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/resource_management_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/resource_management_client.py @@ -102,6 +102,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2016-02-01: :mod:`v2016_02_01.models` * 2016-09-01: :mod:`v2016_09_01.models` * 2017-05-10: :mod:`v2017_05_10.models` + * 2018-02-01: :mod:`v2018_02_01.models` """ if api_version == '2016-02-01': from .v2016_02_01 import models @@ -112,6 +113,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2017-05-10': from .v2017_05_10 import models return models + elif api_version == '2018-02-01': + from .v2018_02_01 import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) @property @@ -121,6 +125,7 @@ def deployment_operations(self): * 2016-02-01: :class:`DeploymentOperations` * 2016-09-01: :class:`DeploymentOperations` * 2017-05-10: :class:`DeploymentOperations` + * 2018-02-01: :class:`DeploymentOperations` """ api_version = self._get_api_version('deployment_operations') if api_version == '2016-02-01': @@ -129,6 +134,8 @@ def deployment_operations(self): from .v2016_09_01.operations import DeploymentOperations as OperationClass elif api_version == '2017-05-10': from .v2017_05_10.operations import DeploymentOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import DeploymentOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -140,6 +147,7 @@ def deployments(self): * 2016-02-01: :class:`DeploymentsOperations` * 2016-09-01: :class:`DeploymentsOperations` * 2017-05-10: :class:`DeploymentsOperations` + * 2018-02-01: :class:`DeploymentsOperations` """ api_version = self._get_api_version('deployments') if api_version == '2016-02-01': @@ -148,6 +156,8 @@ def deployments(self): from .v2016_09_01.operations import DeploymentsOperations as OperationClass elif api_version == '2017-05-10': from .v2017_05_10.operations import DeploymentsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import DeploymentsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -159,6 +169,7 @@ def providers(self): * 2016-02-01: :class:`ProvidersOperations` * 2016-09-01: :class:`ProvidersOperations` * 2017-05-10: :class:`ProvidersOperations` + * 2018-02-01: :class:`ProvidersOperations` """ api_version = self._get_api_version('providers') if api_version == '2016-02-01': @@ -167,6 +178,8 @@ def providers(self): from .v2016_09_01.operations import ProvidersOperations as OperationClass elif api_version == '2017-05-10': from .v2017_05_10.operations import ProvidersOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import ProvidersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -178,6 +191,7 @@ def resource_groups(self): * 2016-02-01: :class:`ResourceGroupsOperations` * 2016-09-01: :class:`ResourceGroupsOperations` * 2017-05-10: :class:`ResourceGroupsOperations` + * 2018-02-01: :class:`ResourceGroupsOperations` """ api_version = self._get_api_version('resource_groups') if api_version == '2016-02-01': @@ -186,6 +200,8 @@ def resource_groups(self): from .v2016_09_01.operations import ResourceGroupsOperations as OperationClass elif api_version == '2017-05-10': from .v2017_05_10.operations import ResourceGroupsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import ResourceGroupsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -197,6 +213,7 @@ def resources(self): * 2016-02-01: :class:`ResourcesOperations` * 2016-09-01: :class:`ResourcesOperations` * 2017-05-10: :class:`ResourcesOperations` + * 2018-02-01: :class:`ResourcesOperations` """ api_version = self._get_api_version('resources') if api_version == '2016-02-01': @@ -205,6 +222,8 @@ def resources(self): from .v2016_09_01.operations import ResourcesOperations as OperationClass elif api_version == '2017-05-10': from .v2017_05_10.operations import ResourcesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import ResourcesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -216,6 +235,7 @@ def tags(self): * 2016-02-01: :class:`TagsOperations` * 2016-09-01: :class:`TagsOperations` * 2017-05-10: :class:`TagsOperations` + * 2018-02-01: :class:`TagsOperations` """ api_version = self._get_api_version('tags') if api_version == '2016-02-01': @@ -224,6 +244,8 @@ def tags(self): from .v2016_09_01.operations import TagsOperations as OperationClass elif api_version == '2017-05-10': from .v2017_05_10.operations import TagsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import TagsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/__init__.py index a40ca771976b..c5534984cdc7 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/__init__.py @@ -9,44 +9,84 @@ # regenerated. # -------------------------------------------------------------------------- -from .deployment_extended_filter import DeploymentExtendedFilter -from .generic_resource_filter import GenericResourceFilter -from .resource_group_filter import ResourceGroupFilter -from .template_link import TemplateLink -from .parameters_link import ParametersLink -from .debug_setting import DebugSetting -from .deployment_properties import DeploymentProperties -from .deployment import Deployment -from .deployment_export_result import DeploymentExportResult -from .resource_management_error_with_details import ResourceManagementErrorWithDetails -from .alias_path_type import AliasPathType -from .alias_type import AliasType -from .provider_resource_type import ProviderResourceType -from .provider import Provider -from .basic_dependency import BasicDependency -from .dependency import Dependency -from .deployment_properties_extended import DeploymentPropertiesExtended -from .deployment_validate_result import DeploymentValidateResult -from .deployment_extended import DeploymentExtended -from .plan import Plan -from .sku import Sku -from .identity import Identity -from .generic_resource import GenericResource -from .resource_group_properties import ResourceGroupProperties -from .resource_group import ResourceGroup -from .resources_move_info import ResourcesMoveInfo -from .export_template_request import ExportTemplateRequest -from .tag_count import TagCount -from .tag_value import TagValue -from .tag_details import TagDetails -from .target_resource import TargetResource -from .http_message import HttpMessage -from .deployment_operation_properties import DeploymentOperationProperties -from .deployment_operation import DeploymentOperation -from .resource_provider_operation_display_properties import ResourceProviderOperationDisplayProperties -from .resource import Resource -from .sub_resource import SubResource -from .resource_group_export_result import ResourceGroupExportResult +try: + from .deployment_extended_filter_py3 import DeploymentExtendedFilter + from .generic_resource_filter_py3 import GenericResourceFilter + from .resource_group_filter_py3 import ResourceGroupFilter + from .template_link_py3 import TemplateLink + from .parameters_link_py3 import ParametersLink + from .debug_setting_py3 import DebugSetting + from .deployment_properties_py3 import DeploymentProperties + from .deployment_py3 import Deployment + from .deployment_export_result_py3 import DeploymentExportResult + from .resource_management_error_with_details_py3 import ResourceManagementErrorWithDetails + from .alias_path_type_py3 import AliasPathType + from .alias_type_py3 import AliasType + from .provider_resource_type_py3 import ProviderResourceType + from .provider_py3 import Provider + from .basic_dependency_py3 import BasicDependency + from .dependency_py3 import Dependency + from .deployment_properties_extended_py3 import DeploymentPropertiesExtended + from .deployment_validate_result_py3 import DeploymentValidateResult + from .deployment_extended_py3 import DeploymentExtended + from .plan_py3 import Plan + from .sku_py3 import Sku + from .identity_py3 import Identity + from .generic_resource_py3 import GenericResource + from .resource_group_properties_py3 import ResourceGroupProperties + from .resource_group_py3 import ResourceGroup + from .resources_move_info_py3 import ResourcesMoveInfo + from .export_template_request_py3 import ExportTemplateRequest + from .tag_count_py3 import TagCount + from .tag_value_py3 import TagValue + from .tag_details_py3 import TagDetails + from .target_resource_py3 import TargetResource + from .http_message_py3 import HttpMessage + from .deployment_operation_properties_py3 import DeploymentOperationProperties + from .deployment_operation_py3 import DeploymentOperation + from .resource_provider_operation_display_properties_py3 import ResourceProviderOperationDisplayProperties + from .resource_py3 import Resource + from .sub_resource_py3 import SubResource + from .resource_group_export_result_py3 import ResourceGroupExportResult +except (SyntaxError, ImportError): + from .deployment_extended_filter import DeploymentExtendedFilter + from .generic_resource_filter import GenericResourceFilter + from .resource_group_filter import ResourceGroupFilter + from .template_link import TemplateLink + from .parameters_link import ParametersLink + from .debug_setting import DebugSetting + from .deployment_properties import DeploymentProperties + from .deployment import Deployment + from .deployment_export_result import DeploymentExportResult + from .resource_management_error_with_details import ResourceManagementErrorWithDetails + from .alias_path_type import AliasPathType + from .alias_type import AliasType + from .provider_resource_type import ProviderResourceType + from .provider import Provider + from .basic_dependency import BasicDependency + from .dependency import Dependency + from .deployment_properties_extended import DeploymentPropertiesExtended + from .deployment_validate_result import DeploymentValidateResult + from .deployment_extended import DeploymentExtended + from .plan import Plan + from .sku import Sku + from .identity import Identity + from .generic_resource import GenericResource + from .resource_group_properties import ResourceGroupProperties + from .resource_group import ResourceGroup + from .resources_move_info import ResourcesMoveInfo + from .export_template_request import ExportTemplateRequest + from .tag_count import TagCount + from .tag_value import TagValue + from .tag_details import TagDetails + from .target_resource import TargetResource + from .http_message import HttpMessage + from .deployment_operation_properties import DeploymentOperationProperties + from .deployment_operation import DeploymentOperation + from .resource_provider_operation_display_properties import ResourceProviderOperationDisplayProperties + from .resource import Resource + from .sub_resource import SubResource + from .resource_group_export_result import ResourceGroupExportResult from .deployment_extended_paged import DeploymentExtendedPaged from .provider_paged import ProviderPaged from .generic_resource_paged import GenericResourcePaged diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/alias_path_type.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/alias_path_type.py index 9b943cf49761..3a828a3d33fd 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/alias_path_type.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/alias_path_type.py @@ -26,7 +26,7 @@ class AliasPathType(Model): 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, } - def __init__(self, path=None, api_versions=None): - super(AliasPathType, self).__init__() - self.path = path - self.api_versions = api_versions + def __init__(self, **kwargs): + super(AliasPathType, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.api_versions = kwargs.get('api_versions', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/alias_path_type_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/alias_path_type_py3.py new file mode 100644 index 000000000000..90013a7568fa --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/alias_path_type_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AliasPathType(Model): + """AliasPathType. + + :param path: The path of an alias. + :type path: str + :param api_versions: The api versions. + :type api_versions: list[str] + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + } + + def __init__(self, *, path: str=None, api_versions=None, **kwargs) -> None: + super(AliasPathType, self).__init__(**kwargs) + self.path = path + self.api_versions = api_versions diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/alias_type.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/alias_type.py index 4daca1dff188..8cddb17f0247 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/alias_type.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/alias_type.py @@ -27,7 +27,7 @@ class AliasType(Model): 'paths': {'key': 'paths', 'type': '[AliasPathType]'}, } - def __init__(self, name=None, paths=None): - super(AliasType, self).__init__() - self.name = name - self.paths = paths + def __init__(self, **kwargs): + super(AliasType, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.paths = kwargs.get('paths', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/alias_type_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/alias_type_py3.py new file mode 100644 index 000000000000..e89e255f18ec --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/alias_type_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AliasType(Model): + """AliasType. + + :param name: The alias name. + :type name: str + :param paths: The paths for an alias. + :type paths: + list[~azure.mgmt.resource.resources.v2016_02_01.models.AliasPathType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'paths': {'key': 'paths', 'type': '[AliasPathType]'}, + } + + def __init__(self, *, name: str=None, paths=None, **kwargs) -> None: + super(AliasType, self).__init__(**kwargs) + self.name = name + self.paths = paths diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/basic_dependency.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/basic_dependency.py index d16931dabd70..3a5ccd4aa464 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/basic_dependency.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/basic_dependency.py @@ -29,8 +29,8 @@ class BasicDependency(Model): 'resource_name': {'key': 'resourceName', 'type': 'str'}, } - def __init__(self, id=None, resource_type=None, resource_name=None): - super(BasicDependency, self).__init__() - self.id = id - self.resource_type = resource_type - self.resource_name = resource_name + def __init__(self, **kwargs): + super(BasicDependency, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_name = kwargs.get('resource_name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/basic_dependency_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/basic_dependency_py3.py new file mode 100644 index 000000000000..49d821737930 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/basic_dependency_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BasicDependency(Model): + """Deployment dependency information. + + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, resource_type: str=None, resource_name: str=None, **kwargs) -> None: + super(BasicDependency, self).__init__(**kwargs) + self.id = id + self.resource_type = resource_type + self.resource_name = resource_name diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/debug_setting.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/debug_setting.py index 198f1237bd50..3dc20a32dba0 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/debug_setting.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/debug_setting.py @@ -23,6 +23,6 @@ class DebugSetting(Model): 'detail_level': {'key': 'detailLevel', 'type': 'str'}, } - def __init__(self, detail_level=None): - super(DebugSetting, self).__init__() - self.detail_level = detail_level + def __init__(self, **kwargs): + super(DebugSetting, self).__init__(**kwargs) + self.detail_level = kwargs.get('detail_level', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/debug_setting_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/debug_setting_py3.py new file mode 100644 index 000000000000..cb479a2500f0 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/debug_setting_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DebugSetting(Model): + """DebugSetting. + + :param detail_level: The debug detail level. + :type detail_level: str + """ + + _attribute_map = { + 'detail_level': {'key': 'detailLevel', 'type': 'str'}, + } + + def __init__(self, *, detail_level: str=None, **kwargs) -> None: + super(DebugSetting, self).__init__(**kwargs) + self.detail_level = detail_level diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/dependency.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/dependency.py index 9676030eb938..81bd7ad52dbf 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/dependency.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/dependency.py @@ -33,9 +33,9 @@ class Dependency(Model): 'resource_name': {'key': 'resourceName', 'type': 'str'}, } - def __init__(self, depends_on=None, id=None, resource_type=None, resource_name=None): - super(Dependency, self).__init__() - self.depends_on = depends_on - self.id = id - self.resource_type = resource_type - self.resource_name = resource_name + def __init__(self, **kwargs): + super(Dependency, self).__init__(**kwargs) + self.depends_on = kwargs.get('depends_on', None) + self.id = kwargs.get('id', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_name = kwargs.get('resource_name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/dependency_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/dependency_py3.py new file mode 100644 index 000000000000..c7b72f765c9c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/dependency_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Dependency(Model): + """Deployment dependency information. + + :param depends_on: The list of dependencies. + :type depends_on: + list[~azure.mgmt.resource.resources.v2016_02_01.models.BasicDependency] + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'depends_on': {'key': 'dependsOn', 'type': '[BasicDependency]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, *, depends_on=None, id: str=None, resource_type: str=None, resource_name: str=None, **kwargs) -> None: + super(Dependency, self).__init__(**kwargs) + self.depends_on = depends_on + self.id = id + self.resource_type = resource_type + self.resource_name = resource_name diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment.py index bb234a14804b..b064f0e3d9dc 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment.py @@ -24,6 +24,6 @@ class Deployment(Model): 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, } - def __init__(self, properties=None): - super(Deployment, self).__init__() - self.properties = properties + def __init__(self, **kwargs): + super(Deployment, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_export_result.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_export_result.py index 71d59dc8cb98..3748db4c9a21 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_export_result.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_export_result.py @@ -23,6 +23,6 @@ class DeploymentExportResult(Model): 'template': {'key': 'template', 'type': 'object'}, } - def __init__(self, template=None): - super(DeploymentExportResult, self).__init__() - self.template = template + def __init__(self, **kwargs): + super(DeploymentExportResult, self).__init__(**kwargs) + self.template = kwargs.get('template', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_export_result_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_export_result_py3.py new file mode 100644 index 000000000000..af87de7862c7 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_export_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExportResult(Model): + """DeploymentExportResult. + + :param template: The template content. + :type template: object + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, *, template=None, **kwargs) -> None: + super(DeploymentExportResult, self).__init__(**kwargs) + self.template = template diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_extended.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_extended.py index 0f45be962b0a..727d55ee9448 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_extended.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_extended.py @@ -15,9 +15,14 @@ class DeploymentExtended(Model): """Deployment information. - :param id: The ID of the deployment. - :type id: str - :param name: The name of the deployment. + 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 ID of the deployment. + :vartype id: str + :param name: Required. The name of the deployment. :type name: str :param properties: Deployment properties. :type properties: @@ -25,6 +30,7 @@ class DeploymentExtended(Model): """ _validation = { + 'id': {'readonly': True}, 'name': {'required': True}, } @@ -34,8 +40,8 @@ class DeploymentExtended(Model): 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, } - def __init__(self, name, id=None, properties=None): - super(DeploymentExtended, self).__init__() - self.id = id - self.name = name - self.properties = properties + def __init__(self, **kwargs): + super(DeploymentExtended, self).__init__(**kwargs) + self.id = None + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_extended_filter.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_extended_filter.py index 45bb10fa20b0..0839bcc12e4e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_extended_filter.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_extended_filter.py @@ -23,6 +23,6 @@ class DeploymentExtendedFilter(Model): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } - def __init__(self, provisioning_state=None): - super(DeploymentExtendedFilter, self).__init__() - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(DeploymentExtendedFilter, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_extended_filter_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_extended_filter_py3.py new file mode 100644 index 000000000000..f06d0d1a4dfb --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_extended_filter_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExtendedFilter(Model): + """Deployment filter. + + :param provisioning_state: The provisioning state. + :type provisioning_state: str + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, provisioning_state: str=None, **kwargs) -> None: + super(DeploymentExtendedFilter, self).__init__(**kwargs) + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_extended_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_extended_py3.py new file mode 100644 index 000000000000..095e187951cb --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_extended_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExtended(Model): + """Deployment information. + + 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 ID of the deployment. + :vartype id: str + :param name: Required. The name of the deployment. + :type name: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentPropertiesExtended + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + } + + def __init__(self, *, name: str, properties=None, **kwargs) -> None: + super(DeploymentExtended, self).__init__(**kwargs) + self.id = None + self.name = name + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_operation.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_operation.py index a31981dc4c4f..b8ffe8a31357 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_operation.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_operation.py @@ -30,8 +30,8 @@ class DeploymentOperation(Model): 'properties': {'key': 'properties', 'type': 'DeploymentOperationProperties'}, } - def __init__(self, id=None, operation_id=None, properties=None): - super(DeploymentOperation, self).__init__() - self.id = id - self.operation_id = operation_id - self.properties = properties + def __init__(self, **kwargs): + super(DeploymentOperation, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.operation_id = kwargs.get('operation_id', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_operation_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_operation_properties.py index 451a6624803f..3d48812932ea 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_operation_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_operation_properties.py @@ -47,13 +47,13 @@ class DeploymentOperationProperties(Model): 'response': {'key': 'response', 'type': 'HttpMessage'}, } - def __init__(self, provisioning_state=None, timestamp=None, service_request_id=None, status_code=None, status_message=None, target_resource=None, request=None, response=None): - super(DeploymentOperationProperties, self).__init__() - self.provisioning_state = provisioning_state - self.timestamp = timestamp - self.service_request_id = service_request_id - self.status_code = status_code - self.status_message = status_message - self.target_resource = target_resource - self.request = request - self.response = response + def __init__(self, **kwargs): + super(DeploymentOperationProperties, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.timestamp = kwargs.get('timestamp', None) + self.service_request_id = kwargs.get('service_request_id', None) + self.status_code = kwargs.get('status_code', None) + self.status_message = kwargs.get('status_message', None) + self.target_resource = kwargs.get('target_resource', None) + self.request = kwargs.get('request', None) + self.response = kwargs.get('response', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_operation_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_operation_properties_py3.py new file mode 100644 index 000000000000..9dc098227639 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_operation_properties_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentOperationProperties(Model): + """Deployment operation properties. + + :param provisioning_state: The state of the provisioning. + :type provisioning_state: str + :param timestamp: The date and time of the operation. + :type timestamp: datetime + :param service_request_id: Deployment operation service request id. + :type service_request_id: str + :param status_code: Operation status code. + :type status_code: str + :param status_message: Operation status message. + :type status_message: object + :param target_resource: The target resource. + :type target_resource: + ~azure.mgmt.resource.resources.v2016_02_01.models.TargetResource + :param request: The HTTP request message. + :type request: + ~azure.mgmt.resource.resources.v2016_02_01.models.HttpMessage + :param response: The HTTP response message. + :type response: + ~azure.mgmt.resource.resources.v2016_02_01.models.HttpMessage + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'service_request_id': {'key': 'serviceRequestId', 'type': 'str'}, + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'status_message': {'key': 'statusMessage', 'type': 'object'}, + 'target_resource': {'key': 'targetResource', 'type': 'TargetResource'}, + 'request': {'key': 'request', 'type': 'HttpMessage'}, + 'response': {'key': 'response', 'type': 'HttpMessage'}, + } + + def __init__(self, *, provisioning_state: str=None, timestamp=None, service_request_id: str=None, status_code: str=None, status_message=None, target_resource=None, request=None, response=None, **kwargs) -> None: + super(DeploymentOperationProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.timestamp = timestamp + self.service_request_id = service_request_id + self.status_code = status_code + self.status_message = status_message + self.target_resource = target_resource + self.request = request + self.response = response diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_operation_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_operation_py3.py new file mode 100644 index 000000000000..9a289c3b202b --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_operation_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentOperation(Model): + """Deployment operation information. + + :param id: Full deployment operation id. + :type id: str + :param operation_id: Deployment operation id. + :type operation_id: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentOperationProperties + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentOperationProperties'}, + } + + def __init__(self, *, id: str=None, operation_id: str=None, properties=None, **kwargs) -> None: + super(DeploymentOperation, self).__init__(**kwargs) + self.id = id + self.operation_id = operation_id + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_properties.py index b622223be124..7bae59be93d7 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_properties.py @@ -15,6 +15,8 @@ class DeploymentProperties(Model): """Deployment properties. + All required parameters must be populated in order to send to Azure. + :param template: The template content. It can be a JObject or a well formed JSON string. Use only one of Template or TemplateLink. :type template: object @@ -29,8 +31,8 @@ class DeploymentProperties(Model): ParametersLink. :type parameters_link: ~azure.mgmt.resource.resources.v2016_02_01.models.ParametersLink - :param mode: The deployment mode. Possible values include: 'Incremental', - 'Complete' + :param mode: Required. The deployment mode. Possible values include: + 'Incremental', 'Complete' :type mode: str or ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentMode :param debug_setting: The debug setting of the deployment. @@ -51,11 +53,11 @@ class DeploymentProperties(Model): 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, } - def __init__(self, mode, template=None, template_link=None, parameters=None, parameters_link=None, debug_setting=None): - super(DeploymentProperties, self).__init__() - self.template = template - self.template_link = template_link - self.parameters = parameters - self.parameters_link = parameters_link - self.mode = mode - self.debug_setting = debug_setting + def __init__(self, **kwargs): + super(DeploymentProperties, self).__init__(**kwargs) + self.template = kwargs.get('template', None) + self.template_link = kwargs.get('template_link', None) + self.parameters = kwargs.get('parameters', None) + self.parameters_link = kwargs.get('parameters_link', None) + self.mode = kwargs.get('mode', None) + self.debug_setting = kwargs.get('debug_setting', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_properties_extended.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_properties_extended.py index 5bac660cd3dd..edfe6ab70557 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_properties_extended.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_properties_extended.py @@ -68,17 +68,17 @@ class DeploymentPropertiesExtended(Model): 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, } - def __init__(self, provisioning_state=None, correlation_id=None, timestamp=None, outputs=None, providers=None, dependencies=None, template=None, template_link=None, parameters=None, parameters_link=None, mode=None, debug_setting=None): - super(DeploymentPropertiesExtended, self).__init__() - self.provisioning_state = provisioning_state - self.correlation_id = correlation_id - self.timestamp = timestamp - self.outputs = outputs - self.providers = providers - self.dependencies = dependencies - self.template = template - self.template_link = template_link - self.parameters = parameters - self.parameters_link = parameters_link - self.mode = mode - self.debug_setting = debug_setting + def __init__(self, **kwargs): + super(DeploymentPropertiesExtended, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.correlation_id = kwargs.get('correlation_id', None) + self.timestamp = kwargs.get('timestamp', None) + self.outputs = kwargs.get('outputs', None) + self.providers = kwargs.get('providers', None) + self.dependencies = kwargs.get('dependencies', None) + self.template = kwargs.get('template', None) + self.template_link = kwargs.get('template_link', None) + self.parameters = kwargs.get('parameters', None) + self.parameters_link = kwargs.get('parameters_link', None) + self.mode = kwargs.get('mode', None) + self.debug_setting = kwargs.get('debug_setting', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_properties_extended_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_properties_extended_py3.py new file mode 100644 index 000000000000..e7d5b758a4fd --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_properties_extended_py3.py @@ -0,0 +1,84 @@ +# 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 DeploymentPropertiesExtended(Model): + """Deployment properties with additional details. + + :param provisioning_state: The state of the provisioning. + :type provisioning_state: str + :param correlation_id: The correlation ID of the deployment. + :type correlation_id: str + :param timestamp: The timestamp of the template deployment. + :type timestamp: datetime + :param outputs: Key/value pairs that represent deploymentoutput. + :type outputs: object + :param providers: The list of resource providers needed for the + deployment. + :type providers: + list[~azure.mgmt.resource.resources.v2016_02_01.models.Provider] + :param dependencies: The list of deployment dependencies. + :type dependencies: + list[~azure.mgmt.resource.resources.v2016_02_01.models.Dependency] + :param template: The template content. Use only one of Template or + TemplateLink. + :type template: object + :param template_link: The URI referencing the template. Use only one of + Template or TemplateLink. + :type template_link: + ~azure.mgmt.resource.resources.v2016_02_01.models.TemplateLink + :param parameters: Deployment parameters. Use only one of Parameters or + ParametersLink. + :type parameters: object + :param parameters_link: The URI referencing the parameters. Use only one + of Parameters or ParametersLink. + :type parameters_link: + ~azure.mgmt.resource.resources.v2016_02_01.models.ParametersLink + :param mode: The deployment mode. Possible values include: 'Incremental', + 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2016_02_01.models.DebugSetting + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'providers': {'key': 'providers', 'type': '[Provider]'}, + 'dependencies': {'key': 'dependencies', 'type': '[Dependency]'}, + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + } + + def __init__(self, *, provisioning_state: str=None, correlation_id: str=None, timestamp=None, outputs=None, providers=None, dependencies=None, template=None, template_link=None, parameters=None, parameters_link=None, mode=None, debug_setting=None, **kwargs) -> None: + super(DeploymentPropertiesExtended, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.correlation_id = correlation_id + self.timestamp = timestamp + self.outputs = outputs + self.providers = providers + self.dependencies = dependencies + self.template = template + self.template_link = template_link + self.parameters = parameters + self.parameters_link = parameters_link + self.mode = mode + self.debug_setting = debug_setting diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_properties_py3.py new file mode 100644 index 000000000000..9ca20cabc8a1 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_properties_py3.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentProperties(Model): + """Deployment properties. + + All required parameters must be populated in order to send to Azure. + + :param template: The template content. It can be a JObject or a well + formed JSON string. Use only one of Template or TemplateLink. + :type template: object + :param template_link: The template URI. Use only one of Template or + TemplateLink. + :type template_link: + ~azure.mgmt.resource.resources.v2016_02_01.models.TemplateLink + :param parameters: Deployment parameters. It can be a JObject or a well + formed JSON string. Use only one of Parameters or ParametersLink. + :type parameters: object + :param parameters_link: The parameters URI. Use only one of Parameters or + ParametersLink. + :type parameters_link: + ~azure.mgmt.resource.resources.v2016_02_01.models.ParametersLink + :param mode: Required. The deployment mode. Possible values include: + 'Incremental', 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2016_02_01.models.DebugSetting + """ + + _validation = { + 'mode': {'required': True}, + } + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + } + + def __init__(self, *, mode, template=None, template_link=None, parameters=None, parameters_link=None, debug_setting=None, **kwargs) -> None: + super(DeploymentProperties, self).__init__(**kwargs) + self.template = template + self.template_link = template_link + self.parameters = parameters + self.parameters_link = parameters_link + self.mode = mode + self.debug_setting = debug_setting diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_py3.py new file mode 100644 index 000000000000..976868b4ff97 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Deployment(Model): + """Deployment operation parameters. + + :param properties: The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(Deployment, self).__init__(**kwargs) + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_validate_result.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_validate_result.py index 06f513afebd7..9ef8f684f310 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_validate_result.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_validate_result.py @@ -28,7 +28,7 @@ class DeploymentValidateResult(Model): 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, } - def __init__(self, error=None, properties=None): - super(DeploymentValidateResult, self).__init__() - self.error = error - self.properties = properties + def __init__(self, **kwargs): + super(DeploymentValidateResult, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_validate_result_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_validate_result_py3.py new file mode 100644 index 000000000000..571f3ac3b587 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/deployment_validate_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentValidateResult(Model): + """Information from validate template deployment response. + + :param error: Validation error. + :type error: + ~azure.mgmt.resource.resources.v2016_02_01.models.ResourceManagementErrorWithDetails + :param properties: The template deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentPropertiesExtended + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ResourceManagementErrorWithDetails'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + } + + def __init__(self, *, error=None, properties=None, **kwargs) -> None: + super(DeploymentValidateResult, self).__init__(**kwargs) + self.error = error + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/export_template_request.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/export_template_request.py index d3c78282b591..2438332b3fd1 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/export_template_request.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/export_template_request.py @@ -30,7 +30,7 @@ class ExportTemplateRequest(Model): 'options': {'key': 'options', 'type': 'str'}, } - def __init__(self, resources=None, options=None): - super(ExportTemplateRequest, self).__init__() - self.resources = resources - self.options = options + def __init__(self, **kwargs): + super(ExportTemplateRequest, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + self.options = kwargs.get('options', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/export_template_request_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/export_template_request_py3.py new file mode 100644 index 000000000000..4c9b3b32d3de --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/export_template_request_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportTemplateRequest(Model): + """Export resource group template request parameters. + + :param resources: The ids of the resources. The only supported string + currently is '*' (all resources). Future api updates will support + exporting specific resources. + :type resources: list[str] + :param options: The export template options. Supported values include + 'IncludeParameterDefaultValue', 'IncludeComments' or + 'IncludeParameterDefaultValue, IncludeComments + :type options: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'options': {'key': 'options', 'type': 'str'}, + } + + def __init__(self, *, resources=None, options: str=None, **kwargs) -> None: + super(ExportTemplateRequest, self).__init__(**kwargs) + self.resources = resources + self.options = options diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource.py index 7674805dbd43..555d0701dcd2 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource.py @@ -62,11 +62,11 @@ class GenericResource(Resource): 'identity': {'key': 'identity', 'type': 'Identity'}, } - def __init__(self, location=None, tags=None, plan=None, properties=None, kind=None, managed_by=None, sku=None, identity=None): - super(GenericResource, self).__init__(location=location, tags=tags) - self.plan = plan - self.properties = properties - self.kind = kind - self.managed_by = managed_by - self.sku = sku - self.identity = identity + def __init__(self, **kwargs): + super(GenericResource, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.properties = kwargs.get('properties', None) + self.kind = kwargs.get('kind', None) + self.managed_by = kwargs.get('managed_by', None) + self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource_filter.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource_filter.py index a31e587e849a..c4488f4cf095 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource_filter.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource_filter.py @@ -29,8 +29,8 @@ class GenericResourceFilter(Model): 'tagvalue': {'key': 'tagvalue', 'type': 'str'}, } - def __init__(self, resource_type=None, tagname=None, tagvalue=None): - super(GenericResourceFilter, self).__init__() - self.resource_type = resource_type - self.tagname = tagname - self.tagvalue = tagvalue + def __init__(self, **kwargs): + super(GenericResourceFilter, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.tagname = kwargs.get('tagname', None) + self.tagvalue = kwargs.get('tagvalue', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource_filter_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource_filter_py3.py new file mode 100644 index 000000000000..17ad0e58c55c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource_filter_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GenericResourceFilter(Model): + """Resource filter. + + :param resource_type: The resource type. + :type resource_type: str + :param tagname: The tag name. + :type tagname: str + :param tagvalue: The tag value. + :type tagvalue: str + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'tagname': {'key': 'tagname', 'type': 'str'}, + 'tagvalue': {'key': 'tagvalue', 'type': 'str'}, + } + + def __init__(self, *, resource_type: str=None, tagname: str=None, tagvalue: str=None, **kwargs) -> None: + super(GenericResourceFilter, self).__init__(**kwargs) + self.resource_type = resource_type + self.tagname = tagname + self.tagvalue = tagvalue diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource_py3.py new file mode 100644 index 000000000000..f1695beac57a --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource_py3.py @@ -0,0 +1,72 @@ +# 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 GenericResource(Resource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2016_02_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: Id of the resource that manages this resource. + :type managed_by: str + :param sku: The sku of the resource. + :type sku: ~azure.mgmt.resource.resources.v2016_02_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2016_02_01.models.Identity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': 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}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResource, self).__init__(location=location, tags=tags, **kwargs) + self.plan = plan + self.properties = properties + self.kind = kind + self.managed_by = managed_by + self.sku = sku + self.identity = identity diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/http_message.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/http_message.py index 569a4d843f61..f6e080babaf1 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/http_message.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/http_message.py @@ -23,6 +23,6 @@ class HttpMessage(Model): 'content': {'key': 'content', 'type': 'object'}, } - def __init__(self, content=None): - super(HttpMessage, self).__init__() - self.content = content + def __init__(self, **kwargs): + super(HttpMessage, self).__init__(**kwargs) + self.content = kwargs.get('content', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/http_message_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/http_message_py3.py new file mode 100644 index 000000000000..0fe8e057876a --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/http_message_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class HttpMessage(Model): + """HttpMessage. + + :param content: HTTP message content. + :type content: object + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'object'}, + } + + def __init__(self, *, content=None, **kwargs) -> None: + super(HttpMessage, self).__init__(**kwargs) + self.content = content diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/identity.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/identity.py index 9c640ccc4ef6..2413d4599f36 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/identity.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/identity.py @@ -38,8 +38,8 @@ class Identity(Model): 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, } - def __init__(self, type=None): - super(Identity, self).__init__() + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = type + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/identity_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/identity_py3.py new file mode 100644 index 000000000000..7dae7201db6d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/identity_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned' + :type type: str or + ~azure.mgmt.resource.resources.v2016_02_01.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/parameters_link.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/parameters_link.py index 34c9c0f98a61..3847a62562a5 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/parameters_link.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/parameters_link.py @@ -15,7 +15,9 @@ class ParametersLink(Model): """Entity representing the reference to the deployment paramaters. - :param uri: URI referencing the template. + All required parameters must be populated in order to send to Azure. + + :param uri: Required. URI referencing the template. :type uri: str :param content_version: If included it must match the ContentVersion in the template. @@ -31,7 +33,7 @@ class ParametersLink(Model): 'content_version': {'key': 'contentVersion', 'type': 'str'}, } - def __init__(self, uri, content_version=None): - super(ParametersLink, self).__init__() - self.uri = uri - self.content_version = content_version + def __init__(self, **kwargs): + super(ParametersLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.content_version = kwargs.get('content_version', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/parameters_link_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/parameters_link_py3.py new file mode 100644 index 000000000000..8325aabe4a38 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/parameters_link_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ParametersLink(Model): + """Entity representing the reference to the deployment paramaters. + + All required parameters must be populated in order to send to Azure. + + :param uri: Required. URI referencing the template. + :type uri: str + :param content_version: If included it must match the ContentVersion in + the template. + :type content_version: str + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + } + + def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: + super(ParametersLink, self).__init__(**kwargs) + self.uri = uri + self.content_version = content_version diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/plan.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/plan.py index 8909aa831135..b0052f4344ea 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/plan.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/plan.py @@ -32,9 +32,9 @@ class Plan(Model): 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, } - def __init__(self, name=None, publisher=None, product=None, promotion_code=None): - super(Plan, self).__init__() - self.name = name - self.publisher = publisher - self.product = product - self.promotion_code = promotion_code + def __init__(self, **kwargs): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/plan_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/plan_py3.py new file mode 100644 index 000000000000..59da139a551e --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/plan_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Plan(Model): + """Plan for the resource. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The offer ID. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, product: str=None, promotion_code: str=None, **kwargs) -> None: + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider.py index 7d41fa427408..2a8777107446 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider.py @@ -33,9 +33,9 @@ class Provider(Model): 'resource_types': {'key': 'resourceTypes', 'type': '[ProviderResourceType]'}, } - def __init__(self, id=None, namespace=None, registration_state=None, resource_types=None): - super(Provider, self).__init__() - self.id = id - self.namespace = namespace - self.registration_state = registration_state - self.resource_types = resource_types + def __init__(self, **kwargs): + super(Provider, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.namespace = kwargs.get('namespace', None) + self.registration_state = kwargs.get('registration_state', None) + self.resource_types = kwargs.get('resource_types', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider_py3.py new file mode 100644 index 000000000000..28fe4396230b --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Provider(Model): + """Resource provider information. + + :param id: The provider id. + :type id: str + :param namespace: The namespace of the provider. + :type namespace: str + :param registration_state: The registration state of the provider. + :type registration_state: str + :param resource_types: The collection of provider resource types. + :type resource_types: + list[~azure.mgmt.resource.resources.v2016_02_01.models.ProviderResourceType] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'registration_state': {'key': 'registrationState', 'type': 'str'}, + 'resource_types': {'key': 'resourceTypes', 'type': '[ProviderResourceType]'}, + } + + def __init__(self, *, id: str=None, namespace: str=None, registration_state: str=None, resource_types=None, **kwargs) -> None: + super(Provider, self).__init__(**kwargs) + self.id = id + self.namespace = namespace + self.registration_state = registration_state + self.resource_types = resource_types diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider_resource_type.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider_resource_type.py index 779dbc7f269f..4ca6e1bb813b 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider_resource_type.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider_resource_type.py @@ -37,10 +37,10 @@ class ProviderResourceType(Model): 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, resource_type=None, locations=None, aliases=None, api_versions=None, properties=None): - super(ProviderResourceType, self).__init__() - self.resource_type = resource_type - self.locations = locations - self.aliases = aliases - self.api_versions = api_versions - self.properties = properties + def __init__(self, **kwargs): + super(ProviderResourceType, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.locations = kwargs.get('locations', None) + self.aliases = kwargs.get('aliases', None) + self.api_versions = kwargs.get('api_versions', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider_resource_type_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider_resource_type_py3.py new file mode 100644 index 000000000000..60457dab9a53 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider_resource_type_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ProviderResourceType(Model): + """Resource type managed by the resource provider. + + :param resource_type: The resource type. + :type resource_type: str + :param locations: The collection of locations where this resource type can + be created in. + :type locations: list[str] + :param aliases: The aliases that are supported by this resource type. + :type aliases: + list[~azure.mgmt.resource.resources.v2016_02_01.models.AliasType] + :param api_versions: The api version. + :type api_versions: list[str] + :param properties: The properties. + :type properties: dict[str, str] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, properties=None, **kwargs) -> None: + super(ProviderResourceType, self).__init__(**kwargs) + self.resource_type = resource_type + self.locations = locations + self.aliases = aliases + self.api_versions = api_versions + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource.py index ca42e73ef20d..a24cfa5648f3 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource.py @@ -44,10 +44,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group.py index 2da5cfdab3d9..bc47fd96f85b 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group.py @@ -18,6 +18,8 @@ class ResourceGroup(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The ID of the resource group. :vartype id: str :param name: The Name of the resource group. @@ -25,9 +27,10 @@ class ResourceGroup(Model): :param properties: :type properties: ~azure.mgmt.resource.resources.v2016_02_01.models.ResourceGroupProperties - :param location: The location of the resource group. It cannot be changed - after the resource group has been created. Has to be one of the supported - Azure Locations, such as West US, East US, West Europe, East Asia, etc. + :param location: Required. The location of the resource group. It cannot + be changed after the resource group has been created. Has to be one of the + supported Azure Locations, such as West US, East US, West Europe, East + Asia, etc. :type location: str :param tags: The tags attached to the resource group. :type tags: dict[str, str] @@ -46,10 +49,10 @@ class ResourceGroup(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, name=None, properties=None, tags=None): - super(ResourceGroup, self).__init__() + def __init__(self, **kwargs): + super(ResourceGroup, self).__init__(**kwargs) self.id = None - self.name = name - self.properties = properties - self.location = location - self.tags = tags + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_export_result.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_export_result.py index 3453c9e7f275..cdb3f515ea77 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_export_result.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_export_result.py @@ -27,7 +27,7 @@ class ResourceGroupExportResult(Model): 'error': {'key': 'error', 'type': 'ResourceManagementErrorWithDetails'}, } - def __init__(self, template=None, error=None): - super(ResourceGroupExportResult, self).__init__() - self.template = template - self.error = error + def __init__(self, **kwargs): + super(ResourceGroupExportResult, self).__init__(**kwargs) + self.template = kwargs.get('template', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_export_result_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_export_result_py3.py new file mode 100644 index 000000000000..baa6d472a58c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_export_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceGroupExportResult(Model): + """ResourceGroupExportResult. + + :param template: The template content. + :type template: object + :param error: The error. + :type error: + ~azure.mgmt.resource.resources.v2016_02_01.models.ResourceManagementErrorWithDetails + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'error': {'key': 'error', 'type': 'ResourceManagementErrorWithDetails'}, + } + + def __init__(self, *, template=None, error=None, **kwargs) -> None: + super(ResourceGroupExportResult, self).__init__(**kwargs) + self.template = template + self.error = error diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_filter.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_filter.py index fa0011120785..c94284bf3644 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_filter.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_filter.py @@ -26,7 +26,7 @@ class ResourceGroupFilter(Model): 'tag_value': {'key': 'tagValue', 'type': 'str'}, } - def __init__(self, tag_name=None, tag_value=None): - super(ResourceGroupFilter, self).__init__() - self.tag_name = tag_name - self.tag_value = tag_value + def __init__(self, **kwargs): + super(ResourceGroupFilter, self).__init__(**kwargs) + self.tag_name = kwargs.get('tag_name', None) + self.tag_value = kwargs.get('tag_value', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_filter_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_filter_py3.py new file mode 100644 index 000000000000..d709b6afd34f --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_filter_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceGroupFilter(Model): + """Resource group filter. + + :param tag_name: The tag name. + :type tag_name: str + :param tag_value: The tag value. + :type tag_value: str + """ + + _attribute_map = { + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + } + + def __init__(self, *, tag_name: str=None, tag_value: str=None, **kwargs) -> None: + super(ResourceGroupFilter, self).__init__(**kwargs) + self.tag_name = tag_name + self.tag_value = tag_value diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_properties.py index a6c35140c9d6..39411e3d79fb 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_properties.py @@ -30,6 +30,6 @@ class ResourceGroupProperties(Model): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } - def __init__(self): - super(ResourceGroupProperties, self).__init__() + def __init__(self, **kwargs): + super(ResourceGroupProperties, self).__init__(**kwargs) self.provisioning_state = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_properties_py3.py new file mode 100644 index 000000000000..67d6d06dedbd --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_properties_py3.py @@ -0,0 +1,35 @@ +# 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 ResourceGroupProperties(Model): + """The resource group properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceGroupProperties, self).__init__(**kwargs) + self.provisioning_state = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_py3.py new file mode 100644 index 000000000000..63105fba8f95 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group_py3.py @@ -0,0 +1,58 @@ +# 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 ResourceGroup(Model): + """Resource group information. + + 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 ID of the resource group. + :vartype id: str + :param name: The Name of the resource group. + :type name: str + :param properties: + :type properties: + ~azure.mgmt.resource.resources.v2016_02_01.models.ResourceGroupProperties + :param location: Required. The location of the resource group. It cannot + be changed after the resource group has been created. Has to be one of the + supported Azure Locations, such as West US, East US, West Europe, East + Asia, etc. + :type location: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, name: str=None, properties=None, tags=None, **kwargs) -> None: + super(ResourceGroup, self).__init__(**kwargs) + self.id = None + self.name = name + self.properties = properties + self.location = location + self.tags = tags diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_management_client_enums.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_management_client_enums.py index 011ae3609d77..3b6a0e19d760 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_management_client_enums.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_management_client_enums.py @@ -12,12 +12,12 @@ from enum import Enum -class DeploymentMode(Enum): +class DeploymentMode(str, Enum): incremental = "Incremental" complete = "Complete" -class ResourceIdentityType(Enum): +class ResourceIdentityType(str, Enum): system_assigned = "SystemAssigned" diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_management_error_with_details.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_management_error_with_details.py index 4ecd4e508664..dee88677696e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_management_error_with_details.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_management_error_with_details.py @@ -15,9 +15,11 @@ class ResourceManagementErrorWithDetails(Model): """ResourceManagementErrorWithDetails. - :param code: The error code returned from the server. + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code returned from the server. :type code: str - :param message: The error message returned from the server. + :param message: Required. The error message returned from the server. :type message: str :param target: The target of the error. :type target: str @@ -38,9 +40,9 @@ class ResourceManagementErrorWithDetails(Model): 'details': {'key': 'details', 'type': '[ResourceManagementErrorWithDetails]'}, } - def __init__(self, code, message, target=None, details=None): - super(ResourceManagementErrorWithDetails, self).__init__() - self.code = code - self.message = message - self.target = target - self.details = details + def __init__(self, **kwargs): + super(ResourceManagementErrorWithDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_management_error_with_details_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_management_error_with_details_py3.py new file mode 100644 index 000000000000..97c992e8e916 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_management_error_with_details_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceManagementErrorWithDetails(Model): + """ResourceManagementErrorWithDetails. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code returned from the server. + :type code: str + :param message: Required. The error message returned from the server. + :type message: str + :param target: The target of the error. + :type target: str + :param details: Validation error. + :type details: + list[~azure.mgmt.resource.resources.v2016_02_01.models.ResourceManagementErrorWithDetails] + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ResourceManagementErrorWithDetails]'}, + } + + def __init__(self, *, code: str, message: str, target: str=None, details=None, **kwargs) -> None: + super(ResourceManagementErrorWithDetails, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_provider_operation_display_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_provider_operation_display_properties.py index 6a1f181d764a..ac328b64bb1a 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_provider_operation_display_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_provider_operation_display_properties.py @@ -35,10 +35,10 @@ class ResourceProviderOperationDisplayProperties(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, publisher=None, provider=None, resource=None, operation=None, description=None): - super(ResourceProviderOperationDisplayProperties, self).__init__() - self.publisher = publisher - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(ResourceProviderOperationDisplayProperties, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_provider_operation_display_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_provider_operation_display_properties_py3.py new file mode 100644 index 000000000000..aecc5a412673 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_provider_operation_display_properties_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceProviderOperationDisplayProperties(Model): + """Resource provider operation's display properties. + + :param publisher: Operation description. + :type publisher: str + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, publisher: str=None, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(ResourceProviderOperationDisplayProperties, self).__init__(**kwargs) + self.publisher = publisher + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_py3.py new file mode 100644 index 000000000000..ded219535f4c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_py3.py @@ -0,0 +1,53 @@ +# 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): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': 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=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resources_move_info.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resources_move_info.py index 4e927a58fb88..00f415954731 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resources_move_info.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resources_move_info.py @@ -26,7 +26,7 @@ class ResourcesMoveInfo(Model): 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, } - def __init__(self, resources=None, target_resource_group=None): - super(ResourcesMoveInfo, self).__init__() - self.resources = resources - self.target_resource_group = target_resource_group + def __init__(self, **kwargs): + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + self.target_resource_group = kwargs.get('target_resource_group', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resources_move_info_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resources_move_info_py3.py new file mode 100644 index 000000000000..f69e3e42a3d2 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resources_move_info_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourcesMoveInfo(Model): + """Parameters of move resources. + + :param resources: The ids of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + } + + def __init__(self, *, resources=None, target_resource_group: str=None, **kwargs) -> None: + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.resources = resources + self.target_resource_group = target_resource_group diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/sku.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/sku.py index eebf5da44e29..e2ced66cc962 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/sku.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/sku.py @@ -38,11 +38,11 @@ class Sku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, size=None, family=None, model=None, capacity=None): - super(Sku, self).__init__() - self.name = name - self.tier = tier - self.size = size - self.family = family - self.model = model - self.capacity = capacity + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.model = kwargs.get('model', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/sku_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/sku_py3.py new file mode 100644 index 000000000000..6b441d3d85af --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/sku_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """Sku for the resource. + + :param name: The sku name. + :type name: str + :param tier: The sku tier. + :type tier: str + :param size: The sku size. + :type size: str + :param family: The sku family. + :type family: str + :param model: The sku model. + :type model: str + :param capacity: The sku capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'model': {'key': 'model', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, tier: str=None, size: str=None, family: str=None, model: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.model = model + self.capacity = capacity diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/sub_resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/sub_resource.py index b32875f54c8e..11e092cc6ff5 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/sub_resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/sub_resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/sub_resource_py3.py new file mode 100644 index 000000000000..29e5afee38f9 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """SubResource. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_count.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_count.py index 33eef840ed51..1f0ad6d4ffe8 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_count.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_count.py @@ -26,7 +26,7 @@ class TagCount(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, type=None, value=None): - super(TagCount, self).__init__() - self.type = type - self.value = value + def __init__(self, **kwargs): + super(TagCount, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_count_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_count_py3.py new file mode 100644 index 000000000000..82c8d1ee26a5 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_count_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TagCount(Model): + """Tag count. + + :param type: Type of count. + :type type: str + :param value: Value of count. + :type value: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, value: str=None, **kwargs) -> None: + super(TagCount, self).__init__(**kwargs) + self.type = type + self.value = value diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_details.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_details.py index c47c4c59ffbc..6f13c5842129 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_details.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_details.py @@ -15,8 +15,11 @@ class TagDetails(Model): """Tag details. - :param id: The tag ID. - :type id: str + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str :param tag_name: The tag name. :type tag_name: str :param count: The tag count. @@ -26,6 +29,10 @@ class TagDetails(Model): list[~azure.mgmt.resource.resources.v2016_02_01.models.TagValue] """ + _validation = { + 'id': {'readonly': True}, + } + _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'tag_name': {'key': 'tagName', 'type': 'str'}, @@ -33,9 +40,9 @@ class TagDetails(Model): 'values': {'key': 'values', 'type': '[TagValue]'}, } - def __init__(self, id=None, tag_name=None, count=None, values=None): - super(TagDetails, self).__init__() - self.id = id - self.tag_name = tag_name - self.count = count - self.values = values + def __init__(self, **kwargs): + super(TagDetails, self).__init__(**kwargs) + self.id = None + self.tag_name = kwargs.get('tag_name', None) + self.count = kwargs.get('count', None) + self.values = kwargs.get('values', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_details_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_details_py3.py new file mode 100644 index 000000000000..1044b1cf9b05 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_details_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TagDetails(Model): + """Tag details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str + :param tag_name: The tag name. + :type tag_name: str + :param count: The tag count. + :type count: ~azure.mgmt.resource.resources.v2016_02_01.models.TagCount + :param values: The list of tag values. + :type values: + list[~azure.mgmt.resource.resources.v2016_02_01.models.TagValue] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + 'values': {'key': 'values', 'type': '[TagValue]'}, + } + + def __init__(self, *, tag_name: str=None, count=None, values=None, **kwargs) -> None: + super(TagDetails, self).__init__(**kwargs) + self.id = None + self.tag_name = tag_name + self.count = count + self.values = values diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_value.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_value.py index 37381fd2ff88..2de4f58ee20d 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_value.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_value.py @@ -15,22 +15,29 @@ class TagValue(Model): """Tag information. - :param id: The tag ID. - :type id: str + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str :param tag_value: The tag value. :type tag_value: str :param count: The tag value count. :type count: ~azure.mgmt.resource.resources.v2016_02_01.models.TagCount """ + _validation = { + 'id': {'readonly': True}, + } + _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'tag_value': {'key': 'tagValue', 'type': 'str'}, 'count': {'key': 'count', 'type': 'TagCount'}, } - def __init__(self, id=None, tag_value=None, count=None): - super(TagValue, self).__init__() - self.id = id - self.tag_value = tag_value - self.count = count + def __init__(self, **kwargs): + super(TagValue, self).__init__(**kwargs) + self.id = None + self.tag_value = kwargs.get('tag_value', None) + self.count = kwargs.get('count', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_value_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_value_py3.py new file mode 100644 index 000000000000..a9c47d2ebfbe --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/tag_value_py3.py @@ -0,0 +1,43 @@ +# 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 TagValue(Model): + """Tag information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str + :param tag_value: The tag value. + :type tag_value: str + :param count: The tag value count. + :type count: ~azure.mgmt.resource.resources.v2016_02_01.models.TagCount + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + } + + def __init__(self, *, tag_value: str=None, count=None, **kwargs) -> None: + super(TagValue, self).__init__(**kwargs) + self.id = None + self.tag_value = tag_value + self.count = count diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/target_resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/target_resource.py index 311bd74c9c2d..27d557645e8b 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/target_resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/target_resource.py @@ -29,8 +29,8 @@ class TargetResource(Model): 'resource_type': {'key': 'resourceType', 'type': 'str'}, } - def __init__(self, id=None, resource_name=None, resource_type=None): - super(TargetResource, self).__init__() - self.id = id - self.resource_name = resource_name - self.resource_type = resource_type + def __init__(self, **kwargs): + super(TargetResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.resource_name = kwargs.get('resource_name', None) + self.resource_type = kwargs.get('resource_type', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/target_resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/target_resource_py3.py new file mode 100644 index 000000000000..933347cec8f8 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/target_resource_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TargetResource(Model): + """Target resource. + + :param id: The ID of the resource. + :type id: str + :param resource_name: The name of the resource. + :type resource_name: str + :param resource_type: The type of the resource. + :type resource_type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, resource_name: str=None, resource_type: str=None, **kwargs) -> None: + super(TargetResource, self).__init__(**kwargs) + self.id = id + self.resource_name = resource_name + self.resource_type = resource_type diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/template_link.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/template_link.py index b64116192dec..5e6e03eb7bfe 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/template_link.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/template_link.py @@ -15,7 +15,9 @@ class TemplateLink(Model): """Entity representing the reference to the template. - :param uri: URI referencing the template. + All required parameters must be populated in order to send to Azure. + + :param uri: Required. URI referencing the template. :type uri: str :param content_version: If included it must match the ContentVersion in the template. @@ -31,7 +33,7 @@ class TemplateLink(Model): 'content_version': {'key': 'contentVersion', 'type': 'str'}, } - def __init__(self, uri, content_version=None): - super(TemplateLink, self).__init__() - self.uri = uri - self.content_version = content_version + def __init__(self, **kwargs): + super(TemplateLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.content_version = kwargs.get('content_version', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/template_link_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/template_link_py3.py new file mode 100644 index 000000000000..0e4e9016e093 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/template_link_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TemplateLink(Model): + """Entity representing the reference to the template. + + All required parameters must be populated in order to send to Azure. + + :param uri: Required. URI referencing the template. + :type uri: str + :param content_version: If included it must match the ContentVersion in + the template. + :type content_version: str + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + } + + def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: + super(TemplateLink, self).__init__(**kwargs) + self.uri = uri + self.content_version = content_version diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/deployments_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/deployments_operations.py index 868d350bd3b8..2347f80715d5 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/deployments_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/deployments_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): """Delete deployment. :param resource_group_name: The name of the resource group. The name @@ -88,12 +88,14 @@ def delete( :param deployment_name: The name of the deployment to be deleted. :type deployment_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -103,40 +105,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} def check_existence( @@ -251,7 +232,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, deployment_name, properties=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, deployment_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): """Create a named template deployment using a template. :param resource_group_name: The name of the resource group. The name @@ -263,13 +244,16 @@ def create_or_update( :type properties: ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentProperties :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - DeploymentExtended or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentExtended or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentExtended] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentExtended]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +264,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('DeploymentExtended', response) if raw: @@ -312,12 +274,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} def get( diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/resource_groups_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/resource_groups_operations.py index 65f11a23e74f..bf1ba4aa5346 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/resource_groups_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/resource_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -285,19 +285,21 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Delete resource group. :param resource_group_name: The name of the resource group to be deleted. The name is case insensitive. :type resource_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -306,40 +308,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} def get( diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/resources_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/resources_operations.py index f75ad84f5d05..0a26d58f5bc3 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/resources_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/resources_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -84,7 +84,7 @@ def _move_resources_initial( return client_raw_response def move_resources( - self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, **operation_config): + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, polling=True, **operation_config): """Move resources from one resource group to another. The resources being moved should all be in the same resource group. @@ -95,12 +95,14 @@ def move_resources( :param target_resource_group: The target resource group. :type target_resource_group: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._move_resources_initial( @@ -111,40 +113,19 @@ def move_resources( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) move_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources'} def list( @@ -497,7 +478,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a resource. :param resource_group_name: The name of the resource group for the @@ -518,13 +499,16 @@ def update( :type parameters: ~azure.mgmt.resource.resources.v2016_02_01.models.GenericResource :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GenericResource or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2016_02_01.models.GenericResource] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2016_02_01.models.GenericResource]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -539,30 +523,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GenericResource', response) if raw: @@ -571,12 +533,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} def get( diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/resource_management_client.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/resource_management_client.py index bc8a7a9b1ca8..3870480becf6 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/resource_management_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/resource_management_client.py @@ -9,7 +9,7 @@ # 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 @@ -56,7 +56,7 @@ def __init__( self.subscription_id = subscription_id -class ResourceManagementClient(object): +class ResourceManagementClient(SDKClient): """ResourceManagementClient :ivar config: Configuration for client. @@ -89,7 +89,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = ResourceManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(ResourceManagementClient, 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 = '2016-02-01' diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py index a40ca771976b..c5534984cdc7 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py @@ -9,44 +9,84 @@ # regenerated. # -------------------------------------------------------------------------- -from .deployment_extended_filter import DeploymentExtendedFilter -from .generic_resource_filter import GenericResourceFilter -from .resource_group_filter import ResourceGroupFilter -from .template_link import TemplateLink -from .parameters_link import ParametersLink -from .debug_setting import DebugSetting -from .deployment_properties import DeploymentProperties -from .deployment import Deployment -from .deployment_export_result import DeploymentExportResult -from .resource_management_error_with_details import ResourceManagementErrorWithDetails -from .alias_path_type import AliasPathType -from .alias_type import AliasType -from .provider_resource_type import ProviderResourceType -from .provider import Provider -from .basic_dependency import BasicDependency -from .dependency import Dependency -from .deployment_properties_extended import DeploymentPropertiesExtended -from .deployment_validate_result import DeploymentValidateResult -from .deployment_extended import DeploymentExtended -from .plan import Plan -from .sku import Sku -from .identity import Identity -from .generic_resource import GenericResource -from .resource_group_properties import ResourceGroupProperties -from .resource_group import ResourceGroup -from .resources_move_info import ResourcesMoveInfo -from .export_template_request import ExportTemplateRequest -from .tag_count import TagCount -from .tag_value import TagValue -from .tag_details import TagDetails -from .target_resource import TargetResource -from .http_message import HttpMessage -from .deployment_operation_properties import DeploymentOperationProperties -from .deployment_operation import DeploymentOperation -from .resource_provider_operation_display_properties import ResourceProviderOperationDisplayProperties -from .resource import Resource -from .sub_resource import SubResource -from .resource_group_export_result import ResourceGroupExportResult +try: + from .deployment_extended_filter_py3 import DeploymentExtendedFilter + from .generic_resource_filter_py3 import GenericResourceFilter + from .resource_group_filter_py3 import ResourceGroupFilter + from .template_link_py3 import TemplateLink + from .parameters_link_py3 import ParametersLink + from .debug_setting_py3 import DebugSetting + from .deployment_properties_py3 import DeploymentProperties + from .deployment_py3 import Deployment + from .deployment_export_result_py3 import DeploymentExportResult + from .resource_management_error_with_details_py3 import ResourceManagementErrorWithDetails + from .alias_path_type_py3 import AliasPathType + from .alias_type_py3 import AliasType + from .provider_resource_type_py3 import ProviderResourceType + from .provider_py3 import Provider + from .basic_dependency_py3 import BasicDependency + from .dependency_py3 import Dependency + from .deployment_properties_extended_py3 import DeploymentPropertiesExtended + from .deployment_validate_result_py3 import DeploymentValidateResult + from .deployment_extended_py3 import DeploymentExtended + from .plan_py3 import Plan + from .sku_py3 import Sku + from .identity_py3 import Identity + from .generic_resource_py3 import GenericResource + from .resource_group_properties_py3 import ResourceGroupProperties + from .resource_group_py3 import ResourceGroup + from .resources_move_info_py3 import ResourcesMoveInfo + from .export_template_request_py3 import ExportTemplateRequest + from .tag_count_py3 import TagCount + from .tag_value_py3 import TagValue + from .tag_details_py3 import TagDetails + from .target_resource_py3 import TargetResource + from .http_message_py3 import HttpMessage + from .deployment_operation_properties_py3 import DeploymentOperationProperties + from .deployment_operation_py3 import DeploymentOperation + from .resource_provider_operation_display_properties_py3 import ResourceProviderOperationDisplayProperties + from .resource_py3 import Resource + from .sub_resource_py3 import SubResource + from .resource_group_export_result_py3 import ResourceGroupExportResult +except (SyntaxError, ImportError): + from .deployment_extended_filter import DeploymentExtendedFilter + from .generic_resource_filter import GenericResourceFilter + from .resource_group_filter import ResourceGroupFilter + from .template_link import TemplateLink + from .parameters_link import ParametersLink + from .debug_setting import DebugSetting + from .deployment_properties import DeploymentProperties + from .deployment import Deployment + from .deployment_export_result import DeploymentExportResult + from .resource_management_error_with_details import ResourceManagementErrorWithDetails + from .alias_path_type import AliasPathType + from .alias_type import AliasType + from .provider_resource_type import ProviderResourceType + from .provider import Provider + from .basic_dependency import BasicDependency + from .dependency import Dependency + from .deployment_properties_extended import DeploymentPropertiesExtended + from .deployment_validate_result import DeploymentValidateResult + from .deployment_extended import DeploymentExtended + from .plan import Plan + from .sku import Sku + from .identity import Identity + from .generic_resource import GenericResource + from .resource_group_properties import ResourceGroupProperties + from .resource_group import ResourceGroup + from .resources_move_info import ResourcesMoveInfo + from .export_template_request import ExportTemplateRequest + from .tag_count import TagCount + from .tag_value import TagValue + from .tag_details import TagDetails + from .target_resource import TargetResource + from .http_message import HttpMessage + from .deployment_operation_properties import DeploymentOperationProperties + from .deployment_operation import DeploymentOperation + from .resource_provider_operation_display_properties import ResourceProviderOperationDisplayProperties + from .resource import Resource + from .sub_resource import SubResource + from .resource_group_export_result import ResourceGroupExportResult from .deployment_extended_paged import DeploymentExtendedPaged from .provider_paged import ProviderPaged from .generic_resource_paged import GenericResourcePaged diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/alias_path_type.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/alias_path_type.py index 35ffbb1ca154..ee5959ef5463 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/alias_path_type.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/alias_path_type.py @@ -26,7 +26,7 @@ class AliasPathType(Model): 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, } - def __init__(self, path=None, api_versions=None): - super(AliasPathType, self).__init__() - self.path = path - self.api_versions = api_versions + def __init__(self, **kwargs): + super(AliasPathType, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.api_versions = kwargs.get('api_versions', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/alias_path_type_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/alias_path_type_py3.py new file mode 100644 index 000000000000..ccd48141f917 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/alias_path_type_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AliasPathType(Model): + """The type of the paths for alias. . + + :param path: The path of an alias. + :type path: str + :param api_versions: The API versions. + :type api_versions: list[str] + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + } + + def __init__(self, *, path: str=None, api_versions=None, **kwargs) -> None: + super(AliasPathType, self).__init__(**kwargs) + self.path = path + self.api_versions = api_versions diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/alias_type.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/alias_type.py index 2342d5e88a26..50529e5cf312 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/alias_type.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/alias_type.py @@ -27,7 +27,7 @@ class AliasType(Model): 'paths': {'key': 'paths', 'type': '[AliasPathType]'}, } - def __init__(self, name=None, paths=None): - super(AliasType, self).__init__() - self.name = name - self.paths = paths + def __init__(self, **kwargs): + super(AliasType, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.paths = kwargs.get('paths', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/alias_type_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/alias_type_py3.py new file mode 100644 index 000000000000..c4df9f929765 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/alias_type_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AliasType(Model): + """The alias type. . + + :param name: The alias name. + :type name: str + :param paths: The paths for an alias. + :type paths: + list[~azure.mgmt.resource.resources.v2016_09_01.models.AliasPathType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'paths': {'key': 'paths', 'type': '[AliasPathType]'}, + } + + def __init__(self, *, name: str=None, paths=None, **kwargs) -> None: + super(AliasType, self).__init__(**kwargs) + self.name = name + self.paths = paths diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/basic_dependency.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/basic_dependency.py index d16931dabd70..3a5ccd4aa464 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/basic_dependency.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/basic_dependency.py @@ -29,8 +29,8 @@ class BasicDependency(Model): 'resource_name': {'key': 'resourceName', 'type': 'str'}, } - def __init__(self, id=None, resource_type=None, resource_name=None): - super(BasicDependency, self).__init__() - self.id = id - self.resource_type = resource_type - self.resource_name = resource_name + def __init__(self, **kwargs): + super(BasicDependency, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_name = kwargs.get('resource_name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/basic_dependency_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/basic_dependency_py3.py new file mode 100644 index 000000000000..49d821737930 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/basic_dependency_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BasicDependency(Model): + """Deployment dependency information. + + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, resource_type: str=None, resource_name: str=None, **kwargs) -> None: + super(BasicDependency, self).__init__(**kwargs) + self.id = id + self.resource_type = resource_type + self.resource_name = resource_name diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/debug_setting.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/debug_setting.py index e908a46b1c52..d6f778c5c86d 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/debug_setting.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/debug_setting.py @@ -29,6 +29,6 @@ class DebugSetting(Model): 'detail_level': {'key': 'detailLevel', 'type': 'str'}, } - def __init__(self, detail_level=None): - super(DebugSetting, self).__init__() - self.detail_level = detail_level + def __init__(self, **kwargs): + super(DebugSetting, self).__init__(**kwargs) + self.detail_level = kwargs.get('detail_level', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/debug_setting_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/debug_setting_py3.py new file mode 100644 index 000000000000..af571a729762 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/debug_setting_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DebugSetting(Model): + """DebugSetting. + + :param detail_level: Specifies the type of information to log for + debugging. The permitted values are none, requestContent, responseContent, + or both requestContent and responseContent separated by a comma. The + default is none. When setting this value, carefully consider the type of + information you are passing in during deployment. By logging information + about the request or response, you could potentially expose sensitive data + that is retrieved through the deployment operations. + :type detail_level: str + """ + + _attribute_map = { + 'detail_level': {'key': 'detailLevel', 'type': 'str'}, + } + + def __init__(self, *, detail_level: str=None, **kwargs) -> None: + super(DebugSetting, self).__init__(**kwargs) + self.detail_level = detail_level diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/dependency.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/dependency.py index 9f16592f4c71..eaea8dbcb8ab 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/dependency.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/dependency.py @@ -33,9 +33,9 @@ class Dependency(Model): 'resource_name': {'key': 'resourceName', 'type': 'str'}, } - def __init__(self, depends_on=None, id=None, resource_type=None, resource_name=None): - super(Dependency, self).__init__() - self.depends_on = depends_on - self.id = id - self.resource_type = resource_type - self.resource_name = resource_name + def __init__(self, **kwargs): + super(Dependency, self).__init__(**kwargs) + self.depends_on = kwargs.get('depends_on', None) + self.id = kwargs.get('id', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_name = kwargs.get('resource_name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/dependency_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/dependency_py3.py new file mode 100644 index 000000000000..adecd1f20f4b --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/dependency_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Dependency(Model): + """Deployment dependency information. + + :param depends_on: The list of dependencies. + :type depends_on: + list[~azure.mgmt.resource.resources.v2016_09_01.models.BasicDependency] + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'depends_on': {'key': 'dependsOn', 'type': '[BasicDependency]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, *, depends_on=None, id: str=None, resource_type: str=None, resource_name: str=None, **kwargs) -> None: + super(Dependency, self).__init__(**kwargs) + self.depends_on = depends_on + self.id = id + self.resource_type = resource_type + self.resource_name = resource_name diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment.py index 85bca89b1e79..8e0456aeb00d 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment.py @@ -15,7 +15,9 @@ class Deployment(Model): """Deployment operation parameters. - :param properties: The deployment properties. + All required parameters must be populated in order to send to Azure. + + :param properties: Required. The deployment properties. :type properties: ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentProperties """ @@ -28,6 +30,6 @@ class Deployment(Model): 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, } - def __init__(self, properties): - super(Deployment, self).__init__() - self.properties = properties + def __init__(self, **kwargs): + super(Deployment, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_export_result.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_export_result.py index 8834a8cd1ccb..807e79c8b678 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_export_result.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_export_result.py @@ -23,6 +23,6 @@ class DeploymentExportResult(Model): 'template': {'key': 'template', 'type': 'object'}, } - def __init__(self, template=None): - super(DeploymentExportResult, self).__init__() - self.template = template + def __init__(self, **kwargs): + super(DeploymentExportResult, self).__init__(**kwargs) + self.template = kwargs.get('template', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_export_result_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_export_result_py3.py new file mode 100644 index 000000000000..63f10bf2735a --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_export_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExportResult(Model): + """The deployment export result. . + + :param template: The template content. + :type template: object + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, *, template=None, **kwargs) -> None: + super(DeploymentExportResult, self).__init__(**kwargs) + self.template = template diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended.py index 68e0ad89b171..60c1bbe9c93e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended.py @@ -15,9 +15,14 @@ class DeploymentExtended(Model): """Deployment information. - :param id: The ID of the deployment. - :type id: str - :param name: The name of the deployment. + 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 ID of the deployment. + :vartype id: str + :param name: Required. The name of the deployment. :type name: str :param properties: Deployment properties. :type properties: @@ -25,6 +30,7 @@ class DeploymentExtended(Model): """ _validation = { + 'id': {'readonly': True}, 'name': {'required': True}, } @@ -34,8 +40,8 @@ class DeploymentExtended(Model): 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, } - def __init__(self, name, id=None, properties=None): - super(DeploymentExtended, self).__init__() - self.id = id - self.name = name - self.properties = properties + def __init__(self, **kwargs): + super(DeploymentExtended, self).__init__(**kwargs) + self.id = None + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended_filter.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended_filter.py index 45bb10fa20b0..0839bcc12e4e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended_filter.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended_filter.py @@ -23,6 +23,6 @@ class DeploymentExtendedFilter(Model): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } - def __init__(self, provisioning_state=None): - super(DeploymentExtendedFilter, self).__init__() - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(DeploymentExtendedFilter, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended_filter_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended_filter_py3.py new file mode 100644 index 000000000000..f06d0d1a4dfb --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended_filter_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExtendedFilter(Model): + """Deployment filter. + + :param provisioning_state: The provisioning state. + :type provisioning_state: str + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, provisioning_state: str=None, **kwargs) -> None: + super(DeploymentExtendedFilter, self).__init__(**kwargs) + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended_py3.py new file mode 100644 index 000000000000..63c91e2a377f --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExtended(Model): + """Deployment information. + + 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 ID of the deployment. + :vartype id: str + :param name: Required. The name of the deployment. + :type name: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentPropertiesExtended + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + } + + def __init__(self, *, name: str, properties=None, **kwargs) -> None: + super(DeploymentExtended, self).__init__(**kwargs) + self.id = None + self.name = name + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_operation.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_operation.py index a2d4db889707..03f068a75209 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_operation.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_operation.py @@ -38,8 +38,8 @@ class DeploymentOperation(Model): 'properties': {'key': 'properties', 'type': 'DeploymentOperationProperties'}, } - def __init__(self, properties=None): - super(DeploymentOperation, self).__init__() + def __init__(self, **kwargs): + super(DeploymentOperation, self).__init__(**kwargs) self.id = None self.operation_id = None - self.properties = properties + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_operation_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_operation_properties.py index f266797d7dda..b419f384d996 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_operation_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_operation_properties.py @@ -61,8 +61,8 @@ class DeploymentOperationProperties(Model): 'response': {'key': 'response', 'type': 'HttpMessage'}, } - def __init__(self): - super(DeploymentOperationProperties, self).__init__() + def __init__(self, **kwargs): + super(DeploymentOperationProperties, self).__init__(**kwargs) self.provisioning_state = None self.timestamp = None self.service_request_id = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_operation_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_operation_properties_py3.py new file mode 100644 index 000000000000..5f38d5397dac --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_operation_properties_py3.py @@ -0,0 +1,73 @@ +# 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 DeploymentOperationProperties(Model): + """Deployment operation properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the provisioning. + :vartype provisioning_state: str + :ivar timestamp: The date and time of the operation. + :vartype timestamp: datetime + :ivar service_request_id: Deployment operation service request id. + :vartype service_request_id: str + :ivar status_code: Operation status code. + :vartype status_code: str + :ivar status_message: Operation status message. + :vartype status_message: object + :ivar target_resource: The target resource. + :vartype target_resource: + ~azure.mgmt.resource.resources.v2016_09_01.models.TargetResource + :ivar request: The HTTP request message. + :vartype request: + ~azure.mgmt.resource.resources.v2016_09_01.models.HttpMessage + :ivar response: The HTTP response message. + :vartype response: + ~azure.mgmt.resource.resources.v2016_09_01.models.HttpMessage + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'service_request_id': {'readonly': True}, + 'status_code': {'readonly': True}, + 'status_message': {'readonly': True}, + 'target_resource': {'readonly': True}, + 'request': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'service_request_id': {'key': 'serviceRequestId', 'type': 'str'}, + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'status_message': {'key': 'statusMessage', 'type': 'object'}, + 'target_resource': {'key': 'targetResource', 'type': 'TargetResource'}, + 'request': {'key': 'request', 'type': 'HttpMessage'}, + 'response': {'key': 'response', 'type': 'HttpMessage'}, + } + + def __init__(self, **kwargs) -> None: + super(DeploymentOperationProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.timestamp = None + self.service_request_id = None + self.status_code = None + self.status_message = None + self.target_resource = None + self.request = None + self.response = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_operation_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_operation_py3.py new file mode 100644 index 000000000000..04e8dd066bb5 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_operation_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentOperation(Model): + """Deployment operation information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Full deployment operation ID. + :vartype id: str + :ivar operation_id: Deployment operation ID. + :vartype operation_id: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentOperationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentOperationProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(DeploymentOperation, self).__init__(**kwargs) + self.id = None + self.operation_id = None + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_properties.py index 0f39ffe4e9c4..fc2c23d46783 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_properties.py @@ -15,6 +15,8 @@ class DeploymentProperties(Model): """Deployment properties. + All required parameters must be populated in order to send to Azure. + :param template: The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use @@ -36,13 +38,14 @@ class DeploymentProperties(Model): property or the parameters property, but not both. :type parameters_link: ~azure.mgmt.resource.resources.v2016_09_01.models.ParametersLink - :param mode: The mode that is used to deploy resources. This value can be - either Incremental or Complete. In Incremental mode, resources are - deployed without deleting existing resources that are not included in the - template. In Complete mode, resources are deployed and existing resources - in the resource group that are not included in the template are deleted. - Be careful when using Complete mode as you may unintentionally delete - resources. Possible values include: 'Incremental', 'Complete' + :param mode: Required. The mode that is used to deploy resources. This + value can be either Incremental or Complete. In Incremental mode, + resources are deployed without deleting existing resources that are not + included in the template. In Complete mode, resources are deployed and + existing resources in the resource group that are not included in the + template are deleted. Be careful when using Complete mode as you may + unintentionally delete resources. Possible values include: 'Incremental', + 'Complete' :type mode: str or ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentMode :param debug_setting: The debug setting of the deployment. @@ -63,11 +66,11 @@ class DeploymentProperties(Model): 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, } - def __init__(self, mode, template=None, template_link=None, parameters=None, parameters_link=None, debug_setting=None): - super(DeploymentProperties, self).__init__() - self.template = template - self.template_link = template_link - self.parameters = parameters - self.parameters_link = parameters_link - self.mode = mode - self.debug_setting = debug_setting + def __init__(self, **kwargs): + super(DeploymentProperties, self).__init__(**kwargs) + self.template = kwargs.get('template', None) + self.template_link = kwargs.get('template_link', None) + self.parameters = kwargs.get('parameters', None) + self.parameters_link = kwargs.get('parameters_link', None) + self.mode = kwargs.get('mode', None) + self.debug_setting = kwargs.get('debug_setting', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_properties_extended.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_properties_extended.py index c918bca37c2d..e95f6889239a 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_properties_extended.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_properties_extended.py @@ -77,17 +77,17 @@ class DeploymentPropertiesExtended(Model): 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, } - def __init__(self, outputs=None, providers=None, dependencies=None, template=None, template_link=None, parameters=None, parameters_link=None, mode=None, debug_setting=None): - super(DeploymentPropertiesExtended, self).__init__() + def __init__(self, **kwargs): + super(DeploymentPropertiesExtended, self).__init__(**kwargs) self.provisioning_state = None self.correlation_id = None self.timestamp = None - self.outputs = outputs - self.providers = providers - self.dependencies = dependencies - self.template = template - self.template_link = template_link - self.parameters = parameters - self.parameters_link = parameters_link - self.mode = mode - self.debug_setting = debug_setting + self.outputs = kwargs.get('outputs', None) + self.providers = kwargs.get('providers', None) + self.dependencies = kwargs.get('dependencies', None) + self.template = kwargs.get('template', None) + self.template_link = kwargs.get('template_link', None) + self.parameters = kwargs.get('parameters', None) + self.parameters_link = kwargs.get('parameters_link', None) + self.mode = kwargs.get('mode', None) + self.debug_setting = kwargs.get('debug_setting', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_properties_extended_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_properties_extended_py3.py new file mode 100644 index 000000000000..c38d218f11b6 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_properties_extended_py3.py @@ -0,0 +1,93 @@ +# 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 DeploymentPropertiesExtended(Model): + """Deployment properties with additional details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the provisioning. + :vartype provisioning_state: str + :ivar correlation_id: The correlation ID of the deployment. + :vartype correlation_id: str + :ivar timestamp: The timestamp of the template deployment. + :vartype timestamp: datetime + :param outputs: Key/value pairs that represent deploymentoutput. + :type outputs: object + :param providers: The list of resource providers needed for the + deployment. + :type providers: + list[~azure.mgmt.resource.resources.v2016_09_01.models.Provider] + :param dependencies: The list of deployment dependencies. + :type dependencies: + list[~azure.mgmt.resource.resources.v2016_09_01.models.Dependency] + :param template: The template content. Use only one of Template or + TemplateLink. + :type template: object + :param template_link: The URI referencing the template. Use only one of + Template or TemplateLink. + :type template_link: + ~azure.mgmt.resource.resources.v2016_09_01.models.TemplateLink + :param parameters: Deployment parameters. Use only one of Parameters or + ParametersLink. + :type parameters: object + :param parameters_link: The URI referencing the parameters. Use only one + of Parameters or ParametersLink. + :type parameters_link: + ~azure.mgmt.resource.resources.v2016_09_01.models.ParametersLink + :param mode: The deployment mode. Possible values are Incremental and + Complete. Possible values include: 'Incremental', 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2016_09_01.models.DebugSetting + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'timestamp': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'providers': {'key': 'providers', 'type': '[Provider]'}, + 'dependencies': {'key': 'dependencies', 'type': '[Dependency]'}, + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + } + + def __init__(self, *, outputs=None, providers=None, dependencies=None, template=None, template_link=None, parameters=None, parameters_link=None, mode=None, debug_setting=None, **kwargs) -> None: + super(DeploymentPropertiesExtended, self).__init__(**kwargs) + self.provisioning_state = None + self.correlation_id = None + self.timestamp = None + self.outputs = outputs + self.providers = providers + self.dependencies = dependencies + self.template = template + self.template_link = template_link + self.parameters = parameters + self.parameters_link = parameters_link + self.mode = mode + self.debug_setting = debug_setting diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_properties_py3.py new file mode 100644 index 000000000000..962216f1a0a5 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_properties_py3.py @@ -0,0 +1,76 @@ +# 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 DeploymentProperties(Model): + """Deployment properties. + + All required parameters must be populated in order to send to Azure. + + :param template: The template content. You use this element when you want + to pass the template syntax directly in the request rather than link to an + existing template. It can be a JObject or well-formed JSON string. Use + either the templateLink property or the template property, but not both. + :type template: object + :param template_link: The URI of the template. Use either the templateLink + property or the template property, but not both. + :type template_link: + ~azure.mgmt.resource.resources.v2016_09_01.models.TemplateLink + :param parameters: Name and value pairs that define the deployment + parameters for the template. You use this element when you want to provide + the parameter values directly in the request rather than link to an + existing parameter file. Use either the parametersLink property or the + parameters property, but not both. It can be a JObject or a well formed + JSON string. + :type parameters: object + :param parameters_link: The URI of parameters file. You use this element + to link to an existing parameters file. Use either the parametersLink + property or the parameters property, but not both. + :type parameters_link: + ~azure.mgmt.resource.resources.v2016_09_01.models.ParametersLink + :param mode: Required. The mode that is used to deploy resources. This + value can be either Incremental or Complete. In Incremental mode, + resources are deployed without deleting existing resources that are not + included in the template. In Complete mode, resources are deployed and + existing resources in the resource group that are not included in the + template are deleted. Be careful when using Complete mode as you may + unintentionally delete resources. Possible values include: 'Incremental', + 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2016_09_01.models.DebugSetting + """ + + _validation = { + 'mode': {'required': True}, + } + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + } + + def __init__(self, *, mode, template=None, template_link=None, parameters=None, parameters_link=None, debug_setting=None, **kwargs) -> None: + super(DeploymentProperties, self).__init__(**kwargs) + self.template = template + self.template_link = template_link + self.parameters = parameters + self.parameters_link = parameters_link + self.mode = mode + self.debug_setting = debug_setting diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_py3.py new file mode 100644 index 000000000000..415f35e07862 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_py3.py @@ -0,0 +1,35 @@ +# 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 Deployment(Model): + """Deployment operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentProperties + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + } + + def __init__(self, *, properties, **kwargs) -> None: + super(Deployment, self).__init__(**kwargs) + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_validate_result.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_validate_result.py index 910d827ec9f7..3e454cc4b390 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_validate_result.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_validate_result.py @@ -28,7 +28,7 @@ class DeploymentValidateResult(Model): 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, } - def __init__(self, error=None, properties=None): - super(DeploymentValidateResult, self).__init__() - self.error = error - self.properties = properties + def __init__(self, **kwargs): + super(DeploymentValidateResult, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_validate_result_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_validate_result_py3.py new file mode 100644 index 000000000000..5f2c3db1fd22 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_validate_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentValidateResult(Model): + """Information from validate template deployment response. + + :param error: Validation error. + :type error: + ~azure.mgmt.resource.resources.v2016_09_01.models.ResourceManagementErrorWithDetails + :param properties: The template deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentPropertiesExtended + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ResourceManagementErrorWithDetails'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + } + + def __init__(self, *, error=None, properties=None, **kwargs) -> None: + super(DeploymentValidateResult, self).__init__(**kwargs) + self.error = error + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/export_template_request.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/export_template_request.py index d39261d5fb13..069bfbb70632 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/export_template_request.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/export_template_request.py @@ -30,7 +30,7 @@ class ExportTemplateRequest(Model): 'options': {'key': 'options', 'type': 'str'}, } - def __init__(self, resources=None, options=None): - super(ExportTemplateRequest, self).__init__() - self.resources = resources - self.options = options + def __init__(self, **kwargs): + super(ExportTemplateRequest, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + self.options = kwargs.get('options', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/export_template_request_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/export_template_request_py3.py new file mode 100644 index 000000000000..2374c103d566 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/export_template_request_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportTemplateRequest(Model): + """Export resource group template request parameters. + + :param resources: The IDs of the resources. The only supported string + currently is '*' (all resources). Future updates will support exporting + specific resources. + :type resources: list[str] + :param options: The export template options. Supported values include + 'IncludeParameterDefaultValue', 'IncludeComments' or + 'IncludeParameterDefaultValue, IncludeComments + :type options: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'options': {'key': 'options', 'type': 'str'}, + } + + def __init__(self, *, resources=None, options: str=None, **kwargs) -> None: + super(ExportTemplateRequest, self).__init__(**kwargs) + self.resources = resources + self.options = options diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/generic_resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/generic_resource.py index 22b5c9ae7fe7..44b6cf1eb592 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/generic_resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/generic_resource.py @@ -63,11 +63,11 @@ class GenericResource(Resource): 'identity': {'key': 'identity', 'type': 'Identity'}, } - def __init__(self, location=None, tags=None, plan=None, properties=None, kind=None, managed_by=None, sku=None, identity=None): - super(GenericResource, self).__init__(location=location, tags=tags) - self.plan = plan - self.properties = properties - self.kind = kind - self.managed_by = managed_by - self.sku = sku - self.identity = identity + def __init__(self, **kwargs): + super(GenericResource, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.properties = kwargs.get('properties', None) + self.kind = kwargs.get('kind', None) + self.managed_by = kwargs.get('managed_by', None) + self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/generic_resource_filter.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/generic_resource_filter.py index a31e587e849a..c4488f4cf095 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/generic_resource_filter.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/generic_resource_filter.py @@ -29,8 +29,8 @@ class GenericResourceFilter(Model): 'tagvalue': {'key': 'tagvalue', 'type': 'str'}, } - def __init__(self, resource_type=None, tagname=None, tagvalue=None): - super(GenericResourceFilter, self).__init__() - self.resource_type = resource_type - self.tagname = tagname - self.tagvalue = tagvalue + def __init__(self, **kwargs): + super(GenericResourceFilter, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.tagname = kwargs.get('tagname', None) + self.tagvalue = kwargs.get('tagvalue', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/generic_resource_filter_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/generic_resource_filter_py3.py new file mode 100644 index 000000000000..17ad0e58c55c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/generic_resource_filter_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GenericResourceFilter(Model): + """Resource filter. + + :param resource_type: The resource type. + :type resource_type: str + :param tagname: The tag name. + :type tagname: str + :param tagvalue: The tag value. + :type tagvalue: str + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'tagname': {'key': 'tagname', 'type': 'str'}, + 'tagvalue': {'key': 'tagvalue', 'type': 'str'}, + } + + def __init__(self, *, resource_type: str=None, tagname: str=None, tagvalue: str=None, **kwargs) -> None: + super(GenericResourceFilter, self).__init__(**kwargs) + self.resource_type = resource_type + self.tagname = tagname + self.tagvalue = tagvalue diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/generic_resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/generic_resource_py3.py new file mode 100644 index 000000000000..de1bc15f2733 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/generic_resource_py3.py @@ -0,0 +1,73 @@ +# 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 GenericResource(Resource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2016_09_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2016_09_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2016_09_01.models.Identity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + } + + _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}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResource, self).__init__(location=location, tags=tags, **kwargs) + self.plan = plan + self.properties = properties + self.kind = kind + self.managed_by = managed_by + self.sku = sku + self.identity = identity diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/http_message.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/http_message.py index 569a4d843f61..f6e080babaf1 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/http_message.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/http_message.py @@ -23,6 +23,6 @@ class HttpMessage(Model): 'content': {'key': 'content', 'type': 'object'}, } - def __init__(self, content=None): - super(HttpMessage, self).__init__() - self.content = content + def __init__(self, **kwargs): + super(HttpMessage, self).__init__(**kwargs) + self.content = kwargs.get('content', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/http_message_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/http_message_py3.py new file mode 100644 index 000000000000..0fe8e057876a --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/http_message_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class HttpMessage(Model): + """HttpMessage. + + :param content: HTTP message content. + :type content: object + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'object'}, + } + + def __init__(self, *, content=None, **kwargs) -> None: + super(HttpMessage, self).__init__(**kwargs) + self.content = content diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/identity.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/identity.py index 0d3f1e546254..8f1adb1fd10a 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/identity.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/identity.py @@ -38,8 +38,8 @@ class Identity(Model): 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, } - def __init__(self, type=None): - super(Identity, self).__init__() + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = type + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/identity_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/identity_py3.py new file mode 100644 index 000000000000..8b22c328ada6 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/identity_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned' + :type type: str or + ~azure.mgmt.resource.resources.v2016_09_01.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/parameters_link.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/parameters_link.py index ca52e7df302c..c436b9d4ab6e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/parameters_link.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/parameters_link.py @@ -15,7 +15,9 @@ class ParametersLink(Model): """Entity representing the reference to the deployment paramaters. - :param uri: The URI of the parameters file. + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the parameters file. :type uri: str :param content_version: If included, must match the ContentVersion in the template. @@ -31,7 +33,7 @@ class ParametersLink(Model): 'content_version': {'key': 'contentVersion', 'type': 'str'}, } - def __init__(self, uri, content_version=None): - super(ParametersLink, self).__init__() - self.uri = uri - self.content_version = content_version + def __init__(self, **kwargs): + super(ParametersLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.content_version = kwargs.get('content_version', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/parameters_link_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/parameters_link_py3.py new file mode 100644 index 000000000000..52bc9723fa3e --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/parameters_link_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ParametersLink(Model): + """Entity representing the reference to the deployment paramaters. + + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the parameters file. + :type uri: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + } + + def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: + super(ParametersLink, self).__init__(**kwargs) + self.uri = uri + self.content_version = content_version diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/plan.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/plan.py index 8909aa831135..b0052f4344ea 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/plan.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/plan.py @@ -32,9 +32,9 @@ class Plan(Model): 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, } - def __init__(self, name=None, publisher=None, product=None, promotion_code=None): - super(Plan, self).__init__() - self.name = name - self.publisher = publisher - self.product = product - self.promotion_code = promotion_code + def __init__(self, **kwargs): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/plan_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/plan_py3.py new file mode 100644 index 000000000000..59da139a551e --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/plan_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Plan(Model): + """Plan for the resource. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The offer ID. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, product: str=None, promotion_code: str=None, **kwargs) -> None: + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/provider.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/provider.py index f11983358e13..04dc2c801611 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/provider.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/provider.py @@ -42,9 +42,9 @@ class Provider(Model): 'resource_types': {'key': 'resourceTypes', 'type': '[ProviderResourceType]'}, } - def __init__(self, namespace=None): - super(Provider, self).__init__() + def __init__(self, **kwargs): + super(Provider, self).__init__(**kwargs) self.id = None - self.namespace = namespace + self.namespace = kwargs.get('namespace', None) self.registration_state = None self.resource_types = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/provider_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/provider_py3.py new file mode 100644 index 000000000000..b830cf9023cc --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/provider_py3.py @@ -0,0 +1,50 @@ +# 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 Provider(Model): + """Resource provider information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The provider ID. + :vartype id: str + :param namespace: The namespace of the resource provider. + :type namespace: str + :ivar registration_state: The registration state of the provider. + :vartype registration_state: str + :ivar resource_types: The collection of provider resource types. + :vartype resource_types: + list[~azure.mgmt.resource.resources.v2016_09_01.models.ProviderResourceType] + """ + + _validation = { + 'id': {'readonly': True}, + 'registration_state': {'readonly': True}, + 'resource_types': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'registration_state': {'key': 'registrationState', 'type': 'str'}, + 'resource_types': {'key': 'resourceTypes', 'type': '[ProviderResourceType]'}, + } + + def __init__(self, *, namespace: str=None, **kwargs) -> None: + super(Provider, self).__init__(**kwargs) + self.id = None + self.namespace = namespace + self.registration_state = None + self.resource_types = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/provider_resource_type.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/provider_resource_type.py index 24be8ddd42b5..b87867ad0a86 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/provider_resource_type.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/provider_resource_type.py @@ -37,10 +37,10 @@ class ProviderResourceType(Model): 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, resource_type=None, locations=None, aliases=None, api_versions=None, properties=None): - super(ProviderResourceType, self).__init__() - self.resource_type = resource_type - self.locations = locations - self.aliases = aliases - self.api_versions = api_versions - self.properties = properties + def __init__(self, **kwargs): + super(ProviderResourceType, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.locations = kwargs.get('locations', None) + self.aliases = kwargs.get('aliases', None) + self.api_versions = kwargs.get('api_versions', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/provider_resource_type_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/provider_resource_type_py3.py new file mode 100644 index 000000000000..9f07228051e7 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/provider_resource_type_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ProviderResourceType(Model): + """Resource type managed by the resource provider. + + :param resource_type: The resource type. + :type resource_type: str + :param locations: The collection of locations where this resource type can + be created. + :type locations: list[str] + :param aliases: The aliases that are supported by this resource type. + :type aliases: + list[~azure.mgmt.resource.resources.v2016_09_01.models.AliasType] + :param api_versions: The API version. + :type api_versions: list[str] + :param properties: The properties. + :type properties: dict[str, str] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, properties=None, **kwargs) -> None: + super(ProviderResourceType, self).__init__(**kwargs) + self.resource_type = resource_type + self.locations = locations + self.aliases = aliases + self.api_versions = api_versions + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource.py index 14a828e9001b..ee7662aeee52 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource.py @@ -44,10 +44,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group.py index 1356079d3310..5744235367cd 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group.py @@ -18,6 +18,8 @@ class ResourceGroup(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The ID of the resource group. :vartype id: str :param name: The name of the resource group. @@ -25,9 +27,9 @@ class ResourceGroup(Model): :param properties: :type properties: ~azure.mgmt.resource.resources.v2016_09_01.models.ResourceGroupProperties - :param location: The location of the resource group. It cannot be changed - after the resource group has been created. It muct be one of the supported - Azure locations. + :param location: Required. The location of the resource group. It cannot + be changed after the resource group has been created. It muct be one of + the supported Azure locations. :type location: str :param managed_by: The ID of the resource that manages this resource group. @@ -50,11 +52,11 @@ class ResourceGroup(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, name=None, properties=None, managed_by=None, tags=None): - super(ResourceGroup, self).__init__() + def __init__(self, **kwargs): + super(ResourceGroup, self).__init__(**kwargs) self.id = None - self.name = name - self.properties = properties - self.location = location - self.managed_by = managed_by - self.tags = tags + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + self.location = kwargs.get('location', None) + self.managed_by = kwargs.get('managed_by', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_export_result.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_export_result.py index 7314f7c76c2e..a2fab58e5e1f 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_export_result.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_export_result.py @@ -27,7 +27,7 @@ class ResourceGroupExportResult(Model): 'error': {'key': 'error', 'type': 'ResourceManagementErrorWithDetails'}, } - def __init__(self, template=None, error=None): - super(ResourceGroupExportResult, self).__init__() - self.template = template - self.error = error + def __init__(self, **kwargs): + super(ResourceGroupExportResult, self).__init__(**kwargs) + self.template = kwargs.get('template', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_export_result_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_export_result_py3.py new file mode 100644 index 000000000000..35130719e255 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_export_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceGroupExportResult(Model): + """ResourceGroupExportResult. + + :param template: The template content. + :type template: object + :param error: The error. + :type error: + ~azure.mgmt.resource.resources.v2016_09_01.models.ResourceManagementErrorWithDetails + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'error': {'key': 'error', 'type': 'ResourceManagementErrorWithDetails'}, + } + + def __init__(self, *, template=None, error=None, **kwargs) -> None: + super(ResourceGroupExportResult, self).__init__(**kwargs) + self.template = template + self.error = error diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_filter.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_filter.py index fa0011120785..c94284bf3644 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_filter.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_filter.py @@ -26,7 +26,7 @@ class ResourceGroupFilter(Model): 'tag_value': {'key': 'tagValue', 'type': 'str'}, } - def __init__(self, tag_name=None, tag_value=None): - super(ResourceGroupFilter, self).__init__() - self.tag_name = tag_name - self.tag_value = tag_value + def __init__(self, **kwargs): + super(ResourceGroupFilter, self).__init__(**kwargs) + self.tag_name = kwargs.get('tag_name', None) + self.tag_value = kwargs.get('tag_value', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_filter_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_filter_py3.py new file mode 100644 index 000000000000..d709b6afd34f --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_filter_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceGroupFilter(Model): + """Resource group filter. + + :param tag_name: The tag name. + :type tag_name: str + :param tag_value: The tag value. + :type tag_value: str + """ + + _attribute_map = { + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + } + + def __init__(self, *, tag_name: str=None, tag_value: str=None, **kwargs) -> None: + super(ResourceGroupFilter, self).__init__(**kwargs) + self.tag_name = tag_name + self.tag_value = tag_value diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_properties.py index a6c35140c9d6..39411e3d79fb 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_properties.py @@ -30,6 +30,6 @@ class ResourceGroupProperties(Model): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } - def __init__(self): - super(ResourceGroupProperties, self).__init__() + def __init__(self, **kwargs): + super(ResourceGroupProperties, self).__init__(**kwargs) self.provisioning_state = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_properties_py3.py new file mode 100644 index 000000000000..67d6d06dedbd --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_properties_py3.py @@ -0,0 +1,35 @@ +# 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 ResourceGroupProperties(Model): + """The resource group properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceGroupProperties, self).__init__(**kwargs) + self.provisioning_state = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_py3.py new file mode 100644 index 000000000000..431e5c21f17b --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_group_py3.py @@ -0,0 +1,62 @@ +# 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 ResourceGroup(Model): + """Resource group information. + + 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 ID of the resource group. + :vartype id: str + :param name: The name of the resource group. + :type name: str + :param properties: + :type properties: + ~azure.mgmt.resource.resources.v2016_09_01.models.ResourceGroupProperties + :param location: Required. The location of the resource group. It cannot + be changed after the resource group has been created. It muct be one of + the supported Azure locations. + :type location: str + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, name: str=None, properties=None, managed_by: str=None, tags=None, **kwargs) -> None: + super(ResourceGroup, self).__init__(**kwargs) + self.id = None + self.name = name + self.properties = properties + self.location = location + self.managed_by = managed_by + self.tags = tags diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_management_client_enums.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_management_client_enums.py index 011ae3609d77..3b6a0e19d760 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_management_client_enums.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_management_client_enums.py @@ -12,12 +12,12 @@ from enum import Enum -class DeploymentMode(Enum): +class DeploymentMode(str, Enum): incremental = "Incremental" complete = "Complete" -class ResourceIdentityType(Enum): +class ResourceIdentityType(str, Enum): system_assigned = "SystemAssigned" diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_management_error_with_details.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_management_error_with_details.py index fdad9ac5482e..8e48f01e3db7 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_management_error_with_details.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_management_error_with_details.py @@ -43,8 +43,8 @@ class ResourceManagementErrorWithDetails(Model): 'details': {'key': 'details', 'type': '[ResourceManagementErrorWithDetails]'}, } - def __init__(self): - super(ResourceManagementErrorWithDetails, self).__init__() + def __init__(self, **kwargs): + super(ResourceManagementErrorWithDetails, self).__init__(**kwargs) self.code = None self.message = None self.target = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_management_error_with_details_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_management_error_with_details_py3.py new file mode 100644 index 000000000000..8ca9c8e28cdd --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_management_error_with_details_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceManagementErrorWithDetails(Model): + """ResourceManagementErrorWithDetails. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code returned when exporting the template. + :vartype code: str + :ivar message: The error message describing the export error. + :vartype message: str + :ivar target: The target of the error. + :vartype target: str + :ivar details: Validation error. + :vartype details: + list[~azure.mgmt.resource.resources.v2016_09_01.models.ResourceManagementErrorWithDetails] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ResourceManagementErrorWithDetails]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceManagementErrorWithDetails, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_provider_operation_display_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_provider_operation_display_properties.py index 6a1f181d764a..ac328b64bb1a 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_provider_operation_display_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_provider_operation_display_properties.py @@ -35,10 +35,10 @@ class ResourceProviderOperationDisplayProperties(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, publisher=None, provider=None, resource=None, operation=None, description=None): - super(ResourceProviderOperationDisplayProperties, self).__init__() - self.publisher = publisher - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(ResourceProviderOperationDisplayProperties, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_provider_operation_display_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_provider_operation_display_properties_py3.py new file mode 100644 index 000000000000..aecc5a412673 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_provider_operation_display_properties_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceProviderOperationDisplayProperties(Model): + """Resource provider operation's display properties. + + :param publisher: Operation description. + :type publisher: str + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, publisher: str=None, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(ResourceProviderOperationDisplayProperties, self).__init__(**kwargs) + self.publisher = publisher + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_py3.py new file mode 100644 index 000000000000..3c8102ab5262 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resource_py3.py @@ -0,0 +1,53 @@ +# 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): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': 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=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resources_move_info.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resources_move_info.py index a33bdefaeca1..edf946d7076b 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resources_move_info.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resources_move_info.py @@ -26,7 +26,7 @@ class ResourcesMoveInfo(Model): 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, } - def __init__(self, resources=None, target_resource_group=None): - super(ResourcesMoveInfo, self).__init__() - self.resources = resources - self.target_resource_group = target_resource_group + def __init__(self, **kwargs): + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + self.target_resource_group = kwargs.get('target_resource_group', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resources_move_info_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resources_move_info_py3.py new file mode 100644 index 000000000000..d10e2558d499 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/resources_move_info_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourcesMoveInfo(Model): + """Parameters of move resources. + + :param resources: The IDs of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + } + + def __init__(self, *, resources=None, target_resource_group: str=None, **kwargs) -> None: + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.resources = resources + self.target_resource_group = target_resource_group diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/sku.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/sku.py index 109278b7fe75..bfcda32477df 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/sku.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/sku.py @@ -38,11 +38,11 @@ class Sku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, size=None, family=None, model=None, capacity=None): - super(Sku, self).__init__() - self.name = name - self.tier = tier - self.size = size - self.family = family - self.model = model - self.capacity = capacity + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.model = kwargs.get('model', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/sku_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/sku_py3.py new file mode 100644 index 000000000000..676f1d770b79 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/sku_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """SKU for the resource. + + :param name: The SKU name. + :type name: str + :param tier: The SKU tier. + :type tier: str + :param size: The SKU size. + :type size: str + :param family: The SKU family. + :type family: str + :param model: The SKU model. + :type model: str + :param capacity: The SKU capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'model': {'key': 'model', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, tier: str=None, size: str=None, family: str=None, model: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.model = model + self.capacity = capacity diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/sub_resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/sub_resource.py index 522dc053d949..2c8b30771873 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/sub_resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/sub_resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/sub_resource_py3.py new file mode 100644 index 000000000000..d801e54680b2 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """SubResource. + + :param id: Resource ID + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_count.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_count.py index a94e6ef38d55..a5eeb6b38cf8 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_count.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_count.py @@ -26,7 +26,7 @@ class TagCount(Model): 'value': {'key': 'value', 'type': 'int'}, } - def __init__(self, type=None, value=None): - super(TagCount, self).__init__() - self.type = type - self.value = value + def __init__(self, **kwargs): + super(TagCount, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_count_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_count_py3.py new file mode 100644 index 000000000000..53c80f63fdb3 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_count_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TagCount(Model): + """Tag count. + + :param type: Type of count. + :type type: str + :param value: Value of count. + :type value: int + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'int'}, + } + + def __init__(self, *, type: str=None, value: int=None, **kwargs) -> None: + super(TagCount, self).__init__(**kwargs) + self.type = type + self.value = value diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_details.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_details.py index 435c49b223aa..53c21e1fea02 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_details.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_details.py @@ -15,8 +15,11 @@ class TagDetails(Model): """Tag details. - :param id: The tag ID. - :type id: str + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str :param tag_name: The tag name. :type tag_name: str :param count: The total number of resources that use the resource tag. @@ -28,6 +31,10 @@ class TagDetails(Model): list[~azure.mgmt.resource.resources.v2016_09_01.models.TagValue] """ + _validation = { + 'id': {'readonly': True}, + } + _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'tag_name': {'key': 'tagName', 'type': 'str'}, @@ -35,9 +42,9 @@ class TagDetails(Model): 'values': {'key': 'values', 'type': '[TagValue]'}, } - def __init__(self, id=None, tag_name=None, count=None, values=None): - super(TagDetails, self).__init__() - self.id = id - self.tag_name = tag_name - self.count = count - self.values = values + def __init__(self, **kwargs): + super(TagDetails, self).__init__(**kwargs) + self.id = None + self.tag_name = kwargs.get('tag_name', None) + self.count = kwargs.get('count', None) + self.values = kwargs.get('values', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_details_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_details_py3.py new file mode 100644 index 000000000000..9b946fea1a86 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_details_py3.py @@ -0,0 +1,50 @@ +# 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 TagDetails(Model): + """Tag details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str + :param tag_name: The tag name. + :type tag_name: str + :param count: The total number of resources that use the resource tag. + When a tag is initially created and has no associated resources, the value + is 0. + :type count: ~azure.mgmt.resource.resources.v2016_09_01.models.TagCount + :param values: The list of tag values. + :type values: + list[~azure.mgmt.resource.resources.v2016_09_01.models.TagValue] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + 'values': {'key': 'values', 'type': '[TagValue]'}, + } + + def __init__(self, *, tag_name: str=None, count=None, values=None, **kwargs) -> None: + super(TagDetails, self).__init__(**kwargs) + self.id = None + self.tag_name = tag_name + self.count = count + self.values = values diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_value.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_value.py index 347446d31e1c..5b4a2e8e28d7 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_value.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_value.py @@ -15,22 +15,29 @@ class TagValue(Model): """Tag information. - :param id: The tag ID. - :type id: str + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str :param tag_value: The tag value. :type tag_value: str :param count: The tag value count. :type count: ~azure.mgmt.resource.resources.v2016_09_01.models.TagCount """ + _validation = { + 'id': {'readonly': True}, + } + _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'tag_value': {'key': 'tagValue', 'type': 'str'}, 'count': {'key': 'count', 'type': 'TagCount'}, } - def __init__(self, id=None, tag_value=None, count=None): - super(TagValue, self).__init__() - self.id = id - self.tag_value = tag_value - self.count = count + def __init__(self, **kwargs): + super(TagValue, self).__init__(**kwargs) + self.id = None + self.tag_value = kwargs.get('tag_value', None) + self.count = kwargs.get('count', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_value_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_value_py3.py new file mode 100644 index 000000000000..3228cd63f3f4 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_value_py3.py @@ -0,0 +1,43 @@ +# 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 TagValue(Model): + """Tag information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str + :param tag_value: The tag value. + :type tag_value: str + :param count: The tag value count. + :type count: ~azure.mgmt.resource.resources.v2016_09_01.models.TagCount + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + } + + def __init__(self, *, tag_value: str=None, count=None, **kwargs) -> None: + super(TagValue, self).__init__(**kwargs) + self.id = None + self.tag_value = tag_value + self.count = count diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/target_resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/target_resource.py index 311bd74c9c2d..27d557645e8b 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/target_resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/target_resource.py @@ -29,8 +29,8 @@ class TargetResource(Model): 'resource_type': {'key': 'resourceType', 'type': 'str'}, } - def __init__(self, id=None, resource_name=None, resource_type=None): - super(TargetResource, self).__init__() - self.id = id - self.resource_name = resource_name - self.resource_type = resource_type + def __init__(self, **kwargs): + super(TargetResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.resource_name = kwargs.get('resource_name', None) + self.resource_type = kwargs.get('resource_type', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/target_resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/target_resource_py3.py new file mode 100644 index 000000000000..933347cec8f8 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/target_resource_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TargetResource(Model): + """Target resource. + + :param id: The ID of the resource. + :type id: str + :param resource_name: The name of the resource. + :type resource_name: str + :param resource_type: The type of the resource. + :type resource_type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, resource_name: str=None, resource_type: str=None, **kwargs) -> None: + super(TargetResource, self).__init__(**kwargs) + self.id = id + self.resource_name = resource_name + self.resource_type = resource_type diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/template_link.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/template_link.py index 7a29c00576bb..634095bb9754 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/template_link.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/template_link.py @@ -15,7 +15,9 @@ class TemplateLink(Model): """Entity representing the reference to the template. - :param uri: The URI of the template to deploy. + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the template to deploy. :type uri: str :param content_version: If included, must match the ContentVersion in the template. @@ -31,7 +33,7 @@ class TemplateLink(Model): 'content_version': {'key': 'contentVersion', 'type': 'str'}, } - def __init__(self, uri, content_version=None): - super(TemplateLink, self).__init__() - self.uri = uri - self.content_version = content_version + def __init__(self, **kwargs): + super(TemplateLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.content_version = kwargs.get('content_version', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/template_link_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/template_link_py3.py new file mode 100644 index 000000000000..00f2597ccd98 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/template_link_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TemplateLink(Model): + """Entity representing the reference to the template. + + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the template to deploy. + :type uri: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + } + + def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: + super(TemplateLink, self).__init__(**kwargs) + self.uri = uri + self.content_version = content_version diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/deployments_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/deployments_operations.py index 473dc3ab491c..600826e96462 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/deployments_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/deployments_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a deployment from the deployment history. A template deployment that is currently running cannot be deleted. @@ -100,12 +100,14 @@ def delete( :param deployment_name: The name of the deployment to delete. :type deployment_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -115,40 +117,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} def check_existence( @@ -263,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, deployment_name, properties, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, deployment_name, properties, custom_headers=None, raw=False, polling=True, **operation_config): """Deploys resources to a resource group. You can provide the template and parameters directly in the request or @@ -279,13 +260,16 @@ def create_or_update( :type properties: ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentProperties :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - DeploymentExtended or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentExtended or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentExtended] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentExtended]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -296,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('DeploymentExtended', response) if raw: @@ -328,12 +290,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} def get( diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/resource_groups_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/resource_groups_operations.py index 2f335eaeee56..dece11419457 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/resource_groups_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/resource_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -285,7 +285,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a resource group. When you delete a resource group, all of its resources are also @@ -296,12 +296,14 @@ def delete( The name is case insensitive. :type resource_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -310,40 +312,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} def get( diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/resources_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/resources_operations.py index 473a720a6e57..6f9521809d07 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/resources_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/resources_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -84,7 +84,7 @@ def _move_resources_initial( return client_raw_response def move_resources( - self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, **operation_config): + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, polling=True, **operation_config): """Moves resources from one resource group to another resource group. The resources to move must be in the same source resource group. The @@ -101,12 +101,14 @@ def move_resources( :param target_resource_group: The target resource group. :type target_resource_group: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._move_resources_initial( @@ -117,40 +119,19 @@ def move_resources( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) move_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources'} def list( @@ -344,7 +325,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a resource. :param resource_group_name: The name of the resource group that @@ -362,12 +343,14 @@ def delete( :param api_version: The API version to use for the operation. :type api_version: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -381,40 +364,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} @@ -473,7 +435,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates a resource. :param resource_group_name: The name of the resource group for the @@ -494,13 +456,16 @@ def create_or_update( :type parameters: ~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GenericResource or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -515,30 +480,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GenericResource', response) if raw: @@ -547,12 +490,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} @@ -609,7 +553,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a resource. :param resource_group_name: The name of the resource group for the @@ -630,13 +574,16 @@ def update( :type parameters: ~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GenericResource or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -651,30 +598,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GenericResource', response) if raw: @@ -683,12 +608,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} def get( @@ -861,7 +787,7 @@ def _delete_by_id_initial( return client_raw_response def delete_by_id( - self, resource_id, api_version, custom_headers=None, raw=False, **operation_config): + self, resource_id, api_version, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a resource by ID. :param resource_id: The fully qualified ID of the resource, including @@ -871,12 +797,14 @@ def delete_by_id( :param api_version: The API version to use for the operation. :type api_version: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_by_id_initial( @@ -886,40 +814,19 @@ def delete_by_id( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete_by_id.metadata = {'url': '/{resourceId}'} @@ -973,7 +880,7 @@ def _create_or_update_by_id_initial( return deserialized def create_or_update_by_id( - self, resource_id, api_version, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_id, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create a resource by ID. :param resource_id: The fully qualified ID of the resource, including @@ -986,13 +893,16 @@ def create_or_update_by_id( :type parameters: ~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GenericResource or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_by_id_initial( @@ -1003,30 +913,8 @@ def create_or_update_by_id( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GenericResource', response) if raw: @@ -1035,12 +923,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update_by_id.metadata = {'url': '/{resourceId}'} @@ -1092,7 +981,7 @@ def _update_by_id_initial( return deserialized def update_by_id( - self, resource_id, api_version, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_id, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a resource by ID. :param resource_id: The fully qualified ID of the resource, including @@ -1105,13 +994,16 @@ def update_by_id( :type parameters: ~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GenericResource or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource]] :raises: :class:`CloudError` """ raw_result = self._update_by_id_initial( @@ -1122,30 +1014,8 @@ def update_by_id( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GenericResource', response) if raw: @@ -1154,12 +1024,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update_by_id.metadata = {'url': '/{resourceId}'} def get_by_id( diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/resource_management_client.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/resource_management_client.py index a8532ab43741..4fa4270256bb 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/resource_management_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/resource_management_client.py @@ -9,7 +9,7 @@ # 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 @@ -54,7 +54,7 @@ def __init__( self.subscription_id = subscription_id -class ResourceManagementClient(object): +class ResourceManagementClient(SDKClient): """Provides operations for working with resources and resource groups. :ivar config: Configuration for client. @@ -85,7 +85,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = ResourceManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(ResourceManagementClient, 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 = '2016-09-01' diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py index bd88128bcce0..5d0dbe082824 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py @@ -9,45 +9,86 @@ # regenerated. # -------------------------------------------------------------------------- -from .deployment_extended_filter import DeploymentExtendedFilter -from .generic_resource_filter import GenericResourceFilter -from .resource_group_filter import ResourceGroupFilter -from .template_link import TemplateLink -from .parameters_link import ParametersLink -from .debug_setting import DebugSetting -from .deployment_properties import DeploymentProperties -from .deployment import Deployment -from .deployment_export_result import DeploymentExportResult -from .resource_management_error_with_details import ResourceManagementErrorWithDetails -from .alias_path_type import AliasPathType -from .alias_type import AliasType -from .provider_resource_type import ProviderResourceType -from .provider import Provider -from .basic_dependency import BasicDependency -from .dependency import Dependency -from .deployment_properties_extended import DeploymentPropertiesExtended -from .deployment_validate_result import DeploymentValidateResult -from .deployment_extended import DeploymentExtended -from .plan import Plan -from .sku import Sku -from .identity import Identity -from .generic_resource import GenericResource -from .resource_group_properties import ResourceGroupProperties -from .resource_group import ResourceGroup -from .resource_group_patchable import ResourceGroupPatchable -from .resources_move_info import ResourcesMoveInfo -from .export_template_request import ExportTemplateRequest -from .tag_count import TagCount -from .tag_value import TagValue -from .tag_details import TagDetails -from .target_resource import TargetResource -from .http_message import HttpMessage -from .deployment_operation_properties import DeploymentOperationProperties -from .deployment_operation import DeploymentOperation -from .resource_provider_operation_display_properties import ResourceProviderOperationDisplayProperties -from .resource import Resource -from .sub_resource import SubResource -from .resource_group_export_result import ResourceGroupExportResult +try: + from .deployment_extended_filter_py3 import DeploymentExtendedFilter + from .generic_resource_filter_py3 import GenericResourceFilter + from .resource_group_filter_py3 import ResourceGroupFilter + from .template_link_py3 import TemplateLink + from .parameters_link_py3 import ParametersLink + from .debug_setting_py3 import DebugSetting + from .deployment_properties_py3 import DeploymentProperties + from .deployment_py3 import Deployment + from .deployment_export_result_py3 import DeploymentExportResult + from .resource_management_error_with_details_py3 import ResourceManagementErrorWithDetails + from .alias_path_type_py3 import AliasPathType + from .alias_type_py3 import AliasType + from .provider_resource_type_py3 import ProviderResourceType + from .provider_py3 import Provider + from .basic_dependency_py3 import BasicDependency + from .dependency_py3 import Dependency + from .deployment_properties_extended_py3 import DeploymentPropertiesExtended + from .deployment_validate_result_py3 import DeploymentValidateResult + from .deployment_extended_py3 import DeploymentExtended + from .plan_py3 import Plan + from .sku_py3 import Sku + from .identity_py3 import Identity + from .generic_resource_py3 import GenericResource + from .resource_group_properties_py3 import ResourceGroupProperties + from .resource_group_py3 import ResourceGroup + from .resource_group_patchable_py3 import ResourceGroupPatchable + from .resources_move_info_py3 import ResourcesMoveInfo + from .export_template_request_py3 import ExportTemplateRequest + from .tag_count_py3 import TagCount + from .tag_value_py3 import TagValue + from .tag_details_py3 import TagDetails + from .target_resource_py3 import TargetResource + from .http_message_py3 import HttpMessage + from .deployment_operation_properties_py3 import DeploymentOperationProperties + from .deployment_operation_py3 import DeploymentOperation + from .resource_provider_operation_display_properties_py3 import ResourceProviderOperationDisplayProperties + from .resource_py3 import Resource + from .sub_resource_py3 import SubResource + from .resource_group_export_result_py3 import ResourceGroupExportResult +except (SyntaxError, ImportError): + from .deployment_extended_filter import DeploymentExtendedFilter + from .generic_resource_filter import GenericResourceFilter + from .resource_group_filter import ResourceGroupFilter + from .template_link import TemplateLink + from .parameters_link import ParametersLink + from .debug_setting import DebugSetting + from .deployment_properties import DeploymentProperties + from .deployment import Deployment + from .deployment_export_result import DeploymentExportResult + from .resource_management_error_with_details import ResourceManagementErrorWithDetails + from .alias_path_type import AliasPathType + from .alias_type import AliasType + from .provider_resource_type import ProviderResourceType + from .provider import Provider + from .basic_dependency import BasicDependency + from .dependency import Dependency + from .deployment_properties_extended import DeploymentPropertiesExtended + from .deployment_validate_result import DeploymentValidateResult + from .deployment_extended import DeploymentExtended + from .plan import Plan + from .sku import Sku + from .identity import Identity + from .generic_resource import GenericResource + from .resource_group_properties import ResourceGroupProperties + from .resource_group import ResourceGroup + from .resource_group_patchable import ResourceGroupPatchable + from .resources_move_info import ResourcesMoveInfo + from .export_template_request import ExportTemplateRequest + from .tag_count import TagCount + from .tag_value import TagValue + from .tag_details import TagDetails + from .target_resource import TargetResource + from .http_message import HttpMessage + from .deployment_operation_properties import DeploymentOperationProperties + from .deployment_operation import DeploymentOperation + from .resource_provider_operation_display_properties import ResourceProviderOperationDisplayProperties + from .resource import Resource + from .sub_resource import SubResource + from .resource_group_export_result import ResourceGroupExportResult from .deployment_extended_paged import DeploymentExtendedPaged from .provider_paged import ProviderPaged from .generic_resource_paged import GenericResourcePaged diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/alias_path_type.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/alias_path_type.py index 35ffbb1ca154..ee5959ef5463 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/alias_path_type.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/alias_path_type.py @@ -26,7 +26,7 @@ class AliasPathType(Model): 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, } - def __init__(self, path=None, api_versions=None): - super(AliasPathType, self).__init__() - self.path = path - self.api_versions = api_versions + def __init__(self, **kwargs): + super(AliasPathType, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.api_versions = kwargs.get('api_versions', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/alias_path_type_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/alias_path_type_py3.py new file mode 100644 index 000000000000..ccd48141f917 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/alias_path_type_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AliasPathType(Model): + """The type of the paths for alias. . + + :param path: The path of an alias. + :type path: str + :param api_versions: The API versions. + :type api_versions: list[str] + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + } + + def __init__(self, *, path: str=None, api_versions=None, **kwargs) -> None: + super(AliasPathType, self).__init__(**kwargs) + self.path = path + self.api_versions = api_versions diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/alias_type.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/alias_type.py index eddbfd783a0e..8c64bece4665 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/alias_type.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/alias_type.py @@ -27,7 +27,7 @@ class AliasType(Model): 'paths': {'key': 'paths', 'type': '[AliasPathType]'}, } - def __init__(self, name=None, paths=None): - super(AliasType, self).__init__() - self.name = name - self.paths = paths + def __init__(self, **kwargs): + super(AliasType, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.paths = kwargs.get('paths', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/alias_type_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/alias_type_py3.py new file mode 100644 index 000000000000..dc3dd9aa4e66 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/alias_type_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AliasType(Model): + """The alias type. . + + :param name: The alias name. + :type name: str + :param paths: The paths for an alias. + :type paths: + list[~azure.mgmt.resource.resources.v2017_05_10.models.AliasPathType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'paths': {'key': 'paths', 'type': '[AliasPathType]'}, + } + + def __init__(self, *, name: str=None, paths=None, **kwargs) -> None: + super(AliasType, self).__init__(**kwargs) + self.name = name + self.paths = paths diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/basic_dependency.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/basic_dependency.py index d16931dabd70..3a5ccd4aa464 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/basic_dependency.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/basic_dependency.py @@ -29,8 +29,8 @@ class BasicDependency(Model): 'resource_name': {'key': 'resourceName', 'type': 'str'}, } - def __init__(self, id=None, resource_type=None, resource_name=None): - super(BasicDependency, self).__init__() - self.id = id - self.resource_type = resource_type - self.resource_name = resource_name + def __init__(self, **kwargs): + super(BasicDependency, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_name = kwargs.get('resource_name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/basic_dependency_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/basic_dependency_py3.py new file mode 100644 index 000000000000..49d821737930 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/basic_dependency_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BasicDependency(Model): + """Deployment dependency information. + + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, resource_type: str=None, resource_name: str=None, **kwargs) -> None: + super(BasicDependency, self).__init__(**kwargs) + self.id = id + self.resource_type = resource_type + self.resource_name = resource_name diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/debug_setting.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/debug_setting.py index e908a46b1c52..d6f778c5c86d 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/debug_setting.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/debug_setting.py @@ -29,6 +29,6 @@ class DebugSetting(Model): 'detail_level': {'key': 'detailLevel', 'type': 'str'}, } - def __init__(self, detail_level=None): - super(DebugSetting, self).__init__() - self.detail_level = detail_level + def __init__(self, **kwargs): + super(DebugSetting, self).__init__(**kwargs) + self.detail_level = kwargs.get('detail_level', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/debug_setting_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/debug_setting_py3.py new file mode 100644 index 000000000000..af571a729762 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/debug_setting_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DebugSetting(Model): + """DebugSetting. + + :param detail_level: Specifies the type of information to log for + debugging. The permitted values are none, requestContent, responseContent, + or both requestContent and responseContent separated by a comma. The + default is none. When setting this value, carefully consider the type of + information you are passing in during deployment. By logging information + about the request or response, you could potentially expose sensitive data + that is retrieved through the deployment operations. + :type detail_level: str + """ + + _attribute_map = { + 'detail_level': {'key': 'detailLevel', 'type': 'str'}, + } + + def __init__(self, *, detail_level: str=None, **kwargs) -> None: + super(DebugSetting, self).__init__(**kwargs) + self.detail_level = detail_level diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/dependency.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/dependency.py index dd818a26b58f..460ffee98db4 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/dependency.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/dependency.py @@ -33,9 +33,9 @@ class Dependency(Model): 'resource_name': {'key': 'resourceName', 'type': 'str'}, } - def __init__(self, depends_on=None, id=None, resource_type=None, resource_name=None): - super(Dependency, self).__init__() - self.depends_on = depends_on - self.id = id - self.resource_type = resource_type - self.resource_name = resource_name + def __init__(self, **kwargs): + super(Dependency, self).__init__(**kwargs) + self.depends_on = kwargs.get('depends_on', None) + self.id = kwargs.get('id', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_name = kwargs.get('resource_name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/dependency_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/dependency_py3.py new file mode 100644 index 000000000000..500123327225 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/dependency_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Dependency(Model): + """Deployment dependency information. + + :param depends_on: The list of dependencies. + :type depends_on: + list[~azure.mgmt.resource.resources.v2017_05_10.models.BasicDependency] + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'depends_on': {'key': 'dependsOn', 'type': '[BasicDependency]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, *, depends_on=None, id: str=None, resource_type: str=None, resource_name: str=None, **kwargs) -> None: + super(Dependency, self).__init__(**kwargs) + self.depends_on = depends_on + self.id = id + self.resource_type = resource_type + self.resource_name = resource_name diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment.py index 4ff35092046f..d780f5763e5c 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment.py @@ -15,7 +15,9 @@ class Deployment(Model): """Deployment operation parameters. - :param properties: The deployment properties. + All required parameters must be populated in order to send to Azure. + + :param properties: Required. The deployment properties. :type properties: ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentProperties """ @@ -28,6 +30,6 @@ class Deployment(Model): 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, } - def __init__(self, properties): - super(Deployment, self).__init__() - self.properties = properties + def __init__(self, **kwargs): + super(Deployment, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_export_result.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_export_result.py index 8834a8cd1ccb..807e79c8b678 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_export_result.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_export_result.py @@ -23,6 +23,6 @@ class DeploymentExportResult(Model): 'template': {'key': 'template', 'type': 'object'}, } - def __init__(self, template=None): - super(DeploymentExportResult, self).__init__() - self.template = template + def __init__(self, **kwargs): + super(DeploymentExportResult, self).__init__(**kwargs) + self.template = kwargs.get('template', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_export_result_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_export_result_py3.py new file mode 100644 index 000000000000..63f10bf2735a --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_export_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExportResult(Model): + """The deployment export result. . + + :param template: The template content. + :type template: object + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, *, template=None, **kwargs) -> None: + super(DeploymentExportResult, self).__init__(**kwargs) + self.template = template diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_extended.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_extended.py index c4b9e4cc6ead..df5ec2ed6e82 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_extended.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_extended.py @@ -15,9 +15,14 @@ class DeploymentExtended(Model): """Deployment information. - :param id: The ID of the deployment. - :type id: str - :param name: The name of the deployment. + 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 ID of the deployment. + :vartype id: str + :param name: Required. The name of the deployment. :type name: str :param properties: Deployment properties. :type properties: @@ -25,6 +30,7 @@ class DeploymentExtended(Model): """ _validation = { + 'id': {'readonly': True}, 'name': {'required': True}, } @@ -34,8 +40,8 @@ class DeploymentExtended(Model): 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, } - def __init__(self, name, id=None, properties=None): - super(DeploymentExtended, self).__init__() - self.id = id - self.name = name - self.properties = properties + def __init__(self, **kwargs): + super(DeploymentExtended, self).__init__(**kwargs) + self.id = None + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_extended_filter.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_extended_filter.py index 45bb10fa20b0..0839bcc12e4e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_extended_filter.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_extended_filter.py @@ -23,6 +23,6 @@ class DeploymentExtendedFilter(Model): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } - def __init__(self, provisioning_state=None): - super(DeploymentExtendedFilter, self).__init__() - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(DeploymentExtendedFilter, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_extended_filter_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_extended_filter_py3.py new file mode 100644 index 000000000000..f06d0d1a4dfb --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_extended_filter_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExtendedFilter(Model): + """Deployment filter. + + :param provisioning_state: The provisioning state. + :type provisioning_state: str + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, provisioning_state: str=None, **kwargs) -> None: + super(DeploymentExtendedFilter, self).__init__(**kwargs) + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_extended_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_extended_py3.py new file mode 100644 index 000000000000..b54fd6fe83a3 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_extended_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExtended(Model): + """Deployment information. + + 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 ID of the deployment. + :vartype id: str + :param name: Required. The name of the deployment. + :type name: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentPropertiesExtended + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + } + + def __init__(self, *, name: str, properties=None, **kwargs) -> None: + super(DeploymentExtended, self).__init__(**kwargs) + self.id = None + self.name = name + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_operation.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_operation.py index e8bcb3e0f03b..009c44250eb6 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_operation.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_operation.py @@ -38,8 +38,8 @@ class DeploymentOperation(Model): 'properties': {'key': 'properties', 'type': 'DeploymentOperationProperties'}, } - def __init__(self, properties=None): - super(DeploymentOperation, self).__init__() + def __init__(self, **kwargs): + super(DeploymentOperation, self).__init__(**kwargs) self.id = None self.operation_id = None - self.properties = properties + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_operation_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_operation_properties.py index f129fb10b762..fe6aa9c383d3 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_operation_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_operation_properties.py @@ -61,8 +61,8 @@ class DeploymentOperationProperties(Model): 'response': {'key': 'response', 'type': 'HttpMessage'}, } - def __init__(self): - super(DeploymentOperationProperties, self).__init__() + def __init__(self, **kwargs): + super(DeploymentOperationProperties, self).__init__(**kwargs) self.provisioning_state = None self.timestamp = None self.service_request_id = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_operation_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_operation_properties_py3.py new file mode 100644 index 000000000000..ea0971a14ca5 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_operation_properties_py3.py @@ -0,0 +1,73 @@ +# 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 DeploymentOperationProperties(Model): + """Deployment operation properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the provisioning. + :vartype provisioning_state: str + :ivar timestamp: The date and time of the operation. + :vartype timestamp: datetime + :ivar service_request_id: Deployment operation service request id. + :vartype service_request_id: str + :ivar status_code: Operation status code. + :vartype status_code: str + :ivar status_message: Operation status message. + :vartype status_message: object + :ivar target_resource: The target resource. + :vartype target_resource: + ~azure.mgmt.resource.resources.v2017_05_10.models.TargetResource + :ivar request: The HTTP request message. + :vartype request: + ~azure.mgmt.resource.resources.v2017_05_10.models.HttpMessage + :ivar response: The HTTP response message. + :vartype response: + ~azure.mgmt.resource.resources.v2017_05_10.models.HttpMessage + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'service_request_id': {'readonly': True}, + 'status_code': {'readonly': True}, + 'status_message': {'readonly': True}, + 'target_resource': {'readonly': True}, + 'request': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'service_request_id': {'key': 'serviceRequestId', 'type': 'str'}, + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'status_message': {'key': 'statusMessage', 'type': 'object'}, + 'target_resource': {'key': 'targetResource', 'type': 'TargetResource'}, + 'request': {'key': 'request', 'type': 'HttpMessage'}, + 'response': {'key': 'response', 'type': 'HttpMessage'}, + } + + def __init__(self, **kwargs) -> None: + super(DeploymentOperationProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.timestamp = None + self.service_request_id = None + self.status_code = None + self.status_message = None + self.target_resource = None + self.request = None + self.response = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_operation_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_operation_py3.py new file mode 100644 index 000000000000..2892a39fd8bb --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_operation_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentOperation(Model): + """Deployment operation information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Full deployment operation ID. + :vartype id: str + :ivar operation_id: Deployment operation ID. + :vartype operation_id: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentOperationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentOperationProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(DeploymentOperation, self).__init__(**kwargs) + self.id = None + self.operation_id = None + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_properties.py index 421ef1a1fa56..5a98a89eb802 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_properties.py @@ -15,6 +15,8 @@ class DeploymentProperties(Model): """Deployment properties. + All required parameters must be populated in order to send to Azure. + :param template: The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use @@ -36,13 +38,14 @@ class DeploymentProperties(Model): property or the parameters property, but not both. :type parameters_link: ~azure.mgmt.resource.resources.v2017_05_10.models.ParametersLink - :param mode: The mode that is used to deploy resources. This value can be - either Incremental or Complete. In Incremental mode, resources are - deployed without deleting existing resources that are not included in the - template. In Complete mode, resources are deployed and existing resources - in the resource group that are not included in the template are deleted. - Be careful when using Complete mode as you may unintentionally delete - resources. Possible values include: 'Incremental', 'Complete' + :param mode: Required. The mode that is used to deploy resources. This + value can be either Incremental or Complete. In Incremental mode, + resources are deployed without deleting existing resources that are not + included in the template. In Complete mode, resources are deployed and + existing resources in the resource group that are not included in the + template are deleted. Be careful when using Complete mode as you may + unintentionally delete resources. Possible values include: 'Incremental', + 'Complete' :type mode: str or ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentMode :param debug_setting: The debug setting of the deployment. @@ -63,11 +66,11 @@ class DeploymentProperties(Model): 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, } - def __init__(self, mode, template=None, template_link=None, parameters=None, parameters_link=None, debug_setting=None): - super(DeploymentProperties, self).__init__() - self.template = template - self.template_link = template_link - self.parameters = parameters - self.parameters_link = parameters_link - self.mode = mode - self.debug_setting = debug_setting + def __init__(self, **kwargs): + super(DeploymentProperties, self).__init__(**kwargs) + self.template = kwargs.get('template', None) + self.template_link = kwargs.get('template_link', None) + self.parameters = kwargs.get('parameters', None) + self.parameters_link = kwargs.get('parameters_link', None) + self.mode = kwargs.get('mode', None) + self.debug_setting = kwargs.get('debug_setting', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_properties_extended.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_properties_extended.py index 9a6f525dcf68..091c71ec2dcc 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_properties_extended.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_properties_extended.py @@ -77,17 +77,17 @@ class DeploymentPropertiesExtended(Model): 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, } - def __init__(self, outputs=None, providers=None, dependencies=None, template=None, template_link=None, parameters=None, parameters_link=None, mode=None, debug_setting=None): - super(DeploymentPropertiesExtended, self).__init__() + def __init__(self, **kwargs): + super(DeploymentPropertiesExtended, self).__init__(**kwargs) self.provisioning_state = None self.correlation_id = None self.timestamp = None - self.outputs = outputs - self.providers = providers - self.dependencies = dependencies - self.template = template - self.template_link = template_link - self.parameters = parameters - self.parameters_link = parameters_link - self.mode = mode - self.debug_setting = debug_setting + self.outputs = kwargs.get('outputs', None) + self.providers = kwargs.get('providers', None) + self.dependencies = kwargs.get('dependencies', None) + self.template = kwargs.get('template', None) + self.template_link = kwargs.get('template_link', None) + self.parameters = kwargs.get('parameters', None) + self.parameters_link = kwargs.get('parameters_link', None) + self.mode = kwargs.get('mode', None) + self.debug_setting = kwargs.get('debug_setting', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_properties_extended_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_properties_extended_py3.py new file mode 100644 index 000000000000..fec0234e2647 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_properties_extended_py3.py @@ -0,0 +1,93 @@ +# 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 DeploymentPropertiesExtended(Model): + """Deployment properties with additional details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the provisioning. + :vartype provisioning_state: str + :ivar correlation_id: The correlation ID of the deployment. + :vartype correlation_id: str + :ivar timestamp: The timestamp of the template deployment. + :vartype timestamp: datetime + :param outputs: Key/value pairs that represent deploymentoutput. + :type outputs: object + :param providers: The list of resource providers needed for the + deployment. + :type providers: + list[~azure.mgmt.resource.resources.v2017_05_10.models.Provider] + :param dependencies: The list of deployment dependencies. + :type dependencies: + list[~azure.mgmt.resource.resources.v2017_05_10.models.Dependency] + :param template: The template content. Use only one of Template or + TemplateLink. + :type template: object + :param template_link: The URI referencing the template. Use only one of + Template or TemplateLink. + :type template_link: + ~azure.mgmt.resource.resources.v2017_05_10.models.TemplateLink + :param parameters: Deployment parameters. Use only one of Parameters or + ParametersLink. + :type parameters: object + :param parameters_link: The URI referencing the parameters. Use only one + of Parameters or ParametersLink. + :type parameters_link: + ~azure.mgmt.resource.resources.v2017_05_10.models.ParametersLink + :param mode: The deployment mode. Possible values are Incremental and + Complete. Possible values include: 'Incremental', 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2017_05_10.models.DebugSetting + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'timestamp': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'providers': {'key': 'providers', 'type': '[Provider]'}, + 'dependencies': {'key': 'dependencies', 'type': '[Dependency]'}, + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + } + + def __init__(self, *, outputs=None, providers=None, dependencies=None, template=None, template_link=None, parameters=None, parameters_link=None, mode=None, debug_setting=None, **kwargs) -> None: + super(DeploymentPropertiesExtended, self).__init__(**kwargs) + self.provisioning_state = None + self.correlation_id = None + self.timestamp = None + self.outputs = outputs + self.providers = providers + self.dependencies = dependencies + self.template = template + self.template_link = template_link + self.parameters = parameters + self.parameters_link = parameters_link + self.mode = mode + self.debug_setting = debug_setting diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_properties_py3.py new file mode 100644 index 000000000000..3a2cd11041fe --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_properties_py3.py @@ -0,0 +1,76 @@ +# 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 DeploymentProperties(Model): + """Deployment properties. + + All required parameters must be populated in order to send to Azure. + + :param template: The template content. You use this element when you want + to pass the template syntax directly in the request rather than link to an + existing template. It can be a JObject or well-formed JSON string. Use + either the templateLink property or the template property, but not both. + :type template: object + :param template_link: The URI of the template. Use either the templateLink + property or the template property, but not both. + :type template_link: + ~azure.mgmt.resource.resources.v2017_05_10.models.TemplateLink + :param parameters: Name and value pairs that define the deployment + parameters for the template. You use this element when you want to provide + the parameter values directly in the request rather than link to an + existing parameter file. Use either the parametersLink property or the + parameters property, but not both. It can be a JObject or a well formed + JSON string. + :type parameters: object + :param parameters_link: The URI of parameters file. You use this element + to link to an existing parameters file. Use either the parametersLink + property or the parameters property, but not both. + :type parameters_link: + ~azure.mgmt.resource.resources.v2017_05_10.models.ParametersLink + :param mode: Required. The mode that is used to deploy resources. This + value can be either Incremental or Complete. In Incremental mode, + resources are deployed without deleting existing resources that are not + included in the template. In Complete mode, resources are deployed and + existing resources in the resource group that are not included in the + template are deleted. Be careful when using Complete mode as you may + unintentionally delete resources. Possible values include: 'Incremental', + 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2017_05_10.models.DebugSetting + """ + + _validation = { + 'mode': {'required': True}, + } + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + } + + def __init__(self, *, mode, template=None, template_link=None, parameters=None, parameters_link=None, debug_setting=None, **kwargs) -> None: + super(DeploymentProperties, self).__init__(**kwargs) + self.template = template + self.template_link = template_link + self.parameters = parameters + self.parameters_link = parameters_link + self.mode = mode + self.debug_setting = debug_setting diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_py3.py new file mode 100644 index 000000000000..ecbaa65ed4db --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_py3.py @@ -0,0 +1,35 @@ +# 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 Deployment(Model): + """Deployment operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentProperties + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + } + + def __init__(self, *, properties, **kwargs) -> None: + super(Deployment, self).__init__(**kwargs) + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_validate_result.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_validate_result.py index 8aa46cda5ed3..bf511a46ba03 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_validate_result.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_validate_result.py @@ -28,7 +28,7 @@ class DeploymentValidateResult(Model): 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, } - def __init__(self, error=None, properties=None): - super(DeploymentValidateResult, self).__init__() - self.error = error - self.properties = properties + def __init__(self, **kwargs): + super(DeploymentValidateResult, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_validate_result_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_validate_result_py3.py new file mode 100644 index 000000000000..18d06626d914 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/deployment_validate_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentValidateResult(Model): + """Information from validate template deployment response. + + :param error: Validation error. + :type error: + ~azure.mgmt.resource.resources.v2017_05_10.models.ResourceManagementErrorWithDetails + :param properties: The template deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentPropertiesExtended + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ResourceManagementErrorWithDetails'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + } + + def __init__(self, *, error=None, properties=None, **kwargs) -> None: + super(DeploymentValidateResult, self).__init__(**kwargs) + self.error = error + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/export_template_request.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/export_template_request.py index d39261d5fb13..069bfbb70632 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/export_template_request.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/export_template_request.py @@ -30,7 +30,7 @@ class ExportTemplateRequest(Model): 'options': {'key': 'options', 'type': 'str'}, } - def __init__(self, resources=None, options=None): - super(ExportTemplateRequest, self).__init__() - self.resources = resources - self.options = options + def __init__(self, **kwargs): + super(ExportTemplateRequest, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + self.options = kwargs.get('options', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/export_template_request_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/export_template_request_py3.py new file mode 100644 index 000000000000..2374c103d566 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/export_template_request_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportTemplateRequest(Model): + """Export resource group template request parameters. + + :param resources: The IDs of the resources. The only supported string + currently is '*' (all resources). Future updates will support exporting + specific resources. + :type resources: list[str] + :param options: The export template options. Supported values include + 'IncludeParameterDefaultValue', 'IncludeComments' or + 'IncludeParameterDefaultValue, IncludeComments + :type options: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'options': {'key': 'options', 'type': 'str'}, + } + + def __init__(self, *, resources=None, options: str=None, **kwargs) -> None: + super(ExportTemplateRequest, self).__init__(**kwargs) + self.resources = resources + self.options = options diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/generic_resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/generic_resource.py index 9e3d679c6c2a..260dfe07ad3d 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/generic_resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/generic_resource.py @@ -63,11 +63,11 @@ class GenericResource(Resource): 'identity': {'key': 'identity', 'type': 'Identity'}, } - def __init__(self, location=None, tags=None, plan=None, properties=None, kind=None, managed_by=None, sku=None, identity=None): - super(GenericResource, self).__init__(location=location, tags=tags) - self.plan = plan - self.properties = properties - self.kind = kind - self.managed_by = managed_by - self.sku = sku - self.identity = identity + def __init__(self, **kwargs): + super(GenericResource, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.properties = kwargs.get('properties', None) + self.kind = kwargs.get('kind', None) + self.managed_by = kwargs.get('managed_by', None) + self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/generic_resource_filter.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/generic_resource_filter.py index a31e587e849a..c4488f4cf095 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/generic_resource_filter.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/generic_resource_filter.py @@ -29,8 +29,8 @@ class GenericResourceFilter(Model): 'tagvalue': {'key': 'tagvalue', 'type': 'str'}, } - def __init__(self, resource_type=None, tagname=None, tagvalue=None): - super(GenericResourceFilter, self).__init__() - self.resource_type = resource_type - self.tagname = tagname - self.tagvalue = tagvalue + def __init__(self, **kwargs): + super(GenericResourceFilter, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.tagname = kwargs.get('tagname', None) + self.tagvalue = kwargs.get('tagvalue', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/generic_resource_filter_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/generic_resource_filter_py3.py new file mode 100644 index 000000000000..17ad0e58c55c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/generic_resource_filter_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GenericResourceFilter(Model): + """Resource filter. + + :param resource_type: The resource type. + :type resource_type: str + :param tagname: The tag name. + :type tagname: str + :param tagvalue: The tag value. + :type tagvalue: str + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'tagname': {'key': 'tagname', 'type': 'str'}, + 'tagvalue': {'key': 'tagvalue', 'type': 'str'}, + } + + def __init__(self, *, resource_type: str=None, tagname: str=None, tagvalue: str=None, **kwargs) -> None: + super(GenericResourceFilter, self).__init__(**kwargs) + self.resource_type = resource_type + self.tagname = tagname + self.tagvalue = tagvalue diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/generic_resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/generic_resource_py3.py new file mode 100644 index 000000000000..00e7d168fd22 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/generic_resource_py3.py @@ -0,0 +1,73 @@ +# 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 GenericResource(Resource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2017_05_10.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2017_05_10.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2017_05_10.models.Identity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + } + + _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}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResource, self).__init__(location=location, tags=tags, **kwargs) + self.plan = plan + self.properties = properties + self.kind = kind + self.managed_by = managed_by + self.sku = sku + self.identity = identity diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/http_message.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/http_message.py index f94eada2e8a3..c4a11d3ebc30 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/http_message.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/http_message.py @@ -23,6 +23,6 @@ class HttpMessage(Model): 'content': {'key': 'content', 'type': 'object'}, } - def __init__(self, content=None): - super(HttpMessage, self).__init__() - self.content = content + def __init__(self, **kwargs): + super(HttpMessage, self).__init__(**kwargs) + self.content = kwargs.get('content', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/http_message_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/http_message_py3.py new file mode 100644 index 000000000000..efe1b5abd2fb --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/http_message_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class HttpMessage(Model): + """HTTP message. + + :param content: HTTP message content. + :type content: object + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'object'}, + } + + def __init__(self, *, content=None, **kwargs) -> None: + super(HttpMessage, self).__init__(**kwargs) + self.content = content diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/identity.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/identity.py index af86d8024588..f92e44520b53 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/identity.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/identity.py @@ -38,8 +38,8 @@ class Identity(Model): 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, } - def __init__(self, type=None): - super(Identity, self).__init__() + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = type + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/identity_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/identity_py3.py new file mode 100644 index 000000000000..72e1d6185122 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/identity_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned' + :type type: str or + ~azure.mgmt.resource.resources.v2017_05_10.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/parameters_link.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/parameters_link.py index ca52e7df302c..c436b9d4ab6e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/parameters_link.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/parameters_link.py @@ -15,7 +15,9 @@ class ParametersLink(Model): """Entity representing the reference to the deployment paramaters. - :param uri: The URI of the parameters file. + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the parameters file. :type uri: str :param content_version: If included, must match the ContentVersion in the template. @@ -31,7 +33,7 @@ class ParametersLink(Model): 'content_version': {'key': 'contentVersion', 'type': 'str'}, } - def __init__(self, uri, content_version=None): - super(ParametersLink, self).__init__() - self.uri = uri - self.content_version = content_version + def __init__(self, **kwargs): + super(ParametersLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.content_version = kwargs.get('content_version', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/parameters_link_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/parameters_link_py3.py new file mode 100644 index 000000000000..52bc9723fa3e --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/parameters_link_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ParametersLink(Model): + """Entity representing the reference to the deployment paramaters. + + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the parameters file. + :type uri: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + } + + def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: + super(ParametersLink, self).__init__(**kwargs) + self.uri = uri + self.content_version = content_version diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/plan.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/plan.py index d915ea5bb3bd..594d670d723c 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/plan.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/plan.py @@ -35,10 +35,10 @@ class Plan(Model): 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, name=None, publisher=None, product=None, promotion_code=None, version=None): - super(Plan, self).__init__() - self.name = name - self.publisher = publisher - self.product = product - self.promotion_code = promotion_code - self.version = version + def __init__(self, **kwargs): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/plan_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/plan_py3.py new file mode 100644 index 000000000000..972976e1ba0f --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/plan_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Plan(Model): + """Plan for the resource. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The offer ID. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + :param version: The plan's version. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, product: str=None, promotion_code: str=None, version: str=None, **kwargs) -> None: + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code + self.version = version diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/provider.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/provider.py index 40f309035d02..2336a5e5e686 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/provider.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/provider.py @@ -42,9 +42,9 @@ class Provider(Model): 'resource_types': {'key': 'resourceTypes', 'type': '[ProviderResourceType]'}, } - def __init__(self, namespace=None): - super(Provider, self).__init__() + def __init__(self, **kwargs): + super(Provider, self).__init__(**kwargs) self.id = None - self.namespace = namespace + self.namespace = kwargs.get('namespace', None) self.registration_state = None self.resource_types = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/provider_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/provider_py3.py new file mode 100644 index 000000000000..c7df7c28de14 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/provider_py3.py @@ -0,0 +1,50 @@ +# 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 Provider(Model): + """Resource provider information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The provider ID. + :vartype id: str + :param namespace: The namespace of the resource provider. + :type namespace: str + :ivar registration_state: The registration state of the provider. + :vartype registration_state: str + :ivar resource_types: The collection of provider resource types. + :vartype resource_types: + list[~azure.mgmt.resource.resources.v2017_05_10.models.ProviderResourceType] + """ + + _validation = { + 'id': {'readonly': True}, + 'registration_state': {'readonly': True}, + 'resource_types': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'registration_state': {'key': 'registrationState', 'type': 'str'}, + 'resource_types': {'key': 'resourceTypes', 'type': '[ProviderResourceType]'}, + } + + def __init__(self, *, namespace: str=None, **kwargs) -> None: + super(Provider, self).__init__(**kwargs) + self.id = None + self.namespace = namespace + self.registration_state = None + self.resource_types = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/provider_resource_type.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/provider_resource_type.py index b3b250cf12d2..b2d2cc4f1c31 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/provider_resource_type.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/provider_resource_type.py @@ -37,10 +37,10 @@ class ProviderResourceType(Model): 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, resource_type=None, locations=None, aliases=None, api_versions=None, properties=None): - super(ProviderResourceType, self).__init__() - self.resource_type = resource_type - self.locations = locations - self.aliases = aliases - self.api_versions = api_versions - self.properties = properties + def __init__(self, **kwargs): + super(ProviderResourceType, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.locations = kwargs.get('locations', None) + self.aliases = kwargs.get('aliases', None) + self.api_versions = kwargs.get('api_versions', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/provider_resource_type_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/provider_resource_type_py3.py new file mode 100644 index 000000000000..246655b4007d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/provider_resource_type_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ProviderResourceType(Model): + """Resource type managed by the resource provider. + + :param resource_type: The resource type. + :type resource_type: str + :param locations: The collection of locations where this resource type can + be created. + :type locations: list[str] + :param aliases: The aliases that are supported by this resource type. + :type aliases: + list[~azure.mgmt.resource.resources.v2017_05_10.models.AliasType] + :param api_versions: The API version. + :type api_versions: list[str] + :param properties: The properties. + :type properties: dict[str, str] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, properties=None, **kwargs) -> None: + super(ProviderResourceType, self).__init__(**kwargs) + self.resource_type = resource_type + self.locations = locations + self.aliases = aliases + self.api_versions = api_versions + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource.py index 14a828e9001b..ecfd0cbb1b5c 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource.py @@ -13,7 +13,7 @@ class Resource(Model): - """Resource. + """Basic set of the resource properties. Variables are only populated by the server, and will be ignored when sending a request. @@ -44,10 +44,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group.py index e642f076890f..13bfa98e1630 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group.py @@ -18,6 +18,8 @@ class ResourceGroup(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The ID of the resource group. :vartype id: str :param name: The name of the resource group. @@ -25,9 +27,9 @@ class ResourceGroup(Model): :param properties: :type properties: ~azure.mgmt.resource.resources.v2017_05_10.models.ResourceGroupProperties - :param location: The location of the resource group. It cannot be changed - after the resource group has been created. It must be one of the supported - Azure locations. + :param location: Required. The location of the resource group. It cannot + be changed after the resource group has been created. It must be one of + the supported Azure locations. :type location: str :param managed_by: The ID of the resource that manages this resource group. @@ -50,11 +52,11 @@ class ResourceGroup(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, name=None, properties=None, managed_by=None, tags=None): - super(ResourceGroup, self).__init__() + def __init__(self, **kwargs): + super(ResourceGroup, self).__init__(**kwargs) self.id = None - self.name = name - self.properties = properties - self.location = location - self.managed_by = managed_by - self.tags = tags + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + self.location = kwargs.get('location', None) + self.managed_by = kwargs.get('managed_by', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_export_result.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_export_result.py index b8401dfd61b2..527d7884511d 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_export_result.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_export_result.py @@ -27,7 +27,7 @@ class ResourceGroupExportResult(Model): 'error': {'key': 'error', 'type': 'ResourceManagementErrorWithDetails'}, } - def __init__(self, template=None, error=None): - super(ResourceGroupExportResult, self).__init__() - self.template = template - self.error = error + def __init__(self, **kwargs): + super(ResourceGroupExportResult, self).__init__(**kwargs) + self.template = kwargs.get('template', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_export_result_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_export_result_py3.py new file mode 100644 index 000000000000..3470fcf529b4 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_export_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceGroupExportResult(Model): + """Resource group export result. + + :param template: The template content. + :type template: object + :param error: The error. + :type error: + ~azure.mgmt.resource.resources.v2017_05_10.models.ResourceManagementErrorWithDetails + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'error': {'key': 'error', 'type': 'ResourceManagementErrorWithDetails'}, + } + + def __init__(self, *, template=None, error=None, **kwargs) -> None: + super(ResourceGroupExportResult, self).__init__(**kwargs) + self.template = template + self.error = error diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_filter.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_filter.py index fa0011120785..c94284bf3644 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_filter.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_filter.py @@ -26,7 +26,7 @@ class ResourceGroupFilter(Model): 'tag_value': {'key': 'tagValue', 'type': 'str'}, } - def __init__(self, tag_name=None, tag_value=None): - super(ResourceGroupFilter, self).__init__() - self.tag_name = tag_name - self.tag_value = tag_value + def __init__(self, **kwargs): + super(ResourceGroupFilter, self).__init__(**kwargs) + self.tag_name = kwargs.get('tag_name', None) + self.tag_value = kwargs.get('tag_value', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_filter_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_filter_py3.py new file mode 100644 index 000000000000..d709b6afd34f --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_filter_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceGroupFilter(Model): + """Resource group filter. + + :param tag_name: The tag name. + :type tag_name: str + :param tag_value: The tag value. + :type tag_value: str + """ + + _attribute_map = { + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + } + + def __init__(self, *, tag_name: str=None, tag_value: str=None, **kwargs) -> None: + super(ResourceGroupFilter, self).__init__(**kwargs) + self.tag_name = tag_name + self.tag_value = tag_value diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_patchable.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_patchable.py index 9e71c53f7165..0f51ef0a5602 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_patchable.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_patchable.py @@ -34,9 +34,9 @@ class ResourceGroupPatchable(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, name=None, properties=None, managed_by=None, tags=None): - super(ResourceGroupPatchable, self).__init__() - self.name = name - self.properties = properties - self.managed_by = managed_by - self.tags = tags + def __init__(self, **kwargs): + super(ResourceGroupPatchable, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + self.managed_by = kwargs.get('managed_by', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_patchable_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_patchable_py3.py new file mode 100644 index 000000000000..f78ae3ff01ac --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_patchable_py3.py @@ -0,0 +1,42 @@ +# 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 ResourceGroupPatchable(Model): + """Resource group information. + + :param name: The name of the resource group. + :type name: str + :param properties: + :type properties: + ~azure.mgmt.resource.resources.v2017_05_10.models.ResourceGroupProperties + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, name: str=None, properties=None, managed_by: str=None, tags=None, **kwargs) -> None: + super(ResourceGroupPatchable, self).__init__(**kwargs) + self.name = name + self.properties = properties + self.managed_by = managed_by + self.tags = tags diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_properties.py index a6c35140c9d6..39411e3d79fb 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_properties.py @@ -30,6 +30,6 @@ class ResourceGroupProperties(Model): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } - def __init__(self): - super(ResourceGroupProperties, self).__init__() + def __init__(self, **kwargs): + super(ResourceGroupProperties, self).__init__(**kwargs) self.provisioning_state = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_properties_py3.py new file mode 100644 index 000000000000..67d6d06dedbd --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_properties_py3.py @@ -0,0 +1,35 @@ +# 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 ResourceGroupProperties(Model): + """The resource group properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceGroupProperties, self).__init__(**kwargs) + self.provisioning_state = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_py3.py new file mode 100644 index 000000000000..1f034dec564d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_group_py3.py @@ -0,0 +1,62 @@ +# 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 ResourceGroup(Model): + """Resource group information. + + 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 ID of the resource group. + :vartype id: str + :param name: The name of the resource group. + :type name: str + :param properties: + :type properties: + ~azure.mgmt.resource.resources.v2017_05_10.models.ResourceGroupProperties + :param location: Required. The location of the resource group. It cannot + be changed after the resource group has been created. It must be one of + the supported Azure locations. + :type location: str + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, name: str=None, properties=None, managed_by: str=None, tags=None, **kwargs) -> None: + super(ResourceGroup, self).__init__(**kwargs) + self.id = None + self.name = name + self.properties = properties + self.location = location + self.managed_by = managed_by + self.tags = tags diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_management_client_enums.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_management_client_enums.py index 011ae3609d77..3b6a0e19d760 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_management_client_enums.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_management_client_enums.py @@ -12,12 +12,12 @@ from enum import Enum -class DeploymentMode(Enum): +class DeploymentMode(str, Enum): incremental = "Incremental" complete = "Complete" -class ResourceIdentityType(Enum): +class ResourceIdentityType(str, Enum): system_assigned = "SystemAssigned" diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_management_error_with_details.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_management_error_with_details.py index 03e78c261a13..9b8e7bd74839 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_management_error_with_details.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_management_error_with_details.py @@ -43,8 +43,8 @@ class ResourceManagementErrorWithDetails(Model): 'details': {'key': 'details', 'type': '[ResourceManagementErrorWithDetails]'}, } - def __init__(self): - super(ResourceManagementErrorWithDetails, self).__init__() + def __init__(self, **kwargs): + super(ResourceManagementErrorWithDetails, self).__init__(**kwargs) self.code = None self.message = None self.target = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_management_error_with_details_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_management_error_with_details_py3.py new file mode 100644 index 000000000000..f6e0b337c987 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_management_error_with_details_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceManagementErrorWithDetails(Model): + """The detailed error message of resource management. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code returned when exporting the template. + :vartype code: str + :ivar message: The error message describing the export error. + :vartype message: str + :ivar target: The target of the error. + :vartype target: str + :ivar details: Validation error. + :vartype details: + list[~azure.mgmt.resource.resources.v2017_05_10.models.ResourceManagementErrorWithDetails] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ResourceManagementErrorWithDetails]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceManagementErrorWithDetails, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_provider_operation_display_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_provider_operation_display_properties.py index 6a1f181d764a..2a0106c3507e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_provider_operation_display_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_provider_operation_display_properties.py @@ -21,7 +21,7 @@ class ResourceProviderOperationDisplayProperties(Model): :type provider: str :param resource: Operation resource. :type resource: str - :param operation: Operation. + :param operation: The operation name. :type operation: str :param description: Operation description. :type description: str @@ -35,10 +35,10 @@ class ResourceProviderOperationDisplayProperties(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, publisher=None, provider=None, resource=None, operation=None, description=None): - super(ResourceProviderOperationDisplayProperties, self).__init__() - self.publisher = publisher - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(ResourceProviderOperationDisplayProperties, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_provider_operation_display_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_provider_operation_display_properties_py3.py new file mode 100644 index 000000000000..b4e722881910 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_provider_operation_display_properties_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceProviderOperationDisplayProperties(Model): + """Resource provider operation's display properties. + + :param publisher: Operation description. + :type publisher: str + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: The operation name. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, publisher: str=None, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(ResourceProviderOperationDisplayProperties, self).__init__(**kwargs) + self.publisher = publisher + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_py3.py new file mode 100644 index 000000000000..b7da9118d4f5 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resource_py3.py @@ -0,0 +1,53 @@ +# 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): + """Basic set of the resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': 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=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resources_move_info.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resources_move_info.py index a33bdefaeca1..edf946d7076b 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resources_move_info.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resources_move_info.py @@ -26,7 +26,7 @@ class ResourcesMoveInfo(Model): 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, } - def __init__(self, resources=None, target_resource_group=None): - super(ResourcesMoveInfo, self).__init__() - self.resources = resources - self.target_resource_group = target_resource_group + def __init__(self, **kwargs): + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + self.target_resource_group = kwargs.get('target_resource_group', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resources_move_info_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resources_move_info_py3.py new file mode 100644 index 000000000000..d10e2558d499 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/resources_move_info_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourcesMoveInfo(Model): + """Parameters of move resources. + + :param resources: The IDs of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + } + + def __init__(self, *, resources=None, target_resource_group: str=None, **kwargs) -> None: + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.resources = resources + self.target_resource_group = target_resource_group diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sku.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sku.py index 109278b7fe75..bfcda32477df 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sku.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sku.py @@ -38,11 +38,11 @@ class Sku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, size=None, family=None, model=None, capacity=None): - super(Sku, self).__init__() - self.name = name - self.tier = tier - self.size = size - self.family = family - self.model = model - self.capacity = capacity + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.model = kwargs.get('model', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sku_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sku_py3.py new file mode 100644 index 000000000000..676f1d770b79 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sku_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """SKU for the resource. + + :param name: The SKU name. + :type name: str + :param tier: The SKU tier. + :type tier: str + :param size: The SKU size. + :type size: str + :param family: The SKU family. + :type family: str + :param model: The SKU model. + :type model: str + :param capacity: The SKU capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'model': {'key': 'model', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, tier: str=None, size: str=None, family: str=None, model: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.model = model + self.capacity = capacity diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sub_resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sub_resource.py index 2d6ffc89a72e..ca48705cc825 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sub_resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sub_resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sub_resource_py3.py new file mode 100644 index 000000000000..b2d0251b79df --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """Sub-resource. + + :param id: Resource ID + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_count.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_count.py index a94e6ef38d55..a5eeb6b38cf8 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_count.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_count.py @@ -26,7 +26,7 @@ class TagCount(Model): 'value': {'key': 'value', 'type': 'int'}, } - def __init__(self, type=None, value=None): - super(TagCount, self).__init__() - self.type = type - self.value = value + def __init__(self, **kwargs): + super(TagCount, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_count_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_count_py3.py new file mode 100644 index 000000000000..53c80f63fdb3 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_count_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TagCount(Model): + """Tag count. + + :param type: Type of count. + :type type: str + :param value: Value of count. + :type value: int + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'int'}, + } + + def __init__(self, *, type: str=None, value: int=None, **kwargs) -> None: + super(TagCount, self).__init__(**kwargs) + self.type = type + self.value = value diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_details.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_details.py index 43e5f568cf1d..ebefcbf25918 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_details.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_details.py @@ -15,8 +15,11 @@ class TagDetails(Model): """Tag details. - :param id: The tag ID. - :type id: str + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str :param tag_name: The tag name. :type tag_name: str :param count: The total number of resources that use the resource tag. @@ -28,6 +31,10 @@ class TagDetails(Model): list[~azure.mgmt.resource.resources.v2017_05_10.models.TagValue] """ + _validation = { + 'id': {'readonly': True}, + } + _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'tag_name': {'key': 'tagName', 'type': 'str'}, @@ -35,9 +42,9 @@ class TagDetails(Model): 'values': {'key': 'values', 'type': '[TagValue]'}, } - def __init__(self, id=None, tag_name=None, count=None, values=None): - super(TagDetails, self).__init__() - self.id = id - self.tag_name = tag_name - self.count = count - self.values = values + def __init__(self, **kwargs): + super(TagDetails, self).__init__(**kwargs) + self.id = None + self.tag_name = kwargs.get('tag_name', None) + self.count = kwargs.get('count', None) + self.values = kwargs.get('values', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_details_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_details_py3.py new file mode 100644 index 000000000000..1ea814e91394 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_details_py3.py @@ -0,0 +1,50 @@ +# 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 TagDetails(Model): + """Tag details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str + :param tag_name: The tag name. + :type tag_name: str + :param count: The total number of resources that use the resource tag. + When a tag is initially created and has no associated resources, the value + is 0. + :type count: ~azure.mgmt.resource.resources.v2017_05_10.models.TagCount + :param values: The list of tag values. + :type values: + list[~azure.mgmt.resource.resources.v2017_05_10.models.TagValue] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + 'values': {'key': 'values', 'type': '[TagValue]'}, + } + + def __init__(self, *, tag_name: str=None, count=None, values=None, **kwargs) -> None: + super(TagDetails, self).__init__(**kwargs) + self.id = None + self.tag_name = tag_name + self.count = count + self.values = values diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_value.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_value.py index b48963c7424c..f44c7d51af67 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_value.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_value.py @@ -15,22 +15,29 @@ class TagValue(Model): """Tag information. - :param id: The tag ID. - :type id: str + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str :param tag_value: The tag value. :type tag_value: str :param count: The tag value count. :type count: ~azure.mgmt.resource.resources.v2017_05_10.models.TagCount """ + _validation = { + 'id': {'readonly': True}, + } + _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'tag_value': {'key': 'tagValue', 'type': 'str'}, 'count': {'key': 'count', 'type': 'TagCount'}, } - def __init__(self, id=None, tag_value=None, count=None): - super(TagValue, self).__init__() - self.id = id - self.tag_value = tag_value - self.count = count + def __init__(self, **kwargs): + super(TagValue, self).__init__(**kwargs) + self.id = None + self.tag_value = kwargs.get('tag_value', None) + self.count = kwargs.get('count', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_value_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_value_py3.py new file mode 100644 index 000000000000..54591bc152e4 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/tag_value_py3.py @@ -0,0 +1,43 @@ +# 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 TagValue(Model): + """Tag information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str + :param tag_value: The tag value. + :type tag_value: str + :param count: The tag value count. + :type count: ~azure.mgmt.resource.resources.v2017_05_10.models.TagCount + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + } + + def __init__(self, *, tag_value: str=None, count=None, **kwargs) -> None: + super(TagValue, self).__init__(**kwargs) + self.id = None + self.tag_value = tag_value + self.count = count diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/target_resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/target_resource.py index 311bd74c9c2d..27d557645e8b 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/target_resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/target_resource.py @@ -29,8 +29,8 @@ class TargetResource(Model): 'resource_type': {'key': 'resourceType', 'type': 'str'}, } - def __init__(self, id=None, resource_name=None, resource_type=None): - super(TargetResource, self).__init__() - self.id = id - self.resource_name = resource_name - self.resource_type = resource_type + def __init__(self, **kwargs): + super(TargetResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.resource_name = kwargs.get('resource_name', None) + self.resource_type = kwargs.get('resource_type', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/target_resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/target_resource_py3.py new file mode 100644 index 000000000000..933347cec8f8 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/target_resource_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TargetResource(Model): + """Target resource. + + :param id: The ID of the resource. + :type id: str + :param resource_name: The name of the resource. + :type resource_name: str + :param resource_type: The type of the resource. + :type resource_type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, resource_name: str=None, resource_type: str=None, **kwargs) -> None: + super(TargetResource, self).__init__(**kwargs) + self.id = id + self.resource_name = resource_name + self.resource_type = resource_type diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/template_link.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/template_link.py index 7a29c00576bb..634095bb9754 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/template_link.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/template_link.py @@ -15,7 +15,9 @@ class TemplateLink(Model): """Entity representing the reference to the template. - :param uri: The URI of the template to deploy. + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the template to deploy. :type uri: str :param content_version: If included, must match the ContentVersion in the template. @@ -31,7 +33,7 @@ class TemplateLink(Model): 'content_version': {'key': 'contentVersion', 'type': 'str'}, } - def __init__(self, uri, content_version=None): - super(TemplateLink, self).__init__() - self.uri = uri - self.content_version = content_version + def __init__(self, **kwargs): + super(TemplateLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.content_version = kwargs.get('content_version', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/template_link_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/template_link_py3.py new file mode 100644 index 000000000000..00f2597ccd98 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/template_link_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TemplateLink(Model): + """Entity representing the reference to the template. + + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the template to deploy. + :type uri: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + } + + def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: + super(TemplateLink, self).__init__(**kwargs) + self.uri = uri + self.content_version = content_version diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/deployments_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/deployments_operations.py index 4fe757a41efc..4ebba1bb93a2 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/deployments_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/deployments_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a deployment from the deployment history. A template deployment that is currently running cannot be deleted. @@ -100,12 +100,14 @@ def delete( :param deployment_name: The name of the deployment to delete. :type deployment_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -115,40 +117,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} def check_existence( @@ -263,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, deployment_name, properties, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, deployment_name, properties, custom_headers=None, raw=False, polling=True, **operation_config): """Deploys resources to a resource group. You can provide the template and parameters directly in the request or @@ -279,13 +260,16 @@ def create_or_update( :type properties: ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentProperties :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - DeploymentExtended or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentExtended or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentExtended] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentExtended]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -296,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('DeploymentExtended', response) if raw: @@ -328,12 +290,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} def get( diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/resource_groups_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/resource_groups_operations.py index 78fe91152e55..31c8500d83d8 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/resource_groups_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/resource_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -203,7 +203,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a resource group. When you delete a resource group, all of its resources are also @@ -214,12 +214,14 @@ def delete( The name is case insensitive. :type resource_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -228,40 +230,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} def get( diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/resources_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/resources_operations.py index db6363e89600..b9bc462e3e60 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/resources_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/resources_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -166,7 +166,7 @@ def _move_resources_initial( return client_raw_response def move_resources( - self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, **operation_config): + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, polling=True, **operation_config): """Moves resources from one resource group to another resource group. The resources to move must be in the same source resource group. The @@ -183,12 +183,14 @@ def move_resources( :param target_resource_group: The target resource group. :type target_resource_group: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._move_resources_initial( @@ -199,40 +201,19 @@ def move_resources( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) move_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources'} @@ -280,7 +261,7 @@ def _validate_move_resources_initial( return client_raw_response def validate_move_resources( - self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, **operation_config): + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, polling=True, **operation_config): """Validates whether resources can be moved from one resource group to another resource group. @@ -300,12 +281,14 @@ def validate_move_resources( :param target_resource_group: The target resource group. :type target_resource_group: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._validate_move_resources_initial( @@ -316,40 +299,19 @@ def validate_move_resources( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204, 409]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) validate_move_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources'} def list( @@ -543,7 +505,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a resource. :param resource_group_name: The name of the resource group that @@ -561,12 +523,14 @@ def delete( :param api_version: The API version to use for the operation. :type api_version: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -580,40 +544,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} @@ -672,7 +615,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates a resource. :param resource_group_name: The name of the resource group for the @@ -693,13 +636,16 @@ def create_or_update( :type parameters: ~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GenericResource or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -714,30 +660,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GenericResource', response) if raw: @@ -746,12 +670,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} @@ -808,7 +733,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a resource. :param resource_group_name: The name of the resource group for the @@ -829,13 +754,16 @@ def update( :type parameters: ~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GenericResource or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -850,30 +778,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GenericResource', response) if raw: @@ -882,12 +788,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} def get( @@ -1060,7 +967,7 @@ def _delete_by_id_initial( return client_raw_response def delete_by_id( - self, resource_id, api_version, custom_headers=None, raw=False, **operation_config): + self, resource_id, api_version, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a resource by ID. :param resource_id: The fully qualified ID of the resource, including @@ -1070,12 +977,14 @@ def delete_by_id( :param api_version: The API version to use for the operation. :type api_version: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_by_id_initial( @@ -1085,40 +994,19 @@ def delete_by_id( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete_by_id.metadata = {'url': '/{resourceId}'} @@ -1172,7 +1060,7 @@ def _create_or_update_by_id_initial( return deserialized def create_or_update_by_id( - self, resource_id, api_version, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_id, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create a resource by ID. :param resource_id: The fully qualified ID of the resource, including @@ -1185,13 +1073,16 @@ def create_or_update_by_id( :type parameters: ~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GenericResource or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_by_id_initial( @@ -1202,30 +1093,8 @@ def create_or_update_by_id( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GenericResource', response) if raw: @@ -1234,12 +1103,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update_by_id.metadata = {'url': '/{resourceId}'} @@ -1291,7 +1161,7 @@ def _update_by_id_initial( return deserialized def update_by_id( - self, resource_id, api_version, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_id, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a resource by ID. :param resource_id: The fully qualified ID of the resource, including @@ -1304,13 +1174,16 @@ def update_by_id( :type parameters: ~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GenericResource or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource]] :raises: :class:`CloudError` """ raw_result = self._update_by_id_initial( @@ -1321,30 +1194,8 @@ def update_by_id( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GenericResource', response) if raw: @@ -1353,12 +1204,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update_by_id.metadata = {'url': '/{resourceId}'} def get_by_id( diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/resource_management_client.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/resource_management_client.py index 5b86f00197fb..1e8e488a20da 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/resource_management_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/resource_management_client.py @@ -9,7 +9,7 @@ # 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 @@ -54,7 +54,7 @@ def __init__( self.subscription_id = subscription_id -class ResourceManagementClient(object): +class ResourceManagementClient(SDKClient): """Provides operations for working with resources and resource groups. :ivar config: Configuration for client. @@ -85,7 +85,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = ResourceManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(ResourceManagementClient, 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 = '2017-05-10' diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/__init__.py new file mode 100644 index 000000000000..d2e3198e88e6 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/__init__.py @@ -0,0 +1,18 @@ +# 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_management_client import ResourceManagementClient +from .version import VERSION + +__all__ = ['ResourceManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py new file mode 100644 index 000000000000..ae4447cedf0d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py @@ -0,0 +1,159 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .deployment_extended_filter_py3 import DeploymentExtendedFilter + from .generic_resource_filter_py3 import GenericResourceFilter + from .resource_group_filter_py3 import ResourceGroupFilter + from .template_link_py3 import TemplateLink + from .parameters_link_py3 import ParametersLink + from .debug_setting_py3 import DebugSetting + from .on_error_deployment_py3 import OnErrorDeployment + from .deployment_properties_py3 import DeploymentProperties + from .deployment_py3 import Deployment + from .deployment_export_result_py3 import DeploymentExportResult + from .resource_management_error_with_details_py3 import ResourceManagementErrorWithDetails + from .alias_path_type_py3 import AliasPathType + from .alias_type_py3 import AliasType + from .provider_resource_type_py3 import ProviderResourceType + from .provider_py3 import Provider + from .basic_dependency_py3 import BasicDependency + from .dependency_py3 import Dependency + from .on_error_deployment_extended_py3 import OnErrorDeploymentExtended + from .deployment_properties_extended_py3 import DeploymentPropertiesExtended + from .deployment_validate_result_py3 import DeploymentValidateResult + from .deployment_extended_py3 import DeploymentExtended + from .plan_py3 import Plan + from .sku_py3 import Sku + from .identity_py3 import Identity + from .generic_resource_py3 import GenericResource + from .resource_group_properties_py3 import ResourceGroupProperties + from .resource_group_py3 import ResourceGroup + from .resource_group_patchable_py3 import ResourceGroupPatchable + from .resources_move_info_py3 import ResourcesMoveInfo + from .export_template_request_py3 import ExportTemplateRequest + from .tag_count_py3 import TagCount + from .tag_value_py3 import TagValue + from .tag_details_py3 import TagDetails + from .target_resource_py3 import TargetResource + from .http_message_py3 import HttpMessage + from .deployment_operation_properties_py3 import DeploymentOperationProperties + from .deployment_operation_py3 import DeploymentOperation + from .resource_provider_operation_display_properties_py3 import ResourceProviderOperationDisplayProperties + from .resource_py3 import Resource + from .sub_resource_py3 import SubResource + from .resource_group_export_result_py3 import ResourceGroupExportResult +except (SyntaxError, ImportError): + from .deployment_extended_filter import DeploymentExtendedFilter + from .generic_resource_filter import GenericResourceFilter + from .resource_group_filter import ResourceGroupFilter + from .template_link import TemplateLink + from .parameters_link import ParametersLink + from .debug_setting import DebugSetting + from .on_error_deployment import OnErrorDeployment + from .deployment_properties import DeploymentProperties + from .deployment import Deployment + from .deployment_export_result import DeploymentExportResult + from .resource_management_error_with_details import ResourceManagementErrorWithDetails + from .alias_path_type import AliasPathType + from .alias_type import AliasType + from .provider_resource_type import ProviderResourceType + from .provider import Provider + from .basic_dependency import BasicDependency + from .dependency import Dependency + from .on_error_deployment_extended import OnErrorDeploymentExtended + from .deployment_properties_extended import DeploymentPropertiesExtended + from .deployment_validate_result import DeploymentValidateResult + from .deployment_extended import DeploymentExtended + from .plan import Plan + from .sku import Sku + from .identity import Identity + from .generic_resource import GenericResource + from .resource_group_properties import ResourceGroupProperties + from .resource_group import ResourceGroup + from .resource_group_patchable import ResourceGroupPatchable + from .resources_move_info import ResourcesMoveInfo + from .export_template_request import ExportTemplateRequest + from .tag_count import TagCount + from .tag_value import TagValue + from .tag_details import TagDetails + from .target_resource import TargetResource + from .http_message import HttpMessage + from .deployment_operation_properties import DeploymentOperationProperties + from .deployment_operation import DeploymentOperation + from .resource_provider_operation_display_properties import ResourceProviderOperationDisplayProperties + from .resource import Resource + from .sub_resource import SubResource + from .resource_group_export_result import ResourceGroupExportResult +from .deployment_extended_paged import DeploymentExtendedPaged +from .provider_paged import ProviderPaged +from .generic_resource_paged import GenericResourcePaged +from .resource_group_paged import ResourceGroupPaged +from .tag_details_paged import TagDetailsPaged +from .deployment_operation_paged import DeploymentOperationPaged +from .resource_management_client_enums import ( + DeploymentMode, + OnErrorDeploymentType, + ResourceIdentityType, +) + +__all__ = [ + 'DeploymentExtendedFilter', + 'GenericResourceFilter', + 'ResourceGroupFilter', + 'TemplateLink', + 'ParametersLink', + 'DebugSetting', + 'OnErrorDeployment', + 'DeploymentProperties', + 'Deployment', + 'DeploymentExportResult', + 'ResourceManagementErrorWithDetails', + 'AliasPathType', + 'AliasType', + 'ProviderResourceType', + 'Provider', + 'BasicDependency', + 'Dependency', + 'OnErrorDeploymentExtended', + 'DeploymentPropertiesExtended', + 'DeploymentValidateResult', + 'DeploymentExtended', + 'Plan', + 'Sku', + 'Identity', + 'GenericResource', + 'ResourceGroupProperties', + 'ResourceGroup', + 'ResourceGroupPatchable', + 'ResourcesMoveInfo', + 'ExportTemplateRequest', + 'TagCount', + 'TagValue', + 'TagDetails', + 'TargetResource', + 'HttpMessage', + 'DeploymentOperationProperties', + 'DeploymentOperation', + 'ResourceProviderOperationDisplayProperties', + 'Resource', + 'SubResource', + 'ResourceGroupExportResult', + 'DeploymentExtendedPaged', + 'ProviderPaged', + 'GenericResourcePaged', + 'ResourceGroupPaged', + 'TagDetailsPaged', + 'DeploymentOperationPaged', + 'DeploymentMode', + 'OnErrorDeploymentType', + 'ResourceIdentityType', +] diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/alias_path_type.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/alias_path_type.py new file mode 100644 index 000000000000..ee5959ef5463 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/alias_path_type.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AliasPathType(Model): + """The type of the paths for alias. . + + :param path: The path of an alias. + :type path: str + :param api_versions: The API versions. + :type api_versions: list[str] + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AliasPathType, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.api_versions = kwargs.get('api_versions', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/alias_path_type_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/alias_path_type_py3.py new file mode 100644 index 000000000000..ccd48141f917 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/alias_path_type_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AliasPathType(Model): + """The type of the paths for alias. . + + :param path: The path of an alias. + :type path: str + :param api_versions: The API versions. + :type api_versions: list[str] + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + } + + def __init__(self, *, path: str=None, api_versions=None, **kwargs) -> None: + super(AliasPathType, self).__init__(**kwargs) + self.path = path + self.api_versions = api_versions diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/alias_type.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/alias_type.py new file mode 100644 index 000000000000..431b2a903825 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/alias_type.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AliasType(Model): + """The alias type. . + + :param name: The alias name. + :type name: str + :param paths: The paths for an alias. + :type paths: + list[~azure.mgmt.resource.resources.v2018_02_01.models.AliasPathType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'paths': {'key': 'paths', 'type': '[AliasPathType]'}, + } + + def __init__(self, **kwargs): + super(AliasType, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.paths = kwargs.get('paths', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/alias_type_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/alias_type_py3.py new file mode 100644 index 000000000000..bfc87d90df3b --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/alias_type_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AliasType(Model): + """The alias type. . + + :param name: The alias name. + :type name: str + :param paths: The paths for an alias. + :type paths: + list[~azure.mgmt.resource.resources.v2018_02_01.models.AliasPathType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'paths': {'key': 'paths', 'type': '[AliasPathType]'}, + } + + def __init__(self, *, name: str=None, paths=None, **kwargs) -> None: + super(AliasType, self).__init__(**kwargs) + self.name = name + self.paths = paths diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/basic_dependency.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/basic_dependency.py new file mode 100644 index 000000000000..3a5ccd4aa464 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/basic_dependency.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BasicDependency(Model): + """Deployment dependency information. + + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BasicDependency, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_name = kwargs.get('resource_name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/basic_dependency_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/basic_dependency_py3.py new file mode 100644 index 000000000000..49d821737930 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/basic_dependency_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BasicDependency(Model): + """Deployment dependency information. + + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, resource_type: str=None, resource_name: str=None, **kwargs) -> None: + super(BasicDependency, self).__init__(**kwargs) + self.id = id + self.resource_type = resource_type + self.resource_name = resource_name diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/debug_setting.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/debug_setting.py new file mode 100644 index 000000000000..d6f778c5c86d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/debug_setting.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DebugSetting(Model): + """DebugSetting. + + :param detail_level: Specifies the type of information to log for + debugging. The permitted values are none, requestContent, responseContent, + or both requestContent and responseContent separated by a comma. The + default is none. When setting this value, carefully consider the type of + information you are passing in during deployment. By logging information + about the request or response, you could potentially expose sensitive data + that is retrieved through the deployment operations. + :type detail_level: str + """ + + _attribute_map = { + 'detail_level': {'key': 'detailLevel', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DebugSetting, self).__init__(**kwargs) + self.detail_level = kwargs.get('detail_level', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/debug_setting_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/debug_setting_py3.py new file mode 100644 index 000000000000..af571a729762 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/debug_setting_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DebugSetting(Model): + """DebugSetting. + + :param detail_level: Specifies the type of information to log for + debugging. The permitted values are none, requestContent, responseContent, + or both requestContent and responseContent separated by a comma. The + default is none. When setting this value, carefully consider the type of + information you are passing in during deployment. By logging information + about the request or response, you could potentially expose sensitive data + that is retrieved through the deployment operations. + :type detail_level: str + """ + + _attribute_map = { + 'detail_level': {'key': 'detailLevel', 'type': 'str'}, + } + + def __init__(self, *, detail_level: str=None, **kwargs) -> None: + super(DebugSetting, self).__init__(**kwargs) + self.detail_level = detail_level diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/dependency.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/dependency.py new file mode 100644 index 000000000000..759549b0df7f --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/dependency.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Dependency(Model): + """Deployment dependency information. + + :param depends_on: The list of dependencies. + :type depends_on: + list[~azure.mgmt.resource.resources.v2018_02_01.models.BasicDependency] + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'depends_on': {'key': 'dependsOn', 'type': '[BasicDependency]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dependency, self).__init__(**kwargs) + self.depends_on = kwargs.get('depends_on', None) + self.id = kwargs.get('id', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_name = kwargs.get('resource_name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/dependency_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/dependency_py3.py new file mode 100644 index 000000000000..c45f51e11c5d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/dependency_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Dependency(Model): + """Deployment dependency information. + + :param depends_on: The list of dependencies. + :type depends_on: + list[~azure.mgmt.resource.resources.v2018_02_01.models.BasicDependency] + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'depends_on': {'key': 'dependsOn', 'type': '[BasicDependency]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, *, depends_on=None, id: str=None, resource_type: str=None, resource_name: str=None, **kwargs) -> None: + super(Dependency, self).__init__(**kwargs) + self.depends_on = depends_on + self.id = id + self.resource_type = resource_type + self.resource_name = resource_name diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment.py new file mode 100644 index 000000000000..8d7e061526ea --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment.py @@ -0,0 +1,35 @@ +# 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 Deployment(Model): + """Deployment operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentProperties + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + } + + def __init__(self, **kwargs): + super(Deployment, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_export_result.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_export_result.py new file mode 100644 index 000000000000..807e79c8b678 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_export_result.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExportResult(Model): + """The deployment export result. . + + :param template: The template content. + :type template: object + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(DeploymentExportResult, self).__init__(**kwargs) + self.template = kwargs.get('template', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_export_result_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_export_result_py3.py new file mode 100644 index 000000000000..63f10bf2735a --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_export_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExportResult(Model): + """The deployment export result. . + + :param template: The template content. + :type template: object + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, *, template=None, **kwargs) -> None: + super(DeploymentExportResult, self).__init__(**kwargs) + self.template = template diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended.py new file mode 100644 index 000000000000..95ec87a87549 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExtended(Model): + """Deployment information. + + 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 ID of the deployment. + :vartype id: str + :param name: Required. The name of the deployment. + :type name: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentPropertiesExtended + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + } + + def __init__(self, **kwargs): + super(DeploymentExtended, self).__init__(**kwargs) + self.id = None + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended_filter.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended_filter.py new file mode 100644 index 000000000000..0839bcc12e4e --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended_filter.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExtendedFilter(Model): + """Deployment filter. + + :param provisioning_state: The provisioning state. + :type provisioning_state: str + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeploymentExtendedFilter, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended_filter_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended_filter_py3.py new file mode 100644 index 000000000000..f06d0d1a4dfb --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended_filter_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExtendedFilter(Model): + """Deployment filter. + + :param provisioning_state: The provisioning state. + :type provisioning_state: str + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, provisioning_state: str=None, **kwargs) -> None: + super(DeploymentExtendedFilter, self).__init__(**kwargs) + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended_paged.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended_paged.py new file mode 100644 index 000000000000..61a16fb15dff --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class DeploymentExtendedPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeploymentExtended ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeploymentExtended]'} + } + + def __init__(self, *args, **kwargs): + + super(DeploymentExtendedPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended_py3.py new file mode 100644 index 000000000000..0f0afa51c488 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_extended_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentExtended(Model): + """Deployment information. + + 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 ID of the deployment. + :vartype id: str + :param name: Required. The name of the deployment. + :type name: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentPropertiesExtended + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + } + + def __init__(self, *, name: str, properties=None, **kwargs) -> None: + super(DeploymentExtended, self).__init__(**kwargs) + self.id = None + self.name = name + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation.py new file mode 100644 index 000000000000..dd24347ab3fb --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentOperation(Model): + """Deployment operation information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Full deployment operation ID. + :vartype id: str + :ivar operation_id: Deployment operation ID. + :vartype operation_id: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentOperationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentOperationProperties'}, + } + + def __init__(self, **kwargs): + super(DeploymentOperation, self).__init__(**kwargs) + self.id = None + self.operation_id = None + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation_paged.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation_paged.py new file mode 100644 index 000000000000..443462fdfe33 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class DeploymentOperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeploymentOperation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeploymentOperation]'} + } + + def __init__(self, *args, **kwargs): + + super(DeploymentOperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation_properties.py new file mode 100644 index 000000000000..7f6b05659885 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation_properties.py @@ -0,0 +1,73 @@ +# 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 DeploymentOperationProperties(Model): + """Deployment operation properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the provisioning. + :vartype provisioning_state: str + :ivar timestamp: The date and time of the operation. + :vartype timestamp: datetime + :ivar service_request_id: Deployment operation service request id. + :vartype service_request_id: str + :ivar status_code: Operation status code. + :vartype status_code: str + :ivar status_message: Operation status message. + :vartype status_message: object + :ivar target_resource: The target resource. + :vartype target_resource: + ~azure.mgmt.resource.resources.v2018_02_01.models.TargetResource + :ivar request: The HTTP request message. + :vartype request: + ~azure.mgmt.resource.resources.v2018_02_01.models.HttpMessage + :ivar response: The HTTP response message. + :vartype response: + ~azure.mgmt.resource.resources.v2018_02_01.models.HttpMessage + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'service_request_id': {'readonly': True}, + 'status_code': {'readonly': True}, + 'status_message': {'readonly': True}, + 'target_resource': {'readonly': True}, + 'request': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'service_request_id': {'key': 'serviceRequestId', 'type': 'str'}, + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'status_message': {'key': 'statusMessage', 'type': 'object'}, + 'target_resource': {'key': 'targetResource', 'type': 'TargetResource'}, + 'request': {'key': 'request', 'type': 'HttpMessage'}, + 'response': {'key': 'response', 'type': 'HttpMessage'}, + } + + def __init__(self, **kwargs): + super(DeploymentOperationProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.timestamp = None + self.service_request_id = None + self.status_code = None + self.status_message = None + self.target_resource = None + self.request = None + self.response = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation_properties_py3.py new file mode 100644 index 000000000000..4b53e8b814e4 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation_properties_py3.py @@ -0,0 +1,73 @@ +# 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 DeploymentOperationProperties(Model): + """Deployment operation properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the provisioning. + :vartype provisioning_state: str + :ivar timestamp: The date and time of the operation. + :vartype timestamp: datetime + :ivar service_request_id: Deployment operation service request id. + :vartype service_request_id: str + :ivar status_code: Operation status code. + :vartype status_code: str + :ivar status_message: Operation status message. + :vartype status_message: object + :ivar target_resource: The target resource. + :vartype target_resource: + ~azure.mgmt.resource.resources.v2018_02_01.models.TargetResource + :ivar request: The HTTP request message. + :vartype request: + ~azure.mgmt.resource.resources.v2018_02_01.models.HttpMessage + :ivar response: The HTTP response message. + :vartype response: + ~azure.mgmt.resource.resources.v2018_02_01.models.HttpMessage + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'service_request_id': {'readonly': True}, + 'status_code': {'readonly': True}, + 'status_message': {'readonly': True}, + 'target_resource': {'readonly': True}, + 'request': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'service_request_id': {'key': 'serviceRequestId', 'type': 'str'}, + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'status_message': {'key': 'statusMessage', 'type': 'object'}, + 'target_resource': {'key': 'targetResource', 'type': 'TargetResource'}, + 'request': {'key': 'request', 'type': 'HttpMessage'}, + 'response': {'key': 'response', 'type': 'HttpMessage'}, + } + + def __init__(self, **kwargs) -> None: + super(DeploymentOperationProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.timestamp = None + self.service_request_id = None + self.status_code = None + self.status_message = None + self.target_resource = None + self.request = None + self.response = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation_py3.py new file mode 100644 index 000000000000..0e8e9069c2a1 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_operation_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentOperation(Model): + """Deployment operation information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Full deployment operation ID. + :vartype id: str + :ivar operation_id: Deployment operation ID. + :vartype operation_id: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentOperationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentOperationProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(DeploymentOperation, self).__init__(**kwargs) + self.id = None + self.operation_id = None + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_properties.py new file mode 100644 index 000000000000..1f6039eabf17 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_properties.py @@ -0,0 +1,81 @@ +# 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 DeploymentProperties(Model): + """Deployment properties. + + All required parameters must be populated in order to send to Azure. + + :param template: The template content. You use this element when you want + to pass the template syntax directly in the request rather than link to an + existing template. It can be a JObject or well-formed JSON string. Use + either the templateLink property or the template property, but not both. + :type template: object + :param template_link: The URI of the template. Use either the templateLink + property or the template property, but not both. + :type template_link: + ~azure.mgmt.resource.resources.v2018_02_01.models.TemplateLink + :param parameters: Name and value pairs that define the deployment + parameters for the template. You use this element when you want to provide + the parameter values directly in the request rather than link to an + existing parameter file. Use either the parametersLink property or the + parameters property, but not both. It can be a JObject or a well formed + JSON string. + :type parameters: object + :param parameters_link: The URI of parameters file. You use this element + to link to an existing parameters file. Use either the parametersLink + property or the parameters property, but not both. + :type parameters_link: + ~azure.mgmt.resource.resources.v2018_02_01.models.ParametersLink + :param mode: Required. The mode that is used to deploy resources. This + value can be either Incremental or Complete. In Incremental mode, + resources are deployed without deleting existing resources that are not + included in the template. In Complete mode, resources are deployed and + existing resources in the resource group that are not included in the + template are deleted. Be careful when using Complete mode as you may + unintentionally delete resources. Possible values include: 'Incremental', + 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2018_02_01.models.DebugSetting + :param on_error_deployment: The deployment on error behavior. + :type on_error_deployment: + ~azure.mgmt.resource.resources.v2018_02_01.models.OnErrorDeployment + """ + + _validation = { + 'mode': {'required': True}, + } + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeployment'}, + } + + def __init__(self, **kwargs): + super(DeploymentProperties, self).__init__(**kwargs) + self.template = kwargs.get('template', None) + self.template_link = kwargs.get('template_link', None) + self.parameters = kwargs.get('parameters', None) + self.parameters_link = kwargs.get('parameters_link', None) + self.mode = kwargs.get('mode', None) + self.debug_setting = kwargs.get('debug_setting', None) + self.on_error_deployment = kwargs.get('on_error_deployment', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_properties_extended.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_properties_extended.py new file mode 100644 index 000000000000..eb120e6b8eec --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_properties_extended.py @@ -0,0 +1,98 @@ +# 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 DeploymentPropertiesExtended(Model): + """Deployment properties with additional details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the provisioning. + :vartype provisioning_state: str + :ivar correlation_id: The correlation ID of the deployment. + :vartype correlation_id: str + :ivar timestamp: The timestamp of the template deployment. + :vartype timestamp: datetime + :param outputs: Key/value pairs that represent deploymentoutput. + :type outputs: object + :param providers: The list of resource providers needed for the + deployment. + :type providers: + list[~azure.mgmt.resource.resources.v2018_02_01.models.Provider] + :param dependencies: The list of deployment dependencies. + :type dependencies: + list[~azure.mgmt.resource.resources.v2018_02_01.models.Dependency] + :param template: The template content. Use only one of Template or + TemplateLink. + :type template: object + :param template_link: The URI referencing the template. Use only one of + Template or TemplateLink. + :type template_link: + ~azure.mgmt.resource.resources.v2018_02_01.models.TemplateLink + :param parameters: Deployment parameters. Use only one of Parameters or + ParametersLink. + :type parameters: object + :param parameters_link: The URI referencing the parameters. Use only one + of Parameters or ParametersLink. + :type parameters_link: + ~azure.mgmt.resource.resources.v2018_02_01.models.ParametersLink + :param mode: The deployment mode. Possible values are Incremental and + Complete. Possible values include: 'Incremental', 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2018_02_01.models.DebugSetting + :param on_error_deployment: The deployment on error behavior. + :type on_error_deployment: + ~azure.mgmt.resource.resources.v2018_02_01.models.OnErrorDeploymentExtended + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'timestamp': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'providers': {'key': 'providers', 'type': '[Provider]'}, + 'dependencies': {'key': 'dependencies', 'type': '[Dependency]'}, + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeploymentExtended'}, + } + + def __init__(self, **kwargs): + super(DeploymentPropertiesExtended, self).__init__(**kwargs) + self.provisioning_state = None + self.correlation_id = None + self.timestamp = None + self.outputs = kwargs.get('outputs', None) + self.providers = kwargs.get('providers', None) + self.dependencies = kwargs.get('dependencies', None) + self.template = kwargs.get('template', None) + self.template_link = kwargs.get('template_link', None) + self.parameters = kwargs.get('parameters', None) + self.parameters_link = kwargs.get('parameters_link', None) + self.mode = kwargs.get('mode', None) + self.debug_setting = kwargs.get('debug_setting', None) + self.on_error_deployment = kwargs.get('on_error_deployment', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_properties_extended_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_properties_extended_py3.py new file mode 100644 index 000000000000..7bd847dd042a --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_properties_extended_py3.py @@ -0,0 +1,98 @@ +# 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 DeploymentPropertiesExtended(Model): + """Deployment properties with additional details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the provisioning. + :vartype provisioning_state: str + :ivar correlation_id: The correlation ID of the deployment. + :vartype correlation_id: str + :ivar timestamp: The timestamp of the template deployment. + :vartype timestamp: datetime + :param outputs: Key/value pairs that represent deploymentoutput. + :type outputs: object + :param providers: The list of resource providers needed for the + deployment. + :type providers: + list[~azure.mgmt.resource.resources.v2018_02_01.models.Provider] + :param dependencies: The list of deployment dependencies. + :type dependencies: + list[~azure.mgmt.resource.resources.v2018_02_01.models.Dependency] + :param template: The template content. Use only one of Template or + TemplateLink. + :type template: object + :param template_link: The URI referencing the template. Use only one of + Template or TemplateLink. + :type template_link: + ~azure.mgmt.resource.resources.v2018_02_01.models.TemplateLink + :param parameters: Deployment parameters. Use only one of Parameters or + ParametersLink. + :type parameters: object + :param parameters_link: The URI referencing the parameters. Use only one + of Parameters or ParametersLink. + :type parameters_link: + ~azure.mgmt.resource.resources.v2018_02_01.models.ParametersLink + :param mode: The deployment mode. Possible values are Incremental and + Complete. Possible values include: 'Incremental', 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2018_02_01.models.DebugSetting + :param on_error_deployment: The deployment on error behavior. + :type on_error_deployment: + ~azure.mgmt.resource.resources.v2018_02_01.models.OnErrorDeploymentExtended + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'timestamp': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'providers': {'key': 'providers', 'type': '[Provider]'}, + 'dependencies': {'key': 'dependencies', 'type': '[Dependency]'}, + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeploymentExtended'}, + } + + def __init__(self, *, outputs=None, providers=None, dependencies=None, template=None, template_link=None, parameters=None, parameters_link=None, mode=None, debug_setting=None, on_error_deployment=None, **kwargs) -> None: + super(DeploymentPropertiesExtended, self).__init__(**kwargs) + self.provisioning_state = None + self.correlation_id = None + self.timestamp = None + self.outputs = outputs + self.providers = providers + self.dependencies = dependencies + self.template = template + self.template_link = template_link + self.parameters = parameters + self.parameters_link = parameters_link + self.mode = mode + self.debug_setting = debug_setting + self.on_error_deployment = on_error_deployment diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_properties_py3.py new file mode 100644 index 000000000000..2c8dbd42510e --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_properties_py3.py @@ -0,0 +1,81 @@ +# 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 DeploymentProperties(Model): + """Deployment properties. + + All required parameters must be populated in order to send to Azure. + + :param template: The template content. You use this element when you want + to pass the template syntax directly in the request rather than link to an + existing template. It can be a JObject or well-formed JSON string. Use + either the templateLink property or the template property, but not both. + :type template: object + :param template_link: The URI of the template. Use either the templateLink + property or the template property, but not both. + :type template_link: + ~azure.mgmt.resource.resources.v2018_02_01.models.TemplateLink + :param parameters: Name and value pairs that define the deployment + parameters for the template. You use this element when you want to provide + the parameter values directly in the request rather than link to an + existing parameter file. Use either the parametersLink property or the + parameters property, but not both. It can be a JObject or a well formed + JSON string. + :type parameters: object + :param parameters_link: The URI of parameters file. You use this element + to link to an existing parameters file. Use either the parametersLink + property or the parameters property, but not both. + :type parameters_link: + ~azure.mgmt.resource.resources.v2018_02_01.models.ParametersLink + :param mode: Required. The mode that is used to deploy resources. This + value can be either Incremental or Complete. In Incremental mode, + resources are deployed without deleting existing resources that are not + included in the template. In Complete mode, resources are deployed and + existing resources in the resource group that are not included in the + template are deleted. Be careful when using Complete mode as you may + unintentionally delete resources. Possible values include: 'Incremental', + 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2018_02_01.models.DebugSetting + :param on_error_deployment: The deployment on error behavior. + :type on_error_deployment: + ~azure.mgmt.resource.resources.v2018_02_01.models.OnErrorDeployment + """ + + _validation = { + 'mode': {'required': True}, + } + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeployment'}, + } + + def __init__(self, *, mode, template=None, template_link=None, parameters=None, parameters_link=None, debug_setting=None, on_error_deployment=None, **kwargs) -> None: + super(DeploymentProperties, self).__init__(**kwargs) + self.template = template + self.template_link = template_link + self.parameters = parameters + self.parameters_link = parameters_link + self.mode = mode + self.debug_setting = debug_setting + self.on_error_deployment = on_error_deployment diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_py3.py new file mode 100644 index 000000000000..cd6c93634a2a --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_py3.py @@ -0,0 +1,35 @@ +# 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 Deployment(Model): + """Deployment operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentProperties + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + } + + def __init__(self, *, properties, **kwargs) -> None: + super(Deployment, self).__init__(**kwargs) + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_validate_result.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_validate_result.py new file mode 100644 index 000000000000..147e64dc574d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_validate_result.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentValidateResult(Model): + """Information from validate template deployment response. + + :param error: Validation error. + :type error: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceManagementErrorWithDetails + :param properties: The template deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentPropertiesExtended + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ResourceManagementErrorWithDetails'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + } + + def __init__(self, **kwargs): + super(DeploymentValidateResult, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_validate_result_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_validate_result_py3.py new file mode 100644 index 000000000000..1234097c2b1b --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/deployment_validate_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeploymentValidateResult(Model): + """Information from validate template deployment response. + + :param error: Validation error. + :type error: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceManagementErrorWithDetails + :param properties: The template deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentPropertiesExtended + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ResourceManagementErrorWithDetails'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + } + + def __init__(self, *, error=None, properties=None, **kwargs) -> None: + super(DeploymentValidateResult, self).__init__(**kwargs) + self.error = error + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/export_template_request.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/export_template_request.py new file mode 100644 index 000000000000..069bfbb70632 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/export_template_request.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportTemplateRequest(Model): + """Export resource group template request parameters. + + :param resources: The IDs of the resources. The only supported string + currently is '*' (all resources). Future updates will support exporting + specific resources. + :type resources: list[str] + :param options: The export template options. Supported values include + 'IncludeParameterDefaultValue', 'IncludeComments' or + 'IncludeParameterDefaultValue, IncludeComments + :type options: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'options': {'key': 'options', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExportTemplateRequest, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + self.options = kwargs.get('options', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/export_template_request_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/export_template_request_py3.py new file mode 100644 index 000000000000..2374c103d566 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/export_template_request_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportTemplateRequest(Model): + """Export resource group template request parameters. + + :param resources: The IDs of the resources. The only supported string + currently is '*' (all resources). Future updates will support exporting + specific resources. + :type resources: list[str] + :param options: The export template options. Supported values include + 'IncludeParameterDefaultValue', 'IncludeComments' or + 'IncludeParameterDefaultValue, IncludeComments + :type options: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'options': {'key': 'options', 'type': 'str'}, + } + + def __init__(self, *, resources=None, options: str=None, **kwargs) -> None: + super(ExportTemplateRequest, self).__init__(**kwargs) + self.resources = resources + self.options = options diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource.py new file mode 100644 index 000000000000..2a9b41e80569 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource.py @@ -0,0 +1,73 @@ +# 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 GenericResource(Resource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2018_02_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2018_02_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2018_02_01.models.Identity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + } + + _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}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + def __init__(self, **kwargs): + super(GenericResource, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.properties = kwargs.get('properties', None) + self.kind = kwargs.get('kind', None) + self.managed_by = kwargs.get('managed_by', None) + self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource_filter.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource_filter.py new file mode 100644 index 000000000000..c4488f4cf095 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource_filter.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GenericResourceFilter(Model): + """Resource filter. + + :param resource_type: The resource type. + :type resource_type: str + :param tagname: The tag name. + :type tagname: str + :param tagvalue: The tag value. + :type tagvalue: str + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'tagname': {'key': 'tagname', 'type': 'str'}, + 'tagvalue': {'key': 'tagvalue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceFilter, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.tagname = kwargs.get('tagname', None) + self.tagvalue = kwargs.get('tagvalue', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource_filter_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource_filter_py3.py new file mode 100644 index 000000000000..17ad0e58c55c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource_filter_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GenericResourceFilter(Model): + """Resource filter. + + :param resource_type: The resource type. + :type resource_type: str + :param tagname: The tag name. + :type tagname: str + :param tagvalue: The tag value. + :type tagvalue: str + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'tagname': {'key': 'tagname', 'type': 'str'}, + 'tagvalue': {'key': 'tagvalue', 'type': 'str'}, + } + + def __init__(self, *, resource_type: str=None, tagname: str=None, tagvalue: str=None, **kwargs) -> None: + super(GenericResourceFilter, self).__init__(**kwargs) + self.resource_type = resource_type + self.tagname = tagname + self.tagvalue = tagvalue diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource_paged.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource_paged.py new file mode 100644 index 000000000000..9a79d84888f6 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class GenericResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`GenericResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[GenericResource]'} + } + + def __init__(self, *args, **kwargs): + + super(GenericResourcePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource_py3.py new file mode 100644 index 000000000000..cf9067a92e3a --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/generic_resource_py3.py @@ -0,0 +1,73 @@ +# 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 GenericResource(Resource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2018_02_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2018_02_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2018_02_01.models.Identity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + } + + _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}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResource, self).__init__(location=location, tags=tags, **kwargs) + self.plan = plan + self.properties = properties + self.kind = kind + self.managed_by = managed_by + self.sku = sku + self.identity = identity diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/http_message.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/http_message.py new file mode 100644 index 000000000000..c4a11d3ebc30 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/http_message.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class HttpMessage(Model): + """HTTP message. + + :param content: HTTP message content. + :type content: object + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(HttpMessage, self).__init__(**kwargs) + self.content = kwargs.get('content', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/http_message_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/http_message_py3.py new file mode 100644 index 000000000000..efe1b5abd2fb --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/http_message_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class HttpMessage(Model): + """HTTP message. + + :param content: HTTP message content. + :type content: object + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'object'}, + } + + def __init__(self, *, content=None, **kwargs) -> None: + super(HttpMessage, self).__init__(**kwargs) + self.content = content diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/identity.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/identity.py new file mode 100644 index 000000000000..461cc8574f08 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/identity.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned', + 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + :type type: str or + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/identity_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/identity_py3.py new file mode 100644 index 000000000000..8222ca6ed4d5 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/identity_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned', + 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + :type type: str or + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/on_error_deployment.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/on_error_deployment.py new file mode 100644 index 000000000000..21c57d788eb8 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/on_error_deployment.py @@ -0,0 +1,35 @@ +# 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 OnErrorDeployment(Model): + """Deployment on error behavior. + + :param type: The deployment on error behavior type. Possible values are + LastSuccessful and SpecificDeployment. Possible values include: + 'LastSuccessful', 'SpecificDeployment' + :type type: str or + ~azure.mgmt.resource.resources.v2018_02_01.models.OnErrorDeploymentType + :param deployment_name: The deployment to be used on error case. + :type deployment_name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'OnErrorDeploymentType'}, + 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OnErrorDeployment, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.deployment_name = kwargs.get('deployment_name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/on_error_deployment_extended.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/on_error_deployment_extended.py new file mode 100644 index 000000000000..e1a320448b65 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/on_error_deployment_extended.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OnErrorDeploymentExtended(Model): + """Deployment on error behavior with additional details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the provisioning for the on error + deployment. + :vartype provisioning_state: str + :param type: The deployment on error behavior type. Possible values are + LastSuccessful and SpecificDeployment. Possible values include: + 'LastSuccessful', 'SpecificDeployment' + :type type: str or + ~azure.mgmt.resource.resources.v2018_02_01.models.OnErrorDeploymentType + :param deployment_name: The deployment to be used on error case. + :type deployment_name: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'OnErrorDeploymentType'}, + 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OnErrorDeploymentExtended, self).__init__(**kwargs) + self.provisioning_state = None + self.type = kwargs.get('type', None) + self.deployment_name = kwargs.get('deployment_name', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/on_error_deployment_extended_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/on_error_deployment_extended_py3.py new file mode 100644 index 000000000000..886cf00786bf --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/on_error_deployment_extended_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OnErrorDeploymentExtended(Model): + """Deployment on error behavior with additional details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the provisioning for the on error + deployment. + :vartype provisioning_state: str + :param type: The deployment on error behavior type. Possible values are + LastSuccessful and SpecificDeployment. Possible values include: + 'LastSuccessful', 'SpecificDeployment' + :type type: str or + ~azure.mgmt.resource.resources.v2018_02_01.models.OnErrorDeploymentType + :param deployment_name: The deployment to be used on error case. + :type deployment_name: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'OnErrorDeploymentType'}, + 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + } + + def __init__(self, *, type=None, deployment_name: str=None, **kwargs) -> None: + super(OnErrorDeploymentExtended, self).__init__(**kwargs) + self.provisioning_state = None + self.type = type + self.deployment_name = deployment_name diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/on_error_deployment_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/on_error_deployment_py3.py new file mode 100644 index 000000000000..05245bb8f480 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/on_error_deployment_py3.py @@ -0,0 +1,35 @@ +# 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 OnErrorDeployment(Model): + """Deployment on error behavior. + + :param type: The deployment on error behavior type. Possible values are + LastSuccessful and SpecificDeployment. Possible values include: + 'LastSuccessful', 'SpecificDeployment' + :type type: str or + ~azure.mgmt.resource.resources.v2018_02_01.models.OnErrorDeploymentType + :param deployment_name: The deployment to be used on error case. + :type deployment_name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'OnErrorDeploymentType'}, + 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + } + + def __init__(self, *, type=None, deployment_name: str=None, **kwargs) -> None: + super(OnErrorDeployment, self).__init__(**kwargs) + self.type = type + self.deployment_name = deployment_name diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/parameters_link.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/parameters_link.py new file mode 100644 index 000000000000..c436b9d4ab6e --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/parameters_link.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ParametersLink(Model): + """Entity representing the reference to the deployment paramaters. + + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the parameters file. + :type uri: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ParametersLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.content_version = kwargs.get('content_version', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/parameters_link_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/parameters_link_py3.py new file mode 100644 index 000000000000..52bc9723fa3e --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/parameters_link_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ParametersLink(Model): + """Entity representing the reference to the deployment paramaters. + + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the parameters file. + :type uri: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + } + + def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: + super(ParametersLink, self).__init__(**kwargs) + self.uri = uri + self.content_version = content_version diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/plan.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/plan.py new file mode 100644 index 000000000000..594d670d723c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/plan.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Plan(Model): + """Plan for the resource. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The offer ID. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + :param version: The plan's version. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/plan_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/plan_py3.py new file mode 100644 index 000000000000..972976e1ba0f --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/plan_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Plan(Model): + """Plan for the resource. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The offer ID. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + :param version: The plan's version. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, product: str=None, promotion_code: str=None, version: str=None, **kwargs) -> None: + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code + self.version = version diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider.py new file mode 100644 index 000000000000..0490a5aa870a --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider.py @@ -0,0 +1,50 @@ +# 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 Provider(Model): + """Resource provider information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The provider ID. + :vartype id: str + :param namespace: The namespace of the resource provider. + :type namespace: str + :ivar registration_state: The registration state of the provider. + :vartype registration_state: str + :ivar resource_types: The collection of provider resource types. + :vartype resource_types: + list[~azure.mgmt.resource.resources.v2018_02_01.models.ProviderResourceType] + """ + + _validation = { + 'id': {'readonly': True}, + 'registration_state': {'readonly': True}, + 'resource_types': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'registration_state': {'key': 'registrationState', 'type': 'str'}, + 'resource_types': {'key': 'resourceTypes', 'type': '[ProviderResourceType]'}, + } + + def __init__(self, **kwargs): + super(Provider, self).__init__(**kwargs) + self.id = None + self.namespace = kwargs.get('namespace', None) + self.registration_state = None + self.resource_types = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider_paged.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider_paged.py new file mode 100644 index 000000000000..7a6abf6f944b --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ProviderPaged(Paged): + """ + A paging container for iterating over a list of :class:`Provider ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Provider]'} + } + + def __init__(self, *args, **kwargs): + + super(ProviderPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider_py3.py new file mode 100644 index 000000000000..2dc5e8957b90 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider_py3.py @@ -0,0 +1,50 @@ +# 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 Provider(Model): + """Resource provider information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The provider ID. + :vartype id: str + :param namespace: The namespace of the resource provider. + :type namespace: str + :ivar registration_state: The registration state of the provider. + :vartype registration_state: str + :ivar resource_types: The collection of provider resource types. + :vartype resource_types: + list[~azure.mgmt.resource.resources.v2018_02_01.models.ProviderResourceType] + """ + + _validation = { + 'id': {'readonly': True}, + 'registration_state': {'readonly': True}, + 'resource_types': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'registration_state': {'key': 'registrationState', 'type': 'str'}, + 'resource_types': {'key': 'resourceTypes', 'type': '[ProviderResourceType]'}, + } + + def __init__(self, *, namespace: str=None, **kwargs) -> None: + super(Provider, self).__init__(**kwargs) + self.id = None + self.namespace = namespace + self.registration_state = None + self.resource_types = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider_resource_type.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider_resource_type.py new file mode 100644 index 000000000000..dc26d8e7dce0 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider_resource_type.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ProviderResourceType(Model): + """Resource type managed by the resource provider. + + :param resource_type: The resource type. + :type resource_type: str + :param locations: The collection of locations where this resource type can + be created. + :type locations: list[str] + :param aliases: The aliases that are supported by this resource type. + :type aliases: + list[~azure.mgmt.resource.resources.v2018_02_01.models.AliasType] + :param api_versions: The API version. + :type api_versions: list[str] + :param properties: The properties. + :type properties: dict[str, str] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ProviderResourceType, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.locations = kwargs.get('locations', None) + self.aliases = kwargs.get('aliases', None) + self.api_versions = kwargs.get('api_versions', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider_resource_type_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider_resource_type_py3.py new file mode 100644 index 000000000000..57a413154af0 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/provider_resource_type_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ProviderResourceType(Model): + """Resource type managed by the resource provider. + + :param resource_type: The resource type. + :type resource_type: str + :param locations: The collection of locations where this resource type can + be created. + :type locations: list[str] + :param aliases: The aliases that are supported by this resource type. + :type aliases: + list[~azure.mgmt.resource.resources.v2018_02_01.models.AliasType] + :param api_versions: The API version. + :type api_versions: list[str] + :param properties: The properties. + :type properties: dict[str, str] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, properties=None, **kwargs) -> None: + super(ProviderResourceType, self).__init__(**kwargs) + self.resource_type = resource_type + self.locations = locations + self.aliases = aliases + self.api_versions = api_versions + self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource.py new file mode 100644 index 000000000000..ee7662aeee52 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource.py @@ -0,0 +1,53 @@ +# 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): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': 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/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group.py new file mode 100644 index 000000000000..fedbd4989401 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group.py @@ -0,0 +1,62 @@ +# 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 ResourceGroup(Model): + """Resource group information. + + 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 ID of the resource group. + :vartype id: str + :param name: The name of the resource group. + :type name: str + :param properties: + :type properties: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroupProperties + :param location: Required. The location of the resource group. It cannot + be changed after the resource group has been created. It must be one of + the supported Azure locations. + :type location: str + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ResourceGroup, self).__init__(**kwargs) + self.id = None + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + self.location = kwargs.get('location', None) + self.managed_by = kwargs.get('managed_by', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_export_result.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_export_result.py new file mode 100644 index 000000000000..af7d5c621b82 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_export_result.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceGroupExportResult(Model): + """Resource group export result. + + :param template: The template content. + :type template: object + :param error: The error. + :type error: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceManagementErrorWithDetails + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'error': {'key': 'error', 'type': 'ResourceManagementErrorWithDetails'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupExportResult, self).__init__(**kwargs) + self.template = kwargs.get('template', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_export_result_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_export_result_py3.py new file mode 100644 index 000000000000..41d26fb1c38b --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_export_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceGroupExportResult(Model): + """Resource group export result. + + :param template: The template content. + :type template: object + :param error: The error. + :type error: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceManagementErrorWithDetails + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'error': {'key': 'error', 'type': 'ResourceManagementErrorWithDetails'}, + } + + def __init__(self, *, template=None, error=None, **kwargs) -> None: + super(ResourceGroupExportResult, self).__init__(**kwargs) + self.template = template + self.error = error diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_filter.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_filter.py new file mode 100644 index 000000000000..c94284bf3644 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_filter.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceGroupFilter(Model): + """Resource group filter. + + :param tag_name: The tag name. + :type tag_name: str + :param tag_value: The tag value. + :type tag_value: str + """ + + _attribute_map = { + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupFilter, self).__init__(**kwargs) + self.tag_name = kwargs.get('tag_name', None) + self.tag_value = kwargs.get('tag_value', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_filter_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_filter_py3.py new file mode 100644 index 000000000000..d709b6afd34f --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_filter_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceGroupFilter(Model): + """Resource group filter. + + :param tag_name: The tag name. + :type tag_name: str + :param tag_value: The tag value. + :type tag_value: str + """ + + _attribute_map = { + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + } + + def __init__(self, *, tag_name: str=None, tag_value: str=None, **kwargs) -> None: + super(ResourceGroupFilter, self).__init__(**kwargs) + self.tag_name = tag_name + self.tag_value = tag_value diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_paged.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_paged.py new file mode 100644 index 000000000000..e3f4bf44e308 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ResourceGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceGroupPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_patchable.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_patchable.py new file mode 100644 index 000000000000..809c091f2b3a --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_patchable.py @@ -0,0 +1,42 @@ +# 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 ResourceGroupPatchable(Model): + """Resource group information. + + :param name: The name of the resource group. + :type name: str + :param properties: + :type properties: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroupProperties + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupPatchable, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + self.managed_by = kwargs.get('managed_by', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_patchable_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_patchable_py3.py new file mode 100644 index 000000000000..a50917b91f63 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_patchable_py3.py @@ -0,0 +1,42 @@ +# 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 ResourceGroupPatchable(Model): + """Resource group information. + + :param name: The name of the resource group. + :type name: str + :param properties: + :type properties: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroupProperties + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, name: str=None, properties=None, managed_by: str=None, tags=None, **kwargs) -> None: + super(ResourceGroupPatchable, self).__init__(**kwargs) + self.name = name + self.properties = properties + self.managed_by = managed_by + self.tags = tags diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_properties.py new file mode 100644 index 000000000000..39411e3d79fb --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_properties.py @@ -0,0 +1,35 @@ +# 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 ResourceGroupProperties(Model): + """The resource group properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupProperties, self).__init__(**kwargs) + self.provisioning_state = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_properties_py3.py new file mode 100644 index 000000000000..67d6d06dedbd --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_properties_py3.py @@ -0,0 +1,35 @@ +# 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 ResourceGroupProperties(Model): + """The resource group properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceGroupProperties, self).__init__(**kwargs) + self.provisioning_state = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_py3.py new file mode 100644 index 000000000000..00c729ab3ec2 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_group_py3.py @@ -0,0 +1,62 @@ +# 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 ResourceGroup(Model): + """Resource group information. + + 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 ID of the resource group. + :vartype id: str + :param name: The name of the resource group. + :type name: str + :param properties: + :type properties: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroupProperties + :param location: Required. The location of the resource group. It cannot + be changed after the resource group has been created. It must be one of + the supported Azure locations. + :type location: str + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, name: str=None, properties=None, managed_by: str=None, tags=None, **kwargs) -> None: + super(ResourceGroup, self).__init__(**kwargs) + self.id = None + self.name = name + self.properties = properties + self.location = location + self.managed_by = managed_by + self.tags = tags diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_management_client_enums.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_management_client_enums.py new file mode 100644 index 000000000000..9fd73ca1de47 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_management_client_enums.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class DeploymentMode(str, Enum): + + incremental = "Incremental" + complete = "Complete" + + +class OnErrorDeploymentType(str, Enum): + + last_successful = "LastSuccessful" + specific_deployment = "SpecificDeployment" + + +class ResourceIdentityType(str, Enum): + + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + system_assigned_user_assigned = "SystemAssigned, UserAssigned" + none = "None" diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_management_error_with_details.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_management_error_with_details.py new file mode 100644 index 000000000000..20f1f1bd2133 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_management_error_with_details.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceManagementErrorWithDetails(Model): + """The detailed error message of resource management. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code returned when exporting the template. + :vartype code: str + :ivar message: The error message describing the export error. + :vartype message: str + :ivar target: The target of the error. + :vartype target: str + :ivar details: Validation error. + :vartype details: + list[~azure.mgmt.resource.resources.v2018_02_01.models.ResourceManagementErrorWithDetails] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ResourceManagementErrorWithDetails]'}, + } + + def __init__(self, **kwargs): + super(ResourceManagementErrorWithDetails, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_management_error_with_details_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_management_error_with_details_py3.py new file mode 100644 index 000000000000..e6d720973c47 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_management_error_with_details_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceManagementErrorWithDetails(Model): + """The detailed error message of resource management. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code returned when exporting the template. + :vartype code: str + :ivar message: The error message describing the export error. + :vartype message: str + :ivar target: The target of the error. + :vartype target: str + :ivar details: Validation error. + :vartype details: + list[~azure.mgmt.resource.resources.v2018_02_01.models.ResourceManagementErrorWithDetails] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ResourceManagementErrorWithDetails]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceManagementErrorWithDetails, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_provider_operation_display_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_provider_operation_display_properties.py new file mode 100644 index 000000000000..ac328b64bb1a --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_provider_operation_display_properties.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceProviderOperationDisplayProperties(Model): + """Resource provider operation's display properties. + + :param publisher: Operation description. + :type publisher: str + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperationDisplayProperties, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_provider_operation_display_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_provider_operation_display_properties_py3.py new file mode 100644 index 000000000000..aecc5a412673 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_provider_operation_display_properties_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceProviderOperationDisplayProperties(Model): + """Resource provider operation's display properties. + + :param publisher: Operation description. + :type publisher: str + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, publisher: str=None, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(ResourceProviderOperationDisplayProperties, self).__init__(**kwargs) + self.publisher = publisher + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_py3.py new file mode 100644 index 000000000000..3c8102ab5262 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resource_py3.py @@ -0,0 +1,53 @@ +# 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): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': 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=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resources_move_info.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resources_move_info.py new file mode 100644 index 000000000000..edf946d7076b --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resources_move_info.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourcesMoveInfo(Model): + """Parameters of move resources. + + :param resources: The IDs of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + self.target_resource_group = kwargs.get('target_resource_group', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resources_move_info_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resources_move_info_py3.py new file mode 100644 index 000000000000..d10e2558d499 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/resources_move_info_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourcesMoveInfo(Model): + """Parameters of move resources. + + :param resources: The IDs of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + } + + def __init__(self, *, resources=None, target_resource_group: str=None, **kwargs) -> None: + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.resources = resources + self.target_resource_group = target_resource_group diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/sku.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/sku.py new file mode 100644 index 000000000000..bfcda32477df --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/sku.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """SKU for the resource. + + :param name: The SKU name. + :type name: str + :param tier: The SKU tier. + :type tier: str + :param size: The SKU size. + :type size: str + :param family: The SKU family. + :type family: str + :param model: The SKU model. + :type model: str + :param capacity: The SKU capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'model': {'key': 'model', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.model = kwargs.get('model', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/sku_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/sku_py3.py new file mode 100644 index 000000000000..676f1d770b79 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/sku_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """SKU for the resource. + + :param name: The SKU name. + :type name: str + :param tier: The SKU tier. + :type tier: str + :param size: The SKU size. + :type size: str + :param family: The SKU family. + :type family: str + :param model: The SKU model. + :type model: str + :param capacity: The SKU capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'model': {'key': 'model', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, tier: str=None, size: str=None, family: str=None, model: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.model = model + self.capacity = capacity diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/sub_resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/sub_resource.py new file mode 100644 index 000000000000..ca48705cc825 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/sub_resource.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """Sub-resource. + + :param id: Resource ID + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/sub_resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/sub_resource_py3.py new file mode 100644 index 000000000000..b2d0251b79df --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """Sub-resource. + + :param id: Resource ID + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_count.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_count.py new file mode 100644 index 000000000000..a5eeb6b38cf8 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_count.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TagCount(Model): + """Tag count. + + :param type: Type of count. + :type type: str + :param value: Value of count. + :type value: int + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(TagCount, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_count_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_count_py3.py new file mode 100644 index 000000000000..53c80f63fdb3 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_count_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TagCount(Model): + """Tag count. + + :param type: Type of count. + :type type: str + :param value: Value of count. + :type value: int + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'int'}, + } + + def __init__(self, *, type: str=None, value: int=None, **kwargs) -> None: + super(TagCount, self).__init__(**kwargs) + self.type = type + self.value = value diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_details.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_details.py new file mode 100644 index 000000000000..12a3a0462283 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_details.py @@ -0,0 +1,50 @@ +# 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 TagDetails(Model): + """Tag details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str + :param tag_name: The tag name. + :type tag_name: str + :param count: The total number of resources that use the resource tag. + When a tag is initially created and has no associated resources, the value + is 0. + :type count: ~azure.mgmt.resource.resources.v2018_02_01.models.TagCount + :param values: The list of tag values. + :type values: + list[~azure.mgmt.resource.resources.v2018_02_01.models.TagValue] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + 'values': {'key': 'values', 'type': '[TagValue]'}, + } + + def __init__(self, **kwargs): + super(TagDetails, self).__init__(**kwargs) + self.id = None + self.tag_name = kwargs.get('tag_name', None) + self.count = kwargs.get('count', None) + self.values = kwargs.get('values', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_details_paged.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_details_paged.py new file mode 100644 index 000000000000..c8e6889a8ce9 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_details_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class TagDetailsPaged(Paged): + """ + A paging container for iterating over a list of :class:`TagDetails ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TagDetails]'} + } + + def __init__(self, *args, **kwargs): + + super(TagDetailsPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_details_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_details_py3.py new file mode 100644 index 000000000000..4aa07d3c160f --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_details_py3.py @@ -0,0 +1,50 @@ +# 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 TagDetails(Model): + """Tag details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str + :param tag_name: The tag name. + :type tag_name: str + :param count: The total number of resources that use the resource tag. + When a tag is initially created and has no associated resources, the value + is 0. + :type count: ~azure.mgmt.resource.resources.v2018_02_01.models.TagCount + :param values: The list of tag values. + :type values: + list[~azure.mgmt.resource.resources.v2018_02_01.models.TagValue] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + 'values': {'key': 'values', 'type': '[TagValue]'}, + } + + def __init__(self, *, tag_name: str=None, count=None, values=None, **kwargs) -> None: + super(TagDetails, self).__init__(**kwargs) + self.id = None + self.tag_name = tag_name + self.count = count + self.values = values diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_value.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_value.py new file mode 100644 index 000000000000..07f9f42a29fe --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_value.py @@ -0,0 +1,43 @@ +# 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 TagValue(Model): + """Tag information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str + :param tag_value: The tag value. + :type tag_value: str + :param count: The tag value count. + :type count: ~azure.mgmt.resource.resources.v2018_02_01.models.TagCount + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + } + + def __init__(self, **kwargs): + super(TagValue, self).__init__(**kwargs) + self.id = None + self.tag_value = kwargs.get('tag_value', None) + self.count = kwargs.get('count', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_value_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_value_py3.py new file mode 100644 index 000000000000..acd5ab7e04ad --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/tag_value_py3.py @@ -0,0 +1,43 @@ +# 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 TagValue(Model): + """Tag information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag ID. + :vartype id: str + :param tag_value: The tag value. + :type tag_value: str + :param count: The tag value count. + :type count: ~azure.mgmt.resource.resources.v2018_02_01.models.TagCount + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + } + + def __init__(self, *, tag_value: str=None, count=None, **kwargs) -> None: + super(TagValue, self).__init__(**kwargs) + self.id = None + self.tag_value = tag_value + self.count = count diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/target_resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/target_resource.py new file mode 100644 index 000000000000..27d557645e8b --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/target_resource.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TargetResource(Model): + """Target resource. + + :param id: The ID of the resource. + :type id: str + :param resource_name: The name of the resource. + :type resource_name: str + :param resource_type: The type of the resource. + :type resource_type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TargetResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.resource_name = kwargs.get('resource_name', None) + self.resource_type = kwargs.get('resource_type', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/target_resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/target_resource_py3.py new file mode 100644 index 000000000000..933347cec8f8 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/target_resource_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TargetResource(Model): + """Target resource. + + :param id: The ID of the resource. + :type id: str + :param resource_name: The name of the resource. + :type resource_name: str + :param resource_type: The type of the resource. + :type resource_type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, resource_name: str=None, resource_type: str=None, **kwargs) -> None: + super(TargetResource, self).__init__(**kwargs) + self.id = id + self.resource_name = resource_name + self.resource_type = resource_type diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/template_link.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/template_link.py new file mode 100644 index 000000000000..634095bb9754 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/template_link.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TemplateLink(Model): + """Entity representing the reference to the template. + + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the template to deploy. + :type uri: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TemplateLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.content_version = kwargs.get('content_version', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/template_link_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/template_link_py3.py new file mode 100644 index 000000000000..00f2597ccd98 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/template_link_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TemplateLink(Model): + """Entity representing the reference to the template. + + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the template to deploy. + :type uri: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + } + + def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: + super(TemplateLink, self).__init__(**kwargs) + self.uri = uri + self.content_version = content_version diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/__init__.py new file mode 100644 index 000000000000..5aae03a99594 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/__init__.py @@ -0,0 +1,26 @@ +# 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 .deployments_operations import DeploymentsOperations +from .providers_operations import ProvidersOperations +from .resources_operations import ResourcesOperations +from .resource_groups_operations import ResourceGroupsOperations +from .tags_operations import TagsOperations +from .deployment_operations import DeploymentOperations + +__all__ = [ + 'DeploymentsOperations', + 'ProvidersOperations', + 'ResourcesOperations', + 'ResourceGroupsOperations', + 'TagsOperations', + 'DeploymentOperations', +] diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/deployment_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/deployment_operations.py new file mode 100644 index 000000000000..914651c2fe28 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/deployment_operations.py @@ -0,0 +1,182 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DeploymentOperations(object): + """DeploymentOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def get( + self, resource_group_name, deployment_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets a deployments operation. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param operation_id: The ID of the operation to get. + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentOperation or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentOperation + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeploymentOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}'} + + def list( + self, resource_group_name, deployment_name, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all deployments operations for a deployment. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment with the operation + to get. + :type deployment_name: str + :param top: The number of results to return. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeploymentOperation + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentOperationPaged[~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentOperation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DeploymentOperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DeploymentOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/deployments_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/deployments_operations.py new file mode 100644 index 000000000000..3d53cd87ab14 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/deployments_operations.py @@ -0,0 +1,645 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DeploymentsOperations(object): + """DeploymentsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a deployment from the deployment history. + + A template deployment that is currently running cannot be deleted. + Deleting a template deployment removes the associated deployment + operations. Deleting a template deployment does not affect the state of + the resource group. This is an asynchronous operation that returns a + status of 202 until the template deployment is successfully deleted. + The Location response header contains the URI that is used to obtain + the status of the process. While the process is running, a call to the + URI in the Location header returns a status of 202. When the process + finishes, the URI in the Location header returns a status of 204 on + success. If the asynchronous request failed, the URI in the Location + header returns an error-level status code. + + :param resource_group_name: The name of the resource group with the + deployment to delete. The name is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment to delete. + :type deployment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def check_existence( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Checks whether the deployment exists. + + :param resource_group_name: The name of the resource group with the + deployment to check. The name is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment to check. + :type deployment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + + def _create_or_update_initial( + self, resource_group_name, deployment_name, properties, custom_headers=None, raw=False, **operation_config): + parameters = models.Deployment(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Deployment') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExtended', response) + if response.status_code == 201: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, deployment_name, properties, custom_headers=None, raw=False, polling=True, **operation_config): + """Deploys resources to a resource group. + + You can provide the template and parameters directly in the request or + link to JSON files. + + :param resource_group_name: The name of the resource group to deploy + the resources to. The name is case insensitive. The resource group + must already exist. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param properties: The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentExtended or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentExtended] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentExtended]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + deployment_name=deployment_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def get( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Gets a deployment. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment to get. + :type deployment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExtended or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentExtended + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def cancel( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Cancels a currently running template deployment. + + You can cancel a deployment only if the provisioningState is Accepted + or Running. After the deployment is canceled, the provisioningState is + set to Canceled. Canceling a template deployment stops the currently + running template deployment and leaves the resource group partially + deployed. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment to cancel. + :type deployment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.cancel.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} + + def validate( + self, resource_group_name, deployment_name, properties, custom_headers=None, raw=False, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param resource_group_name: The name of the resource group the + template will be deployed to. The name is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param properties: The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentValidateResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentValidateResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.Deployment(properties=properties) + + # Construct URL + url = self.validate.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Deployment') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 400]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeploymentValidateResult', response) + if response.status_code == 400: + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} + + def export_template( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Exports the template used for specified deployment. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment from which to get + the template. + :type deployment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExportResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentExportResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.export_template.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_template.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'} + + def list_by_resource_group( + self, resource_group_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the deployments for a resource group. + + :param resource_group_name: The name of the resource group with the + deployments to get. The name is case insensitive. + :type resource_group_name: str + :param filter: The filter to apply on the operation. For example, you + can use $filter=provisioningState eq '{state}'. + :type filter: str + :param top: The number of results to get. If null is passed, returns + all deployments. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeploymentExtended + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentExtendedPaged[~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentExtended] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DeploymentExtendedPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DeploymentExtendedPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/providers_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/providers_operations.py new file mode 100644 index 000000000000..16eb094c3851 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/providers_operations.py @@ -0,0 +1,300 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ProvidersOperations(object): + """ProvidersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def unregister( + self, resource_provider_namespace, custom_headers=None, raw=False, **operation_config): + """Unregisters a subscription from a resource provider. + + :param resource_provider_namespace: The namespace of the resource + provider to unregister. + :type resource_provider_namespace: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Provider or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.Provider or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.unregister.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Provider', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + unregister.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister'} + + def register( + self, resource_provider_namespace, custom_headers=None, raw=False, **operation_config): + """Registers a subscription with a resource provider. + + :param resource_provider_namespace: The namespace of the resource + provider to register. + :type resource_provider_namespace: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Provider or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.Provider or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.register.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Provider', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + register.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register'} + + def list( + self, top=None, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets all resource providers for a subscription. + + :param top: The number of results to return. If null is passed returns + all deployments. + :type top: int + :param expand: The properties to include in the results. For example, + use &$expand=metadata in the query string to retrieve resource + provider metadata. To include property aliases in response, use + $expand=resourceTypes/aliases. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Provider + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.ProviderPaged[~azure.mgmt.resource.resources.v2018_02_01.models.Provider] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ProviderPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProviderPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers'} + + def get( + self, resource_provider_namespace, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified resource provider. + + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: str + :param expand: The $expand query parameter. For example, to include + property aliases in response, use $expand=resourceTypes/aliases. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Provider or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.Provider or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Provider', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/resource_groups_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/resource_groups_operations.py new file mode 100644 index 000000000000..9e8f450964ed --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/resource_groups_operations.py @@ -0,0 +1,529 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ResourceGroupsOperations(object): + """ResourceGroupsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def check_existence( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Checks whether a resource group exists. + + :param resource_group_name: The name of the resource group to check. + The name is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + def create_or_update( + self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a resource group. + + :param resource_group_name: The name of the resource group to create + or update. + :type resource_group_name: str + :param parameters: Parameters supplied to the create or update a + resource group. + :type parameters: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroup + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ResourceGroup or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ResourceGroup') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ResourceGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('ResourceGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + + def _delete_initial( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a resource group. + + When you delete a resource group, all of its resources are also + deleted. Deleting a resource group deletes all of its template + deployments and currently stored operations. + + :param resource_group_name: The name of the resource group to delete. + The name is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + def get( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a resource group. + + :param resource_group_name: The name of the resource group to get. The + name is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ResourceGroup or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ResourceGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + def update( + self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + """Updates a resource group. + + Resource groups can be updated through a simple PATCH operation to a + group address. The format of the request is the same as that for + creating a resource group. If a field is unspecified, the current value + is retained. + + :param resource_group_name: The name of the resource group to update. + The name is case insensitive. + :type resource_group_name: str + :param parameters: Parameters supplied to update a resource group. + :type parameters: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroupPatchable + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ResourceGroup or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ResourceGroupPatchable') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ResourceGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + def export_template( + self, resource_group_name, resources=None, options=None, custom_headers=None, raw=False, **operation_config): + """Captures the specified resource group as a template. + + :param resource_group_name: The name of the resource group to export + as a template. + :type resource_group_name: str + :param resources: The IDs of the resources. The only supported string + currently is '*' (all resources). Future updates will support + exporting specific resources. + :type resources: list[str] + :param options: The export template options. Supported values include + 'IncludeParameterDefaultValue', 'IncludeComments' or + 'IncludeParameterDefaultValue, IncludeComments + :type options: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ResourceGroupExportResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroupExportResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.ExportTemplateRequest(resources=resources, options=options) + + # Construct URL + url = self.export_template.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ExportTemplateRequest') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ResourceGroupExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_template.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate'} + + def list( + self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all the resource groups for a subscription. + + :param filter: The filter to apply on the operation. + :type filter: str + :param top: The number of results to return. If null is passed, + returns all resource groups. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ResourceGroup + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroupPaged[~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroup] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ResourceGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/resources_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/resources_operations.py new file mode 100644 index 000000000000..0d10da3006f6 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/resources_operations.py @@ -0,0 +1,1277 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ResourcesOperations(object): + """ResourcesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def list_by_resource_group( + self, resource_group_name, filter=None, expand=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the resources for a resource group. + + :param resource_group_name: The resource group with the resources to + get. + :type resource_group_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param expand: The $expand query parameter + :type expand: str + :param top: The number of results to return. If null is passed, + returns all resources. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of GenericResource + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'} + + + def _move_resources_initial( + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ResourcesMoveInfo(resources=resources, target_resource_group=target_resource_group) + + # Construct URL + url = self.move_resources.metadata['url'] + path_format_arguments = { + 'sourceResourceGroupName': self._serialize.url("source_resource_group_name", source_resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ResourcesMoveInfo') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def move_resources( + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Moves resources from one resource group to another resource group. + + The resources to move must be in the same source resource group. The + target resource group may be in a different subscription. When moving + resources, both the source group and the target group are locked for + the duration of the operation. Write and delete operations are blocked + on the groups until the move completes. . + + :param source_resource_group_name: The name of the resource group + containing the resources to move. + :type source_resource_group_name: str + :param resources: The IDs of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._move_resources_initial( + source_resource_group_name=source_resource_group_name, + resources=resources, + target_resource_group=target_resource_group, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + move_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources'} + + + def _validate_move_resources_initial( + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ResourcesMoveInfo(resources=resources, target_resource_group=target_resource_group) + + # Construct URL + url = self.validate_move_resources.metadata['url'] + path_format_arguments = { + 'sourceResourceGroupName': self._serialize.url("source_resource_group_name", source_resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ResourcesMoveInfo') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [202, 204, 409]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def validate_move_resources( + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether resources can be moved from one resource group to + another resource group. + + This operation checks whether the specified resources can be moved to + the target. The resources to move must be in the same source resource + group. The target resource group may be in a different subscription. If + validation succeeds, it returns HTTP response code 204 (no content). If + validation fails, it returns HTTP response code 409 (Conflict) with an + error message. Retrieve the URL in the Location header value to check + the result of the long-running operation. + + :param source_resource_group_name: The name of the resource group + containing the resources to validate for move. + :type source_resource_group_name: str + :param resources: The IDs of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_move_resources_initial( + source_resource_group_name=source_resource_group_name, + resources=resources, + target_resource_group=target_resource_group, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate_move_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources'} + + def list( + self, filter=None, expand=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the resources in a subscription. + + :param filter: The filter to apply on the operation. + :type filter: str + :param expand: The $expand query parameter. + :type expand: str + :param top: The number of results to return. If null is passed, + returns all resource groups. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of GenericResource + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resources'} + + def check_existence( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, **operation_config): + """Checks whether a resource exists. + + :param resource_group_name: The name of the resource group containing + the resource to check. The name is case insensitive. + :type resource_group_name: str + :param resource_provider_namespace: The resource provider of the + resource to check. + :type resource_provider_namespace: str + :param parent_resource_path: The parent resource identity. + :type parent_resource_path: str + :param resource_type: The resource type. + :type resource_type: str + :param resource_name: The name of the resource to check whether it + exists. + :type resource_name: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'parentResourcePath': self._serialize.url("parent_resource_path", parent_resource_path, 'str', skip_quote=True), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + + def _delete_initial( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'parentResourcePath': self._serialize.url("parent_resource_path", parent_resource_path, 'str', skip_quote=True), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a resource. + + :param resource_group_name: The name of the resource group that + contains the resource to delete. The name is case insensitive. + :type resource_group_name: str + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: str + :param parent_resource_path: The parent resource identity. + :type parent_resource_path: str + :param resource_type: The resource type. + :type resource_type: str + :param resource_name: The name of the resource to delete. + :type resource_name: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_provider_namespace=resource_provider_namespace, + parent_resource_path=parent_resource_path, + resource_type=resource_type, + resource_name=resource_name, + api_version=api_version, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + + def _create_or_update_initial( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'parentResourcePath': self._serialize.url("parent_resource_path", parent_resource_path, 'str', skip_quote=True), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'GenericResource') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GenericResource', response) + if response.status_code == 201: + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a resource. + + :param resource_group_name: The name of the resource group for the + resource. The name is case insensitive. + :type resource_group_name: str + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: str + :param parent_resource_path: The parent resource identity. + :type parent_resource_path: str + :param resource_type: The resource type of the resource to create. + :type resource_type: str + :param resource_name: The name of the resource to create. + :type resource_name: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param parameters: Parameters for creating or updating the resource. + :type parameters: + ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_provider_namespace=resource_provider_namespace, + parent_resource_path=parent_resource_path, + resource_type=resource_type, + resource_name=resource_name, + api_version=api_version, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + + def _update_initial( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'parentResourcePath': self._serialize.url("parent_resource_path", parent_resource_path, 'str', skip_quote=True), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'GenericResource') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a resource. + + :param resource_group_name: The name of the resource group for the + resource. The name is case insensitive. + :type resource_group_name: str + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: str + :param parent_resource_path: The parent resource identity. + :type parent_resource_path: str + :param resource_type: The resource type of the resource to update. + :type resource_type: str + :param resource_name: The name of the resource to update. + :type resource_name: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param parameters: Parameters for updating the resource. + :type parameters: + ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_provider_namespace=resource_provider_namespace, + parent_resource_path=parent_resource_path, + resource_type=resource_type, + resource_name=resource_name, + api_version=api_version, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + def get( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, **operation_config): + """Gets a resource. + + :param resource_group_name: The name of the resource group containing + the resource to get. The name is case insensitive. + :type resource_group_name: str + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: str + :param parent_resource_path: The parent resource identity. + :type parent_resource_path: str + :param resource_type: The resource type of the resource. + :type resource_type: str + :param resource_name: The name of the resource to get. + :type resource_name: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GenericResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'parentResourcePath': self._serialize.url("parent_resource_path", parent_resource_path, 'str', skip_quote=True), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + def check_existence_by_id( + self, resource_id, api_version, custom_headers=None, raw=False, **operation_config): + """Checks by ID whether a resource exists. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence_by_id.metadata = {'url': '/{resourceId}'} + + + def _delete_by_id_initial( + self, resource_id, api_version, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_by_id( + self, resource_id, api_version, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a resource by ID. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_by_id_initial( + resource_id=resource_id, + api_version=api_version, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_by_id.metadata = {'url': '/{resourceId}'} + + + def _create_or_update_by_id_initial( + self, resource_id, api_version, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'GenericResource') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GenericResource', response) + if response.status_code == 201: + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_by_id( + self, resource_id, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a resource by ID. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param parameters: Create or update resource parameters. + :type parameters: + ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_by_id_initial( + resource_id=resource_id, + api_version=api_version, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update_by_id.metadata = {'url': '/{resourceId}'} + + + def _update_by_id_initial( + self, resource_id, api_version, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'GenericResource') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_by_id( + self, resource_id, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a resource by ID. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param parameters: Update resource parameters. + :type parameters: + ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_by_id_initial( + resource_id=resource_id, + api_version=api_version, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_by_id.metadata = {'url': '/{resourceId}'} + + def get_by_id( + self, resource_id, api_version, custom_headers=None, raw=False, **operation_config): + """Gets a resource by ID. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GenericResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/{resourceId}'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/tags_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/tags_operations.py new file mode 100644 index 000000000000..04c6fc1e6941 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/tags_operations.py @@ -0,0 +1,341 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class TagsOperations(object): + """TagsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def delete_value( + self, tag_name, tag_value, custom_headers=None, raw=False, **operation_config): + """Deletes a tag value. + + :param tag_name: The name of the tag. + :type tag_name: str + :param tag_value: The value of the tag to delete. + :type tag_value: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_value.metadata['url'] + path_format_arguments = { + 'tagName': self._serialize.url("tag_name", tag_name, 'str'), + 'tagValue': self._serialize.url("tag_value", tag_value, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_value.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}'} + + def create_or_update_value( + self, tag_name, tag_value, custom_headers=None, raw=False, **operation_config): + """Creates a tag value. The name of the tag must already exist. + + :param tag_name: The name of the tag. + :type tag_name: str + :param tag_value: The value of the tag to create. + :type tag_value: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TagValue or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.TagValue or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update_value.metadata['url'] + path_format_arguments = { + 'tagName': self._serialize.url("tag_name", tag_name, 'str'), + 'tagValue': self._serialize.url("tag_value", tag_value, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TagValue', response) + if response.status_code == 201: + deserialized = self._deserialize('TagValue', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_value.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}'} + + def create_or_update( + self, tag_name, custom_headers=None, raw=False, **operation_config): + """Creates a tag in the subscription. + + The tag name can have a maximum of 512 characters and is case + insensitive. Tag names created by Azure have prefixes of microsoft, + azure, or windows. You cannot create tags with one of these prefixes. + + :param tag_name: The name of the tag to create. + :type tag_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TagDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.TagDetails + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'tagName': self._serialize.url("tag_name", tag_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TagDetails', response) + if response.status_code == 201: + deserialized = self._deserialize('TagDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames/{tagName}'} + + def delete( + self, tag_name, custom_headers=None, raw=False, **operation_config): + """Deletes a tag from the subscription. + + You must remove all values from a resource tag before you can delete + it. + + :param tag_name: The name of the tag. + :type tag_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'tagName': self._serialize.url("tag_name", tag_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames/{tagName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets the names and values of all resource tags that are defined in a + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TagDetails + :rtype: + ~azure.mgmt.resource.resources.v2018_02_01.models.TagDetailsPaged[~azure.mgmt.resource.resources.v2018_02_01.models.TagDetails] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.TagDetailsPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TagDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/resource_management_client.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/resource_management_client.py new file mode 100644 index 000000000000..1c34a9d14522 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/resource_management_client.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.deployments_operations import DeploymentsOperations +from .operations.providers_operations import ProvidersOperations +from .operations.resources_operations import ResourcesOperations +from .operations.resource_groups_operations import ResourceGroupsOperations +from .operations.tags_operations import TagsOperations +from .operations.deployment_operations import DeploymentOperations +from . import models + + +class ResourceManagementClientConfiguration(AzureConfiguration): + """Configuration for ResourceManagementClient + 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 ID of the target subscription. + :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(ResourceManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-resource/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class ResourceManagementClient(SDKClient): + """Provides operations for working with resources and resource groups. + + :ivar config: Configuration for client. + :vartype config: ResourceManagementClientConfiguration + + :ivar deployments: Deployments operations + :vartype deployments: azure.mgmt.resource.resources.v2018_02_01.operations.DeploymentsOperations + :ivar providers: Providers operations + :vartype providers: azure.mgmt.resource.resources.v2018_02_01.operations.ProvidersOperations + :ivar resources: Resources operations + :vartype resources: azure.mgmt.resource.resources.v2018_02_01.operations.ResourcesOperations + :ivar resource_groups: ResourceGroups operations + :vartype resource_groups: azure.mgmt.resource.resources.v2018_02_01.operations.ResourceGroupsOperations + :ivar tags: Tags operations + :vartype tags: azure.mgmt.resource.resources.v2018_02_01.operations.TagsOperations + :ivar deployment_operations: DeploymentOperations operations + :vartype deployment_operations: azure.mgmt.resource.resources.v2018_02_01.operations.DeploymentOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ResourceManagementClientConfiguration(credentials, subscription_id, base_url) + super(ResourceManagementClient, 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-02-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.deployments = DeploymentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.providers = ProvidersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.resources = ResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.resource_groups = ResourceGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tags = TagsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.deployment_operations = DeploymentOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/version.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/version.py new file mode 100644 index 000000000000..848a6c9f9e92 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2018-02-01" + diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/__init__.py index 3ce233115f8f..c13dd928bb5e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/__init__.py @@ -9,10 +9,16 @@ # regenerated. # -------------------------------------------------------------------------- -from .location import Location -from .subscription_policies import SubscriptionPolicies -from .subscription import Subscription -from .tenant_id_description import TenantIdDescription +try: + from .location_py3 import Location + from .subscription_policies_py3 import SubscriptionPolicies + from .subscription_py3 import Subscription + from .tenant_id_description_py3 import TenantIdDescription +except (SyntaxError, ImportError): + from .location import Location + from .subscription_policies import SubscriptionPolicies + from .subscription import Subscription + from .tenant_id_description import TenantIdDescription from .location_paged import LocationPaged from .subscription_paged import SubscriptionPaged from .tenant_id_description_paged import TenantIdDescriptionPaged diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/location.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/location.py index cccfb4331997..691616984d27 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/location.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/location.py @@ -51,8 +51,8 @@ class Location(Model): 'longitude': {'key': 'longitude', 'type': 'str'}, } - def __init__(self): - super(Location, self).__init__() + def __init__(self, **kwargs): + super(Location, self).__init__(**kwargs) self.id = None self.subscription_id = None self.name = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/location_py3.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/location_py3.py new file mode 100644 index 000000000000..40af216a6647 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/location_py3.py @@ -0,0 +1,61 @@ +# 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 Location(Model): + """Location information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID of the location. For example, + /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. + :vartype id: str + :ivar subscription_id: The subscription ID. + :vartype subscription_id: str + :ivar name: The location name. + :vartype name: str + :ivar display_name: The display name of the location. + :vartype display_name: str + :ivar latitude: The latitude of the location. + :vartype latitude: str + :ivar longitude: The longitude of the location. + :vartype longitude: str + """ + + _validation = { + 'id': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'name': {'readonly': True}, + 'display_name': {'readonly': True}, + 'latitude': {'readonly': True}, + 'longitude': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'latitude': {'key': 'latitude', 'type': 'str'}, + 'longitude': {'key': 'longitude', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Location, self).__init__(**kwargs) + self.id = None + self.subscription_id = None + self.name = None + self.display_name = None + self.latitude = None + self.longitude = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription.py index 1deffdf41eeb..44beb231a2bb 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription.py @@ -55,11 +55,11 @@ class Subscription(Model): 'authorization_source': {'key': 'authorizationSource', 'type': 'str'}, } - def __init__(self, subscription_policies=None, authorization_source=None): - super(Subscription, self).__init__() + def __init__(self, **kwargs): + super(Subscription, self).__init__(**kwargs) self.id = None self.subscription_id = None self.display_name = None self.state = None - self.subscription_policies = subscription_policies - self.authorization_source = authorization_source + self.subscription_policies = kwargs.get('subscription_policies', None) + self.authorization_source = kwargs.get('authorization_source', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription_client_enums.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription_client_enums.py index edfce74d4f8a..bc846c09187b 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription_client_enums.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class SubscriptionState(Enum): +class SubscriptionState(str, Enum): enabled = "Enabled" warned = "Warned" @@ -21,7 +21,7 @@ class SubscriptionState(Enum): deleted = "Deleted" -class SpendingLimit(Enum): +class SpendingLimit(str, Enum): on = "On" off = "Off" diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription_policies.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription_policies.py index 1e1f7c61d148..14c6f09aa39f 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription_policies.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription_policies.py @@ -43,8 +43,8 @@ class SubscriptionPolicies(Model): 'spending_limit': {'key': 'spendingLimit', 'type': 'SpendingLimit'}, } - def __init__(self): - super(SubscriptionPolicies, self).__init__() + def __init__(self, **kwargs): + super(SubscriptionPolicies, self).__init__(**kwargs) self.location_placement_id = None self.quota_id = None self.spending_limit = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription_policies_py3.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription_policies_py3.py new file mode 100644 index 000000000000..94eabde9f289 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription_policies_py3.py @@ -0,0 +1,50 @@ +# 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 SubscriptionPolicies(Model): + """Subscription policies. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar location_placement_id: The subscription location placement ID. The + ID indicates which regions are visible for a subscription. For example, a + subscription with a location placement Id of Public_2014-09-01 has access + to Azure public regions. + :vartype location_placement_id: str + :ivar quota_id: The subscription quota ID. + :vartype quota_id: str + :ivar spending_limit: The subscription spending limit. Possible values + include: 'On', 'Off', 'CurrentPeriodOff' + :vartype spending_limit: str or + ~azure.mgmt.resource.subscriptions.v2016_06_01.models.SpendingLimit + """ + + _validation = { + 'location_placement_id': {'readonly': True}, + 'quota_id': {'readonly': True}, + 'spending_limit': {'readonly': True}, + } + + _attribute_map = { + 'location_placement_id': {'key': 'locationPlacementId', 'type': 'str'}, + 'quota_id': {'key': 'quotaId', 'type': 'str'}, + 'spending_limit': {'key': 'spendingLimit', 'type': 'SpendingLimit'}, + } + + def __init__(self, **kwargs) -> None: + super(SubscriptionPolicies, self).__init__(**kwargs) + self.location_placement_id = None + self.quota_id = None + self.spending_limit = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription_py3.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription_py3.py new file mode 100644 index 000000000000..dfad65822705 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/subscription_py3.py @@ -0,0 +1,65 @@ +# 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 Subscription(Model): + """Subscription information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the subscription. For example, + /subscriptions/00000000-0000-0000-0000-000000000000. + :vartype id: str + :ivar subscription_id: The subscription ID. + :vartype subscription_id: str + :ivar display_name: The subscription display name. + :vartype display_name: str + :ivar state: The subscription state. Possible values are Enabled, Warned, + PastDue, Disabled, and Deleted. Possible values include: 'Enabled', + 'Warned', 'PastDue', 'Disabled', 'Deleted' + :vartype state: str or + ~azure.mgmt.resource.subscriptions.v2016_06_01.models.SubscriptionState + :param subscription_policies: The subscription policies. + :type subscription_policies: + ~azure.mgmt.resource.subscriptions.v2016_06_01.models.SubscriptionPolicies + :param authorization_source: The authorization source of the request. + Valid values are one or more combinations of Legacy, RoleBased, Bypassed, + Direct and Management. For example, 'Legacy, RoleBased'. + :type authorization_source: str + """ + + _validation = { + 'id': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'SubscriptionState'}, + 'subscription_policies': {'key': 'subscriptionPolicies', 'type': 'SubscriptionPolicies'}, + 'authorization_source': {'key': 'authorizationSource', 'type': 'str'}, + } + + def __init__(self, *, subscription_policies=None, authorization_source: str=None, **kwargs) -> None: + super(Subscription, self).__init__(**kwargs) + self.id = None + self.subscription_id = None + self.display_name = None + self.state = None + self.subscription_policies = subscription_policies + self.authorization_source = authorization_source diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/tenant_id_description.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/tenant_id_description.py index 69af496a5fc3..dc4ddc3edde9 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/tenant_id_description.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/tenant_id_description.py @@ -36,7 +36,7 @@ class TenantIdDescription(Model): 'tenant_id': {'key': 'tenantId', 'type': 'str'}, } - def __init__(self): - super(TenantIdDescription, self).__init__() + def __init__(self, **kwargs): + super(TenantIdDescription, self).__init__(**kwargs) self.id = None self.tenant_id = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/tenant_id_description_py3.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/tenant_id_description_py3.py new file mode 100644 index 000000000000..3b1103d1b9dd --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/tenant_id_description_py3.py @@ -0,0 +1,42 @@ +# 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 TenantIdDescription(Model): + """Tenant Id information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID of the tenant. For example, + /tenants/00000000-0000-0000-0000-000000000000. + :vartype id: str + :ivar tenant_id: The tenant ID. For example, + 00000000-0000-0000-0000-000000000000. + :vartype tenant_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TenantIdDescription, self).__init__(**kwargs) + self.id = None + self.tenant_id = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/subscription_client.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/subscription_client.py index 9c69fc7862e4..deacfa9bab66 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/subscription_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/subscription_client.py @@ -9,7 +9,7 @@ # 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 @@ -45,7 +45,7 @@ def __init__( self.credentials = credentials -class SubscriptionClient(object): +class SubscriptionClient(SDKClient): """All resource groups and resources exist within subscriptions. These operation enable you get information about your subscriptions and tenants. A tenant is a dedicated instance of Azure Active Directory (Azure AD) for your organization. :ivar config: Configuration for client. @@ -66,7 +66,7 @@ def __init__( self, credentials, base_url=None): self.config = SubscriptionClientConfiguration(credentials, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(SubscriptionClient, 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 = '2016-06-01'