diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py index 7c6c4fdd0879..7fdbd4ab01dc 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py @@ -50,14 +50,15 @@ from ._models_py3 import ResourceGroupPatchable from ._models_py3 import ResourceGroupProperties from ._models_py3 import ResourceProviderOperationDisplayProperties + from ._models_py3 import ResourceReference from ._models_py3 import ResourcesMoveInfo from ._models_py3 import ScopedDeployment from ._models_py3 import Sku from ._models_py3 import SubResource from ._models_py3 import TagCount from ._models_py3 import TagDetails - from ._models_py3 import TagPatchRequest from ._models_py3 import Tags + from ._models_py3 import TagsPatchResource from ._models_py3 import TagsResource from ._models_py3 import TagValue from ._models_py3 import TargetResource @@ -107,14 +108,15 @@ from ._models import ResourceGroupPatchable from ._models import ResourceGroupProperties from ._models import ResourceProviderOperationDisplayProperties + from ._models import ResourceReference from ._models import ResourcesMoveInfo from ._models import ScopedDeployment from ._models import Sku from ._models import SubResource from ._models import TagCount from ._models import TagDetails - from ._models import TagPatchRequest from ._models import Tags + from ._models import TagsPatchResource from ._models import TagsResource from ._models import TagValue from ._models import TargetResource @@ -180,14 +182,15 @@ 'ResourceGroupPatchable', 'ResourceGroupProperties', 'ResourceProviderOperationDisplayProperties', + 'ResourceReference', 'ResourcesMoveInfo', 'ScopedDeployment', 'Sku', 'SubResource', 'TagCount', 'TagDetails', - 'TagPatchRequest', 'Tags', + 'TagsPatchResource', 'TagsResource', 'TagValue', 'TargetResource', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models.py index 5c72eb92aa53..4f17fe532be9 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models.py @@ -441,39 +441,43 @@ class DeploymentPropertiesExtended(Model): :vartype timestamp: datetime :ivar duration: The duration of the template deployment. :vartype duration: str - :param outputs: Key/value pairs that represent deployment output. - :type outputs: object - :param providers: The list of resource providers needed for the - deployment. - :type providers: + :ivar outputs: Key/value pairs that represent deployment output. + :vartype outputs: object + :ivar providers: The list of resource providers needed for the deployment. + :vartype providers: list[~azure.mgmt.resource.resources.v2019_10_01.models.Provider] - :param dependencies: The list of deployment dependencies. - :type dependencies: + :ivar dependencies: The list of deployment dependencies. + :vartype dependencies: list[~azure.mgmt.resource.resources.v2019_10_01.models.Dependency] - :param template: The template content. Use only one of Template or - TemplateLink. - :type template: object - :param template_link: The URI referencing the template. Use only one of - Template or TemplateLink. - :type template_link: + :ivar template_link: The URI referencing the template. + :vartype template_link: ~azure.mgmt.resource.resources.v2019_10_01.models.TemplateLink - :param parameters: Deployment parameters. Use only one of Parameters or - ParametersLink. - :type parameters: object - :param parameters_link: The URI referencing the parameters. Use only one - of Parameters or ParametersLink. - :type parameters_link: + :ivar parameters: Deployment parameters. + :vartype parameters: object + :ivar parameters_link: The URI referencing the parameters. + :vartype parameters_link: ~azure.mgmt.resource.resources.v2019_10_01.models.ParametersLink - :param mode: The deployment mode. Possible values are Incremental and + :ivar mode: The deployment mode. Possible values are Incremental and Complete. Possible values include: 'Incremental', 'Complete' - :type mode: str or + :vartype mode: str or ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentMode - :param debug_setting: The debug setting of the deployment. - :type debug_setting: + :ivar debug_setting: The debug setting of the deployment. + :vartype debug_setting: ~azure.mgmt.resource.resources.v2019_10_01.models.DebugSetting - :param on_error_deployment: The deployment on error behavior. - :type on_error_deployment: + :ivar on_error_deployment: The deployment on error behavior. + :vartype on_error_deployment: ~azure.mgmt.resource.resources.v2019_10_01.models.OnErrorDeploymentExtended + :ivar template_hash: The hash produced for the template. + :vartype template_hash: str + :ivar output_resources: Array of provisioned resources. + :vartype output_resources: + list[~azure.mgmt.resource.resources.v2019_10_01.models.ResourceReference] + :ivar validated_resources: Array of validated resources. + :vartype validated_resources: + list[~azure.mgmt.resource.resources.v2019_10_01.models.ResourceReference] + :ivar error: The deployment error. + :vartype error: + ~azure.mgmt.resource.resources.v2019_10_01.models.ErrorResponse """ _validation = { @@ -481,6 +485,19 @@ class DeploymentPropertiesExtended(Model): 'correlation_id': {'readonly': True}, 'timestamp': {'readonly': True}, 'duration': {'readonly': True}, + 'outputs': {'readonly': True}, + 'providers': {'readonly': True}, + 'dependencies': {'readonly': True}, + 'template_link': {'readonly': True}, + 'parameters': {'readonly': True}, + 'parameters_link': {'readonly': True}, + 'mode': {'readonly': True}, + 'debug_setting': {'readonly': True}, + 'on_error_deployment': {'readonly': True}, + 'template_hash': {'readonly': True}, + 'output_resources': {'readonly': True}, + 'validated_resources': {'readonly': True}, + 'error': {'readonly': True}, } _attribute_map = { @@ -491,13 +508,16 @@ class DeploymentPropertiesExtended(Model): 'outputs': {'key': 'outputs', 'type': 'object'}, 'providers': {'key': 'providers', 'type': '[Provider]'}, 'dependencies': {'key': 'dependencies', 'type': '[Dependency]'}, - 'template': {'key': 'template', 'type': 'object'}, 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, 'parameters': {'key': 'parameters', 'type': 'object'}, 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeploymentExtended'}, + 'template_hash': {'key': 'templateHash', 'type': 'str'}, + 'output_resources': {'key': 'outputResources', 'type': '[ResourceReference]'}, + 'validated_resources': {'key': 'validatedResources', 'type': '[ResourceReference]'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, } def __init__(self, **kwargs): @@ -506,29 +526,39 @@ def __init__(self, **kwargs): self.correlation_id = None self.timestamp = None self.duration = None - self.outputs = kwargs.get('outputs', None) - self.providers = kwargs.get('providers', None) - self.dependencies = kwargs.get('dependencies', None) - self.template = kwargs.get('template', None) - self.template_link = kwargs.get('template_link', None) - self.parameters = kwargs.get('parameters', None) - self.parameters_link = kwargs.get('parameters_link', None) - self.mode = kwargs.get('mode', None) - self.debug_setting = kwargs.get('debug_setting', None) - self.on_error_deployment = kwargs.get('on_error_deployment', None) + self.outputs = None + self.providers = None + self.dependencies = None + self.template_link = None + self.parameters = None + self.parameters_link = None + self.mode = None + self.debug_setting = None + self.on_error_deployment = None + self.template_hash = None + self.output_resources = None + self.validated_resources = None + self.error = None class DeploymentValidateResult(Model): """Information from validate template deployment response. - :param error: The deployment validation error. - :type error: + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error: The deployment validation error. + :vartype error: ~azure.mgmt.resource.resources.v2019_10_01.models.ErrorResponse :param properties: The template deployment properties. :type properties: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentPropertiesExtended """ + _validation = { + 'error': {'readonly': True}, + } + _attribute_map = { 'error': {'key': 'error', 'type': 'ErrorResponse'}, 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, @@ -536,7 +566,7 @@ class DeploymentValidateResult(Model): def __init__(self, **kwargs): super(DeploymentValidateResult, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + self.error = None self.properties = kwargs.get('properties', None) @@ -1393,6 +1423,29 @@ def __init__(self, **kwargs): self.description = kwargs.get('description', None) +class ResourceReference(Model): + """The resource Id model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified resource Id. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceReference, self).__init__(**kwargs) + self.id = None + + class ResourcesMoveInfo(Model): """Parameters of move resources. @@ -1519,7 +1572,7 @@ class TagDetails(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The tag ID. + :ivar id: The tag name ID. :vartype id: str :param tag_name: The tag name. :type tag_name: str @@ -1551,63 +1604,59 @@ def __init__(self, **kwargs): self.values = kwargs.get('values', None) -class TagPatchRequest(Model): - """Tag Request for Patch operation. +class Tags(Model): + """A dictionary of name and value pairs. - :param operation: The operation type for the patch api. Possible values - include: 'Replace', 'Merge', 'Delete' - :type operation: str or - ~azure.mgmt.resource.resources.v2019_10_01.models.enum - :param properties: tags object passing in the request. - :type properties: ~azure.mgmt.resource.resources.v2019_10_01.models.Tags + :param tags: + :type tags: dict[str, str] """ _attribute_map = { - 'operation': {'key': 'operation', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'Tags'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__(self, **kwargs): - super(TagPatchRequest, self).__init__(**kwargs) - self.operation = kwargs.get('operation', None) - self.properties = kwargs.get('properties', None) + super(Tags, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) -class Tags(Model): - """key and value pairs for tags. +class TagsPatchResource(Model): + """Wrapper resource for tags patch API request only. - :param tags: - :type tags: dict[str, str] + :param operation: The operation type for the patch API. Possible values + include: 'Replace', 'Merge', 'Delete' + :type operation: str or + ~azure.mgmt.resource.resources.v2019_10_01.models.enum + :param properties: The set of tags. + :type properties: ~azure.mgmt.resource.resources.v2019_10_01.models.Tags """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'Tags'}, } def __init__(self, **kwargs): - super(Tags, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) + super(TagsPatchResource, self).__init__(**kwargs) + self.operation = kwargs.get('operation', None) + self.properties = kwargs.get('properties', None) -class TagsResource(Resource): - """Tags for the resource. +class TagsResource(Model): + """Wrapper resource for tags API requests and responses. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID + :ivar id: The ID of the tags wrapper resource. :vartype id: str - :ivar name: Resource name + :ivar name: The name of the tags wrapper resource. :vartype name: str - :ivar type: Resource type + :ivar type: The type of the tags wrapper resource. :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param properties: Required. tags property. + :param properties: Required. The set of tags. :type properties: ~azure.mgmt.resource.resources.v2019_10_01.models.Tags """ @@ -1622,13 +1671,14 @@ class TagsResource(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, 'properties': {'key': 'properties', 'type': 'Tags'}, } def __init__(self, **kwargs): super(TagsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None self.properties = kwargs.get('properties', None) @@ -1638,7 +1688,7 @@ class TagValue(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The tag ID. + :ivar id: The tag value ID. :vartype id: str :param tag_value: The tag value. :type tag_value: str diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py index fe13bdb1b954..3876a4925d2d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py @@ -441,39 +441,43 @@ class DeploymentPropertiesExtended(Model): :vartype timestamp: datetime :ivar duration: The duration of the template deployment. :vartype duration: str - :param outputs: Key/value pairs that represent deployment output. - :type outputs: object - :param providers: The list of resource providers needed for the - deployment. - :type providers: + :ivar outputs: Key/value pairs that represent deployment output. + :vartype outputs: object + :ivar providers: The list of resource providers needed for the deployment. + :vartype providers: list[~azure.mgmt.resource.resources.v2019_10_01.models.Provider] - :param dependencies: The list of deployment dependencies. - :type dependencies: + :ivar dependencies: The list of deployment dependencies. + :vartype dependencies: list[~azure.mgmt.resource.resources.v2019_10_01.models.Dependency] - :param template: The template content. Use only one of Template or - TemplateLink. - :type template: object - :param template_link: The URI referencing the template. Use only one of - Template or TemplateLink. - :type template_link: + :ivar template_link: The URI referencing the template. + :vartype template_link: ~azure.mgmt.resource.resources.v2019_10_01.models.TemplateLink - :param parameters: Deployment parameters. Use only one of Parameters or - ParametersLink. - :type parameters: object - :param parameters_link: The URI referencing the parameters. Use only one - of Parameters or ParametersLink. - :type parameters_link: + :ivar parameters: Deployment parameters. + :vartype parameters: object + :ivar parameters_link: The URI referencing the parameters. + :vartype parameters_link: ~azure.mgmt.resource.resources.v2019_10_01.models.ParametersLink - :param mode: The deployment mode. Possible values are Incremental and + :ivar mode: The deployment mode. Possible values are Incremental and Complete. Possible values include: 'Incremental', 'Complete' - :type mode: str or + :vartype mode: str or ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentMode - :param debug_setting: The debug setting of the deployment. - :type debug_setting: + :ivar debug_setting: The debug setting of the deployment. + :vartype debug_setting: ~azure.mgmt.resource.resources.v2019_10_01.models.DebugSetting - :param on_error_deployment: The deployment on error behavior. - :type on_error_deployment: + :ivar on_error_deployment: The deployment on error behavior. + :vartype on_error_deployment: ~azure.mgmt.resource.resources.v2019_10_01.models.OnErrorDeploymentExtended + :ivar template_hash: The hash produced for the template. + :vartype template_hash: str + :ivar output_resources: Array of provisioned resources. + :vartype output_resources: + list[~azure.mgmt.resource.resources.v2019_10_01.models.ResourceReference] + :ivar validated_resources: Array of validated resources. + :vartype validated_resources: + list[~azure.mgmt.resource.resources.v2019_10_01.models.ResourceReference] + :ivar error: The deployment error. + :vartype error: + ~azure.mgmt.resource.resources.v2019_10_01.models.ErrorResponse """ _validation = { @@ -481,6 +485,19 @@ class DeploymentPropertiesExtended(Model): 'correlation_id': {'readonly': True}, 'timestamp': {'readonly': True}, 'duration': {'readonly': True}, + 'outputs': {'readonly': True}, + 'providers': {'readonly': True}, + 'dependencies': {'readonly': True}, + 'template_link': {'readonly': True}, + 'parameters': {'readonly': True}, + 'parameters_link': {'readonly': True}, + 'mode': {'readonly': True}, + 'debug_setting': {'readonly': True}, + 'on_error_deployment': {'readonly': True}, + 'template_hash': {'readonly': True}, + 'output_resources': {'readonly': True}, + 'validated_resources': {'readonly': True}, + 'error': {'readonly': True}, } _attribute_map = { @@ -491,52 +508,65 @@ class DeploymentPropertiesExtended(Model): 'outputs': {'key': 'outputs', 'type': 'object'}, 'providers': {'key': 'providers', 'type': '[Provider]'}, 'dependencies': {'key': 'dependencies', 'type': '[Dependency]'}, - 'template': {'key': 'template', 'type': 'object'}, 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, 'parameters': {'key': 'parameters', 'type': 'object'}, 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeploymentExtended'}, + 'template_hash': {'key': 'templateHash', 'type': 'str'}, + 'output_resources': {'key': 'outputResources', 'type': '[ResourceReference]'}, + 'validated_resources': {'key': 'validatedResources', 'type': '[ResourceReference]'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, } - def __init__(self, *, outputs=None, providers=None, dependencies=None, template=None, template_link=None, parameters=None, parameters_link=None, mode=None, debug_setting=None, on_error_deployment=None, **kwargs) -> None: + def __init__(self, **kwargs) -> None: super(DeploymentPropertiesExtended, self).__init__(**kwargs) self.provisioning_state = None self.correlation_id = None self.timestamp = None self.duration = None - self.outputs = outputs - self.providers = providers - self.dependencies = dependencies - self.template = template - self.template_link = template_link - self.parameters = parameters - self.parameters_link = parameters_link - self.mode = mode - self.debug_setting = debug_setting - self.on_error_deployment = on_error_deployment + self.outputs = None + self.providers = None + self.dependencies = None + self.template_link = None + self.parameters = None + self.parameters_link = None + self.mode = None + self.debug_setting = None + self.on_error_deployment = None + self.template_hash = None + self.output_resources = None + self.validated_resources = None + self.error = None class DeploymentValidateResult(Model): """Information from validate template deployment response. - :param error: The deployment validation error. - :type error: + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error: The deployment validation error. + :vartype error: ~azure.mgmt.resource.resources.v2019_10_01.models.ErrorResponse :param properties: The template deployment properties. :type properties: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentPropertiesExtended """ + _validation = { + 'error': {'readonly': True}, + } + _attribute_map = { 'error': {'key': 'error', 'type': 'ErrorResponse'}, 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, } - def __init__(self, *, error=None, properties=None, **kwargs) -> None: + def __init__(self, *, properties=None, **kwargs) -> None: super(DeploymentValidateResult, self).__init__(**kwargs) - self.error = error + self.error = None self.properties = properties @@ -1393,6 +1423,29 @@ def __init__(self, *, publisher: str=None, provider: str=None, resource: str=Non self.description = description +class ResourceReference(Model): + """The resource Id model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified resource Id. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceReference, self).__init__(**kwargs) + self.id = None + + class ResourcesMoveInfo(Model): """Parameters of move resources. @@ -1519,7 +1572,7 @@ class TagDetails(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The tag ID. + :ivar id: The tag name ID. :vartype id: str :param tag_name: The tag name. :type tag_name: str @@ -1551,14 +1604,30 @@ def __init__(self, *, tag_name: str=None, count=None, values=None, **kwargs) -> self.values = values -class TagPatchRequest(Model): - """Tag Request for Patch operation. +class Tags(Model): + """A dictionary of name and value pairs. + + :param tags: + :type tags: dict[str, str] + """ - :param operation: The operation type for the patch api. Possible values + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(Tags, self).__init__(**kwargs) + self.tags = tags + + +class TagsPatchResource(Model): + """Wrapper resource for tags patch API request only. + + :param operation: The operation type for the patch API. Possible values include: 'Replace', 'Merge', 'Delete' :type operation: str or ~azure.mgmt.resource.resources.v2019_10_01.models.enum - :param properties: tags object passing in the request. + :param properties: The set of tags. :type properties: ~azure.mgmt.resource.resources.v2019_10_01.models.Tags """ @@ -1568,46 +1637,26 @@ class TagPatchRequest(Model): } def __init__(self, *, operation=None, properties=None, **kwargs) -> None: - super(TagPatchRequest, self).__init__(**kwargs) + super(TagsPatchResource, self).__init__(**kwargs) self.operation = operation self.properties = properties -class Tags(Model): - """key and value pairs for tags. - - :param tags: - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(Tags, self).__init__(**kwargs) - self.tags = tags - - -class TagsResource(Resource): - """Tags for the resource. +class TagsResource(Model): + """Wrapper resource for tags API requests and responses. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID + :ivar id: The ID of the tags wrapper resource. :vartype id: str - :ivar name: Resource name + :ivar name: The name of the tags wrapper resource. :vartype name: str - :ivar type: Resource type + :ivar type: The type of the tags wrapper resource. :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param properties: Required. tags property. + :param properties: Required. The set of tags. :type properties: ~azure.mgmt.resource.resources.v2019_10_01.models.Tags """ @@ -1622,13 +1671,14 @@ class TagsResource(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, 'properties': {'key': 'properties', 'type': 'Tags'}, } - def __init__(self, *, properties, location: str=None, tags=None, **kwargs) -> None: - super(TagsResource, self).__init__(location=location, tags=tags, **kwargs) + def __init__(self, *, properties, **kwargs) -> None: + super(TagsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None self.properties = properties @@ -1638,7 +1688,7 @@ class TagValue(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The tag ID. + :ivar id: The tag value ID. :vartype id: str :param tag_value: The tag value. :type tag_value: str diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_tags_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_tags_operations.py index 91a28eed0adc..e65913b7f528 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_tags_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_tags_operations.py @@ -41,7 +41,12 @@ def __init__(self, client, config, serializer, deserializer): def delete_value( self, tag_name, tag_value, custom_headers=None, raw=False, **operation_config): - """Deletes a tag value. + """Deletes a predefined tag value for a predefined tag name. + + This operation allows deleting a value from the list of predefined + values for an existing predefined tag name. The value being deleted + must not be in use as a tag value for the given tag name for any + resource. :param tag_name: The name of the tag. :type tag_name: str @@ -94,7 +99,11 @@ def delete_value( def create_or_update_value( self, tag_name, tag_value, custom_headers=None, raw=False, **operation_config): - """Creates a tag value. The name of the tag must already exist. + """Creates a predefined value for a predefined tag name. + + This operation allows adding a value to the list of predefined values + for an existing predefined tag name. A tag value can have a maximum of + 256 characters. :param tag_name: The name of the tag. :type tag_name: str @@ -157,11 +166,13 @@ def create_or_update_value( def create_or_update( self, tag_name, custom_headers=None, raw=False, **operation_config): - """Creates a tag in the subscription. + """Creates a predefined tag name. - The tag name can have a maximum of 512 characters and is case - insensitive. Tag names created by Azure have prefixes of microsoft, - azure, or windows. You cannot create tags with one of these prefixes. + This operation allows adding a name to the list of predefined tag names + for the given subscription. A tag name can have a maximum of 512 + characters and is case-insensitive. Tag names cannot have the following + prefixes which are reserved for Azure use: 'microsoft', 'azure', + 'windows'. :param tag_name: The name of the tag to create. :type tag_name: str @@ -221,10 +232,12 @@ def create_or_update( def delete( self, tag_name, custom_headers=None, raw=False, **operation_config): - """Deletes a tag from the subscription. + """Deletes a predefined tag name. - You must remove all values from a resource tag before you can delete - it. + This operation allows deleting a name from the list of predefined tag + names for the given subscription. The name being deleted must not be in + use as a tag name for any resource. All predefined values for the given + name must have already been deleted. :param tag_name: The name of the tag. :type tag_name: str @@ -274,8 +287,13 @@ def delete( def list( self, custom_headers=None, raw=False, **operation_config): - """Gets the names and values of all resource tags that are defined in a - subscription. + """Gets a summary of tag usage under the subscription. + + This operation performs a union of predefined tags, resource tags, + resource group tags and subscription tags, and returns a summary of + usage for each tag name and value under the given subscription. In case + of a large number of tags, this operation may return a previously + cached result. :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -339,15 +357,20 @@ def internal_paging(next_link=None): return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames'} - def resource_create( - self, scope, parameters, custom_headers=None, raw=False, **operation_config): - """Create or Replace existing tags with passing in tags. + def create_or_update_at_scope( + self, scope, properties, custom_headers=None, raw=False, **operation_config): + """Creates or updates the entire set of tags on a resource or + subscription. + + This operation allows adding or replacing the entire set of tags on the + specified resource or subscription. The specified entity can have a + maximum of 50 tags. :param scope: The resource scope. :type scope: str - :param parameters: Parameters for creating multiple tags. - :type parameters: - ~azure.mgmt.resource.resources.v2019_10_01.models.TagsResource + :param properties: The set of tags. + :type properties: + ~azure.mgmt.resource.resources.v2019_10_01.models.Tags :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -358,8 +381,10 @@ def resource_create( or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + parameters = models.TagsResource(properties=properties) + # Construct URL - url = self.resource_create.metadata['url'] + url = self.create_or_update_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str') } @@ -401,20 +426,27 @@ def resource_create( return client_raw_response return deserialized - resource_create.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} + create_or_update_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} - def resource_update( + def update_at_scope( self, scope, operation=None, properties=None, custom_headers=None, raw=False, **operation_config): - """Update multiple tags: if the tagKey exists, update tagValue with the - new value; if not, insert the new record. + """Selectively updates the set of tags on a resource or subscription. + + This operation allows replacing, merging or selectively deleting tags + on the specified resource or subscription. The specified entity can + have a maximum of 50 tags at the end of the operation. The 'replace' + option replaces the entire set of existing tags with a new set. The + 'merge' option allows adding tags with new names and updating the + values of tags with existing names. The 'delete' option allows + selectively deleting tags based on given names or name/value pairs. :param scope: The resource scope. :type scope: str - :param operation: The operation type for the patch api. Possible + :param operation: The operation type for the patch API. Possible values include: 'Replace', 'Merge', 'Delete' :type operation: str or ~azure.mgmt.resource.resources.v2019_10_01.models.enum - :param properties: tags object passing in the request. + :param properties: The set of tags. :type properties: ~azure.mgmt.resource.resources.v2019_10_01.models.Tags :param dict custom_headers: headers that will be added to the request @@ -427,10 +459,10 @@ def resource_update( or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.TagPatchRequest(operation=operation, properties=properties) + parameters = models.TagsPatchResource(operation=operation, properties=properties) # Construct URL - url = self.resource_update.metadata['url'] + url = self.update_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str') } @@ -452,7 +484,7 @@ def resource_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'TagPatchRequest') + body_content = self._serialize.body(parameters, 'TagsPatchResource') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) @@ -472,11 +504,11 @@ def resource_update( return client_raw_response return deserialized - resource_update.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} + update_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} - def resource_get( + def get_at_scope( self, scope, custom_headers=None, raw=False, **operation_config): - """Gets all the tags for the resource. + """Gets the entire set of tags on a resource or subscription. :param scope: The resource scope. :type scope: str @@ -491,7 +523,7 @@ def resource_get( :raises: :class:`CloudError` """ # Construct URL - url = self.resource_get.metadata['url'] + url = self.get_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str') } @@ -529,11 +561,11 @@ def resource_get( return client_raw_response return deserialized - resource_get.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} + get_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} - def resource_delete( + def delete_at_scope( self, scope, custom_headers=None, raw=False, **operation_config): - """Deletes all the tags for the resource. + """Deletes the entire set of tags on a resource or subscription. :param scope: The resource scope. :type scope: str @@ -547,7 +579,7 @@ def resource_delete( :raises: :class:`CloudError` """ # Construct URL - url = self.resource_delete.metadata['url'] + url = self.delete_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str') } @@ -578,4 +610,4 @@ def resource_delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - resource_delete.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} + delete_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'}