From 6089d22923ec36155654e0ddfd1d4a8910e9423c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 2 Jan 2019 11:36:50 -0800 Subject: [PATCH] [AutoPR] resources/resource-manager (#3187) * Generated from 060cf203676c2ea6d7ae479c755c1d31604555b4 (#3186) Use same identity pattern as resources * [AutoPR resources/resource-manager] Fix ARMViolation Error for Microsoft.Authorization (#3304) * Generated from b74ebceb22e46a4c6ceb9fd8ab1cb8347f400839 Fix ARMViolation Error for Microsoft.Authorization * Packaging update of azure-mgmt-resource * [AutoPR resources/resource-manager] Fix Swagger Linting Error for Microsoft.Features (#3303) * Generated from 7a6405dee0b1df4ab7da45c12d03cf1336106221 Fix Swagger Linting Error for Microsoft.Features * Packaging update of azure-mgmt-resource * Generated from 79862aa514b96e220ff6c723bcd4f1260659ab8f Remove additional properties in examples * Generated from 04a8bcdd0db69e2ac6de225c3774271f5687054b (#3384) Fix typo, the provider should be Microsoft.Authorization * Generated from 989797a01b3a189f15fd9cb6b68d938f4a4f119f (#3393) Change operationId of Microsoft.Authorization * [AutoPR resources/resource-manager] Fix ARMViolations for Microsoft.Resources (#3356) * Generated from 2677deefc46f8d0978cc262efb1510a41e3832a0 Fix ARMViolations for Microsoft.Resources * Generated from d1873c4588fc3653c9d01f38bb51933cfdd13710 Fix ARM Violations in Microsoft.Resources * Packaging update of azure-mgmt-resource * Generated from b6aeed45dd11f9251470f6a2f0b5371a1ee914d5 (#3616) added descriptions for filter and expand * Packaging update of azure-mgmt-resource * [AutoPR resources/resource-manager] added to description of allowed characters for resource group name (#3662) * Generated from 773581c3a2be72522eb2bc770800bbef994454d3 added to description of allowed characters for resource group name * Generated from 3d920ef4d7524961f809597d3f47f70cfce462ef changed description * Generated from b420267e7b1b12292730e47751c35b2ac586c70a (#3828) Add type for DeploymentExtend and ResourceGroup * Generated from 3b7e0ff3ba3d3d18ce80d86be227e06f43bd747d (#3987) typo: resources/resource-manager/Microsoft.Resources - paramaters -> parameters - deploymentoutput -> deployment output - targetid -> targetId - informaton -> information - rsources -> resources - muct -> must * Generated from b4101839580231ecaf651529783b50f8fa304b52 (#4027) typo: resources/resource-manager/Microsoft.Authorization - assigment -> assignment - reponse -> response * Generated from 61892a6ae9ebb50edee79da2733c646f7759ac13 (#4069) typo: resources/resource-manager/Microsoft.Solutions - reponse -> response * Packaging update of azure-mgmt-resource * 2.1.0 --- azure-mgmt-resource/HISTORY.rst | 9 + azure-mgmt-resource/MANIFEST.in | 3 + .../mgmt/resource/features/feature_client.py | 2 +- .../features/v2015_12_01/feature_client.py | 63 ++ .../features/v2015_12_01/models/__init__.py | 8 + .../features/v2015_12_01/models/operation.py | 33 + .../v2015_12_01/models/operation_display.py | 37 + .../models/operation_display_py3.py | 37 + .../v2015_12_01/models/operation_paged.py | 27 + .../v2015_12_01/models/operation_py3.py | 33 + .../operations/features_operations.py | 26 +- .../resource/links/management_link_client.py | 13 + .../v2016_09_01/management_link_client.py | 5 + .../links/v2016_09_01/models/__init__.py | 8 + .../links/v2016_09_01/models/operation.py | 33 + .../v2016_09_01/models/operation_display.py | 41 + .../models/operation_display_py3.py | 41 + .../v2016_09_01/models/operation_paged.py | 27 + .../links/v2016_09_01/models/operation_py3.py | 33 + .../links/v2016_09_01/models/resource_link.py | 5 + .../v2016_09_01/models/resource_link_py3.py | 5 + .../links/v2016_09_01/operations/__init__.py | 2 + .../v2016_09_01/operations/operations.py | 98 +++ .../operations/resource_links_operations.py | 35 +- .../resource/locks/management_lock_client.py | 13 + .../operations/management_locks_operations.py | 66 +- .../v2016_09_01/management_lock_client.py | 5 + .../locks/v2016_09_01/models/__init__.py | 8 + .../models/management_lock_object.py | 7 +- .../models/management_lock_object_py3.py | 9 +- .../locks/v2016_09_01/models/operation.py | 33 + .../v2016_09_01/models/operation_display.py | 37 + .../models/operation_display_py3.py | 37 + .../v2016_09_01/models/operation_paged.py | 27 + .../locks/v2016_09_01/models/operation_py3.py | 33 + .../locks/v2016_09_01/operations/__init__.py | 2 + .../operations/authorization_operations.py | 98 +++ .../operations/management_locks_operations.py | 89 +- .../models/error_response.py | 2 +- .../models/error_response_py3.py | 2 +- .../application_definitions_operations.py | 41 +- .../operations/applications_operations.py | 60 +- .../mgmt/resource/policy/policy_client.py | 15 +- .../policy_assignments_operations.py | 63 +- .../policy_definitions_operations.py | 24 +- .../policy_assignments_operations.py | 63 +- .../policy_definitions_operations.py | 24 +- .../policy_assignments_operations.py | 63 +- .../policy_definitions_operations.py | 61 +- .../models/error_response.py | 2 +- .../models/error_response_py3.py | 2 +- .../policy_assignments_operations.py | 63 +- .../policy_definitions_operations.py | 61 +- .../policy_set_definitions_operations.py | 61 +- .../v2018_03_01/models/error_response.py | 2 +- .../v2018_03_01/models/error_response_py3.py | 2 +- .../policy_assignments_operations.py | 57 +- .../policy_definitions_operations.py | 61 +- .../policy_set_definitions_operations.py | 61 +- .../resource/policy/v2018_05_01/__init__.py | 18 + .../policy/v2018_05_01/models/__init__.py | 51 ++ .../v2018_05_01/models/error_response.py | 50 ++ .../v2018_05_01/models/error_response_py3.py | 50 ++ .../policy/v2018_05_01/models/identity.py | 46 ++ .../policy/v2018_05_01/models/identity_py3.py | 46 ++ .../v2018_05_01/models/policy_assignment.py | 90 ++ .../models/policy_assignment_paged.py | 27 + .../models/policy_assignment_py3.py | 90 ++ .../v2018_05_01/models/policy_client_enums.py | 32 + .../v2018_05_01/models/policy_definition.py | 80 ++ .../models/policy_definition_paged.py | 27 + .../models/policy_definition_py3.py | 80 ++ .../models/policy_definition_reference.py | 33 + .../models/policy_definition_reference_py3.py | 33 + .../models/policy_set_definition.py | 79 ++ .../models/policy_set_definition_paged.py | 27 + .../models/policy_set_definition_py3.py | 79 ++ .../policy/v2018_05_01/models/policy_sku.py | 39 + .../v2018_05_01/models/policy_sku_py3.py | 39 + .../policy/v2018_05_01/operations/__init__.py | 20 + .../policy_assignments_operations.py | 777 ++++++++++++++++++ .../policy_definitions_operations.py | 683 +++++++++++++++ .../policy_set_definitions_operations.py | 677 +++++++++++++++ .../policy/v2018_05_01/policy_client.py | 91 ++ .../resource/policy/v2018_05_01/version.py | 13 + .../resources/resource_management_client.py | 15 +- .../models/deployment_properties_extended.py | 2 +- .../deployment_properties_extended_py3.py | 2 +- .../v2016_02_01/models/parameters_link.py | 2 +- .../v2016_02_01/models/parameters_link_py3.py | 2 +- .../operations/deployment_operations.py | 13 +- .../operations/deployments_operations.py | 46 +- .../operations/providers_operations.py | 25 +- .../operations/resource_groups_operations.py | 48 +- .../operations/resources_operations.py | 40 +- .../v2016_02_01/operations/tags_operations.py | 29 +- .../models/deployment_properties_extended.py | 2 +- .../deployment_properties_extended_py3.py | 2 +- .../v2016_09_01/models/parameters_link.py | 2 +- .../v2016_09_01/models/parameters_link_py3.py | 2 +- .../v2016_09_01/models/resource_group.py | 2 +- .../v2016_09_01/models/resource_group_py3.py | 2 +- .../operations/deployment_operations.py | 13 +- .../operations/deployments_operations.py | 46 +- .../operations/providers_operations.py | 25 +- .../operations/resource_groups_operations.py | 48 +- .../operations/resources_operations.py | 70 +- .../v2016_09_01/operations/tags_operations.py | 29 +- .../models/deployment_properties_extended.py | 2 +- .../deployment_properties_extended_py3.py | 2 +- .../v2017_05_10/models/parameters_link.py | 2 +- .../v2017_05_10/models/parameters_link_py3.py | 2 +- .../operations/deployment_operations.py | 13 +- .../operations/deployments_operations.py | 46 +- .../operations/providers_operations.py | 25 +- .../operations/resource_groups_operations.py | 41 +- .../operations/resources_operations.py | 80 +- .../v2017_05_10/operations/tags_operations.py | 29 +- .../models/deployment_properties_extended.py | 2 +- .../deployment_properties_extended_py3.py | 2 +- .../v2018_02_01/models/parameters_link.py | 2 +- .../v2018_02_01/models/parameters_link_py3.py | 2 +- .../operations/deployment_operations.py | 13 +- .../operations/deployments_operations.py | 46 +- .../operations/providers_operations.py | 25 +- .../operations/resource_groups_operations.py | 41 +- .../operations/resources_operations.py | 80 +- .../v2018_02_01/operations/tags_operations.py | 29 +- .../resources/v2018_05_01/models/__init__.py | 8 + .../v2018_05_01/models/deployment_extended.py | 15 +- .../models/deployment_extended_py3.py | 17 +- .../models/deployment_properties_extended.py | 2 +- .../deployment_properties_extended_py3.py | 2 +- .../resources/v2018_05_01/models/operation.py | 33 + .../v2018_05_01/models/operation_display.py | 41 + .../models/operation_display_py3.py | 41 + .../v2018_05_01/models/operation_paged.py | 27 + .../v2018_05_01/models/operation_py3.py | 33 + .../v2018_05_01/models/parameters_link.py | 2 +- .../v2018_05_01/models/parameters_link_py3.py | 2 +- .../resources/v2018_05_01/models/resource.py | 2 +- .../v2018_05_01/models/resource_group.py | 12 +- .../v2018_05_01/models/resource_group_py3.py | 14 +- ...e_provider_operation_display_properties.py | 2 +- ...ovider_operation_display_properties_py3.py | 2 +- .../v2018_05_01/models/resource_py3.py | 2 +- .../v2018_05_01/operations/__init__.py | 2 + .../operations/deployment_operations.py | 26 +- .../operations/deployments_operations.py | 92 +-- .../v2018_05_01/operations/operations.py | 98 +++ .../operations/providers_operations.py | 25 +- .../operations/resource_groups_operations.py | 49 +- .../operations/resources_operations.py | 126 +-- .../v2018_05_01/operations/tags_operations.py | 29 +- .../v2018_05_01/resource_management_client.py | 5 + .../subscriptions/subscription_client.py | 13 + .../v2016_06_01/models/__init__.py | 8 + .../v2016_06_01/models/operation.py | 33 + .../v2016_06_01/models/operation_display.py | 41 + .../models/operation_display_py3.py | 41 + .../v2016_06_01/models/operation_paged.py | 27 + .../v2016_06_01/models/operation_py3.py | 33 + .../v2016_06_01/operations/__init__.py | 2 + .../v2016_06_01/operations/operations.py | 98 +++ .../operations/subscriptions_operations.py | 20 +- .../operations/tenants_operations.py | 7 +- .../v2016_06_01/subscription_client.py | 5 + .../azure/mgmt/resource/version.py | 2 +- 168 files changed, 5890 insertions(+), 1255 deletions(-) create mode 100644 azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_paged.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_display.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_display_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_paged.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/operations.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_display.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_display_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_paged.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/authorization_operations.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/__init__.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/__init__.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/error_response.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/error_response_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/identity.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/identity_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_assignment.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_assignment_paged.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_assignment_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_client_enums.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition_paged.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition_reference.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition_reference_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_set_definition.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_set_definition_paged.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_set_definition_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_sku.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_sku_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/__init__.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/policy_assignments_operations.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/policy_definitions_operations.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/policy_set_definitions_operations.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/policy_client.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/version.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_display.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_display_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_paged.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/operations.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_display.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_display_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_paged.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_py3.py create mode 100644 azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/operations.py diff --git a/azure-mgmt-resource/HISTORY.rst b/azure-mgmt-resource/HISTORY.rst index 073f68735637..e94382576bc3 100644 --- a/azure-mgmt-resource/HISTORY.rst +++ b/azure-mgmt-resource/HISTORY.rst @@ -3,6 +3,15 @@ Release History =============== +2.1.0 (2019-02-01) +++++++++++++++++++ + +**Features on Policy** + +- New API version for Policy 2018-05-01 +- Model PolicyAssignment has a new parameter location +- Model PolicyAssignment has a new parameter identity + 2.0.0 (2018-07-20) ++++++++++++++++++ diff --git a/azure-mgmt-resource/MANIFEST.in b/azure-mgmt-resource/MANIFEST.in index bb37a2723dae..6ceb27f7a96e 100644 --- a/azure-mgmt-resource/MANIFEST.in +++ b/azure-mgmt-resource/MANIFEST.in @@ -1 +1,4 @@ include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/feature_client.py b/azure-mgmt-resource/azure/mgmt/resource/features/feature_client.py index 7da03829ab59..581fdde33f3b 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/features/feature_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/features/feature_client.py @@ -107,7 +107,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): from .v2015_12_01 import models return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) - + @property def features(self): """Instance depends on the API version: 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 3dfaec20c691..874b8d7d0248 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 @@ -13,6 +13,9 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +import uuid from .operations.features_operations import FeaturesOperations from . import models @@ -79,3 +82,63 @@ def __init__( self.features = FeaturesOperations( self._client, self.config, self._serialize, self._deserialize) + + def list_operations( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Microsoft.Features REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.resource.features.v2015_12_01.models.OperationPaged[~azure.mgmt.resource.features.v2015_12_01.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_operations.metadata = {'url': '/providers/Microsoft.Features/operations'} 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 59fc0c7f229d..534a16d30c90 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 @@ -12,13 +12,21 @@ try: from .feature_properties_py3 import FeatureProperties from .feature_result_py3 import FeatureResult + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation except (SyntaxError, ImportError): from .feature_properties import FeatureProperties from .feature_result import FeatureResult + from .operation_display import OperationDisplay + from .operation import Operation +from .operation_paged import OperationPaged from .feature_result_paged import FeatureResultPaged __all__ = [ 'FeatureProperties', 'FeatureResult', + 'OperationDisplay', + 'Operation', + 'OperationPaged', 'FeatureResultPaged', ] diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation.py new file mode 100644 index 000000000000..458e37b3bd90 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation.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 Operation(Model): + """Microsoft.Features operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :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(Operation, 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_display.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display.py new file mode 100644 index 000000000000..96c5847dd02d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display.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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Features + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', 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..500ca2ade894 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display_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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Features + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_paged.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_paged.py new file mode 100644 index 000000000000..3205c43a4b5f --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/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 OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_py3.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_py3.py new file mode 100644 index 000000000000..0768baa3c0e6 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_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 Operation(Model): + """Microsoft.Features operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :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(Operation, self).__init__(**kwargs) + self.name = name + self.display = display 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..9e67c6673cea 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 @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -81,9 +81,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -142,7 +141,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -151,9 +150,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -207,7 +205,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -216,8 +214,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -270,7 +268,7 @@ def register( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -279,8 +277,8 @@ def register( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/management_link_client.py b/azure-mgmt-resource/azure/mgmt/resource/links/management_link_client.py index d9285a49f396..81f030277fc7 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/management_link_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/management_link_client.py @@ -102,6 +102,19 @@ def models(cls, api_version=DEFAULT_API_VERSION): from .v2016_09_01 import models return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) + + @property + def operations(self): + """Instance depends on the API version: + + * 2016-09-01: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2016-09-01': + from .v2016_09_01.operations import Operations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def resource_links(self): 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 9820f661c595..398d9f9d208d 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 @@ -13,6 +13,7 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from .operations.operations import Operations from .operations.resource_links_operations import ResourceLinksOperations from . import models @@ -55,6 +56,8 @@ class ManagementLinkClient(SDKClient): :ivar config: Configuration for client. :vartype config: ManagementLinkClientConfiguration + :ivar operations: Operations operations + :vartype operations: azure.mgmt.resource.links.v2016_09_01.operations.Operations :ivar resource_links: ResourceLinks operations :vartype resource_links: azure.mgmt.resource.links.v2016_09_01.operations.ResourceLinksOperations @@ -77,5 +80,7 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) self.resource_links = ResourceLinksOperations( self._client, self.config, self._serialize, self._deserialize) 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 80cdd1f9217a..c7f4a210c5cf 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 @@ -13,10 +13,15 @@ from .resource_link_filter_py3 import ResourceLinkFilter from .resource_link_properties_py3 import ResourceLinkProperties from .resource_link_py3 import ResourceLink + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation except (SyntaxError, ImportError): from .resource_link_filter import ResourceLinkFilter from .resource_link_properties import ResourceLinkProperties from .resource_link import ResourceLink + from .operation_display import OperationDisplay + from .operation import Operation +from .operation_paged import OperationPaged from .resource_link_paged import ResourceLinkPaged from .management_link_client_enums import ( Filter, @@ -26,6 +31,9 @@ 'ResourceLinkFilter', 'ResourceLinkProperties', 'ResourceLink', + 'OperationDisplay', + 'Operation', + 'OperationPaged', 'ResourceLinkPaged', 'Filter', ] diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation.py new file mode 100644 index 000000000000..6f99ca831b0b --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation.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 Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.links.v2016_09_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_display.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_display.py new file mode 100644 index 000000000000..98e3ef7e561c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_display.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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :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/links/v2016_09_01/models/operation_display_py3.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_display_py3.py new file mode 100644 index 000000000000..9579860dfd81 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_display_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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :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/links/v2016_09_01/models/operation_paged.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_paged.py new file mode 100644 index 000000000000..21d8ee08cc45 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/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 OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_py3.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_py3.py new file mode 100644 index 000000000000..a81d9586d98d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_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 Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.links.v2016_09_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(Operation, self).__init__(**kwargs) + self.name = name + self.display = display 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 1c5c5b143719..b0a65c24ac61 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 @@ -22,6 +22,8 @@ class ResourceLink(Model): :vartype id: str :ivar name: The name of the resource link. :vartype name: str + :ivar type: The resource link object. + :vartype type: object :param properties: Properties for resource link. :type properties: ~azure.mgmt.resource.links.v2016_09_01.models.ResourceLinkProperties @@ -30,11 +32,13 @@ class ResourceLink(Model): _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': 'object'}, 'properties': {'key': 'properties', 'type': 'ResourceLinkProperties'}, } @@ -42,4 +46,5 @@ def __init__(self, **kwargs): super(ResourceLink, self).__init__(**kwargs) self.id = None self.name = None + self.type = None self.properties = kwargs.get('properties', None) 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 index ec2bdd48ca70..f4fa3544608c 100644 --- 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 @@ -22,6 +22,8 @@ class ResourceLink(Model): :vartype id: str :ivar name: The name of the resource link. :vartype name: str + :ivar type: The resource link object. + :vartype type: object :param properties: Properties for resource link. :type properties: ~azure.mgmt.resource.links.v2016_09_01.models.ResourceLinkProperties @@ -30,11 +32,13 @@ class ResourceLink(Model): _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': 'object'}, 'properties': {'key': 'properties', 'type': 'ResourceLinkProperties'}, } @@ -42,4 +46,5 @@ def __init__(self, *, properties=None, **kwargs) -> None: super(ResourceLink, self).__init__(**kwargs) self.id = None self.name = None + self.type = None self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/__init__.py index ada44c974c8f..9fd0cda7f4c4 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/__init__.py @@ -9,8 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- +from .operations import Operations from .resource_links_operations import ResourceLinksOperations __all__ = [ + 'Operations', 'ResourceLinksOperations', ] diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/operations.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/operations.py new file mode 100644 index 000000000000..e85ad6f21fe9 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations 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 the operation. Constant value: "2016-09-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-09-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Microsoft.Resources REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.resource.links.v2016_09_01.models.OperationPaged[~azure.mgmt.resource.links.v2016_09_01.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Resources/operations'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/resource_links_operations.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/resource_links_operations.py index 9769f1f95977..395f8a8a6572 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/resource_links_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/resource_links_operations.py @@ -69,7 +69,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -78,8 +77,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -129,6 +128,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -141,9 +141,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'ResourceLink') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -195,7 +194,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -204,8 +203,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -229,8 +228,8 @@ def list_at_subscription( """Gets all the linked resources for the subscription. :param filter: The filter to apply on the list resource links - operation. The supported filter for list resource links is targetid. - For example, $filter=targetid eq {value} + operation. The supported filter for list resource links is targetId. + For example, $filter=targetId eq {value} :type filter: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -264,7 +263,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -273,9 +272,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -340,7 +338,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -349,9 +347,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/management_lock_client.py b/azure-mgmt-resource/azure/mgmt/resource/locks/management_lock_client.py index 72e6d8c65694..f16e7b1c5ab0 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/management_lock_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/management_lock_client.py @@ -106,6 +106,19 @@ def models(cls, api_version=DEFAULT_API_VERSION): from .v2016_09_01 import models return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) + + @property + def authorization_operations(self): + """Instance depends on the API version: + + * 2016-09-01: :class:`AuthorizationOperations` + """ + api_version = self._get_api_version('authorization_operations') + if api_version == '2016-09-01': + from .v2016_09_01.operations import AuthorizationOperations 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))) @property def management_locks(self): diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/management_locks_operations.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/management_locks_operations.py index 85643849148b..588df1adf9c0 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/management_locks_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/management_locks_operations.py @@ -74,6 +74,7 @@ def create_or_update_at_resource_group_level( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -86,9 +87,8 @@ def create_or_update_at_resource_group_level( body_content = self._serialize.body(parameters, 'ManagementLockObject') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -141,7 +141,6 @@ def delete_at_resource_group_level( # 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: @@ -150,8 +149,8 @@ def delete_at_resource_group_level( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -197,7 +196,7 @@ def get_at_resource_group_level( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -206,8 +205,8 @@ def get_at_resource_group_level( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -276,6 +275,7 @@ def create_or_update_at_resource_level( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -288,9 +288,8 @@ def create_or_update_at_resource_level( body_content = self._serialize.body(parameters, 'ManagementLockObject') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -355,7 +354,6 @@ def delete_at_resource_level( # 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: @@ -364,8 +362,8 @@ def delete_at_resource_level( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -411,6 +409,7 @@ def create_or_update_at_subscription_level( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -423,9 +422,8 @@ def create_or_update_at_subscription_level( body_content = self._serialize.body(parameters, 'ManagementLockObject') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -475,7 +473,6 @@ def delete_at_subscription_level( # 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: @@ -484,8 +481,8 @@ def delete_at_subscription_level( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -528,7 +525,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -537,8 +534,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -598,7 +595,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -607,9 +604,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -684,7 +680,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -693,9 +689,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -753,7 +748,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -762,9 +757,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 193ccb0fe905..5489aa865263 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 @@ -13,6 +13,7 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from .operations.authorization_operations import AuthorizationOperations from .operations.management_locks_operations import ManagementLocksOperations from . import models @@ -55,6 +56,8 @@ class ManagementLockClient(SDKClient): :ivar config: Configuration for client. :vartype config: ManagementLockClientConfiguration + :ivar authorization_operations: AuthorizationOperations operations + :vartype authorization_operations: azure.mgmt.resource.locks.v2016_09_01.operations.AuthorizationOperations :ivar management_locks: ManagementLocks operations :vartype management_locks: azure.mgmt.resource.locks.v2016_09_01.operations.ManagementLocksOperations @@ -77,5 +80,7 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.authorization_operations = AuthorizationOperations( + self._client, self.config, self._serialize, self._deserialize) self.management_locks = ManagementLocksOperations( self._client, self.config, self._serialize, self._deserialize) 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 c87415874da2..001c54a2cfb0 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 @@ -12,9 +12,14 @@ try: from .management_lock_owner_py3 import ManagementLockOwner from .management_lock_object_py3 import ManagementLockObject + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation except (SyntaxError, ImportError): from .management_lock_owner import ManagementLockOwner from .management_lock_object import ManagementLockObject + from .operation_display import OperationDisplay + from .operation import Operation +from .operation_paged import OperationPaged from .management_lock_object_paged import ManagementLockObjectPaged from .management_lock_client_enums import ( LockLevel, @@ -23,6 +28,9 @@ __all__ = [ 'ManagementLockOwner', 'ManagementLockObject', + 'OperationDisplay', + 'Operation', + 'OperationPaged', 'ManagementLockObjectPaged', 'LockLevel', ] 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 662bdeb7cd65..2b29b5b02365 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 @@ -37,14 +37,15 @@ class ManagementLockObject(Model): :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 + :ivar name: The name of the lock. + :vartype name: str """ _validation = { 'level': {'required': True}, 'id': {'readonly': True}, 'type': {'readonly': True}, + 'name': {'readonly': True}, } _attribute_map = { @@ -63,4 +64,4 @@ def __init__(self, **kwargs): self.owners = kwargs.get('owners', None) self.id = None self.type = None - self.name = kwargs.get('name', None) + self.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 index 29a159d75456..92a13bb73229 100644 --- 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 @@ -37,14 +37,15 @@ class ManagementLockObject(Model): :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 + :ivar name: The name of the lock. + :vartype name: str """ _validation = { 'level': {'required': True}, 'id': {'readonly': True}, 'type': {'readonly': True}, + 'name': {'readonly': True}, } _attribute_map = { @@ -56,11 +57,11 @@ class ManagementLockObject(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, *, level, notes: str=None, owners=None, name: str=None, **kwargs) -> None: + def __init__(self, *, level, notes: str=None, owners=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 + self.name = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation.py new file mode 100644 index 000000000000..a4cb256669d1 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation.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 Operation(Model): + """Microsoft.Authorization operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.locks.v2016_09_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_display.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_display.py new file mode 100644 index 000000000000..7cf0ae94ff01 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_display.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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Authorization + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_display_py3.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_display_py3.py new file mode 100644 index 000000000000..ae5c37f7298c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_display_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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Authorization + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_paged.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_paged.py new file mode 100644 index 000000000000..5c9933f1f6ad --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/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 OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_py3.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_py3.py new file mode 100644 index 000000000000..275cb1fe02c4 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/operation_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 Operation(Model): + """Microsoft.Authorization operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.locks.v2016_09_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(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/__init__.py index 2bffd473ac4b..89a0150a09b7 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/__init__.py @@ -9,8 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- +from .authorization_operations import AuthorizationOperations from .management_locks_operations import ManagementLocksOperations __all__ = [ + 'AuthorizationOperations', 'ManagementLocksOperations', ] diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/authorization_operations.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/authorization_operations.py new file mode 100644 index 000000000000..e5c8f3d65d55 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/authorization_operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class AuthorizationOperations(object): + """AuthorizationOperations 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 the operation. Constant value: "2016-09-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-09-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Microsoft.Authorization REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.resource.locks.v2016_09_01.models.OperationPaged[~azure.mgmt.resource.locks.v2016_09_01.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Authorization/operations'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/management_locks_operations.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/management_locks_operations.py index 01e2085a67fa..e968a685a3ce 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/management_locks_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/management_locks_operations.py @@ -82,6 +82,7 @@ def create_or_update_at_resource_group_level( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -94,9 +95,8 @@ def create_or_update_at_resource_group_level( body_content = self._serialize.body(parameters, 'ManagementLockObject') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -155,7 +155,6 @@ def delete_at_resource_group_level( # 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: @@ -164,8 +163,8 @@ def delete_at_resource_group_level( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -211,7 +210,7 @@ def get_at_resource_group_level( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -220,8 +219,8 @@ def get_at_resource_group_level( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -281,6 +280,7 @@ def create_or_update_by_scope( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -293,9 +293,8 @@ def create_or_update_by_scope( body_content = self._serialize.body(parameters, 'ManagementLockObject') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -347,7 +346,6 @@ def delete_by_scope( # 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: @@ -356,8 +354,8 @@ def delete_by_scope( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -402,7 +400,7 @@ def get_by_scope( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -411,8 +409,8 @@ def get_by_scope( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -492,6 +490,7 @@ def create_or_update_at_resource_level( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -504,9 +503,8 @@ def create_or_update_at_resource_level( body_content = self._serialize.body(parameters, 'ManagementLockObject') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -581,7 +579,6 @@ def delete_at_resource_level( # 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: @@ -590,8 +587,8 @@ def delete_at_resource_level( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -651,7 +648,7 @@ def get_at_resource_level( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -660,8 +657,8 @@ def get_at_resource_level( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -722,6 +719,7 @@ def create_or_update_at_subscription_level( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -734,9 +732,8 @@ def create_or_update_at_subscription_level( body_content = self._serialize.body(parameters, 'ManagementLockObject') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -791,7 +788,6 @@ def delete_at_subscription_level( # 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: @@ -800,8 +796,8 @@ def delete_at_subscription_level( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -844,7 +840,7 @@ def get_at_subscription_level( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -853,8 +849,8 @@ def get_at_subscription_level( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -915,7 +911,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -924,9 +920,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -1002,7 +997,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -1011,9 +1006,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -1071,7 +1065,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -1080,9 +1074,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 be8461254a2f..48db644b6852 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 @@ -14,7 +14,7 @@ class ErrorResponse(Model): - """Error reponse indicates managed application is not able to process the + """Error response 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. 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 index b04c8da8f669..272d91c7d721 100644 --- 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 @@ -14,7 +14,7 @@ class ErrorResponse(Model): - """Error reponse indicates managed application is not able to process the + """Error response 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. 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 a616ee52355a..1646b9cb2db0 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 @@ -75,7 +75,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -84,8 +84,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 404]: raise models.ErrorResponseException(self._deserialize, response) @@ -120,7 +120,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -129,8 +128,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -201,6 +200,7 @@ def _create_or_update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -213,9 +213,8 @@ def _create_or_update_initial( body_content = self._serialize.body(parameters, 'ApplicationDefinition') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: raise models.ErrorResponseException(self._deserialize, response) @@ -327,7 +326,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -336,9 +335,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -390,7 +388,7 @@ def get_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -399,8 +397,8 @@ def get_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 404]: raise models.ErrorResponseException(self._deserialize, response) @@ -433,7 +431,6 @@ def _delete_by_id_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -442,8 +439,8 @@ def _delete_by_id_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -510,6 +507,7 @@ def _create_or_update_by_id_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -522,9 +520,8 @@ def _create_or_update_by_id_initial( body_content = self._serialize.body(parameters, 'ApplicationDefinition') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: raise models.ErrorResponseException(self._deserialize, response) 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 50f878dae235..9ec07ececf91 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 @@ -73,7 +73,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -82,8 +82,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 404]: raise models.ErrorResponseException(self._deserialize, response) @@ -118,7 +118,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -127,8 +126,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -198,6 +197,7 @@ def _create_or_update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -210,9 +210,8 @@ def _create_or_update_initial( body_content = self._serialize.body(parameters, 'Application') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: raise models.ErrorResponseException(self._deserialize, response) @@ -324,6 +323,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -339,9 +339,8 @@ def update( body_content = None # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -397,7 +396,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -406,9 +405,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -461,7 +459,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -470,9 +468,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -523,7 +520,7 @@ def get_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -532,8 +529,8 @@ def get_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 404]: raise models.ErrorResponseException(self._deserialize, response) @@ -566,7 +563,6 @@ def _delete_by_id_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -575,8 +571,8 @@ def _delete_by_id_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -643,6 +639,7 @@ def _create_or_update_by_id_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -655,9 +652,8 @@ def _create_or_update_by_id_initial( body_content = self._serialize.body(parameters, 'Application') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: raise models.ErrorResponseException(self._deserialize, response) @@ -766,6 +762,7 @@ def update_by_id( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -781,9 +778,8 @@ def update_by_id( body_content = None # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/policy_client.py b/azure-mgmt-resource/azure/mgmt/resource/policy/policy_client.py index 41b3a703e42e..94eab83d9145 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/policy_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/policy_client.py @@ -101,6 +101,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2016-12-01: :mod:`v2016_12_01.models` * 2017-06-01-preview: :mod:`v2017_06_01_preview.models` * 2018-03-01: :mod:`v2018_03_01.models` + * 2018-05-01: :mod:`v2018_05_01.models` """ if api_version == '2015-10-01-preview': from .v2015_10_01_preview import models @@ -117,8 +118,11 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2018-03-01': from .v2018_03_01 import models return models + elif api_version == '2018-05-01': + from .v2018_05_01 import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) - + @property def policy_assignments(self): """Instance depends on the API version: @@ -128,6 +132,7 @@ def policy_assignments(self): * 2016-12-01: :class:`PolicyAssignmentsOperations` * 2017-06-01-preview: :class:`PolicyAssignmentsOperations` * 2018-03-01: :class:`PolicyAssignmentsOperations` + * 2018-05-01: :class:`PolicyAssignmentsOperations` """ api_version = self._get_api_version('policy_assignments') if api_version == '2015-10-01-preview': @@ -140,6 +145,8 @@ def policy_assignments(self): from .v2017_06_01_preview.operations import PolicyAssignmentsOperations as OperationClass elif api_version == '2018-03-01': from .v2018_03_01.operations import PolicyAssignmentsOperations as OperationClass + elif api_version == '2018-05-01': + from .v2018_05_01.operations import PolicyAssignmentsOperations 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))) @@ -153,6 +160,7 @@ def policy_definitions(self): * 2016-12-01: :class:`PolicyDefinitionsOperations` * 2017-06-01-preview: :class:`PolicyDefinitionsOperations` * 2018-03-01: :class:`PolicyDefinitionsOperations` + * 2018-05-01: :class:`PolicyDefinitionsOperations` """ api_version = self._get_api_version('policy_definitions') if api_version == '2015-10-01-preview': @@ -165,6 +173,8 @@ def policy_definitions(self): from .v2017_06_01_preview.operations import PolicyDefinitionsOperations as OperationClass elif api_version == '2018-03-01': from .v2018_03_01.operations import PolicyDefinitionsOperations as OperationClass + elif api_version == '2018-05-01': + from .v2018_05_01.operations import PolicyDefinitionsOperations 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))) @@ -175,12 +185,15 @@ def policy_set_definitions(self): * 2017-06-01-preview: :class:`PolicySetDefinitionsOperations` * 2018-03-01: :class:`PolicySetDefinitionsOperations` + * 2018-05-01: :class:`PolicySetDefinitionsOperations` """ api_version = self._get_api_version('policy_set_definitions') if api_version == '2017-06-01-preview': from .v2017_06_01_preview.operations import PolicySetDefinitionsOperations as OperationClass elif api_version == '2018-03-01': from .v2018_03_01.operations import PolicySetDefinitionsOperations as OperationClass + elif api_version == '2018-05-01': + from .v2018_05_01.operations import PolicySetDefinitionsOperations 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/policy/v2015_10_01_preview/operations/policy_assignments_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/policy_assignments_operations.py index eabe172cc056..49f701a37353 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/policy_assignments_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/policy_assignments_operations.py @@ -71,7 +71,7 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -80,8 +80,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -140,6 +140,7 @@ def create( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -152,9 +153,8 @@ def create( body_content = self._serialize.body(parameters, 'PolicyAssignment') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -207,7 +207,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -216,8 +216,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -278,7 +278,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -287,9 +287,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -365,7 +364,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -374,9 +373,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -434,7 +432,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -443,9 +441,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -469,7 +466,7 @@ def delete_by_id( self, policy_assignment_id, custom_headers=None, raw=False, **operation_config): """Deletes a policy assignment by ID. - When providing a scope for the assigment, use + When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and @@ -504,7 +501,7 @@ def delete_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -513,8 +510,8 @@ def delete_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -539,7 +536,7 @@ def create_by_id( Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all - resources in the group. When providing a scope for the assigment, use + resources in the group. When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and @@ -577,6 +574,7 @@ def create_by_id( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -589,9 +587,8 @@ def create_by_id( body_content = self._serialize.body(parameters, 'PolicyAssignment') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -614,7 +611,7 @@ def get_by_id( self, policy_assignment_id, custom_headers=None, raw=False, **operation_config): """Gets a policy assignment by ID. - When providing a scope for the assigment, use + When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and @@ -649,7 +646,7 @@ def get_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -658,8 +655,8 @@ def get_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/policy_definitions_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/policy_definitions_operations.py index 9a881ad52f60..17c661067f4e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/policy_definitions_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/policy_definitions_operations.py @@ -72,6 +72,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -84,9 +85,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'PolicyDefinition') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -135,7 +135,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -144,8 +143,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -189,7 +188,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -198,8 +197,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -256,7 +255,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -265,9 +264,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/policy_assignments_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/policy_assignments_operations.py index d2b33b9aa90d..e8024dcb5f4c 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/policy_assignments_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/policy_assignments_operations.py @@ -71,7 +71,7 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -80,8 +80,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -140,6 +140,7 @@ def create( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -152,9 +153,8 @@ def create( body_content = self._serialize.body(parameters, 'PolicyAssignment') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -207,7 +207,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -216,8 +216,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -278,7 +278,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -287,9 +287,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -365,7 +364,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -374,9 +373,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -434,7 +432,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -443,9 +441,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -469,7 +466,7 @@ def delete_by_id( self, policy_assignment_id, custom_headers=None, raw=False, **operation_config): """Deletes a policy assignment by ID. - When providing a scope for the assigment, use + When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and @@ -504,7 +501,7 @@ def delete_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -513,8 +510,8 @@ def delete_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -539,7 +536,7 @@ def create_by_id( Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all - resources in the group. When providing a scope for the assigment, use + resources in the group. When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and @@ -577,6 +574,7 @@ def create_by_id( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -589,9 +587,8 @@ def create_by_id( body_content = self._serialize.body(parameters, 'PolicyAssignment') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -614,7 +611,7 @@ def get_by_id( self, policy_assignment_id, custom_headers=None, raw=False, **operation_config): """Gets a policy assignment by ID. - When providing a scope for the assigment, use + When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and @@ -649,7 +646,7 @@ def get_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -658,8 +655,8 @@ def get_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/policy_definitions_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/policy_definitions_operations.py index c7ebdfb0f0be..fddc13c4d91f 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/policy_definitions_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/policy_definitions_operations.py @@ -72,6 +72,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -84,9 +85,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'PolicyDefinition') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -135,7 +135,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -144,8 +143,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -189,7 +188,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -198,8 +197,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -256,7 +255,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -265,9 +264,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/policy_assignments_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/policy_assignments_operations.py index 8a27c690b238..ae8fa0fbcb96 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/policy_assignments_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/policy_assignments_operations.py @@ -71,7 +71,7 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -80,8 +80,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -140,6 +140,7 @@ def create( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -152,9 +153,8 @@ def create( body_content = self._serialize.body(parameters, 'PolicyAssignment') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -207,7 +207,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -216,8 +216,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -278,7 +278,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -287,9 +287,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -365,7 +364,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -374,9 +373,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -434,7 +432,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -443,9 +441,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -469,7 +466,7 @@ def delete_by_id( self, policy_assignment_id, custom_headers=None, raw=False, **operation_config): """Deletes a policy assignment by ID. - When providing a scope for the assigment, use + When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and @@ -504,7 +501,7 @@ def delete_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -513,8 +510,8 @@ def delete_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -539,7 +536,7 @@ def create_by_id( Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all - resources in the group. When providing a scope for the assigment, use + resources in the group. When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and @@ -577,6 +574,7 @@ def create_by_id( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -589,9 +587,8 @@ def create_by_id( body_content = self._serialize.body(parameters, 'PolicyAssignment') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -614,7 +611,7 @@ def get_by_id( self, policy_assignment_id, custom_headers=None, raw=False, **operation_config): """Gets a policy assignment by ID. - When providing a scope for the assigment, use + When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and @@ -649,7 +646,7 @@ def get_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -658,8 +655,8 @@ def get_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/policy_definitions_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/policy_definitions_operations.py index cf5f29d8966f..e3c708d2fa8b 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/policy_definitions_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/policy_definitions_operations.py @@ -72,6 +72,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -84,9 +85,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'PolicyDefinition') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -135,7 +135,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -144,8 +143,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -189,7 +188,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -198,8 +197,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -249,7 +248,7 @@ def get_built_in( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -258,8 +257,8 @@ def get_built_in( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -315,6 +314,7 @@ def create_or_update_at_management_group( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -327,9 +327,8 @@ def create_or_update_at_management_group( body_content = self._serialize.body(parameters, 'PolicyDefinition') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -380,7 +379,6 @@ def delete_at_management_group( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -389,8 +387,8 @@ def delete_at_management_group( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -436,7 +434,7 @@ def get_at_management_group( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -445,8 +443,8 @@ def get_at_management_group( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -499,7 +497,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -508,9 +506,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -560,7 +557,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -569,9 +566,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -628,7 +624,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -637,9 +633,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 c3ee3aad7f21..77b737c9884f 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 @@ -14,7 +14,7 @@ class ErrorResponse(Model): - """Error reponse indicates ARM is not able to process the incoming request. + """Error response indicates ARM is not able to process the incoming request. The reason is provided in the error message. :param http_status: Http status code. 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 index b65d2136f8d4..e76346b8c6ea 100644 --- 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 @@ -14,7 +14,7 @@ class ErrorResponse(Model): - """Error reponse indicates ARM is not able to process the incoming request. + """Error response indicates ARM is not able to process the incoming request. The reason is provided in the error message. :param http_status: Http status code. diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/policy_assignments_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/policy_assignments_operations.py index fbfc016db7c3..010782a793c5 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/policy_assignments_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/policy_assignments_operations.py @@ -71,7 +71,7 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -80,8 +80,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -139,6 +139,7 @@ def create( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -151,9 +152,8 @@ def create( body_content = self._serialize.body(parameters, 'PolicyAssignment') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: raise models.ErrorResponseException(self._deserialize, response) @@ -205,7 +205,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -214,8 +214,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -275,7 +275,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -284,9 +284,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -361,7 +360,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -370,9 +369,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -429,7 +427,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -438,9 +436,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -462,7 +459,7 @@ def delete_by_id( self, policy_assignment_id, custom_headers=None, raw=False, **operation_config): """Deletes a policy assignment by ID. - When providing a scope for the assigment, use + When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and @@ -498,7 +495,7 @@ def delete_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -507,8 +504,8 @@ def delete_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -531,7 +528,7 @@ def create_by_id( Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all - resources in the group. When providing a scope for the assigment, use + resources in the group. When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and @@ -570,6 +567,7 @@ def create_by_id( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -582,9 +580,8 @@ def create_by_id( body_content = self._serialize.body(parameters, 'PolicyAssignment') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: raise models.ErrorResponseException(self._deserialize, response) @@ -605,7 +602,7 @@ def get_by_id( self, policy_assignment_id, custom_headers=None, raw=False, **operation_config): """Gets a policy assignment by ID. - When providing a scope for the assigment, use + When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and @@ -641,7 +638,7 @@ def get_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -650,8 +647,8 @@ def get_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/policy_definitions_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/policy_definitions_operations.py index a34a22e9843b..9603a0061a3e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/policy_definitions_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/policy_definitions_operations.py @@ -72,6 +72,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -84,9 +85,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'PolicyDefinition') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -135,7 +135,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -144,8 +143,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -189,7 +188,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -198,8 +197,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -249,7 +248,7 @@ def get_built_in( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -258,8 +257,8 @@ def get_built_in( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -315,6 +314,7 @@ def create_or_update_at_management_group( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -327,9 +327,8 @@ def create_or_update_at_management_group( body_content = self._serialize.body(parameters, 'PolicyDefinition') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -380,7 +379,6 @@ def delete_at_management_group( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -389,8 +387,8 @@ def delete_at_management_group( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -436,7 +434,7 @@ def get_at_management_group( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -445,8 +443,8 @@ def get_at_management_group( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -499,7 +497,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -508,9 +506,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -560,7 +557,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -569,9 +566,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -628,7 +624,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -637,9 +633,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/policy_set_definitions_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/policy_set_definitions_operations.py index d00bce89f40d..abb66dc2c97f 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/policy_set_definitions_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/policy_set_definitions_operations.py @@ -72,6 +72,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -84,9 +85,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'PolicySetDefinition') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: raise models.ErrorResponseException(self._deserialize, response) @@ -136,7 +136,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -145,8 +144,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -189,7 +188,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -198,8 +197,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -248,7 +247,7 @@ def get_built_in( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -257,8 +256,8 @@ def get_built_in( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -310,7 +309,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -319,9 +318,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -370,7 +368,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -379,9 +377,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -437,6 +434,7 @@ def create_or_update_at_management_group( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -449,9 +447,8 @@ def create_or_update_at_management_group( body_content = self._serialize.body(parameters, 'PolicySetDefinition') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: raise models.ErrorResponseException(self._deserialize, response) @@ -503,7 +500,6 @@ def delete_at_management_group( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -512,8 +508,8 @@ def delete_at_management_group( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -558,7 +554,7 @@ def get_at_management_group( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -567,8 +563,8 @@ def get_at_management_group( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -623,7 +619,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -632,9 +628,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/error_response.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/error_response.py index abd135979bb7..ad2f6934e216 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/error_response.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/error_response.py @@ -14,7 +14,7 @@ class ErrorResponse(Model): - """Error reponse indicates Azure Resource Manager is not able to process the + """Error response indicates Azure Resource Manager is not able to process the incoming request. The reason is provided in the error message. :param http_status: Http status code. diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/error_response_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/error_response_py3.py index 94a49d2d4967..c55e28548997 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/error_response_py3.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/error_response_py3.py @@ -14,7 +14,7 @@ class ErrorResponse(Model): - """Error reponse indicates Azure Resource Manager is not able to process the + """Error response indicates Azure Resource Manager is not able to process the incoming request. The reason is provided in the error message. :param http_status: Http status code. diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/policy_assignments_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/policy_assignments_operations.py index 6b55f833ecd0..90a73943331e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/policy_assignments_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/policy_assignments_operations.py @@ -83,7 +83,7 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -92,8 +92,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -159,6 +159,7 @@ def create( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -171,9 +172,8 @@ def create( body_content = self._serialize.body(parameters, 'PolicyAssignment') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: raise models.ErrorResponseException(self._deserialize, response) @@ -235,7 +235,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -244,8 +244,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -322,7 +322,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -331,9 +331,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -442,7 +441,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -451,9 +450,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -527,7 +525,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -536,9 +534,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -600,7 +597,7 @@ def delete_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -609,8 +606,8 @@ def delete_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -677,6 +674,7 @@ def create_by_id( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -689,9 +687,8 @@ def create_by_id( body_content = self._serialize.body(parameters, 'PolicyAssignment') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: raise models.ErrorResponseException(self._deserialize, response) @@ -752,7 +749,7 @@ def get_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -761,8 +758,8 @@ def get_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/policy_definitions_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/policy_definitions_operations.py index 35d46e882383..46606d5f4ecd 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/policy_definitions_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/policy_definitions_operations.py @@ -75,6 +75,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -87,9 +88,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'PolicyDefinition') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -141,7 +141,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -150,8 +149,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -198,7 +197,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -207,8 +206,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -261,7 +260,7 @@ def get_built_in( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -270,8 +269,8 @@ def get_built_in( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -330,6 +329,7 @@ def create_or_update_at_management_group( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -342,9 +342,8 @@ def create_or_update_at_management_group( body_content = self._serialize.body(parameters, 'PolicyDefinition') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -398,7 +397,6 @@ def delete_at_management_group( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -407,8 +405,8 @@ def delete_at_management_group( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -457,7 +455,7 @@ def get_at_management_group( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -466,8 +464,8 @@ def get_at_management_group( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -523,7 +521,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -532,9 +530,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -586,7 +583,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -595,9 +592,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -656,7 +652,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -665,9 +661,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/policy_set_definitions_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/policy_set_definitions_operations.py index 3f0519a0c639..103b775ad09d 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/policy_set_definitions_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/policy_set_definitions_operations.py @@ -75,6 +75,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -87,9 +88,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'PolicySetDefinition') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: raise models.ErrorResponseException(self._deserialize, response) @@ -142,7 +142,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -151,8 +150,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -198,7 +197,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -207,8 +206,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -260,7 +259,7 @@ def get_built_in( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -269,8 +268,8 @@ def get_built_in( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -325,7 +324,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -334,9 +333,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -388,7 +386,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -397,9 +395,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -458,6 +455,7 @@ def create_or_update_at_management_group( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -470,9 +468,8 @@ def create_or_update_at_management_group( body_content = self._serialize.body(parameters, 'PolicySetDefinition') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: raise models.ErrorResponseException(self._deserialize, response) @@ -527,7 +524,6 @@ def delete_at_management_group( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -536,8 +532,8 @@ def delete_at_management_group( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -585,7 +581,7 @@ def get_at_management_group( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -594,8 +590,8 @@ def get_at_management_group( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -652,7 +648,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -661,9 +657,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/__init__.py new file mode 100644 index 000000000000..2564f85cc82c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_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 .policy_client import PolicyClient +from .version import VERSION + +__all__ = ['PolicyClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/__init__.py new file mode 100644 index 000000000000..46fa67515888 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/__init__.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. +# -------------------------------------------------------------------------- + +try: + from .policy_sku_py3 import PolicySku + from .identity_py3 import Identity + from .policy_assignment_py3 import PolicyAssignment + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .policy_definition_py3 import PolicyDefinition + from .policy_definition_reference_py3 import PolicyDefinitionReference + from .policy_set_definition_py3 import PolicySetDefinition +except (SyntaxError, ImportError): + from .policy_sku import PolicySku + from .identity import Identity + from .policy_assignment import PolicyAssignment + from .error_response import ErrorResponse, ErrorResponseException + from .policy_definition import PolicyDefinition + from .policy_definition_reference import PolicyDefinitionReference + from .policy_set_definition import PolicySetDefinition +from .policy_assignment_paged import PolicyAssignmentPaged +from .policy_definition_paged import PolicyDefinitionPaged +from .policy_set_definition_paged import PolicySetDefinitionPaged +from .policy_client_enums import ( + ResourceIdentityType, + PolicyType, + PolicyMode, +) + +__all__ = [ + 'PolicySku', + 'Identity', + 'PolicyAssignment', + 'ErrorResponse', 'ErrorResponseException', + 'PolicyDefinition', + 'PolicyDefinitionReference', + 'PolicySetDefinition', + 'PolicyAssignmentPaged', + 'PolicyDefinitionPaged', + 'PolicySetDefinitionPaged', + 'ResourceIdentityType', + 'PolicyType', + 'PolicyMode', +] diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/error_response.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/error_response.py new file mode 100644 index 000000000000..ad2f6934e216 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/error_response.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 response indicates Azure Resource Manager 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, **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): + """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/v2018_05_01/models/error_response_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/error_response_py3.py new file mode 100644 index 000000000000..c55e28548997 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/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 response indicates Azure Resource Manager 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/v2018_05_01/models/identity.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/identity.py new file mode 100644 index 000000000000..3bcb0da30312 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_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 the resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the resource identity. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned', + 'None' + :type type: str or + ~azure.mgmt.resource.policy.v2018_05_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/policy/v2018_05_01/models/identity_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/identity_py3.py new file mode 100644 index 000000000000..f51293b28c40 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_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 the resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the resource identity. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned', + 'None' + :type type: str or + ~azure.mgmt.resource.policy.v2018_05_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/policy/v2018_05_01/models/policy_assignment.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_assignment.py new file mode 100644 index 000000000000..c512b232c358 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_assignment.py @@ -0,0 +1,90 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (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 or policy set + definition being assigned. + :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. This property is optional, obsolete, and will + be ignored. + :type sku: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySku + :param location: The location of the policy assignment. Only required when + utilizing managed identity. + :type location: str + :param identity: The managed identity associated with the policy + assignment. + :type identity: ~azure.mgmt.resource.policy.v2018_05_01.models.Identity + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + 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 = kwargs.get('sku', None) + self.location = kwargs.get('location', None) + self.identity = kwargs.get('identity', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_assignment_paged.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_assignment_paged.py new file mode 100644 index 000000000000..25e371fe81ab --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_assignment_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 PolicyAssignmentPaged(Paged): + """ + A paging container for iterating over a list of :class:`PolicyAssignment ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PolicyAssignment]'} + } + + def __init__(self, *args, **kwargs): + + super(PolicyAssignmentPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_assignment_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_assignment_py3.py new file mode 100644 index 000000000000..1cbbdc3e9f85 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_assignment_py3.py @@ -0,0 +1,90 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (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 or policy set + definition being assigned. + :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. This property is optional, obsolete, and will + be ignored. + :type sku: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySku + :param location: The location of the policy assignment. Only required when + utilizing managed identity. + :type location: str + :param identity: The managed identity associated with the policy + assignment. + :type identity: ~azure.mgmt.resource.policy.v2018_05_01.models.Identity + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + 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, location: str=None, identity=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 + self.location = location + self.identity = identity diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_client_enums.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_client_enums.py new file mode 100644 index 000000000000..f42fa2ecfcf9 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_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 ResourceIdentityType(str, Enum): + + system_assigned = "SystemAssigned" + none = "None" + + +class PolicyType(str, Enum): + + not_specified = "NotSpecified" + built_in = "BuiltIn" + custom = "Custom" + + +class PolicyMode(str, Enum): + + not_specified = "NotSpecified" + indexed = "Indexed" + all = "All" diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition.py new file mode 100644 index 000000000000..39bb09700679 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (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.v2018_05_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.v2018_05_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 + :ivar type: The type of the resource + (Microsoft.Authorization/policyDefinitions). + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'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'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + 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 + self.type = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition_paged.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition_paged.py new file mode 100644 index 000000000000..b3454af40ac5 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition_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 PolicyDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PolicyDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PolicyDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(PolicyDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition_py3.py new file mode 100644 index 000000000000..be3c0aa43280 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (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.v2018_05_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.v2018_05_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 + :ivar type: The type of the resource + (Microsoft.Authorization/policyDefinitions). + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'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'}, + 'type': {'key': 'type', '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 + self.type = None diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition_reference.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition_reference.py new file mode 100644 index 000000000000..cf0be3729831 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition_reference.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, **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/v2018_05_01/models/policy_definition_reference_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_definition_reference_py3.py new file mode 100644 index 000000000000..e9aac83dc16e --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/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/v2018_05_01/models/policy_set_definition.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_set_definition.py new file mode 100644 index 000000000000..67180b816ff1 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_set_definition.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.v2018_05_01.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.v2018_05_01.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, **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/v2018_05_01/models/policy_set_definition_paged.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_set_definition_paged.py new file mode 100644 index 000000000000..7f0e590b5821 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_set_definition_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 PolicySetDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PolicySetDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PolicySetDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(PolicySetDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_set_definition_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_set_definition_py3.py new file mode 100644 index 000000000000..7d3389a881d0 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/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.v2018_05_01.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.v2018_05_01.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/v2018_05_01/models/policy_sku.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_sku.py new file mode 100644 index 000000000000..458f7cf52f45 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_sku.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. This property is optional, obsolete, and will be ignored. + + 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, **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/v2018_05_01/models/policy_sku_py3.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/policy_sku_py3.py new file mode 100644 index 000000000000..824479c44f92 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/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. This property is optional, obsolete, and will be ignored. + + 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/v2018_05_01/operations/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/__init__.py new file mode 100644 index 000000000000..44d309ea01cc --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/__init__.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .policy_assignments_operations import PolicyAssignmentsOperations +from .policy_definitions_operations import PolicyDefinitionsOperations +from .policy_set_definitions_operations import PolicySetDefinitionsOperations + +__all__ = [ + 'PolicyAssignmentsOperations', + 'PolicyDefinitionsOperations', + 'PolicySetDefinitionsOperations', +] diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/policy_assignments_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/policy_assignments_operations.py new file mode 100644 index 000000000000..eeae95bdd5bc --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/policy_assignments_operations.py @@ -0,0 +1,777 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PolicyAssignmentsOperations(object): + """PolicyAssignmentsOperations 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 the operation. Constant value: "2018-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01" + + self.config = config + + def delete( + self, scope, policy_assignment_name, custom_headers=None, raw=False, **operation_config): + """Deletes a policy assignment. + + This operation deletes a policy assignment, given its name and the + scope it was created in. The scope of a policy assignment is the part + of its ID preceding + '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + + :param scope: The scope of the policy assignment. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'), resource + group (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', + or resource (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + :type scope: str + :param policy_assignment_name: The name of the policy assignment to + delete. + :type policy_assignment_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: PolicyAssignment or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'policyAssignmentName': self._serialize.url("policy_assignment_name", policy_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'} + + def create( + self, scope, policy_assignment_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a policy assignment. + + This operation creates or updates a policy assignment with the given + scope and name. Policy assignments apply to all resources contained + within their scope. For example, when you assign a policy at resource + group scope, that policy applies to all resources in the group. + + :param scope: The scope of the policy assignment. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'), resource + group (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', + or resource (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + :type scope: str + :param policy_assignment_name: The name of the policy assignment. + :type policy_assignment_name: str + :param parameters: Parameters for the policy assignment. + :type parameters: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment + :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: PolicyAssignment or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'policyAssignmentName': self._serialize.url("policy_assignment_name", policy_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PolicyAssignment') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('PolicyAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'} + + def get( + self, scope, policy_assignment_name, custom_headers=None, raw=False, **operation_config): + """Retrieves a policy assignment. + + This operation retrieves a single policy assignment, given its name and + the scope it was created at. + + :param scope: The scope of the policy assignment. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'), resource + group (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', + or resource (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + :type scope: str + :param policy_assignment_name: The name of the policy assignment to + get. + :type policy_assignment_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: PolicyAssignment or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'policyAssignmentName': self._serialize.url("policy_assignment_name", policy_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'} + + def list_for_resource_group( + self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieves all policy assignments that apply to a resource group. + + This operation retrieves the list of all policy assignments associated + with the given resource group in the given subscription that match the + optional given $filter. Valid values for $filter are: 'atScope()' or + 'policyDefinitionId eq '{value}''. If $filter is not provided, the + unfiltered list includes all policy assignments associated with the + resource group, including those that apply directly or apply from + containing scopes, as well as any applied to resources contained within + the resource group. If $filter=atScope() is provided, the returned list + includes all policy assignments that apply to the resource group, which + is everything in the unfiltered list except those applied to resources + contained within the resource group. If $filter=policyDefinitionId eq + '{value}' is provided, the returned list includes only policy + assignments that apply to the resource group and assign the policy + definition whose id is {value}. + + :param resource_group_name: The name of the resource group that + contains policy assignments. + :type resource_group_name: str + :param filter: The filter to apply on the operation. Valid values for + $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + $filter is not provided, no filtering is performed. + :type filter: 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 PolicyAssignment + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignmentPaged[~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_for_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', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PolicyAssignmentPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PolicyAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_for_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments'} + + def list_for_resource( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieves all policy assignments that apply to a resource. + + This operation retrieves the list of all policy assignments associated + with the specified resource in the given resource group and + subscription that match the optional given $filter. Valid values for + $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + $filter is not provided, the unfiltered list includes all policy + assignments associated with the resource, including those that apply + directly or from all containing scopes, as well as any applied to + resources contained within the resource. If $filter=atScope() is + provided, the returned list includes all policy assignments that apply + to the resource, which is everything in the unfiltered list except + those applied to resources contained within the resource. If + $filter=policyDefinitionId eq '{value}' is provided, the returned list + includes only policy assignments that apply to the resource and assign + the policy definition whose id is {value}. Three parameters plus the + resource name are used to identify a specific resource. If the resource + is not part of a parent resource (the more common case), the parent + resource path should not be provided (or provided as ''). For example a + web app could be specified as ({resourceProviderNamespace} == + 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', + {resourceName} == 'MyWebApp'). If the resource is part of a parent + resource, then all parameters should be provided. For example a virtual + machine DNS name could be specified as ({resourceProviderNamespace} == + 'Microsoft.Compute', {parentResourcePath} == + 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', + {resourceName} == 'MyComputerName'). A convenient alternative to + providing the namespace and type name separately is to provide both in + the {resourceType} parameter, format: ({resourceProviderNamespace} == + '', {parentResourcePath} == '', {resourceType} == + 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). + + :param resource_group_name: The name of the resource group containing + the resource. + :type resource_group_name: str + :param resource_provider_namespace: The namespace of the resource + provider. For example, the namespace of a virtual machine is + Microsoft.Compute (from Microsoft.Compute/virtualMachines) + :type resource_provider_namespace: str + :param parent_resource_path: The parent resource path. Use empty + string if there is none. + :type parent_resource_path: str + :param resource_type: The resource type name. For example the type + name of a web app is 'sites' (from Microsoft.Web/sites). + :type resource_type: str + :param resource_name: The name of the resource. + :type resource_name: str + :param filter: The filter to apply on the operation. Valid values for + $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + $filter is not provided, no filtering is performed. + :type filter: 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 PolicyAssignment + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignmentPaged[~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_for_resource.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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, '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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PolicyAssignmentPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PolicyAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_for_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments'} + + def list( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieves all policy assignments that apply to a subscription. + + This operation retrieves the list of all policy assignments associated + with the given subscription that match the optional given $filter. + Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq + '{value}''. If $filter is not provided, the unfiltered list includes + all policy assignments associated with the subscription, including + those that apply directly or from management groups that contain the + given subscription, as well as any applied to objects contained within + the subscription. If $filter=atScope() is provided, the returned list + includes all policy assignments that apply to the subscription, which + is everything in the unfiltered list except those applied to objects + contained within the subscription. If $filter=policyDefinitionId eq + '{value}' is provided, the returned list includes only policy + assignments that apply to the subscription and assign the policy + definition whose id is {value}. + + :param filter: The filter to apply on the operation. Valid values for + $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + $filter is not provided, no filtering is performed. + :type filter: 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 PolicyAssignment + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignmentPaged[~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment] + :raises: + :class:`ErrorResponseException` + """ + 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PolicyAssignmentPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PolicyAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments'} + + def delete_by_id( + self, policy_assignment_id, custom_headers=None, raw=False, **operation_config): + """Deletes a policy assignment. + + This operation deletes the policy with the given ID. Policy assignment + IDs have this format: + '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + Valid formats for {scope} are: + '/providers/Microsoft.Management/managementGroups/{managementGroup}' + (management group), '/subscriptions/{subscriptionId}' (subscription), + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + (resource group), or + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + (resource). + + :param policy_assignment_id: The ID of the policy assignment to + delete. Use the format + '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + :type policy_assignment_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: PolicyAssignment or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_by_id.metadata['url'] + path_format_arguments = { + 'policyAssignmentId': self._serialize.url("policy_assignment_id", policy_assignment_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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_by_id.metadata = {'url': '/{policyAssignmentId}'} + + def create_by_id( + self, policy_assignment_id, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a policy assignment. + + This operation creates or updates the policy assignment with the given + ID. Policy assignments made on a scope apply to all resources contained + in that scope. For example, when you assign a policy to a resource + group that policy applies to all resources in the group. Policy + assignment IDs have this format: + '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + Valid scopes are: management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'), resource + group (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', + or resource (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + + :param policy_assignment_id: The ID of the policy assignment to + create. Use the format + '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + :type policy_assignment_id: str + :param parameters: Parameters for policy assignment. + :type parameters: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment + :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: PolicyAssignment or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_by_id.metadata['url'] + path_format_arguments = { + 'policyAssignmentId': self._serialize.url("policy_assignment_id", policy_assignment_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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PolicyAssignment') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('PolicyAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_by_id.metadata = {'url': '/{policyAssignmentId}'} + + def get_by_id( + self, policy_assignment_id, custom_headers=None, raw=False, **operation_config): + """Retrieves the policy assignment with the given ID. + + The operation retrieves the policy assignment with the given ID. Policy + assignment IDs have this format: + '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + Valid scopes are: management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'), resource + group (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', + or resource (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + + :param policy_assignment_id: The ID of the policy assignment to get. + Use the format + '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + :type policy_assignment_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: PolicyAssignment or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'policyAssignmentId': self._serialize.url("policy_assignment_id", policy_assignment_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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/{policyAssignmentId}'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/policy_definitions_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/policy_definitions_operations.py new file mode 100644 index 000000000000..3d52c2cb9b72 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/policy_definitions_operations.py @@ -0,0 +1,683 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 PolicyDefinitionsOperations(object): + """PolicyDefinitionsOperations 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 the operation. Constant value: "2018-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01" + + self.config = config + + def create_or_update( + self, policy_definition_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a policy definition in a subscription. + + This operation creates or updates a policy definition in the given + subscription with the given name. + + :param policy_definition_name: The name of the policy definition to + create. + :type policy_definition_name: str + :param parameters: The policy definition properties. + :type parameters: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition + :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: PolicyDefinition or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'policyDefinitionName': self._serialize.url("policy_definition_name", policy_definition_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['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PolicyDefinition') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('PolicyDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}'} + + def delete( + self, policy_definition_name, custom_headers=None, raw=False, **operation_config): + """Deletes a policy definition in a subscription. + + This operation deletes the policy definition in the given subscription + with the given name. + + :param policy_definition_name: The name of the policy definition to + delete. + :type policy_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 + :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 = { + 'policyDefinitionName': self._serialize.url("policy_definition_name", policy_definition_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 = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}'} + + def get( + self, policy_definition_name, custom_headers=None, raw=False, **operation_config): + """Retrieves a policy definition in a subscription. + + This operation retrieves the policy definition in the given + subscription with the given name. + + :param policy_definition_name: The name of the policy definition to + get. + :type policy_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyDefinition or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'policyDefinitionName': self._serialize.url("policy_definition_name", policy_definition_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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + 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('PolicyDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}'} + + def get_built_in( + self, policy_definition_name, custom_headers=None, raw=False, **operation_config): + """Retrieves a built-in policy definition. + + This operation retrieves the built-in policy definition with the given + name. + + :param policy_definition_name: The name of the built-in policy + definition to get. + :type policy_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyDefinition or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_built_in.metadata['url'] + path_format_arguments = { + 'policyDefinitionName': self._serialize.url("policy_definition_name", policy_definition_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + 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('PolicyDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_built_in.metadata = {'url': '/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}'} + + def create_or_update_at_management_group( + self, policy_definition_name, parameters, management_group_id, custom_headers=None, raw=False, **operation_config): + """Creates or updates a policy definition in a management group. + + This operation creates or updates a policy definition in the given + management group with the given name. + + :param policy_definition_name: The name of the policy definition to + create. + :type policy_definition_name: str + :param parameters: The policy definition properties. + :type parameters: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition + :param management_group_id: The ID of the management group. + :type management_group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyDefinition or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update_at_management_group.metadata['url'] + path_format_arguments = { + 'policyDefinitionName': self._serialize.url("policy_definition_name", policy_definition_name, 'str'), + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 'PolicyDefinition') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('PolicyDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_at_management_group.metadata = {'url': '/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}'} + + def delete_at_management_group( + self, policy_definition_name, management_group_id, custom_headers=None, raw=False, **operation_config): + """Deletes a policy definition in a management group. + + This operation deletes the policy definition in the given management + group with the given name. + + :param policy_definition_name: The name of the policy definition to + delete. + :type policy_definition_name: str + :param management_group_id: The ID of the management group. + :type management_group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_at_management_group.metadata['url'] + path_format_arguments = { + 'policyDefinitionName': self._serialize.url("policy_definition_name", policy_definition_name, 'str'), + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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_at_management_group.metadata = {'url': '/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}'} + + def get_at_management_group( + self, policy_definition_name, management_group_id, custom_headers=None, raw=False, **operation_config): + """Retrieve a policy definition in a management group. + + This operation retrieves the policy definition in the given management + group with the given name. + + :param policy_definition_name: The name of the policy definition to + get. + :type policy_definition_name: str + :param management_group_id: The ID of the management group. + :type management_group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyDefinition or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_management_group.metadata['url'] + path_format_arguments = { + 'policyDefinitionName': self._serialize.url("policy_definition_name", policy_definition_name, 'str'), + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + 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('PolicyDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_management_group.metadata = {'url': '/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Retrieves policy definitions in a subscription. + + This operation retrieves a list of all the policy definitions in a + given 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 PolicyDefinition + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinitionPaged[~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition] + :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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PolicyDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PolicyDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions'} + + def list_built_in( + self, custom_headers=None, raw=False, **operation_config): + """Retrieve built-in policy definitions. + + This operation retrieves a list of all the built-in policy definitions. + + :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 PolicyDefinition + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinitionPaged[~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_built_in.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PolicyDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PolicyDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_built_in.metadata = {'url': '/providers/Microsoft.Authorization/policyDefinitions'} + + def list_by_management_group( + self, management_group_id, custom_headers=None, raw=False, **operation_config): + """Retrieve policy definitions in a management group. + + This operation retrieves a list of all the policy definitions in a + given management group. + + :param management_group_id: The ID of the management group. + :type management_group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PolicyDefinition + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinitionPaged[~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_management_group.metadata['url'] + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PolicyDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PolicyDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/policy_set_definitions_operations.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/policy_set_definitions_operations.py new file mode 100644 index 000000000000..24b7b8271c2b --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/policy_set_definitions_operations.py @@ -0,0 +1,677 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PolicySetDefinitionsOperations(object): + """PolicySetDefinitionsOperations 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 the operation. Constant value: "2018-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01" + + self.config = config + + def create_or_update( + self, policy_set_definition_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a policy set definition. + + This operation creates or updates a policy set definition in the given + subscription with the given name. + + :param policy_set_definition_name: The name of the policy set + definition to create. + :type policy_set_definition_name: str + :param parameters: The policy set definition properties. + :type parameters: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition + :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: PolicySetDefinition or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'policySetDefinitionName': self._serialize.url("policy_set_definition_name", policy_set_definition_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['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PolicySetDefinition') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicySetDefinition', response) + if response.status_code == 201: + deserialized = self._deserialize('PolicySetDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}'} + + def delete( + self, policy_set_definition_name, custom_headers=None, raw=False, **operation_config): + """Deletes a policy set definition. + + This operation deletes the policy set definition in the given + subscription with the given name. + + :param policy_set_definition_name: The name of the policy set + definition to delete. + :type policy_set_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'policySetDefinitionName': self._serialize.url("policy_set_definition_name", policy_set_definition_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 = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}'} + + def get( + self, policy_set_definition_name, custom_headers=None, raw=False, **operation_config): + """Retrieves a policy set definition. + + This operation retrieves the policy set definition in the given + subscription with the given name. + + :param policy_set_definition_name: The name of the policy set + definition to get. + :type policy_set_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicySetDefinition or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'policySetDefinitionName': self._serialize.url("policy_set_definition_name", policy_set_definition_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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicySetDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}'} + + def get_built_in( + self, policy_set_definition_name, custom_headers=None, raw=False, **operation_config): + """Retrieves a built in policy set definition. + + This operation retrieves the built-in policy set definition with the + given name. + + :param policy_set_definition_name: The name of the policy set + definition to get. + :type policy_set_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicySetDefinition or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_built_in.metadata['url'] + path_format_arguments = { + 'policySetDefinitionName': self._serialize.url("policy_set_definition_name", policy_set_definition_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicySetDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_built_in.metadata = {'url': '/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Retrieves the policy set definitions for a subscription. + + This operation retrieves a list of all the policy set definitions in + the given 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 PolicySetDefinition + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinitionPaged[~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition] + :raises: + :class:`ErrorResponseException` + """ + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PolicySetDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PolicySetDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions'} + + def list_built_in( + self, custom_headers=None, raw=False, **operation_config): + """Retrieves built-in policy set definitions. + + This operation retrieves a list of all the built-in policy set + definitions. + + :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 PolicySetDefinition + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinitionPaged[~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_built_in.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PolicySetDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PolicySetDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_built_in.metadata = {'url': '/providers/Microsoft.Authorization/policySetDefinitions'} + + def create_or_update_at_management_group( + self, policy_set_definition_name, parameters, management_group_id, custom_headers=None, raw=False, **operation_config): + """Creates or updates a policy set definition. + + This operation creates or updates a policy set definition in the given + management group with the given name. + + :param policy_set_definition_name: The name of the policy set + definition to create. + :type policy_set_definition_name: str + :param parameters: The policy set definition properties. + :type parameters: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition + :param management_group_id: The ID of the management group. + :type management_group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicySetDefinition or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update_at_management_group.metadata['url'] + path_format_arguments = { + 'policySetDefinitionName': self._serialize.url("policy_set_definition_name", policy_set_definition_name, 'str'), + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 'PolicySetDefinition') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicySetDefinition', response) + if response.status_code == 201: + deserialized = self._deserialize('PolicySetDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_at_management_group.metadata = {'url': '/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}'} + + def delete_at_management_group( + self, policy_set_definition_name, management_group_id, custom_headers=None, raw=False, **operation_config): + """Deletes a policy set definition. + + This operation deletes the policy set definition in the given + management group with the given name. + + :param policy_set_definition_name: The name of the policy set + definition to delete. + :type policy_set_definition_name: str + :param management_group_id: The ID of the management group. + :type management_group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_at_management_group.metadata['url'] + path_format_arguments = { + 'policySetDefinitionName': self._serialize.url("policy_set_definition_name", policy_set_definition_name, 'str'), + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_at_management_group.metadata = {'url': '/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}'} + + def get_at_management_group( + self, policy_set_definition_name, management_group_id, custom_headers=None, raw=False, **operation_config): + """Retrieves a policy set definition. + + This operation retrieves the policy set definition in the given + management group with the given name. + + :param policy_set_definition_name: The name of the policy set + definition to get. + :type policy_set_definition_name: str + :param management_group_id: The ID of the management group. + :type management_group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicySetDefinition or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_at_management_group.metadata['url'] + path_format_arguments = { + 'policySetDefinitionName': self._serialize.url("policy_set_definition_name", policy_set_definition_name, 'str'), + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicySetDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_management_group.metadata = {'url': '/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}'} + + def list_by_management_group( + self, management_group_id, custom_headers=None, raw=False, **operation_config): + """Retrieves all policy set definitions in management group. + + This operation retrieves a list of all the a policy set definition in + the given management group. + + :param management_group_id: The ID of the management group. + :type management_group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PolicySetDefinition + :rtype: + ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinitionPaged[~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_management_group.metadata['url'] + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PolicySetDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PolicySetDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/policy_client.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/policy_client.py new file mode 100644 index 000000000000..0010638cf15c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/policy_client.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# 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.policy_assignments_operations import PolicyAssignmentsOperations +from .operations.policy_definitions_operations import PolicyDefinitionsOperations +from .operations.policy_set_definitions_operations import PolicySetDefinitionsOperations +from . import models + + +class PolicyClientConfiguration(AzureConfiguration): + """Configuration for PolicyClient + 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(PolicyClientConfiguration, 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 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. + :vartype config: PolicyClientConfiguration + + :ivar policy_assignments: PolicyAssignments operations + :vartype policy_assignments: azure.mgmt.resource.policy.v2018_05_01.operations.PolicyAssignmentsOperations + :ivar policy_definitions: PolicyDefinitions operations + :vartype policy_definitions: azure.mgmt.resource.policy.v2018_05_01.operations.PolicyDefinitionsOperations + :ivar policy_set_definitions: PolicySetDefinitions operations + :vartype policy_set_definitions: azure.mgmt.resource.policy.v2018_05_01.operations.PolicySetDefinitionsOperations + + :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 = PolicyClientConfiguration(credentials, subscription_id, base_url) + 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 = '2018-05-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.policy_assignments = PolicyAssignmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.policy_definitions = PolicyDefinitionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.policy_set_definitions = PolicySetDefinitionsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/version.py b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/version.py new file mode 100644 index 000000000000..5bfc801ce220 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_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-05-01" + 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 961677f13f9b..e9c39247790c 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 @@ -118,7 +118,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): from .v2018_05_01 import models return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) - + @property def deployment_operations(self): """Instance depends on the API version: @@ -169,6 +169,19 @@ def deployments(self): 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))) + @property + def operations(self): + """Instance depends on the API version: + + * 2018-05-01: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2018-05-01': + from .v2018_05_01.operations import Operations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def providers(self): """Instance depends on the API version: 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 edfe6ab70557..e2065555e3a9 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 @@ -21,7 +21,7 @@ class DeploymentPropertiesExtended(Model): :type correlation_id: str :param timestamp: The timestamp of the template deployment. :type timestamp: datetime - :param outputs: Key/value pairs that represent deploymentoutput. + :param outputs: Key/value pairs that represent deployment output. :type outputs: object :param providers: The list of resource providers needed for the deployment. 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 index e7d5b758a4fd..3819807e38e0 100644 --- 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 @@ -21,7 +21,7 @@ class DeploymentPropertiesExtended(Model): :type correlation_id: str :param timestamp: The timestamp of the template deployment. :type timestamp: datetime - :param outputs: Key/value pairs that represent deploymentoutput. + :param outputs: Key/value pairs that represent deployment output. :type outputs: object :param providers: The list of resource providers needed for the deployment. 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 3847a62562a5..a657e59ff1b8 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 @@ -13,7 +13,7 @@ class ParametersLink(Model): - """Entity representing the reference to the deployment paramaters. + """Entity representing the reference to the deployment parameters. All required parameters must be populated in order to send to Azure. 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 index 8325aabe4a38..5fcf9c18d5f5 100644 --- 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 @@ -13,7 +13,7 @@ class ParametersLink(Model): - """Entity representing the reference to the deployment paramaters. + """Entity representing the reference to the deployment parameters. All required parameters must be populated in order to send to Azure. diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/deployment_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/deployment_operations.py index fee524c2ee5f..3dea64a5257c 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/deployment_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/deployment_operations.py @@ -75,7 +75,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -84,8 +84,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -149,7 +149,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -158,9 +158,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 2347f80715d5..00f417d91aaa 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 @@ -57,7 +57,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -66,8 +65,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: exp = CloudError(response) @@ -153,7 +152,6 @@ def check_existence( # 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: @@ -162,8 +160,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -197,6 +195,7 @@ def _create_or_update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -209,9 +208,8 @@ def _create_or_update_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -318,7 +316,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -327,8 +325,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -380,7 +378,6 @@ def cancel( # 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: @@ -389,8 +386,8 @@ def cancel( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204]: exp = CloudError(response) @@ -442,6 +439,7 @@ def validate( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -454,9 +452,8 @@ def validate( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 400]: exp = CloudError(response) @@ -512,7 +509,7 @@ def export_template( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -521,8 +518,8 @@ def export_template( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -588,7 +585,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -597,9 +594,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/providers_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/providers_operations.py index d31a55392def..bfb7442a6d7d 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/providers_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/providers_operations.py @@ -68,7 +68,7 @@ def unregister( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -77,8 +77,8 @@ def unregister( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -128,7 +128,7 @@ def register( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -137,8 +137,8 @@ def register( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -201,7 +201,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -210,9 +210,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -268,7 +267,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -277,8 +276,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 bf1ba4aa5346..08cc3d0bb19e 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 @@ -90,7 +90,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -99,9 +99,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -151,7 +150,6 @@ def check_existence( # 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: @@ -160,8 +158,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -211,6 +209,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -223,9 +222,8 @@ def create_or_update( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -263,7 +261,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -272,8 +269,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -355,7 +352,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -364,8 +361,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -423,6 +420,7 @@ def patch( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -435,9 +433,8 @@ def patch( body_content = self._serialize.body(parameters, 'ResourceGroup') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -498,6 +495,7 @@ def export_template( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -510,9 +508,8 @@ def export_template( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -574,7 +571,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -583,9 +580,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 0a26d58f5bc3..16723808af93 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 @@ -70,9 +70,8 @@ def _move_resources_initial( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: exp = CloudError(response) @@ -175,7 +174,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -184,9 +183,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -250,7 +248,6 @@ def check_existence( # 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: @@ -259,8 +256,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -318,7 +315,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -327,8 +323,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -389,6 +385,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -401,9 +398,8 @@ def create_or_update( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -445,6 +441,7 @@ def _update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -457,9 +454,8 @@ def _update_initial( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -588,7 +584,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -597,8 +593,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/tags_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/tags_operations.py index 5b1cece54254..824244812a13 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/tags_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/tags_operations.py @@ -69,7 +69,6 @@ def delete_value( # 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: @@ -78,8 +77,8 @@ def delete_value( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -124,7 +123,7 @@ def create_or_update_value( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -133,8 +132,8 @@ def create_or_update_value( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -185,7 +184,7 @@ def create_or_update( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -194,8 +193,8 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -245,7 +244,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -254,8 +252,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -301,7 +299,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -310,9 +308,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 e95f6889239a..b337d1cf4d3c 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 @@ -24,7 +24,7 @@ class DeploymentPropertiesExtended(Model): :vartype correlation_id: str :ivar timestamp: The timestamp of the template deployment. :vartype timestamp: datetime - :param outputs: Key/value pairs that represent deploymentoutput. + :param outputs: Key/value pairs that represent deployment output. :type outputs: object :param providers: The list of resource providers needed for the deployment. 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 index c38d218f11b6..1bb1c132b19b 100644 --- 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 @@ -24,7 +24,7 @@ class DeploymentPropertiesExtended(Model): :vartype correlation_id: str :ivar timestamp: The timestamp of the template deployment. :vartype timestamp: datetime - :param outputs: Key/value pairs that represent deploymentoutput. + :param outputs: Key/value pairs that represent deployment output. :type outputs: object :param providers: The list of resource providers needed for the deployment. 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 c436b9d4ab6e..0696248fc17c 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 @@ -13,7 +13,7 @@ class ParametersLink(Model): - """Entity representing the reference to the deployment paramaters. + """Entity representing the reference to the deployment parameters. All required parameters must be populated in order to send to Azure. 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 index 52bc9723fa3e..734546c362c4 100644 --- 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 @@ -13,7 +13,7 @@ class ParametersLink(Model): - """Entity representing the reference to the deployment paramaters. + """Entity representing the reference to the deployment parameters. All required parameters must be populated in order to send to Azure. 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 5744235367cd..6a66925978ed 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 @@ -28,7 +28,7 @@ class ResourceGroup(Model): :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 + 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 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 index 431e5c21f17b..1243c3e93af1 100644 --- 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 @@ -28,7 +28,7 @@ class ResourceGroup(Model): :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 + 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 diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/deployment_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/deployment_operations.py index 4ed26e30a340..1b387dffc88f 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/deployment_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/deployment_operations.py @@ -75,7 +75,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -84,8 +84,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -150,7 +150,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -159,9 +159,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 600826e96462..961eb3666ef5 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 @@ -57,7 +57,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -66,8 +65,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: exp = CloudError(response) @@ -165,7 +164,6 @@ def check_existence( # 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: @@ -174,8 +172,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -209,6 +207,7 @@ def _create_or_update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -221,9 +220,8 @@ def _create_or_update_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -334,7 +332,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -343,8 +341,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -402,7 +400,6 @@ def cancel( # 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: @@ -411,8 +408,8 @@ def cancel( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204]: exp = CloudError(response) @@ -465,6 +462,7 @@ def validate( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -477,9 +475,8 @@ def validate( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 400]: exp = CloudError(response) @@ -536,7 +533,7 @@ def export_template( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -545,8 +542,8 @@ def export_template( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -613,7 +610,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -622,9 +619,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/providers_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/providers_operations.py index 02c3ae0ac126..af86920a2e5e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/providers_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/providers_operations.py @@ -68,7 +68,7 @@ def unregister( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -77,8 +77,8 @@ def unregister( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -128,7 +128,7 @@ def register( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -137,8 +137,8 @@ def register( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -203,7 +203,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -212,9 +212,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -270,7 +269,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -279,8 +278,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 dece11419457..77577612368f 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 @@ -90,7 +90,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -99,9 +99,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -151,7 +150,6 @@ def check_existence( # 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: @@ -160,8 +158,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -211,6 +209,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -223,9 +222,8 @@ def create_or_update( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -263,7 +261,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -272,8 +269,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -359,7 +356,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -368,8 +365,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -428,6 +425,7 @@ def patch( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -440,9 +438,8 @@ def patch( body_content = self._serialize.body(parameters, 'ResourceGroup') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -503,6 +500,7 @@ def export_template( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -515,9 +513,8 @@ def export_template( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -579,7 +576,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -588,9 +585,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 6f9521809d07..1f65ea4738b3 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 @@ -70,9 +70,8 @@ def _move_resources_initial( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: exp = CloudError(response) @@ -94,7 +93,7 @@ def move_resources( on the groups until the move completes. . :param source_resource_group_name: The name of the resource group - containing the rsources to move. + containing the resources to move. :type source_resource_group_name: str :param resources: The IDs of the resources. :type resources: list[str] @@ -181,7 +180,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -190,9 +189,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -258,7 +256,6 @@ def check_existence( # 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: @@ -267,8 +264,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -303,7 +300,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -312,8 +308,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -400,6 +396,7 @@ def _create_or_update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -412,9 +409,8 @@ def _create_or_update_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201, 202]: exp = CloudError(response) @@ -520,6 +516,7 @@ def _update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -532,9 +529,8 @@ def _update_initial( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -664,7 +660,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -673,8 +669,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -725,7 +721,6 @@ def check_existence_by_id( # 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: @@ -734,8 +729,8 @@ def check_existence_by_id( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -765,7 +760,6 @@ def _delete_by_id_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -774,8 +768,8 @@ def _delete_by_id_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -845,6 +839,7 @@ def _create_or_update_by_id_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -857,9 +852,8 @@ def _create_or_update_by_id_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201, 202]: exp = CloudError(response) @@ -948,6 +942,7 @@ def _update_by_id_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -960,9 +955,8 @@ def _update_by_id_initial( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -1067,7 +1061,7 @@ def get_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -1076,8 +1070,8 @@ def get_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/tags_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/tags_operations.py index 2386cdcfed9b..abfa138d5306 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/tags_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/tags_operations.py @@ -69,7 +69,6 @@ def delete_value( # 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: @@ -78,8 +77,8 @@ def delete_value( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -124,7 +123,7 @@ def create_or_update_value( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -133,8 +132,8 @@ def create_or_update_value( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -189,7 +188,7 @@ def create_or_update( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -198,8 +197,8 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -252,7 +251,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -261,8 +259,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -309,7 +307,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -318,9 +316,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 091c71ec2dcc..da33803f8f92 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 @@ -24,7 +24,7 @@ class DeploymentPropertiesExtended(Model): :vartype correlation_id: str :ivar timestamp: The timestamp of the template deployment. :vartype timestamp: datetime - :param outputs: Key/value pairs that represent deploymentoutput. + :param outputs: Key/value pairs that represent deployment output. :type outputs: object :param providers: The list of resource providers needed for the deployment. 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 index fec0234e2647..1209ad4f26fa 100644 --- 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 @@ -24,7 +24,7 @@ class DeploymentPropertiesExtended(Model): :vartype correlation_id: str :ivar timestamp: The timestamp of the template deployment. :vartype timestamp: datetime - :param outputs: Key/value pairs that represent deploymentoutput. + :param outputs: Key/value pairs that represent deployment output. :type outputs: object :param providers: The list of resource providers needed for the deployment. 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 c436b9d4ab6e..0696248fc17c 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 @@ -13,7 +13,7 @@ class ParametersLink(Model): - """Entity representing the reference to the deployment paramaters. + """Entity representing the reference to the deployment parameters. All required parameters must be populated in order to send to Azure. 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 index 52bc9723fa3e..734546c362c4 100644 --- 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 @@ -13,7 +13,7 @@ class ParametersLink(Model): - """Entity representing the reference to the deployment paramaters. + """Entity representing the reference to the deployment parameters. All required parameters must be populated in order to send to Azure. diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/deployment_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/deployment_operations.py index 054df317785e..f4617ee9b741 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/deployment_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/deployment_operations.py @@ -75,7 +75,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -84,8 +84,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -150,7 +150,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -159,9 +159,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 4ebba1bb93a2..a206c06726ac 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 @@ -57,7 +57,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -66,8 +65,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: exp = CloudError(response) @@ -165,7 +164,6 @@ def check_existence( # 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: @@ -174,8 +172,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -209,6 +207,7 @@ def _create_or_update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -221,9 +220,8 @@ def _create_or_update_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -334,7 +332,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -343,8 +341,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -402,7 +400,6 @@ def cancel( # 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: @@ -411,8 +408,8 @@ def cancel( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204]: exp = CloudError(response) @@ -465,6 +462,7 @@ def validate( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -477,9 +475,8 @@ def validate( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 400]: exp = CloudError(response) @@ -536,7 +533,7 @@ def export_template( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -545,8 +542,8 @@ def export_template( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -613,7 +610,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -622,9 +619,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/providers_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/providers_operations.py index 9e9790970806..8786dcdfdfc2 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/providers_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/providers_operations.py @@ -68,7 +68,7 @@ def unregister( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -77,8 +77,8 @@ def unregister( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -128,7 +128,7 @@ def register( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -137,8 +137,8 @@ def register( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -203,7 +203,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -212,9 +212,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -270,7 +269,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -279,8 +278,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 31c8500d83d8..3cfc16bf3fdf 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 @@ -69,7 +69,6 @@ def check_existence( # 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: @@ -78,8 +77,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -129,6 +128,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -141,9 +141,8 @@ def create_or_update( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -181,7 +180,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -190,8 +188,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -277,7 +275,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -286,8 +284,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -346,6 +344,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -358,9 +357,8 @@ def update( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -421,6 +419,7 @@ def export_template( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -433,9 +432,8 @@ def export_template( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -497,7 +495,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -506,9 +504,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 b9bc462e3e60..53b75df9f3fb 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 @@ -90,7 +90,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -99,9 +99,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -152,9 +151,8 @@ def _move_resources_initial( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: exp = CloudError(response) @@ -247,9 +245,8 @@ def _validate_move_resources_initial( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204, 409]: exp = CloudError(response) @@ -361,7 +358,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -370,9 +367,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -438,7 +434,6 @@ def check_existence( # 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: @@ -447,8 +442,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -483,7 +478,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -492,8 +486,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -580,6 +574,7 @@ def _create_or_update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -592,9 +587,8 @@ def _create_or_update_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201, 202]: exp = CloudError(response) @@ -700,6 +694,7 @@ def _update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -712,9 +707,8 @@ def _update_initial( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -844,7 +838,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -853,8 +847,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -905,7 +899,6 @@ def check_existence_by_id( # 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: @@ -914,8 +907,8 @@ def check_existence_by_id( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -945,7 +938,6 @@ def _delete_by_id_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -954,8 +946,8 @@ def _delete_by_id_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -1025,6 +1017,7 @@ def _create_or_update_by_id_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -1037,9 +1030,8 @@ def _create_or_update_by_id_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201, 202]: exp = CloudError(response) @@ -1128,6 +1120,7 @@ def _update_by_id_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -1140,9 +1133,8 @@ def _update_by_id_initial( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -1247,7 +1239,7 @@ def get_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -1256,8 +1248,8 @@ def get_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/tags_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/tags_operations.py index 7833bf78047a..cd5d1c669360 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/tags_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/tags_operations.py @@ -69,7 +69,6 @@ def delete_value( # 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: @@ -78,8 +77,8 @@ def delete_value( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -124,7 +123,7 @@ def create_or_update_value( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -133,8 +132,8 @@ def create_or_update_value( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -189,7 +188,7 @@ def create_or_update( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -198,8 +197,8 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -252,7 +251,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -261,8 +259,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -309,7 +307,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -318,9 +316,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 index eb120e6b8eec..0e5ffa0ec439 100644 --- 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 @@ -24,7 +24,7 @@ class DeploymentPropertiesExtended(Model): :vartype correlation_id: str :ivar timestamp: The timestamp of the template deployment. :vartype timestamp: datetime - :param outputs: Key/value pairs that represent deploymentoutput. + :param outputs: Key/value pairs that represent deployment output. :type outputs: object :param providers: The list of resource providers needed for the deployment. 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 index 7bd847dd042a..aede2450595c 100644 --- 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 @@ -24,7 +24,7 @@ class DeploymentPropertiesExtended(Model): :vartype correlation_id: str :ivar timestamp: The timestamp of the template deployment. :vartype timestamp: datetime - :param outputs: Key/value pairs that represent deploymentoutput. + :param outputs: Key/value pairs that represent deployment output. :type outputs: object :param providers: The list of resource providers needed for the deployment. 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 index c436b9d4ab6e..0696248fc17c 100644 --- 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 @@ -13,7 +13,7 @@ class ParametersLink(Model): - """Entity representing the reference to the deployment paramaters. + """Entity representing the reference to the deployment parameters. All required parameters must be populated in order to send to Azure. 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 index 52bc9723fa3e..734546c362c4 100644 --- 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 @@ -13,7 +13,7 @@ class ParametersLink(Model): - """Entity representing the reference to the deployment paramaters. + """Entity representing the reference to the deployment parameters. All required parameters must be populated in order to send to Azure. 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 index 914651c2fe28..6a821b729e02 100644 --- 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 @@ -75,7 +75,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -84,8 +84,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -150,7 +150,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -159,9 +159,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 index 3d53cd87ab14..6f437b5aa9d1 100644 --- 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 @@ -57,7 +57,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -66,8 +65,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: exp = CloudError(response) @@ -165,7 +164,6 @@ def check_existence( # 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: @@ -174,8 +172,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -209,6 +207,7 @@ def _create_or_update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -221,9 +220,8 @@ def _create_or_update_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -334,7 +332,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -343,8 +341,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -402,7 +400,6 @@ def cancel( # 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: @@ -411,8 +408,8 @@ def cancel( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204]: exp = CloudError(response) @@ -465,6 +462,7 @@ def validate( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -477,9 +475,8 @@ def validate( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 400]: exp = CloudError(response) @@ -536,7 +533,7 @@ def export_template( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -545,8 +542,8 @@ def export_template( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -613,7 +610,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -622,9 +619,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 index 16eb094c3851..2d76692c9ef2 100644 --- 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 @@ -68,7 +68,7 @@ def unregister( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -77,8 +77,8 @@ def unregister( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -128,7 +128,7 @@ def register( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -137,8 +137,8 @@ def register( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -203,7 +203,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -212,9 +212,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -270,7 +269,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -279,8 +278,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 index 9e8f450964ed..bf5191bfa85b 100644 --- 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 @@ -69,7 +69,6 @@ def check_existence( # 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: @@ -78,8 +77,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -129,6 +128,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -141,9 +141,8 @@ def create_or_update( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -181,7 +180,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -190,8 +188,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -277,7 +275,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -286,8 +284,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -346,6 +344,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -358,9 +357,8 @@ def update( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -421,6 +419,7 @@ def export_template( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -433,9 +432,8 @@ def export_template( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -497,7 +495,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -506,9 +504,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 index 0d10da3006f6..14867614a548 100644 --- 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 @@ -90,7 +90,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -99,9 +99,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -152,9 +151,8 @@ def _move_resources_initial( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: exp = CloudError(response) @@ -247,9 +245,8 @@ def _validate_move_resources_initial( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204, 409]: exp = CloudError(response) @@ -361,7 +358,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -370,9 +367,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -438,7 +434,6 @@ def check_existence( # 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: @@ -447,8 +442,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -483,7 +478,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -492,8 +486,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -580,6 +574,7 @@ def _create_or_update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -592,9 +587,8 @@ def _create_or_update_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201, 202]: exp = CloudError(response) @@ -700,6 +694,7 @@ def _update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -712,9 +707,8 @@ def _update_initial( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -844,7 +838,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -853,8 +847,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -905,7 +899,6 @@ def check_existence_by_id( # 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: @@ -914,8 +907,8 @@ def check_existence_by_id( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -945,7 +938,6 @@ def _delete_by_id_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -954,8 +946,8 @@ def _delete_by_id_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -1025,6 +1017,7 @@ def _create_or_update_by_id_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -1037,9 +1030,8 @@ def _create_or_update_by_id_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201, 202]: exp = CloudError(response) @@ -1128,6 +1120,7 @@ def _update_by_id_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -1140,9 +1133,8 @@ def _update_by_id_initial( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -1247,7 +1239,7 @@ def get_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -1256,8 +1248,8 @@ def get_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 index 04c6fc1e6941..cbbd298f40db 100644 --- 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 @@ -69,7 +69,6 @@ def delete_value( # 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: @@ -78,8 +77,8 @@ def delete_value( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -124,7 +123,7 @@ def create_or_update_value( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -133,8 +132,8 @@ def create_or_update_value( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -189,7 +188,7 @@ def create_or_update( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -198,8 +197,8 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -252,7 +251,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -261,8 +259,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -309,7 +307,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -318,9 +316,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py index 8e763379cfca..a25acecd0869 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py @@ -52,6 +52,8 @@ from .resource_py3 import Resource from .sub_resource_py3 import SubResource from .resource_group_export_result_py3 import ResourceGroupExportResult + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation except (SyntaxError, ImportError): from .deployment_extended_filter import DeploymentExtendedFilter from .generic_resource_filter import GenericResourceFilter @@ -95,6 +97,9 @@ from .resource import Resource from .sub_resource import SubResource from .resource_group_export_result import ResourceGroupExportResult + from .operation_display import OperationDisplay + from .operation import Operation +from .operation_paged import OperationPaged from .deployment_extended_paged import DeploymentExtendedPaged from .provider_paged import ProviderPaged from .generic_resource_paged import GenericResourcePaged @@ -150,6 +155,9 @@ 'Resource', 'SubResource', 'ResourceGroupExportResult', + 'OperationDisplay', + 'Operation', + 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', 'GenericResourcePaged', diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended.py index 36adba4277f1..d18e24c66aeb 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended.py @@ -18,12 +18,12 @@ class DeploymentExtended(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 deployment. :vartype id: str - :param name: Required. The name of the deployment. - :type name: str + :ivar name: The name of the deployment. + :vartype name: str + :ivar type: The type of the deployment. + :vartype type: str :param location: the location of the deployment. :type location: str :param properties: Deployment properties. @@ -33,12 +33,14 @@ class DeploymentExtended(Model): _validation = { 'id': {'readonly': True}, - 'name': {'required': 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'}, 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, } @@ -46,6 +48,7 @@ class DeploymentExtended(Model): def __init__(self, **kwargs): super(DeploymentExtended, self).__init__(**kwargs) self.id = None - self.name = kwargs.get('name', None) + self.name = None + self.type = None self.location = kwargs.get('location', None) self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended_py3.py index 2c21e770ccf7..90dab05dfe13 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended_py3.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended_py3.py @@ -18,12 +18,12 @@ class DeploymentExtended(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 deployment. :vartype id: str - :param name: Required. The name of the deployment. - :type name: str + :ivar name: The name of the deployment. + :vartype name: str + :ivar type: The type of the deployment. + :vartype type: str :param location: the location of the deployment. :type location: str :param properties: Deployment properties. @@ -33,19 +33,22 @@ class DeploymentExtended(Model): _validation = { 'id': {'readonly': True}, - 'name': {'required': 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'}, 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, } - def __init__(self, *, name: str, location: str=None, properties=None, **kwargs) -> None: + def __init__(self, *, location: str=None, properties=None, **kwargs) -> None: super(DeploymentExtended, self).__init__(**kwargs) self.id = None - self.name = name + self.name = None + self.type = None self.location = location self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_properties_extended.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_properties_extended.py index 33237c2da8cf..a3539cd95092 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_properties_extended.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_properties_extended.py @@ -24,7 +24,7 @@ class DeploymentPropertiesExtended(Model): :vartype correlation_id: str :ivar timestamp: The timestamp of the template deployment. :vartype timestamp: datetime - :param outputs: Key/value pairs that represent deploymentoutput. + :param outputs: Key/value pairs that represent deployment output. :type outputs: object :param providers: The list of resource providers needed for the deployment. diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_properties_extended_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_properties_extended_py3.py index db20af1ad7b9..f59df3ea1255 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_properties_extended_py3.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_properties_extended_py3.py @@ -24,7 +24,7 @@ class DeploymentPropertiesExtended(Model): :vartype correlation_id: str :ivar timestamp: The timestamp of the template deployment. :vartype timestamp: datetime - :param outputs: Key/value pairs that represent deploymentoutput. + :param outputs: Key/value pairs that represent deployment output. :type outputs: object :param providers: The list of resource providers needed for the deployment. diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation.py new file mode 100644 index 000000000000..f0617b3edee0 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation.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 Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.resources.v2018_05_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_display.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_display.py new file mode 100644 index 000000000000..98e3ef7e561c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_display.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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :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/resources/v2018_05_01/models/operation_display_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_display_py3.py new file mode 100644 index 000000000000..9579860dfd81 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_display_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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :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/resources/v2018_05_01/models/operation_paged.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_paged.py new file mode 100644 index 000000000000..a998427204db --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/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 OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_py3.py new file mode 100644 index 000000000000..64bbbe2fb4d7 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_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 Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.resources.v2018_05_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(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/parameters_link.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/parameters_link.py index c436b9d4ab6e..0696248fc17c 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/parameters_link.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/parameters_link.py @@ -13,7 +13,7 @@ class ParametersLink(Model): - """Entity representing the reference to the deployment paramaters. + """Entity representing the reference to the deployment parameters. All required parameters must be populated in order to send to Azure. diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/parameters_link_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/parameters_link_py3.py index 52bc9723fa3e..734546c362c4 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/parameters_link_py3.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/parameters_link_py3.py @@ -13,7 +13,7 @@ class ParametersLink(Model): - """Entity representing the reference to the deployment paramaters. + """Entity representing the reference to the deployment parameters. All required parameters must be populated in order to send to Azure. diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource.py index ee7662aeee52..35452c4dbcfc 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource.py @@ -13,7 +13,7 @@ class Resource(Model): - """Resource. + """Specified resource. Variables are only populated by the server, and will be ignored when sending a request. diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group.py index bc9b389b34e7..3c4d19363466 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group.py @@ -22,8 +22,10 @@ class ResourceGroup(Model): :ivar id: The ID of the resource group. :vartype id: str - :param name: The name of the resource group. - :type name: str + :ivar name: The name of the resource group. + :vartype name: str + :ivar type: The type of the resource group. + :vartype type: str :param properties: :type properties: ~azure.mgmt.resource.resources.v2018_05_01.models.ResourceGroupProperties @@ -40,12 +42,15 @@ class ResourceGroup(Model): _validation = { 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'location': {'required': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, 'location': {'key': 'location', 'type': 'str'}, 'managed_by': {'key': 'managedBy', 'type': 'str'}, @@ -55,7 +60,8 @@ class ResourceGroup(Model): def __init__(self, **kwargs): super(ResourceGroup, self).__init__(**kwargs) self.id = None - self.name = kwargs.get('name', None) + self.name = None + self.type = None self.properties = kwargs.get('properties', None) self.location = kwargs.get('location', None) self.managed_by = kwargs.get('managed_by', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group_py3.py index ce72ce725c87..10effdf3740e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group_py3.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group_py3.py @@ -22,8 +22,10 @@ class ResourceGroup(Model): :ivar id: The ID of the resource group. :vartype id: str - :param name: The name of the resource group. - :type name: str + :ivar name: The name of the resource group. + :vartype name: str + :ivar type: The type of the resource group. + :vartype type: str :param properties: :type properties: ~azure.mgmt.resource.resources.v2018_05_01.models.ResourceGroupProperties @@ -40,22 +42,26 @@ class ResourceGroup(Model): _validation = { 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'location': {'required': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', '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: + def __init__(self, *, location: str, properties=None, managed_by: str=None, tags=None, **kwargs) -> None: super(ResourceGroup, self).__init__(**kwargs) self.id = None - self.name = name + self.name = None + self.type = None self.properties = properties self.location = location self.managed_by = managed_by diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties.py index ac328b64bb1a..975778dcb9c9 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/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: Resource provider operation. :type operation: str :param description: Operation description. :type description: str diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties_py3.py index aecc5a412673..853e93d8a01b 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties_py3.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties_py3.py @@ -21,7 +21,7 @@ class ResourceProviderOperationDisplayProperties(Model): :type provider: str :param resource: Operation resource. :type resource: str - :param operation: Operation. + :param operation: Resource provider operation. :type operation: str :param description: Operation description. :type description: str diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_py3.py index 3c8102ab5262..0b12546aafd3 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_py3.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_py3.py @@ -13,7 +13,7 @@ class Resource(Model): - """Resource. + """Specified resource. Variables are only populated by the server, and will be ignored when sending a request. diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/__init__.py index 5aae03a99594..2276b11c175a 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/__init__.py @@ -9,6 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- +from .operations import Operations from .deployments_operations import DeploymentsOperations from .providers_operations import ProvidersOperations from .resources_operations import ResourcesOperations @@ -17,6 +18,7 @@ from .deployment_operations import DeploymentOperations __all__ = [ + 'Operations', 'DeploymentsOperations', 'ProvidersOperations', 'ResourcesOperations', diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/deployment_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/deployment_operations.py index f3409ed799e2..58d056d7682e 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/deployment_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/deployment_operations.py @@ -71,7 +71,7 @@ def get_at_subscription_scope( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -80,8 +80,8 @@ def get_at_subscription_scope( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -142,7 +142,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -151,9 +151,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -211,7 +210,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -220,8 +219,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -286,7 +285,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -295,9 +294,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/deployments_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/deployments_operations.py index d85fdf72ed4e..79b2fd90cd45 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/deployments_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/deployments_operations.py @@ -56,7 +56,6 @@ def _delete_at_subscription_scope_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -65,8 +64,8 @@ def _delete_at_subscription_scope_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: exp = CloudError(response) @@ -155,7 +154,6 @@ def check_existence_at_subscription_scope( # 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: @@ -164,8 +162,8 @@ def check_existence_at_subscription_scope( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -198,6 +196,7 @@ def _create_or_update_at_subscription_scope_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -210,9 +209,8 @@ def _create_or_update_at_subscription_scope_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -317,7 +315,7 @@ def get_at_subscription_scope( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -326,8 +324,8 @@ def get_at_subscription_scope( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -381,7 +379,6 @@ def cancel_at_subscription_scope( # 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: @@ -390,8 +387,8 @@ def cancel_at_subscription_scope( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204]: exp = CloudError(response) @@ -442,6 +439,7 @@ def validate_at_subscription_scope( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -454,9 +452,8 @@ def validate_at_subscription_scope( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 400]: exp = CloudError(response) @@ -509,7 +506,7 @@ def export_template_at_subscription_scope( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -518,8 +515,8 @@ def export_template_at_subscription_scope( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -582,7 +579,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -591,9 +588,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -631,7 +627,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -640,8 +635,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: exp = CloudError(response) @@ -739,7 +734,6 @@ def check_existence( # 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: @@ -748,8 +742,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -783,6 +777,7 @@ def _create_or_update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -795,9 +790,8 @@ def _create_or_update_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -911,7 +905,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -920,8 +914,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -979,7 +973,6 @@ def cancel( # 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: @@ -988,8 +981,8 @@ def cancel( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204]: exp = CloudError(response) @@ -1044,6 +1037,7 @@ def validate( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -1056,9 +1050,8 @@ def validate( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 400]: exp = CloudError(response) @@ -1115,7 +1108,7 @@ def export_template( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -1124,8 +1117,8 @@ def export_template( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -1192,7 +1185,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -1201,9 +1194,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/operations.py new file mode 100644 index 000000000000..606acfd13829 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations 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-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Microsoft.Resources REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.resource.resources.v2018_05_01.models.OperationPaged[~azure.mgmt.resource.resources.v2018_05_01.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Resources/operations'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/providers_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/providers_operations.py index 3ed0a29c5492..1fb8b5429b35 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/providers_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/providers_operations.py @@ -68,7 +68,7 @@ def unregister( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -77,8 +77,8 @@ def unregister( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -128,7 +128,7 @@ def register( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -137,8 +137,8 @@ def register( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -203,7 +203,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -212,9 +212,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -270,7 +269,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -279,8 +278,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/resource_groups_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/resource_groups_operations.py index eabb967751dd..1bfec99bf6d3 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/resource_groups_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/resource_groups_operations.py @@ -69,7 +69,6 @@ def check_existence( # 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: @@ -78,8 +77,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -98,7 +97,9 @@ def create_or_update( """Creates or updates a resource group. :param resource_group_name: The name of the resource group to create - or update. + or update. Can include alphanumeric, underscore, parentheses, hyphen, + period (except at end), and Unicode characters that match the allowed + characters. :type resource_group_name: str :param parameters: Parameters supplied to the create or update a resource group. @@ -129,6 +130,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -141,9 +143,8 @@ def create_or_update( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -181,7 +182,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -190,8 +190,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -277,7 +277,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -286,8 +286,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -346,6 +346,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -358,9 +359,8 @@ def update( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -421,6 +421,7 @@ def export_template( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -433,9 +434,8 @@ def export_template( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -458,7 +458,9 @@ 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. + :param filter: The filter to apply on the operation.

You can + filter by tag names and values. For example, to filter for a tag name + and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1' :type filter: str :param top: The number of results to return. If null is passed, returns all resource groups. @@ -497,7 +499,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -506,9 +508,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/resources_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/resources_operations.py index e19fc3835edf..e8c1a037ea81 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/resources_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/resources_operations.py @@ -46,9 +46,28 @@ def list_by_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. + :param filter: The filter to apply on the operation.

The + properties you can use for eq (equals) or ne (not equals) are: + location, resourceType, name, resourceGroup, identity, + identity/principalId, plan, plan/publisher, plan/product, plan/name, + plan/version, and plan/promotionCode.

For example, to filter by + a resource type, use: $filter=resourceType eq + 'Microsoft.Network/virtualNetworks'

You can use + substringof(value, property) in the filter. The properties you can use + for substring are: name and resourceGroup.

For example, to get + all resources with 'demo' anywhere in the name, use: + $filter=substringof('demo', name)

You can link more than one + substringof together by adding and/or operators.

You can filter + by tag names and values. For example, to filter for a tag name and + value, use $filter=tagName eq 'tag1' and tagValue eq + 'Value1'

You can use some properties together when filtering. + The combinations you can use are: substringof and/or resourceType, + plan and plan/publisher and plan/name, identity and + identity/principalId. :type filter: str - :param expand: The $expand query parameter + :param expand: The $expand query parameter. You can expand createdTime + and changedTime. For example, to expand both properties, use + $expand=changedTime,createdTime :type expand: str :param top: The number of results to return. If null is passed, returns all resources. @@ -90,7 +109,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -99,9 +118,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -152,9 +170,8 @@ def _move_resources_initial( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204]: exp = CloudError(response) @@ -247,9 +264,8 @@ def _validate_move_resources_initial( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 204, 409]: exp = CloudError(response) @@ -318,9 +334,28 @@ 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. + :param filter: The filter to apply on the operation.

The + properties you can use for eq (equals) or ne (not equals) are: + location, resourceType, name, resourceGroup, identity, + identity/principalId, plan, plan/publisher, plan/product, plan/name, + plan/version, and plan/promotionCode.

For example, to filter by + a resource type, use: $filter=resourceType eq + 'Microsoft.Network/virtualNetworks'

You can use + substringof(value, property) in the filter. The properties you can use + for substring are: name and resourceGroup.

For example, to get + all resources with 'demo' anywhere in the name, use: + $filter=substringof('demo', name)

You can link more than one + substringof together by adding and/or operators.

You can filter + by tag names and values. For example, to filter for a tag name and + value, use $filter=tagName eq 'tag1' and tagValue eq + 'Value1'

You can use some properties together when filtering. + The combinations you can use are: substringof and/or resourceType, + plan and plan/publisher and plan/name, identity and + identity/principalId. :type filter: str - :param expand: The $expand query parameter. + :param expand: The $expand query parameter. You can expand createdTime + and changedTime. For example, to expand both properties, use + $expand=changedTime,createdTime :type expand: str :param top: The number of results to return. If null is passed, returns all resource groups. @@ -361,7 +396,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -370,9 +405,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -438,7 +472,6 @@ def check_existence( # 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: @@ -447,8 +480,8 @@ def check_existence( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -483,7 +516,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -492,8 +524,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -580,6 +612,7 @@ def _create_or_update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -592,9 +625,8 @@ def _create_or_update_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201, 202]: exp = CloudError(response) @@ -700,6 +732,7 @@ def _update_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -712,9 +745,8 @@ def _update_initial( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -844,7 +876,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -853,8 +885,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -905,7 +937,6 @@ def check_existence_by_id( # 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: @@ -914,8 +945,8 @@ def check_existence_by_id( 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) + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204, 404]: exp = CloudError(response) @@ -945,7 +976,6 @@ def _delete_by_id_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -954,8 +984,8 @@ def _delete_by_id_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -1025,6 +1055,7 @@ def _create_or_update_by_id_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -1037,9 +1068,8 @@ def _create_or_update_by_id_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201, 202]: exp = CloudError(response) @@ -1128,6 +1158,7 @@ def _update_by_id_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -1140,9 +1171,8 @@ def _update_by_id_initial( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -1247,7 +1277,7 @@ def get_by_id( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -1256,8 +1286,8 @@ def get_by_id( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/tags_operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/tags_operations.py index 27ba4fc6158a..b8ca76185c60 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/tags_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/tags_operations.py @@ -69,7 +69,6 @@ def delete_value( # 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: @@ -78,8 +77,8 @@ def delete_value( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -124,7 +123,7 @@ def create_or_update_value( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -133,8 +132,8 @@ def create_or_update_value( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -189,7 +188,7 @@ def create_or_update( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -198,8 +197,8 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -252,7 +251,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -261,8 +259,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -309,7 +307,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -318,9 +316,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/resource_management_client.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/resource_management_client.py index ea702c28df6d..848bf451ab63 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/resource_management_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/resource_management_client.py @@ -13,6 +13,7 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from .operations.operations import Operations from .operations.deployments_operations import DeploymentsOperations from .operations.providers_operations import ProvidersOperations from .operations.resources_operations import ResourcesOperations @@ -60,6 +61,8 @@ class ResourceManagementClient(SDKClient): :ivar config: Configuration for client. :vartype config: ResourceManagementClientConfiguration + :ivar operations: Operations operations + :vartype operations: azure.mgmt.resource.resources.v2018_05_01.operations.Operations :ivar deployments: Deployments operations :vartype deployments: azure.mgmt.resource.resources.v2018_05_01.operations.DeploymentsOperations :ivar providers: Providers operations @@ -92,6 +95,8 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) self.deployments = DeploymentsOperations( self._client, self.config, self._serialize, self._deserialize) self.providers = ProvidersOperations( diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/subscription_client.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/subscription_client.py index 7b51cb189f40..d179507d6fe4 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/subscription_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/subscription_client.py @@ -95,6 +95,19 @@ def models(cls, api_version=DEFAULT_API_VERSION): from .v2016_06_01 import models return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) + + @property + def operations(self): + """Instance depends on the API version: + + * 2016-06-01: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2016-06-01': + from .v2016_06_01.operations import Operations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def subscriptions(self): 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 c13dd928bb5e..93bb9b27a0d5 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 @@ -14,11 +14,16 @@ from .subscription_policies_py3 import SubscriptionPolicies from .subscription_py3 import Subscription from .tenant_id_description_py3 import TenantIdDescription + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation except (SyntaxError, ImportError): from .location import Location from .subscription_policies import SubscriptionPolicies from .subscription import Subscription from .tenant_id_description import TenantIdDescription + from .operation_display import OperationDisplay + from .operation import Operation +from .operation_paged import OperationPaged from .location_paged import LocationPaged from .subscription_paged import SubscriptionPaged from .tenant_id_description_paged import TenantIdDescriptionPaged @@ -32,6 +37,9 @@ 'SubscriptionPolicies', 'Subscription', 'TenantIdDescription', + 'OperationDisplay', + 'Operation', + 'OperationPaged', 'LocationPaged', 'SubscriptionPaged', 'TenantIdDescriptionPaged', diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation.py new file mode 100644 index 000000000000..17371783a238 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation.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 Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.subscriptions.v2016_06_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_display.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_display.py new file mode 100644 index 000000000000..98e3ef7e561c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_display.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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :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/subscriptions/v2016_06_01/models/operation_display_py3.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_display_py3.py new file mode 100644 index 000000000000..9579860dfd81 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_display_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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :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/subscriptions/v2016_06_01/models/operation_paged.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_paged.py new file mode 100644 index 000000000000..7637539cb607 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/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 OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_py3.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_py3.py new file mode 100644 index 000000000000..392fc49eaefa --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_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 Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.subscriptions.v2016_06_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(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/__init__.py index 49fa5e8b0f03..f6906611d0e7 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/__init__.py @@ -9,10 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- +from .operations import Operations from .subscriptions_operations import SubscriptionsOperations from .tenants_operations import TenantsOperations __all__ = [ + 'Operations', 'SubscriptionsOperations', 'TenantsOperations', ] diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/operations.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/operations.py new file mode 100644 index 000000000000..62c7155f056c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations 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 the operation. Constant value: "2016-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-06-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Microsoft.Resources REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.resource.subscriptions.v2016_06_01.models.OperationPaged[~azure.mgmt.resource.subscriptions.v2016_06_01.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Resources/operations'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/subscriptions_operations.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/subscriptions_operations.py index e48f00643a03..fde956c88828 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/subscriptions_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/subscriptions_operations.py @@ -77,7 +77,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -86,9 +86,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -138,7 +137,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -147,8 +146,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -197,7 +196,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -206,9 +205,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/tenants_operations.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/tenants_operations.py index 3d01811a9005..5e18e7b59032 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/tenants_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/tenants_operations.py @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 deacfa9bab66..dfc36bb76bfb 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 @@ -13,6 +13,7 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from .operations.operations import Operations from .operations.subscriptions_operations import SubscriptionsOperations from .operations.tenants_operations import TenantsOperations from . import models @@ -51,6 +52,8 @@ class SubscriptionClient(SDKClient): :ivar config: Configuration for client. :vartype config: SubscriptionClientConfiguration + :ivar operations: Operations operations + :vartype operations: azure.mgmt.resource.subscriptions.v2016_06_01.operations.Operations :ivar subscriptions: Subscriptions operations :vartype subscriptions: azure.mgmt.resource.subscriptions.v2016_06_01.operations.SubscriptionsOperations :ivar tenants: Tenants operations @@ -73,6 +76,8 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) self.subscriptions = SubscriptionsOperations( self._client, self.config, self._serialize, self._deserialize) self.tenants = TenantsOperations( diff --git a/azure-mgmt-resource/azure/mgmt/resource/version.py b/azure-mgmt-resource/azure/mgmt/resource/version.py index 88729157c488..46c39ed64eb9 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/version.py +++ b/azure-mgmt-resource/azure/mgmt/resource/version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "2.1.0"