diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/__init__.py new file mode 100644 index 000000000000..0353e2a97e4b --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._configuration import DeploymentScriptsClientConfiguration +from ._deployment_scripts_client import DeploymentScriptsClient +__all__ = ['DeploymentScriptsClient', 'DeploymentScriptsClientConfiguration'] + +from ..version import VERSION + +__version__ = VERSION + diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_configuration.py new file mode 100644 index 000000000000..3b7a52685ae1 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_configuration.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from ..version import VERSION + + +class DeploymentScriptsClientConfiguration(AzureConfiguration): + """Configuration for DeploymentScriptsClient + 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: Subscription Id which forms part of the URI for + every service call. + :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(DeploymentScriptsClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-resource/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_deployment_scripts_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_deployment_scripts_client.py new file mode 100644 index 000000000000..52fe055e9c75 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_deployment_scripts_client.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from azure.profiles import KnownProfiles, ProfileDefinition +from azure.profiles.multiapiclient import MultiApiClientMixin +from ._configuration import DeploymentScriptsClientConfiguration + + + +class DeploymentScriptsClient(MultiApiClientMixin, SDKClient): + """The APIs listed in this specification can be used to manage Deployment Scripts resource through the Azure Resource Manager. + + This ready contains multiple API versions, to help you deal with all Azure clouds + (Azure Stack, Azure Government, Azure China, etc.). + By default, uses latest API version available on public Azure. + For production, you should stick a particular api-version and/or profile. + The profile sets a mapping between the operation group and an API version. + The api-version parameter sets the default API version if the operation + group is not described in the profile. + + :ivar config: Configuration for client. + :vartype config: DeploymentScriptsClientConfiguration + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str api_version: API version to use if no profile is provided, or if + missing in profile. + :param str base_url: Service URL + :param profile: A profile definition, from KnownProfiles to dict. + :type profile: azure.profiles.KnownProfiles + """ + + DEFAULT_API_VERSION = '2019-10-01-preview' + _PROFILE_TAG = "azure.mgmt.resource.deploymentscripts.DeploymentScriptsClient" + LATEST_PROFILE = ProfileDefinition({ + _PROFILE_TAG: { + None: DEFAULT_API_VERSION, + }}, + _PROFILE_TAG + " latest" + ) + + def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default): + self.config = DeploymentScriptsClientConfiguration(credentials, subscription_id, base_url) + super(DeploymentScriptsClient, self).__init__( + credentials, + self.config, + api_version=api_version, + profile=profile + ) + + @classmethod + def _models_dict(cls, api_version): + return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} + + @classmethod + def models(cls, api_version=DEFAULT_API_VERSION): + """Module depends on the API version: + + * 2019-10-01-preview: :mod:`v2019_10_preview.models` + """ + if api_version == '2019-10-01-preview': + from .v2019_10_preview import models + return models + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + + @property + def deployment_scripts(self): + """Instance depends on the API version: + + * 2019-10-01-preview: :class:`DeploymentScriptsOperations` + """ + api_version = self._get_api_version('deployment_scripts') + if api_version == '2019-10-01-preview': + from .v2019_10_preview.operations import DeploymentScriptsOperations 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/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/models.py new file mode 100644 index 000000000000..b44e4943769f --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/models.py @@ -0,0 +1,7 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from .v2019_10_preview.models import * diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/__init__.py new file mode 100644 index 000000000000..08e241ee1ed8 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._configuration import DeploymentScriptsClientConfiguration +from ._deployment_scripts_client import DeploymentScriptsClient +__all__ = ['DeploymentScriptsClient', 'DeploymentScriptsClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/_configuration.py new file mode 100644 index 000000000000..142be065a596 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/_configuration.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class DeploymentScriptsClientConfiguration(AzureConfiguration): + """Configuration for DeploymentScriptsClient + 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: Subscription Id which forms part of the URI for + every service call. + :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(DeploymentScriptsClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-resource/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/_deployment_scripts_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/_deployment_scripts_client.py new file mode 100644 index 000000000000..5cae315224cc --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/_deployment_scripts_client.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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import DeploymentScriptsClientConfiguration +from .operations import DeploymentScriptsOperations +from . import models + + +class DeploymentScriptsClient(SDKClient): + """The APIs listed in this specification can be used to manage Deployment Scripts resource through the Azure Resource Manager. + + :ivar config: Configuration for client. + :vartype config: DeploymentScriptsClientConfiguration + + :ivar deployment_scripts: DeploymentScripts operations + :vartype deployment_scripts: azure.mgmt.resource.deploymentscripts.v2019_10_preview.operations.DeploymentScriptsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription Id which forms part of the URI for + every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = DeploymentScriptsClientConfiguration(credentials, subscription_id, base_url) + super(DeploymentScriptsClient, 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 = '2019-10-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.deployment_scripts = DeploymentScriptsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/__init__.py new file mode 100644 index 000000000000..ecfdc3da92de --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/__init__.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 ._models_py3 import AzureCliScript + from ._models_py3 import AzurePowerShellScript + from ._models_py3 import AzureResourceBase + from ._models_py3 import DeploymentScript + from ._models_py3 import DeploymentScriptsError, DeploymentScriptsErrorException + from ._models_py3 import DeploymentScriptUpdateParameter + from ._models_py3 import EnvironmentVariable + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorResponse + from ._models_py3 import ManagedServiceIdentity + from ._models_py3 import ScriptLog + from ._models_py3 import ScriptLogsList + from ._models_py3 import ScriptStatus + from ._models_py3 import UserAssignedIdentity +except (SyntaxError, ImportError): + from ._models import AzureCliScript + from ._models import AzurePowerShellScript + from ._models import AzureResourceBase + from ._models import DeploymentScript + from ._models import DeploymentScriptsError, DeploymentScriptsErrorException + from ._models import DeploymentScriptUpdateParameter + from ._models import EnvironmentVariable + from ._models import ErrorAdditionalInfo + from ._models import ErrorResponse + from ._models import ManagedServiceIdentity + from ._models import ScriptLog + from ._models import ScriptLogsList + from ._models import ScriptStatus + from ._models import UserAssignedIdentity +from ._paged_models import DeploymentScriptPaged +from ._deployment_scripts_client_enums import ( + ManagedServiceIdentityType, + CleanupOptions, + ScriptProvisioningState, +) + +__all__ = [ + 'AzureCliScript', + 'AzurePowerShellScript', + 'AzureResourceBase', + 'DeploymentScript', + 'DeploymentScriptsError', 'DeploymentScriptsErrorException', + 'DeploymentScriptUpdateParameter', + 'EnvironmentVariable', + 'ErrorAdditionalInfo', + 'ErrorResponse', + 'ManagedServiceIdentity', + 'ScriptLog', + 'ScriptLogsList', + 'ScriptStatus', + 'UserAssignedIdentity', + 'DeploymentScriptPaged', + 'ManagedServiceIdentityType', + 'CleanupOptions', + 'ScriptProvisioningState', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_deployment_scripts_client_enums.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_deployment_scripts_client_enums.py new file mode 100644 index 000000000000..5f8ffd356026 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_deployment_scripts_client_enums.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ManagedServiceIdentityType(str, Enum): + + user_assigned = "UserAssigned" + + +class CleanupOptions(str, Enum): + + always = "Always" + on_success = "OnSuccess" + on_expiration = "OnExpiration" + + +class ScriptProvisioningState(str, Enum): + + creating = "Creating" + provisioning_resources = "ProvisioningResources" + running = "Running" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_models.py new file mode 100644 index 000000000000..4329b4b15ccd --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_models.py @@ -0,0 +1,787 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by 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 AzureResourceBase(Model): + """Common properties for all Azure resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureResourceBase, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class DeploymentScript(AzureResourceBase): + """Deployment script object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzurePowerShellScript, AzureCliScript + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :param identity: Required. Managed identity to be used for this deployment + script. Currently, only user-assigned MSI is supported. + :type identity: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ManagedServiceIdentity + :param location: Required. The location of the ACI and the storage account + for the deployment script. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identity': {'required': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'AzurePowerShell': 'AzurePowerShellScript', 'AzureCLI': 'AzureCliScript'} + } + + def __init__(self, **kwargs): + super(DeploymentScript, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.kind = None + self.kind = 'DeploymentScript' + + +class AzureCliScript(DeploymentScript): + """Object model for the Azure CLI script. + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :param identity: Required. Managed identity to be used for this deployment + script. Currently, only user-assigned MSI is supported. + :type identity: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ManagedServiceIdentity + :param location: Required. The location of the ACI and the storage account + for the deployment script. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param cleanup_preference: The clean up preference when the script + execution gets in a terminal state. Default setting is 'Always'. Possible + values include: 'Always', 'OnSuccess', 'OnExpiration' + :type cleanup_preference: str or + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.CleanupOptions + :ivar provisioning_state: State of the script execution. This only appears + in the response. Possible values include: 'Creating', + 'ProvisioningResources', 'Running', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptProvisioningState + :ivar status: Contains the results of script execution. + :vartype status: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptStatus + :ivar outputs: List of script outputs. + :vartype outputs: dict[str, object] + :param primary_script_uri: Uri for the script. This is the entry point for + the external script. + :type primary_script_uri: str + :param supporting_script_uris: Supporting files for the external script. + :type supporting_script_uris: list[str] + :param script_content: Script body. + :type script_content: str + :param arguments: Command line arguments to pass to the script. Arguments + are separated by spaces. ex: -Name blue* -Location 'West US 2' + :type arguments: str + :param environment_variables: The environment variables to pass over to + the script. + :type environment_variables: + list[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.EnvironmentVariable] + :param force_update_tag: Gets or sets how the deployment script should be + forced to execute even if the script resource has not changed. Can be + current time stamp or a GUID. + :type force_update_tag: str + :param retention_interval: Required. Interval for which the service + retains the script resource after it reaches a terminal state. Resource + will be deleted when this duration expires. Duration is based on ISO 8601 + pattern (for example P7D means one week). + :type retention_interval: timedelta + :param timeout: Maximum allowed script execution time specified in ISO + 8601 format. Default value is PT1H + :type timeout: timedelta + :param az_cli_version: Required. Azure CLI module version to be used. + :type az_cli_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identity': {'required': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'outputs': {'readonly': True}, + 'script_content': {'max_length': 32000}, + 'retention_interval': {'required': True}, + 'az_cli_version': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'cleanup_preference': {'key': 'properties.cleanupPreference', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'ScriptStatus'}, + 'outputs': {'key': 'properties.outputs', 'type': '{object}'}, + 'primary_script_uri': {'key': 'properties.primaryScriptUri', 'type': 'str'}, + 'supporting_script_uris': {'key': 'properties.supportingScriptUris', 'type': '[str]'}, + 'script_content': {'key': 'properties.scriptContent', 'type': 'str'}, + 'arguments': {'key': 'properties.arguments', 'type': 'str'}, + 'environment_variables': {'key': 'properties.environmentVariables', 'type': '[EnvironmentVariable]'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'retention_interval': {'key': 'properties.retentionInterval', 'type': 'duration'}, + 'timeout': {'key': 'properties.timeout', 'type': 'duration'}, + 'az_cli_version': {'key': 'properties.azCliVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureCliScript, self).__init__(**kwargs) + self.cleanup_preference = kwargs.get('cleanup_preference', None) + self.provisioning_state = None + self.status = None + self.outputs = None + self.primary_script_uri = kwargs.get('primary_script_uri', None) + self.supporting_script_uris = kwargs.get('supporting_script_uris', None) + self.script_content = kwargs.get('script_content', None) + self.arguments = kwargs.get('arguments', None) + self.environment_variables = kwargs.get('environment_variables', None) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.retention_interval = kwargs.get('retention_interval', None) + self.timeout = kwargs.get('timeout', None) + self.az_cli_version = kwargs.get('az_cli_version', None) + self.kind = 'AzureCLI' + + +class AzurePowerShellScript(DeploymentScript): + """Object model for the Azure PowerShell script. + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :param identity: Required. Managed identity to be used for this deployment + script. Currently, only user-assigned MSI is supported. + :type identity: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ManagedServiceIdentity + :param location: Required. The location of the ACI and the storage account + for the deployment script. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param cleanup_preference: The clean up preference when the script + execution gets in a terminal state. Default setting is 'Always'. Possible + values include: 'Always', 'OnSuccess', 'OnExpiration' + :type cleanup_preference: str or + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.CleanupOptions + :ivar provisioning_state: State of the script execution. This only appears + in the response. Possible values include: 'Creating', + 'ProvisioningResources', 'Running', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptProvisioningState + :ivar status: Contains the results of script execution. + :vartype status: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptStatus + :ivar outputs: List of script outputs. + :vartype outputs: dict[str, object] + :param primary_script_uri: Uri for the script. This is the entry point for + the external script. + :type primary_script_uri: str + :param supporting_script_uris: Supporting files for the external script. + :type supporting_script_uris: list[str] + :param script_content: Script body. + :type script_content: str + :param arguments: Command line arguments to pass to the script. Arguments + are separated by spaces. ex: -Name blue* -Location 'West US 2' + :type arguments: str + :param environment_variables: The environment variables to pass over to + the script. + :type environment_variables: + list[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.EnvironmentVariable] + :param force_update_tag: Gets or sets how the deployment script should be + forced to execute even if the script resource has not changed. Can be + current time stamp or a GUID. + :type force_update_tag: str + :param retention_interval: Required. Interval for which the service + retains the script resource after it reaches a terminal state. Resource + will be deleted when this duration expires. Duration is based on ISO 8601 + pattern (for example P7D means one week). + :type retention_interval: timedelta + :param timeout: Maximum allowed script execution time specified in ISO + 8601 format. Default value is PT1H + :type timeout: timedelta + :param az_power_shell_version: Required. Azure PowerShell module version + to be used. + :type az_power_shell_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identity': {'required': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'outputs': {'readonly': True}, + 'script_content': {'max_length': 32000}, + 'retention_interval': {'required': True}, + 'az_power_shell_version': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'cleanup_preference': {'key': 'properties.cleanupPreference', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'ScriptStatus'}, + 'outputs': {'key': 'properties.outputs', 'type': '{object}'}, + 'primary_script_uri': {'key': 'properties.primaryScriptUri', 'type': 'str'}, + 'supporting_script_uris': {'key': 'properties.supportingScriptUris', 'type': '[str]'}, + 'script_content': {'key': 'properties.scriptContent', 'type': 'str'}, + 'arguments': {'key': 'properties.arguments', 'type': 'str'}, + 'environment_variables': {'key': 'properties.environmentVariables', 'type': '[EnvironmentVariable]'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'retention_interval': {'key': 'properties.retentionInterval', 'type': 'duration'}, + 'timeout': {'key': 'properties.timeout', 'type': 'duration'}, + 'az_power_shell_version': {'key': 'properties.azPowerShellVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzurePowerShellScript, self).__init__(**kwargs) + self.cleanup_preference = kwargs.get('cleanup_preference', None) + self.provisioning_state = None + self.status = None + self.outputs = None + self.primary_script_uri = kwargs.get('primary_script_uri', None) + self.supporting_script_uris = kwargs.get('supporting_script_uris', None) + self.script_content = kwargs.get('script_content', None) + self.arguments = kwargs.get('arguments', None) + self.environment_variables = kwargs.get('environment_variables', None) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.retention_interval = kwargs.get('retention_interval', None) + self.timeout = kwargs.get('timeout', None) + self.az_power_shell_version = kwargs.get('az_power_shell_version', None) + self.kind = 'AzurePowerShell' + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class DeploymentScriptPropertiesBase(Model): + """Common properties for the deployment script. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param cleanup_preference: The clean up preference when the script + execution gets in a terminal state. Default setting is 'Always'. Possible + values include: 'Always', 'OnSuccess', 'OnExpiration' + :type cleanup_preference: str or + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.CleanupOptions + :ivar provisioning_state: State of the script execution. This only appears + in the response. Possible values include: 'Creating', + 'ProvisioningResources', 'Running', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptProvisioningState + :ivar status: Contains the results of script execution. + :vartype status: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptStatus + :ivar outputs: List of script outputs. + :vartype outputs: dict[str, object] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'outputs': {'readonly': True}, + } + + _attribute_map = { + 'cleanup_preference': {'key': 'cleanupPreference', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'ScriptStatus'}, + 'outputs': {'key': 'outputs', 'type': '{object}'}, + } + + def __init__(self, **kwargs): + super(DeploymentScriptPropertiesBase, self).__init__(**kwargs) + self.cleanup_preference = kwargs.get('cleanup_preference', None) + self.provisioning_state = None + self.status = None + self.outputs = None + + +class DeploymentScriptsError(Model): + """Deployment scripts error response. + + :param error: + :type error: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(DeploymentScriptsError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class DeploymentScriptsErrorException(HttpOperationError): + """Server responsed with exception of type: 'DeploymentScriptsError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(DeploymentScriptsErrorException, self).__init__(deserialize, response, 'DeploymentScriptsError', *args) + + +class DeploymentScriptUpdateParameter(AzureResourceBase): + """Deployment script parameters to be updated. . + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :param tags: Resource tags to be updated. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DeploymentScriptUpdateParameter, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class EnvironmentVariable(Model): + """The environment variable to pass to the script in the container instance. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the environment variable. + :type name: str + :param value: The value of the environment variable. + :type value: str + :param secure_value: The value of the secure environment variable. + :type secure_value: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'secure_value': {'key': 'secureValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnvironmentVariable, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.secure_value = kwargs.get('secure_value', None) + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """The resource management error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ManagedServiceIdentity(Model): + """Managed identity generic object. + + :param type: Type of the managed identity. Possible values include: + 'UserAssigned' + :type type: str or + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ManagedServiceIdentityType + :param user_assigned_identities: The list of user-assigned managed + identities associated with the resource. Key is the Azure resource Id of + the managed identity. + :type user_assigned_identities: dict[str, + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.UserAssignedIdentity] + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__(self, **kwargs): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class ScriptConfigurationBase(Model): + """Common configuration settings for both Azure PowerShell and Azure CLI + scripts. + + All required parameters must be populated in order to send to Azure. + + :param primary_script_uri: Uri for the script. This is the entry point for + the external script. + :type primary_script_uri: str + :param supporting_script_uris: Supporting files for the external script. + :type supporting_script_uris: list[str] + :param script_content: Script body. + :type script_content: str + :param arguments: Command line arguments to pass to the script. Arguments + are separated by spaces. ex: -Name blue* -Location 'West US 2' + :type arguments: str + :param environment_variables: The environment variables to pass over to + the script. + :type environment_variables: + list[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.EnvironmentVariable] + :param force_update_tag: Gets or sets how the deployment script should be + forced to execute even if the script resource has not changed. Can be + current time stamp or a GUID. + :type force_update_tag: str + :param retention_interval: Required. Interval for which the service + retains the script resource after it reaches a terminal state. Resource + will be deleted when this duration expires. Duration is based on ISO 8601 + pattern (for example P7D means one week). + :type retention_interval: timedelta + :param timeout: Maximum allowed script execution time specified in ISO + 8601 format. Default value is PT1H + :type timeout: timedelta + """ + + _validation = { + 'script_content': {'max_length': 32000}, + 'retention_interval': {'required': True}, + } + + _attribute_map = { + 'primary_script_uri': {'key': 'primaryScriptUri', 'type': 'str'}, + 'supporting_script_uris': {'key': 'supportingScriptUris', 'type': '[str]'}, + 'script_content': {'key': 'scriptContent', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': 'str'}, + 'environment_variables': {'key': 'environmentVariables', 'type': '[EnvironmentVariable]'}, + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'retention_interval': {'key': 'retentionInterval', 'type': 'duration'}, + 'timeout': {'key': 'timeout', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(ScriptConfigurationBase, self).__init__(**kwargs) + self.primary_script_uri = kwargs.get('primary_script_uri', None) + self.supporting_script_uris = kwargs.get('supporting_script_uris', None) + self.script_content = kwargs.get('script_content', None) + self.arguments = kwargs.get('arguments', None) + self.environment_variables = kwargs.get('environment_variables', None) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.retention_interval = kwargs.get('retention_interval', None) + self.timeout = kwargs.get('timeout', None) + + +class ScriptLog(AzureResourceBase): + """Script execution log object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar log: Script execution logs in text format. + :vartype log: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'log': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'log': {'key': 'properties.log', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScriptLog, self).__init__(**kwargs) + self.log = None + + +class ScriptLogsList(Model): + """Deployment script execution logs. + + :param value: Deployment scripts logs. + :type value: + list[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptLog] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ScriptLog]'}, + } + + def __init__(self, **kwargs): + super(ScriptLogsList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ScriptStatus(Model): + """Generic object modeling results of script execution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar container_instance_id: ACI resource Id. + :vartype container_instance_id: str + :ivar storage_account_id: Storage account resource Id. + :vartype storage_account_id: str + :ivar start_time: Start time of the script execution. + :vartype start_time: datetime + :ivar end_time: End time of the script execution. + :vartype end_time: datetime + :ivar expiration_time: Time the deployment script resource will expire. + :vartype expiration_time: datetime + :param error: Error that is relayed from the script execution. + :type error: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ErrorResponse + """ + + _validation = { + 'container_instance_id': {'readonly': True}, + 'storage_account_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + } + + _attribute_map = { + 'container_instance_id': {'key': 'containerInstanceId', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(ScriptStatus, self).__init__(**kwargs) + self.container_instance_id = None + self.storage_account_id = None + self.start_time = None + self.end_time = None + self.expiration_time = None + self.error = kwargs.get('error', None) + + +class UserAssignedIdentity(Model): + """User-assigned managed identity. + + :param principal_id: Azure Active Directory principal ID associated with + this identity. + :type principal_id: str + :param client_id: Client App Id associated with this identity. + :type client_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.client_id = kwargs.get('client_id', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_models_py3.py new file mode 100644 index 000000000000..4501d4c47aa9 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_models_py3.py @@ -0,0 +1,787 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by 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 AzureResourceBase(Model): + """Common properties for all Azure resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureResourceBase, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class DeploymentScript(AzureResourceBase): + """Deployment script object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzurePowerShellScript, AzureCliScript + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :param identity: Required. Managed identity to be used for this deployment + script. Currently, only user-assigned MSI is supported. + :type identity: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ManagedServiceIdentity + :param location: Required. The location of the ACI and the storage account + for the deployment script. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identity': {'required': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'AzurePowerShell': 'AzurePowerShellScript', 'AzureCLI': 'AzureCliScript'} + } + + def __init__(self, *, identity, location: str, tags=None, **kwargs) -> None: + super(DeploymentScript, self).__init__(**kwargs) + self.identity = identity + self.location = location + self.tags = tags + self.kind = None + self.kind = 'DeploymentScript' + + +class AzureCliScript(DeploymentScript): + """Object model for the Azure CLI script. + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :param identity: Required. Managed identity to be used for this deployment + script. Currently, only user-assigned MSI is supported. + :type identity: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ManagedServiceIdentity + :param location: Required. The location of the ACI and the storage account + for the deployment script. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param cleanup_preference: The clean up preference when the script + execution gets in a terminal state. Default setting is 'Always'. Possible + values include: 'Always', 'OnSuccess', 'OnExpiration' + :type cleanup_preference: str or + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.CleanupOptions + :ivar provisioning_state: State of the script execution. This only appears + in the response. Possible values include: 'Creating', + 'ProvisioningResources', 'Running', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptProvisioningState + :ivar status: Contains the results of script execution. + :vartype status: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptStatus + :ivar outputs: List of script outputs. + :vartype outputs: dict[str, object] + :param primary_script_uri: Uri for the script. This is the entry point for + the external script. + :type primary_script_uri: str + :param supporting_script_uris: Supporting files for the external script. + :type supporting_script_uris: list[str] + :param script_content: Script body. + :type script_content: str + :param arguments: Command line arguments to pass to the script. Arguments + are separated by spaces. ex: -Name blue* -Location 'West US 2' + :type arguments: str + :param environment_variables: The environment variables to pass over to + the script. + :type environment_variables: + list[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.EnvironmentVariable] + :param force_update_tag: Gets or sets how the deployment script should be + forced to execute even if the script resource has not changed. Can be + current time stamp or a GUID. + :type force_update_tag: str + :param retention_interval: Required. Interval for which the service + retains the script resource after it reaches a terminal state. Resource + will be deleted when this duration expires. Duration is based on ISO 8601 + pattern (for example P7D means one week). + :type retention_interval: timedelta + :param timeout: Maximum allowed script execution time specified in ISO + 8601 format. Default value is PT1H + :type timeout: timedelta + :param az_cli_version: Required. Azure CLI module version to be used. + :type az_cli_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identity': {'required': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'outputs': {'readonly': True}, + 'script_content': {'max_length': 32000}, + 'retention_interval': {'required': True}, + 'az_cli_version': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'cleanup_preference': {'key': 'properties.cleanupPreference', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'ScriptStatus'}, + 'outputs': {'key': 'properties.outputs', 'type': '{object}'}, + 'primary_script_uri': {'key': 'properties.primaryScriptUri', 'type': 'str'}, + 'supporting_script_uris': {'key': 'properties.supportingScriptUris', 'type': '[str]'}, + 'script_content': {'key': 'properties.scriptContent', 'type': 'str'}, + 'arguments': {'key': 'properties.arguments', 'type': 'str'}, + 'environment_variables': {'key': 'properties.environmentVariables', 'type': '[EnvironmentVariable]'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'retention_interval': {'key': 'properties.retentionInterval', 'type': 'duration'}, + 'timeout': {'key': 'properties.timeout', 'type': 'duration'}, + 'az_cli_version': {'key': 'properties.azCliVersion', 'type': 'str'}, + } + + def __init__(self, *, identity, location: str, retention_interval, az_cli_version: str, tags=None, cleanup_preference=None, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout=None, **kwargs) -> None: + super(AzureCliScript, self).__init__(identity=identity, location=location, tags=tags, **kwargs) + self.cleanup_preference = cleanup_preference + self.provisioning_state = None + self.status = None + self.outputs = None + self.primary_script_uri = primary_script_uri + self.supporting_script_uris = supporting_script_uris + self.script_content = script_content + self.arguments = arguments + self.environment_variables = environment_variables + self.force_update_tag = force_update_tag + self.retention_interval = retention_interval + self.timeout = timeout + self.az_cli_version = az_cli_version + self.kind = 'AzureCLI' + + +class AzurePowerShellScript(DeploymentScript): + """Object model for the Azure PowerShell script. + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :param identity: Required. Managed identity to be used for this deployment + script. Currently, only user-assigned MSI is supported. + :type identity: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ManagedServiceIdentity + :param location: Required. The location of the ACI and the storage account + for the deployment script. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param cleanup_preference: The clean up preference when the script + execution gets in a terminal state. Default setting is 'Always'. Possible + values include: 'Always', 'OnSuccess', 'OnExpiration' + :type cleanup_preference: str or + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.CleanupOptions + :ivar provisioning_state: State of the script execution. This only appears + in the response. Possible values include: 'Creating', + 'ProvisioningResources', 'Running', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptProvisioningState + :ivar status: Contains the results of script execution. + :vartype status: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptStatus + :ivar outputs: List of script outputs. + :vartype outputs: dict[str, object] + :param primary_script_uri: Uri for the script. This is the entry point for + the external script. + :type primary_script_uri: str + :param supporting_script_uris: Supporting files for the external script. + :type supporting_script_uris: list[str] + :param script_content: Script body. + :type script_content: str + :param arguments: Command line arguments to pass to the script. Arguments + are separated by spaces. ex: -Name blue* -Location 'West US 2' + :type arguments: str + :param environment_variables: The environment variables to pass over to + the script. + :type environment_variables: + list[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.EnvironmentVariable] + :param force_update_tag: Gets or sets how the deployment script should be + forced to execute even if the script resource has not changed. Can be + current time stamp or a GUID. + :type force_update_tag: str + :param retention_interval: Required. Interval for which the service + retains the script resource after it reaches a terminal state. Resource + will be deleted when this duration expires. Duration is based on ISO 8601 + pattern (for example P7D means one week). + :type retention_interval: timedelta + :param timeout: Maximum allowed script execution time specified in ISO + 8601 format. Default value is PT1H + :type timeout: timedelta + :param az_power_shell_version: Required. Azure PowerShell module version + to be used. + :type az_power_shell_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identity': {'required': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'outputs': {'readonly': True}, + 'script_content': {'max_length': 32000}, + 'retention_interval': {'required': True}, + 'az_power_shell_version': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'cleanup_preference': {'key': 'properties.cleanupPreference', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'ScriptStatus'}, + 'outputs': {'key': 'properties.outputs', 'type': '{object}'}, + 'primary_script_uri': {'key': 'properties.primaryScriptUri', 'type': 'str'}, + 'supporting_script_uris': {'key': 'properties.supportingScriptUris', 'type': '[str]'}, + 'script_content': {'key': 'properties.scriptContent', 'type': 'str'}, + 'arguments': {'key': 'properties.arguments', 'type': 'str'}, + 'environment_variables': {'key': 'properties.environmentVariables', 'type': '[EnvironmentVariable]'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'retention_interval': {'key': 'properties.retentionInterval', 'type': 'duration'}, + 'timeout': {'key': 'properties.timeout', 'type': 'duration'}, + 'az_power_shell_version': {'key': 'properties.azPowerShellVersion', 'type': 'str'}, + } + + def __init__(self, *, identity, location: str, retention_interval, az_power_shell_version: str, tags=None, cleanup_preference=None, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout=None, **kwargs) -> None: + super(AzurePowerShellScript, self).__init__(identity=identity, location=location, tags=tags, **kwargs) + self.cleanup_preference = cleanup_preference + self.provisioning_state = None + self.status = None + self.outputs = None + self.primary_script_uri = primary_script_uri + self.supporting_script_uris = supporting_script_uris + self.script_content = script_content + self.arguments = arguments + self.environment_variables = environment_variables + self.force_update_tag = force_update_tag + self.retention_interval = retention_interval + self.timeout = timeout + self.az_power_shell_version = az_power_shell_version + self.kind = 'AzurePowerShell' + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class DeploymentScriptPropertiesBase(Model): + """Common properties for the deployment script. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param cleanup_preference: The clean up preference when the script + execution gets in a terminal state. Default setting is 'Always'. Possible + values include: 'Always', 'OnSuccess', 'OnExpiration' + :type cleanup_preference: str or + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.CleanupOptions + :ivar provisioning_state: State of the script execution. This only appears + in the response. Possible values include: 'Creating', + 'ProvisioningResources', 'Running', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptProvisioningState + :ivar status: Contains the results of script execution. + :vartype status: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptStatus + :ivar outputs: List of script outputs. + :vartype outputs: dict[str, object] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'outputs': {'readonly': True}, + } + + _attribute_map = { + 'cleanup_preference': {'key': 'cleanupPreference', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'ScriptStatus'}, + 'outputs': {'key': 'outputs', 'type': '{object}'}, + } + + def __init__(self, *, cleanup_preference=None, **kwargs) -> None: + super(DeploymentScriptPropertiesBase, self).__init__(**kwargs) + self.cleanup_preference = cleanup_preference + self.provisioning_state = None + self.status = None + self.outputs = None + + +class DeploymentScriptsError(Model): + """Deployment scripts error response. + + :param error: + :type error: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(DeploymentScriptsError, self).__init__(**kwargs) + self.error = error + + +class DeploymentScriptsErrorException(HttpOperationError): + """Server responsed with exception of type: 'DeploymentScriptsError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(DeploymentScriptsErrorException, self).__init__(deserialize, response, 'DeploymentScriptsError', *args) + + +class DeploymentScriptUpdateParameter(AzureResourceBase): + """Deployment script parameters to be updated. . + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :param tags: Resource tags to be updated. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(DeploymentScriptUpdateParameter, self).__init__(**kwargs) + self.tags = tags + + +class EnvironmentVariable(Model): + """The environment variable to pass to the script in the container instance. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the environment variable. + :type name: str + :param value: The value of the environment variable. + :type value: str + :param secure_value: The value of the secure environment variable. + :type secure_value: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'secure_value': {'key': 'secureValue', 'type': 'str'}, + } + + def __init__(self, *, name: str, value: str=None, secure_value: str=None, **kwargs) -> None: + super(EnvironmentVariable, self).__init__(**kwargs) + self.name = name + self.value = value + self.secure_value = secure_value + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """The resource management error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ManagedServiceIdentity(Model): + """Managed identity generic object. + + :param type: Type of the managed identity. Possible values include: + 'UserAssigned' + :type type: str or + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ManagedServiceIdentityType + :param user_assigned_identities: The list of user-assigned managed + identities associated with the resource. Key is the Azure resource Id of + the managed identity. + :type user_assigned_identities: dict[str, + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.UserAssignedIdentity] + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__(self, *, type=None, user_assigned_identities=None, **kwargs) -> None: + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class ScriptConfigurationBase(Model): + """Common configuration settings for both Azure PowerShell and Azure CLI + scripts. + + All required parameters must be populated in order to send to Azure. + + :param primary_script_uri: Uri for the script. This is the entry point for + the external script. + :type primary_script_uri: str + :param supporting_script_uris: Supporting files for the external script. + :type supporting_script_uris: list[str] + :param script_content: Script body. + :type script_content: str + :param arguments: Command line arguments to pass to the script. Arguments + are separated by spaces. ex: -Name blue* -Location 'West US 2' + :type arguments: str + :param environment_variables: The environment variables to pass over to + the script. + :type environment_variables: + list[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.EnvironmentVariable] + :param force_update_tag: Gets or sets how the deployment script should be + forced to execute even if the script resource has not changed. Can be + current time stamp or a GUID. + :type force_update_tag: str + :param retention_interval: Required. Interval for which the service + retains the script resource after it reaches a terminal state. Resource + will be deleted when this duration expires. Duration is based on ISO 8601 + pattern (for example P7D means one week). + :type retention_interval: timedelta + :param timeout: Maximum allowed script execution time specified in ISO + 8601 format. Default value is PT1H + :type timeout: timedelta + """ + + _validation = { + 'script_content': {'max_length': 32000}, + 'retention_interval': {'required': True}, + } + + _attribute_map = { + 'primary_script_uri': {'key': 'primaryScriptUri', 'type': 'str'}, + 'supporting_script_uris': {'key': 'supportingScriptUris', 'type': '[str]'}, + 'script_content': {'key': 'scriptContent', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': 'str'}, + 'environment_variables': {'key': 'environmentVariables', 'type': '[EnvironmentVariable]'}, + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'retention_interval': {'key': 'retentionInterval', 'type': 'duration'}, + 'timeout': {'key': 'timeout', 'type': 'duration'}, + } + + def __init__(self, *, retention_interval, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout=None, **kwargs) -> None: + super(ScriptConfigurationBase, self).__init__(**kwargs) + self.primary_script_uri = primary_script_uri + self.supporting_script_uris = supporting_script_uris + self.script_content = script_content + self.arguments = arguments + self.environment_variables = environment_variables + self.force_update_tag = force_update_tag + self.retention_interval = retention_interval + self.timeout = timeout + + +class ScriptLog(AzureResourceBase): + """Script execution log object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar log: Script execution logs in text format. + :vartype log: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'log': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'log': {'key': 'properties.log', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ScriptLog, self).__init__(**kwargs) + self.log = None + + +class ScriptLogsList(Model): + """Deployment script execution logs. + + :param value: Deployment scripts logs. + :type value: + list[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptLog] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ScriptLog]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ScriptLogsList, self).__init__(**kwargs) + self.value = value + + +class ScriptStatus(Model): + """Generic object modeling results of script execution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar container_instance_id: ACI resource Id. + :vartype container_instance_id: str + :ivar storage_account_id: Storage account resource Id. + :vartype storage_account_id: str + :ivar start_time: Start time of the script execution. + :vartype start_time: datetime + :ivar end_time: End time of the script execution. + :vartype end_time: datetime + :ivar expiration_time: Time the deployment script resource will expire. + :vartype expiration_time: datetime + :param error: Error that is relayed from the script execution. + :type error: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ErrorResponse + """ + + _validation = { + 'container_instance_id': {'readonly': True}, + 'storage_account_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + } + + _attribute_map = { + 'container_instance_id': {'key': 'containerInstanceId', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ScriptStatus, self).__init__(**kwargs) + self.container_instance_id = None + self.storage_account_id = None + self.start_time = None + self.end_time = None + self.expiration_time = None + self.error = error + + +class UserAssignedIdentity(Model): + """User-assigned managed identity. + + :param principal_id: Azure Active Directory principal ID associated with + this identity. + :type principal_id: str + :param client_id: Client App Id associated with this identity. + :type client_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str=None, client_id: str=None, **kwargs) -> None: + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = principal_id + self.client_id = client_id diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_paged_models.py new file mode 100644 index 000000000000..7ff65ddb6503 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_paged_models.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 DeploymentScriptPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeploymentScript ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeploymentScript]'} + } + + def __init__(self, *args, **kwargs): + + super(DeploymentScriptPaged, self).__init__(*args, **kwargs) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/operations/__init__.py new file mode 100644 index 000000000000..3868bac365a6 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/operations/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._deployment_scripts_operations import DeploymentScriptsOperations + +__all__ = [ + 'DeploymentScriptsOperations', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/operations/_deployment_scripts_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/operations/_deployment_scripts_operations.py new file mode 100644 index 000000000000..50e329420559 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/operations/_deployment_scripts_operations.py @@ -0,0 +1,600 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DeploymentScriptsOperations(object): + """DeploymentScriptsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api version. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + + def _create_initial( + self, resource_group_name, script_name, deployment_script, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1) + } + 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(deployment_script, 'DeploymentScript') + + # 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.DeploymentScriptsErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeploymentScript', response) + if response.status_code == 201: + deserialized = self._deserialize('DeploymentScript', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, script_name, deployment_script, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a deployment script. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param script_name: Name of the deployment script. + :type script_name: str + :param deployment_script: Deployment script supplied to the operation. + :type deployment_script: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.DeploymentScript + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentScript or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.DeploymentScript] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.DeploymentScript]] + :raises: + :class:`DeploymentScriptsErrorException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + script_name=script_name, + deployment_script=deployment_script, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentScript', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}'} + + def update( + self, resource_group_name, script_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates deployment script tags with specified values. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param script_name: Name of the deployment script. + :type script_name: str + :param tags: Resource tags to be updated. + :type tags: dict[str, 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: DeploymentScript or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.DeploymentScript + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DeploymentScriptsErrorException` + """ + deployment_script = None + if tags is not None: + deployment_script = models.DeploymentScriptUpdateParameter(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1) + } + 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 + if deployment_script is not None: + body_content = self._serialize.body(deployment_script, 'DeploymentScriptUpdateParameter') + else: + body_content = None + + # Construct and send request + 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.DeploymentScriptsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentScript', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}'} + + def get( + self, resource_group_name, script_name, custom_headers=None, raw=False, **operation_config): + """Gets a deployment script with a given name. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param script_name: Name of the deployment script. + :type script_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: DeploymentScript or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.DeploymentScript + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DeploymentScriptsErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1) + } + 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.DeploymentScriptsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentScript', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}'} + + def delete( + self, resource_group_name, script_name, custom_headers=None, raw=False, **operation_config): + """Deletes a deployment script. When operation completes, status code 200 + returned without content. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param script_name: Name of the deployment script. + :type script_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:`DeploymentScriptsErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1) + } + 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.DeploymentScriptsErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Lists all deployment scripts for 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 DeploymentScript + :rtype: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.DeploymentScriptPaged[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.DeploymentScript] + :raises: + :class:`DeploymentScriptsErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DeploymentScriptsErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentScriptPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentScripts'} + + def get_logs( + self, resource_group_name, script_name, custom_headers=None, raw=False, **operation_config): + """Gets deployment script logs for a given deployment script name. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param script_name: Name of the deployment script. + :type script_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: ScriptLogsList or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptLogsList + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DeploymentScriptsErrorException` + """ + # Construct URL + url = self.get_logs.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1) + } + 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.DeploymentScriptsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ScriptLogsList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}/logs'} + + def get_logs_default( + self, resource_group_name, script_name, tail=None, custom_headers=None, raw=False, **operation_config): + """Gets deployment script logs for a given deployment script name. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param script_name: Name of the deployment script. + :type script_name: str + :param tail: The number of lines to show from the tail of the + deployment script log. Valid value is a positive number up to 1000. If + 'tail' is not provided, all available logs are shown up to container + instance log capacity of 4mb. + :type tail: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ScriptLog or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ScriptLog + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DeploymentScriptsErrorException` + """ + # Construct URL + url = self.get_logs_default.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1) + } + 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') + if tail is not None: + query_parameters['tail'] = self._serialize.query("tail", tail, 'int') + + # 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.DeploymentScriptsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ScriptLog', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_logs_default.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}/logs/default'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists deployments scripts. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeploymentScript + :rtype: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.DeploymentScriptPaged[~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.DeploymentScript] + :raises: + :class:`DeploymentScriptsErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DeploymentScriptsErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentScriptPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/version.py new file mode 100644 index 000000000000..90309975708c --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/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 = "2019-10-01-preview" + diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/__init__.py index febe5d73ee46..ef78f45062ce 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/__init__.py @@ -28,6 +28,7 @@ from ._models_py3 import ErrorResponse from ._models_py3 import ExportTemplateRequest from ._models_py3 import GenericResource + from ._models_py3 import GenericResourceExpanded from ._models_py3 import GenericResourceFilter from ._models_py3 import HttpMessage from ._models_py3 import Identity @@ -70,6 +71,7 @@ from ._models import ErrorResponse from ._models import ExportTemplateRequest from ._models import GenericResource + from ._models import GenericResourceExpanded from ._models import GenericResourceFilter from ._models import HttpMessage from ._models import Identity @@ -95,7 +97,7 @@ from ._models import TemplateLink from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged -from ._paged_models import GenericResourcePaged +from ._paged_models import GenericResourceExpandedPaged from ._paged_models import ProviderPaged from ._paged_models import ResourceGroupPaged from ._paged_models import TagDetailsPaged @@ -123,6 +125,7 @@ 'ErrorResponse', 'ExportTemplateRequest', 'GenericResource', + 'GenericResourceExpanded', 'GenericResourceFilter', 'HttpMessage', 'Identity', @@ -148,7 +151,7 @@ 'TemplateLink', 'DeploymentExtendedPaged', 'ProviderPaged', - 'GenericResourcePaged', + 'GenericResourceExpandedPaged', 'ResourceGroupPaged', 'TagDetailsPaged', 'DeploymentOperationPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_models.py index d0c7ea3b05fe..b15fbf263556 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_models.py @@ -651,6 +651,78 @@ def __init__(self, **kwargs): self.identity = kwargs.get('identity', None) +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2016_02_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: Id of the resource that manages this resource. + :type managed_by: str + :param sku: The sku of the resource. + :type sku: ~azure.mgmt.resource.resources.v2016_02_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2016_02_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceExpanded, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_models_py3.py index cb01f1f6e4f3..6acccb2d6013 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_models_py3.py @@ -651,6 +651,78 @@ def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, self.identity = identity +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2016_02_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: Id of the resource that manages this resource. + :type managed_by: str + :param sku: The sku of the resource. + :type sku: ~azure.mgmt.resource.resources.v2016_02_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2016_02_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResourceExpanded, self).__init__(location=location, tags=tags, plan=plan, properties=properties, kind=kind, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_paged_models.py index 503ebfa840e7..7d038125f963 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_paged_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_paged_models.py @@ -38,19 +38,19 @@ class ProviderPaged(Paged): def __init__(self, *args, **kwargs): super(ProviderPaged, self).__init__(*args, **kwargs) -class GenericResourcePaged(Paged): +class GenericResourceExpandedPaged(Paged): """ - A paging container for iterating over a list of :class:`GenericResource ` object + A paging container for iterating over a list of :class:`GenericResourceExpanded ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[GenericResource]'} + 'current_page': {'key': 'value', 'type': '[GenericResourceExpanded]'} } def __init__(self, *args, **kwargs): - super(GenericResourcePaged, self).__init__(*args, **kwargs) + super(GenericResourceExpandedPaged, self).__init__(*args, **kwargs) class ResourceGroupPaged(Paged): """ A paging container for iterating over a list of :class:`ResourceGroup ` object diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_resource_groups_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_resource_groups_operations.py index c97ac3add73b..cb0261bf625d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_resource_groups_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_resource_groups_operations.py @@ -50,7 +50,10 @@ def list_resources( :type resource_group_name: str :param filter: The filter to apply on the operation. :type filter: str - :param expand: The $expand query parameter + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: Query parameters. If null is passed returns all resource groups. @@ -60,9 +63,9 @@ def list_resources( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2016_02_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2016_02_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2016_02_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2016_02_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -119,7 +122,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_resources_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_resources_operations.py index 0e77e3c96988..65173414cf16 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_resources_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_resources_operations.py @@ -135,7 +135,10 @@ def list( :param filter: The filter to apply on the operation. :type filter: str - :param expand: The $expand query parameter. + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: Query parameters. If null is passed returns all resource groups. @@ -145,9 +148,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2016_02_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2016_02_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2016_02_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2016_02_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -203,7 +206,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resources'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py index febe5d73ee46..ef78f45062ce 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py @@ -28,6 +28,7 @@ from ._models_py3 import ErrorResponse from ._models_py3 import ExportTemplateRequest from ._models_py3 import GenericResource + from ._models_py3 import GenericResourceExpanded from ._models_py3 import GenericResourceFilter from ._models_py3 import HttpMessage from ._models_py3 import Identity @@ -70,6 +71,7 @@ from ._models import ErrorResponse from ._models import ExportTemplateRequest from ._models import GenericResource + from ._models import GenericResourceExpanded from ._models import GenericResourceFilter from ._models import HttpMessage from ._models import Identity @@ -95,7 +97,7 @@ from ._models import TemplateLink from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged -from ._paged_models import GenericResourcePaged +from ._paged_models import GenericResourceExpandedPaged from ._paged_models import ProviderPaged from ._paged_models import ResourceGroupPaged from ._paged_models import TagDetailsPaged @@ -123,6 +125,7 @@ 'ErrorResponse', 'ExportTemplateRequest', 'GenericResource', + 'GenericResourceExpanded', 'GenericResourceFilter', 'HttpMessage', 'Identity', @@ -148,7 +151,7 @@ 'TemplateLink', 'DeploymentExtendedPaged', 'ProviderPaged', - 'GenericResourcePaged', + 'GenericResourceExpandedPaged', 'ResourceGroupPaged', 'TagDetailsPaged', 'DeploymentOperationPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models.py index 8db1ce3e8cc3..846b25951e64 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models.py @@ -708,6 +708,79 @@ def __init__(self, **kwargs): self.identity = kwargs.get('identity', None) +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2016_09_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2016_09_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2016_09_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceExpanded, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models_py3.py index 44d86a08f7d4..d1ce868e68bf 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models_py3.py @@ -708,6 +708,79 @@ def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, self.identity = identity +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2016_09_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2016_09_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2016_09_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResourceExpanded, self).__init__(location=location, tags=tags, plan=plan, properties=properties, kind=kind, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_paged_models.py index cafbf738c93f..d42ad6c10e64 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_paged_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_paged_models.py @@ -38,19 +38,19 @@ class ProviderPaged(Paged): def __init__(self, *args, **kwargs): super(ProviderPaged, self).__init__(*args, **kwargs) -class GenericResourcePaged(Paged): +class GenericResourceExpandedPaged(Paged): """ - A paging container for iterating over a list of :class:`GenericResource ` object + A paging container for iterating over a list of :class:`GenericResourceExpanded ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[GenericResource]'} + 'current_page': {'key': 'value', 'type': '[GenericResourceExpanded]'} } def __init__(self, *args, **kwargs): - super(GenericResourcePaged, self).__init__(*args, **kwargs) + super(GenericResourceExpandedPaged, self).__init__(*args, **kwargs) class ResourceGroupPaged(Paged): """ A paging container for iterating over a list of :class:`ResourceGroup ` object diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_resource_groups_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_resource_groups_operations.py index 0585164c211f..e512b91d0bd9 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_resource_groups_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_resource_groups_operations.py @@ -50,7 +50,10 @@ def list_resources( :type resource_group_name: str :param filter: The filter to apply on the operation. :type filter: str - :param expand: The $expand query parameter + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resources. @@ -60,9 +63,9 @@ def list_resources( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2016_09_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2016_09_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2016_09_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -119,7 +122,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_resources_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_resources_operations.py index fc92357bb55e..ecdde9ebe7c6 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_resources_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_resources_operations.py @@ -141,7 +141,10 @@ def list( :param filter: The filter to apply on the operation. :type filter: str - :param expand: The $expand query parameter. + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resource groups. @@ -151,9 +154,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2016_09_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2016_09_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2016_09_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -209,7 +212,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resources'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py index 281796ba048c..6d69aa4efb8f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py @@ -28,6 +28,7 @@ from ._models_py3 import ErrorResponse from ._models_py3 import ExportTemplateRequest from ._models_py3 import GenericResource + from ._models_py3 import GenericResourceExpanded from ._models_py3 import GenericResourceFilter from ._models_py3 import HttpMessage from ._models_py3 import Identity @@ -71,6 +72,7 @@ from ._models import ErrorResponse from ._models import ExportTemplateRequest from ._models import GenericResource + from ._models import GenericResourceExpanded from ._models import GenericResourceFilter from ._models import HttpMessage from ._models import Identity @@ -97,7 +99,7 @@ from ._models import TemplateLink from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged -from ._paged_models import GenericResourcePaged +from ._paged_models import GenericResourceExpandedPaged from ._paged_models import ProviderPaged from ._paged_models import ResourceGroupPaged from ._paged_models import TagDetailsPaged @@ -125,6 +127,7 @@ 'ErrorResponse', 'ExportTemplateRequest', 'GenericResource', + 'GenericResourceExpanded', 'GenericResourceFilter', 'HttpMessage', 'Identity', @@ -151,7 +154,7 @@ 'TemplateLink', 'DeploymentExtendedPaged', 'ProviderPaged', - 'GenericResourcePaged', + 'GenericResourceExpandedPaged', 'ResourceGroupPaged', 'TagDetailsPaged', 'DeploymentOperationPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models.py index 9528aa03964a..4ebdb811118d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models.py @@ -708,6 +708,79 @@ def __init__(self, **kwargs): self.identity = kwargs.get('identity', None) +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2017_05_10.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2017_05_10.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2017_05_10.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceExpanded, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models_py3.py index 776d6f11adc3..e453236fb488 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models_py3.py @@ -708,6 +708,79 @@ def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, self.identity = identity +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2017_05_10.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2017_05_10.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2017_05_10.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResourceExpanded, self).__init__(location=location, tags=tags, plan=plan, properties=properties, kind=kind, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_paged_models.py index c5db548048c3..8380256e9902 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_paged_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_paged_models.py @@ -38,19 +38,19 @@ class ProviderPaged(Paged): def __init__(self, *args, **kwargs): super(ProviderPaged, self).__init__(*args, **kwargs) -class GenericResourcePaged(Paged): +class GenericResourceExpandedPaged(Paged): """ - A paging container for iterating over a list of :class:`GenericResource ` object + A paging container for iterating over a list of :class:`GenericResourceExpanded ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[GenericResource]'} + 'current_page': {'key': 'value', 'type': '[GenericResourceExpanded]'} } def __init__(self, *args, **kwargs): - super(GenericResourcePaged, self).__init__(*args, **kwargs) + super(GenericResourceExpandedPaged, self).__init__(*args, **kwargs) class ResourceGroupPaged(Paged): """ A paging container for iterating over a list of :class:`ResourceGroup ` object diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/_resources_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/_resources_operations.py index b8fc219ee38e..eb5c31791467 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/_resources_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/_resources_operations.py @@ -50,7 +50,10 @@ def list_by_resource_group( :type resource_group_name: str :param filter: The filter to apply on the operation. :type filter: str - :param expand: The $expand query parameter + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resources. @@ -60,9 +63,9 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2017_05_10.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource] + ~azure.mgmt.resource.resources.v2017_05_10.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2017_05_10.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -119,7 +122,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'} @@ -321,7 +324,10 @@ def list( :param filter: The filter to apply on the operation. :type filter: str - :param expand: The $expand query parameter. + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resource groups. @@ -331,9 +337,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2017_05_10.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource] + ~azure.mgmt.resource.resources.v2017_05_10.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2017_05_10.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -389,7 +395,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resources'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py index 839715d022c0..ab9bcea6f39e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py @@ -28,6 +28,7 @@ from ._models_py3 import ErrorResponse from ._models_py3 import ExportTemplateRequest from ._models_py3 import GenericResource + from ._models_py3 import GenericResourceExpanded from ._models_py3 import GenericResourceFilter from ._models_py3 import HttpMessage from ._models_py3 import Identity @@ -73,6 +74,7 @@ from ._models import ErrorResponse from ._models import ExportTemplateRequest from ._models import GenericResource + from ._models import GenericResourceExpanded from ._models import GenericResourceFilter from ._models import HttpMessage from ._models import Identity @@ -101,7 +103,7 @@ from ._models import TemplateLink from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged -from ._paged_models import GenericResourcePaged +from ._paged_models import GenericResourceExpandedPaged from ._paged_models import ProviderPaged from ._paged_models import ResourceGroupPaged from ._paged_models import TagDetailsPaged @@ -130,6 +132,7 @@ 'ErrorResponse', 'ExportTemplateRequest', 'GenericResource', + 'GenericResourceExpanded', 'GenericResourceFilter', 'HttpMessage', 'Identity', @@ -158,7 +161,7 @@ 'TemplateLink', 'DeploymentExtendedPaged', 'ProviderPaged', - 'GenericResourcePaged', + 'GenericResourceExpandedPaged', 'ResourceGroupPaged', 'TagDetailsPaged', 'DeploymentOperationPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models.py index 5b4c358857e2..21cbfd150f2c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models.py @@ -718,6 +718,79 @@ def __init__(self, **kwargs): self.identity = kwargs.get('identity', None) +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2018_02_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2018_02_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2018_02_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceExpanded, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models_py3.py index 1b48ca8e5bcd..1664994dabc5 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models_py3.py @@ -718,6 +718,79 @@ def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, self.identity = identity +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2018_02_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2018_02_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2018_02_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResourceExpanded, self).__init__(location=location, tags=tags, plan=plan, properties=properties, kind=kind, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_paged_models.py index 48e171f17ffe..63baad6afdd9 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_paged_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_paged_models.py @@ -38,19 +38,19 @@ class ProviderPaged(Paged): def __init__(self, *args, **kwargs): super(ProviderPaged, self).__init__(*args, **kwargs) -class GenericResourcePaged(Paged): +class GenericResourceExpandedPaged(Paged): """ - A paging container for iterating over a list of :class:`GenericResource ` object + A paging container for iterating over a list of :class:`GenericResourceExpanded ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[GenericResource]'} + 'current_page': {'key': 'value', 'type': '[GenericResourceExpanded]'} } def __init__(self, *args, **kwargs): - super(GenericResourcePaged, self).__init__(*args, **kwargs) + super(GenericResourceExpandedPaged, self).__init__(*args, **kwargs) class ResourceGroupPaged(Paged): """ A paging container for iterating over a list of :class:`ResourceGroup ` object diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/_resources_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/_resources_operations.py index 2174bf4fde31..4a473e543e23 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/_resources_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/_resources_operations.py @@ -50,7 +50,10 @@ def list_by_resource_group( :type resource_group_name: str :param filter: The filter to apply on the operation. :type filter: str - :param expand: The $expand query parameter + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resources. @@ -60,9 +63,9 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2018_02_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -119,7 +122,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'} @@ -331,9 +334,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2018_02_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -389,7 +392,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resources'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py index 5c2c9e84d26d..a4e62c5bf265 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py @@ -28,6 +28,7 @@ from ._models_py3 import ErrorResponse from ._models_py3 import ExportTemplateRequest from ._models_py3 import GenericResource + from ._models_py3 import GenericResourceExpanded from ._models_py3 import GenericResourceFilter from ._models_py3 import HttpMessage from ._models_py3 import Identity @@ -76,6 +77,7 @@ from ._models import ErrorResponse from ._models import ExportTemplateRequest from ._models import GenericResource + from ._models import GenericResourceExpanded from ._models import GenericResourceFilter from ._models import HttpMessage from ._models import Identity @@ -107,7 +109,7 @@ from ._models import TemplateLink from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged -from ._paged_models import GenericResourcePaged +from ._paged_models import GenericResourceExpandedPaged from ._paged_models import OperationPaged from ._paged_models import ProviderPaged from ._paged_models import ResourceGroupPaged @@ -137,6 +139,7 @@ 'ErrorResponse', 'ExportTemplateRequest', 'GenericResource', + 'GenericResourceExpanded', 'GenericResourceFilter', 'HttpMessage', 'Identity', @@ -169,7 +172,7 @@ 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', - 'GenericResourcePaged', + 'GenericResourceExpandedPaged', 'ResourceGroupPaged', 'TagDetailsPaged', 'DeploymentOperationPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models.py index 80b0b3fa6e92..c565a95fcc69 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models.py @@ -729,6 +729,79 @@ def __init__(self, **kwargs): self.identity = kwargs.get('identity', None) +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2018_05_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2018_05_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2018_05_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceExpanded, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models_py3.py index 0916a1b641ea..737862b6abbd 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models_py3.py @@ -729,6 +729,79 @@ def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, self.identity = identity +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2018_05_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2018_05_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2018_05_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResourceExpanded, self).__init__(location=location, tags=tags, plan=plan, properties=properties, kind=kind, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_paged_models.py index 03bd023d6998..4acf24aa6cab 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_paged_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_paged_models.py @@ -51,19 +51,19 @@ class ProviderPaged(Paged): def __init__(self, *args, **kwargs): super(ProviderPaged, self).__init__(*args, **kwargs) -class GenericResourcePaged(Paged): +class GenericResourceExpandedPaged(Paged): """ - A paging container for iterating over a list of :class:`GenericResource ` object + A paging container for iterating over a list of :class:`GenericResourceExpanded ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[GenericResource]'} + 'current_page': {'key': 'value', 'type': '[GenericResourceExpanded]'} } def __init__(self, *args, **kwargs): - super(GenericResourcePaged, self).__init__(*args, **kwargs) + super(GenericResourceExpandedPaged, self).__init__(*args, **kwargs) class ResourceGroupPaged(Paged): """ A paging container for iterating over a list of :class:`ResourceGroup ` object diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/_resources_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/_resources_operations.py index f848d737bd5c..edd55c270374 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/_resources_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/_resources_operations.py @@ -67,9 +67,10 @@ def list_by_resource_group( plan and plan/publisher and plan/name, identity and identity/principalId. :type filter: str - :param expand: The $expand query parameter. You can expand createdTime - and changedTime. For example, to expand both properties, use - $expand=changedTime,createdTime + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resources. @@ -79,9 +80,9 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2018_05_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2018_05_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2018_05_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2018_05_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -138,7 +139,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'} @@ -357,9 +358,10 @@ def list( plan and plan/publisher and plan/name, identity and identity/principalId. :type filter: str - :param expand: The $expand query parameter. You can expand createdTime - and changedTime. For example, to expand both properties, use - $expand=changedTime,createdTime + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resource groups. @@ -369,9 +371,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2018_05_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2018_05_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2018_05_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2018_05_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -427,7 +429,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resources'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/__init__.py index 5c2c9e84d26d..a4e62c5bf265 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/__init__.py @@ -28,6 +28,7 @@ from ._models_py3 import ErrorResponse from ._models_py3 import ExportTemplateRequest from ._models_py3 import GenericResource + from ._models_py3 import GenericResourceExpanded from ._models_py3 import GenericResourceFilter from ._models_py3 import HttpMessage from ._models_py3 import Identity @@ -76,6 +77,7 @@ from ._models import ErrorResponse from ._models import ExportTemplateRequest from ._models import GenericResource + from ._models import GenericResourceExpanded from ._models import GenericResourceFilter from ._models import HttpMessage from ._models import Identity @@ -107,7 +109,7 @@ from ._models import TemplateLink from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged -from ._paged_models import GenericResourcePaged +from ._paged_models import GenericResourceExpandedPaged from ._paged_models import OperationPaged from ._paged_models import ProviderPaged from ._paged_models import ResourceGroupPaged @@ -137,6 +139,7 @@ 'ErrorResponse', 'ExportTemplateRequest', 'GenericResource', + 'GenericResourceExpanded', 'GenericResourceFilter', 'HttpMessage', 'Identity', @@ -169,7 +172,7 @@ 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', - 'GenericResourcePaged', + 'GenericResourceExpandedPaged', 'ResourceGroupPaged', 'TagDetailsPaged', 'DeploymentOperationPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models.py index f513b472247f..95c097dda8dd 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models.py @@ -739,6 +739,79 @@ def __init__(self, **kwargs): self.identity = kwargs.get('identity', None) +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2019_05_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2019_05_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2019_05_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceExpanded, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models_py3.py index 0bf082618dd9..242c8e9a858d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models_py3.py @@ -739,6 +739,79 @@ def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, self.identity = identity +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2019_05_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2019_05_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2019_05_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResourceExpanded, self).__init__(location=location, tags=tags, plan=plan, properties=properties, kind=kind, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_paged_models.py index d62c78b76495..1a6e6a84b46c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_paged_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_paged_models.py @@ -51,19 +51,19 @@ class ProviderPaged(Paged): def __init__(self, *args, **kwargs): super(ProviderPaged, self).__init__(*args, **kwargs) -class GenericResourcePaged(Paged): +class GenericResourceExpandedPaged(Paged): """ - A paging container for iterating over a list of :class:`GenericResource ` object + A paging container for iterating over a list of :class:`GenericResourceExpanded ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[GenericResource]'} + 'current_page': {'key': 'value', 'type': '[GenericResourceExpanded]'} } def __init__(self, *args, **kwargs): - super(GenericResourcePaged, self).__init__(*args, **kwargs) + super(GenericResourceExpandedPaged, self).__init__(*args, **kwargs) class ResourceGroupPaged(Paged): """ A paging container for iterating over a list of :class:`ResourceGroup ` object diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_resources_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_resources_operations.py index 2e72aa97762b..21b94a1a4edf 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_resources_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_resources_operations.py @@ -67,9 +67,10 @@ def list_by_resource_group( plan and plan/publisher and plan/name, identity and identity/principalId. :type filter: str - :param expand: The $expand query parameter. You can expand createdTime - and changedTime. For example, to expand both properties, use - $expand=changedTime,createdTime + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resources. @@ -79,9 +80,9 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2019_05_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2019_05_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2019_05_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2019_05_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -138,7 +139,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'} @@ -357,9 +358,10 @@ def list( plan and plan/publisher and plan/name, identity and identity/principalId. :type filter: str - :param expand: The $expand query parameter. You can expand createdTime - and changedTime. For example, to expand both properties, use - $expand=changedTime,createdTime + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resource groups. @@ -369,9 +371,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2019_05_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2019_05_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2019_05_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2019_05_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -427,7 +429,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resources'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/__init__.py index 5c2c9e84d26d..a4e62c5bf265 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/__init__.py @@ -28,6 +28,7 @@ from ._models_py3 import ErrorResponse from ._models_py3 import ExportTemplateRequest from ._models_py3 import GenericResource + from ._models_py3 import GenericResourceExpanded from ._models_py3 import GenericResourceFilter from ._models_py3 import HttpMessage from ._models_py3 import Identity @@ -76,6 +77,7 @@ from ._models import ErrorResponse from ._models import ExportTemplateRequest from ._models import GenericResource + from ._models import GenericResourceExpanded from ._models import GenericResourceFilter from ._models import HttpMessage from ._models import Identity @@ -107,7 +109,7 @@ from ._models import TemplateLink from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged -from ._paged_models import GenericResourcePaged +from ._paged_models import GenericResourceExpandedPaged from ._paged_models import OperationPaged from ._paged_models import ProviderPaged from ._paged_models import ResourceGroupPaged @@ -137,6 +139,7 @@ 'ErrorResponse', 'ExportTemplateRequest', 'GenericResource', + 'GenericResourceExpanded', 'GenericResourceFilter', 'HttpMessage', 'Identity', @@ -169,7 +172,7 @@ 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', - 'GenericResourcePaged', + 'GenericResourceExpandedPaged', 'ResourceGroupPaged', 'TagDetailsPaged', 'DeploymentOperationPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models.py index 6cd2ab2236a4..e45064cd70a9 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models.py @@ -739,6 +739,79 @@ def __init__(self, **kwargs): self.identity = kwargs.get('identity', None) +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2019_05_10.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2019_05_10.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2019_05_10.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceExpanded, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models_py3.py index 175e45e5c745..8152c7a3c4dc 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models_py3.py @@ -739,6 +739,79 @@ def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, self.identity = identity +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2019_05_10.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2019_05_10.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2019_05_10.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResourceExpanded, self).__init__(location=location, tags=tags, plan=plan, properties=properties, kind=kind, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_paged_models.py index 4ae700ef7baa..1e2a6f61155f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_paged_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_paged_models.py @@ -51,19 +51,19 @@ class ProviderPaged(Paged): def __init__(self, *args, **kwargs): super(ProviderPaged, self).__init__(*args, **kwargs) -class GenericResourcePaged(Paged): +class GenericResourceExpandedPaged(Paged): """ - A paging container for iterating over a list of :class:`GenericResource ` object + A paging container for iterating over a list of :class:`GenericResourceExpanded ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[GenericResource]'} + 'current_page': {'key': 'value', 'type': '[GenericResourceExpanded]'} } def __init__(self, *args, **kwargs): - super(GenericResourcePaged, self).__init__(*args, **kwargs) + super(GenericResourceExpandedPaged, self).__init__(*args, **kwargs) class ResourceGroupPaged(Paged): """ A paging container for iterating over a list of :class:`ResourceGroup ` object diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/_resources_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/_resources_operations.py index d5c8f0247077..ac86f11d499c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/_resources_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/_resources_operations.py @@ -67,9 +67,10 @@ def list_by_resource_group( plan and plan/publisher and plan/name, identity and identity/principalId. :type filter: str - :param expand: The $expand query parameter. You can expand createdTime - and changedTime. For example, to expand both properties, use - $expand=changedTime,createdTime + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resources. @@ -79,9 +80,9 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2019_05_10.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2019_05_10.models.GenericResource] + ~azure.mgmt.resource.resources.v2019_05_10.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2019_05_10.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -138,7 +139,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'} @@ -357,9 +358,10 @@ def list( plan and plan/publisher and plan/name, identity and identity/principalId. :type filter: str - :param expand: The $expand query parameter. You can expand createdTime - and changedTime. For example, to expand both properties, use - $expand=changedTime,createdTime + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resource groups. @@ -369,9 +371,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2019_05_10.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2019_05_10.models.GenericResource] + ~azure.mgmt.resource.resources.v2019_05_10.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2019_05_10.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -427,7 +429,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resources'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/__init__.py index 7f71f20a961b..2f02c0c85ca9 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/__init__.py @@ -31,6 +31,7 @@ from ._models_py3 import ErrorResponse from ._models_py3 import ExportTemplateRequest from ._models_py3 import GenericResource + from ._models_py3 import GenericResourceExpanded from ._models_py3 import GenericResourceFilter from ._models_py3 import HttpMessage from ._models_py3 import Identity @@ -84,6 +85,7 @@ from ._models import ErrorResponse from ._models import ExportTemplateRequest from ._models import GenericResource + from ._models import GenericResourceExpanded from ._models import GenericResourceFilter from ._models import HttpMessage from ._models import Identity @@ -117,7 +119,7 @@ from ._models import WhatIfPropertyChange from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged -from ._paged_models import GenericResourcePaged +from ._paged_models import GenericResourceExpandedPaged from ._paged_models import OperationPaged from ._paged_models import ProviderPaged from ._paged_models import ResourceGroupPaged @@ -153,6 +155,7 @@ 'ErrorResponse', 'ExportTemplateRequest', 'GenericResource', + 'GenericResourceExpanded', 'GenericResourceFilter', 'HttpMessage', 'Identity', @@ -187,7 +190,7 @@ 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', - 'GenericResourcePaged', + 'GenericResourceExpandedPaged', 'ResourceGroupPaged', 'TagDetailsPaged', 'DeploymentOperationPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models.py index 677e68e9faa5..a90e7c58d108 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models.py @@ -851,6 +851,79 @@ def __init__(self, **kwargs): self.identity = kwargs.get('identity', None) +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2019_07_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2019_07_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2019_07_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceExpanded, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models_py3.py index 0b166a7fb6bb..496b687ba762 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models_py3.py @@ -851,6 +851,79 @@ def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, self.identity = identity +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2019_07_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2019_07_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2019_07_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResourceExpanded, self).__init__(location=location, tags=tags, plan=plan, properties=properties, kind=kind, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_paged_models.py index 98abbb83e22a..dc02350ae2bb 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_paged_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_paged_models.py @@ -51,19 +51,19 @@ class ProviderPaged(Paged): def __init__(self, *args, **kwargs): super(ProviderPaged, self).__init__(*args, **kwargs) -class GenericResourcePaged(Paged): +class GenericResourceExpandedPaged(Paged): """ - A paging container for iterating over a list of :class:`GenericResource ` object + A paging container for iterating over a list of :class:`GenericResourceExpanded ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[GenericResource]'} + 'current_page': {'key': 'value', 'type': '[GenericResourceExpanded]'} } def __init__(self, *args, **kwargs): - super(GenericResourcePaged, self).__init__(*args, **kwargs) + super(GenericResourceExpandedPaged, self).__init__(*args, **kwargs) class ResourceGroupPaged(Paged): """ A paging container for iterating over a list of :class:`ResourceGroup ` object diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/_resources_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/_resources_operations.py index 693da52a5f35..855b603dc10a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/_resources_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/_resources_operations.py @@ -67,9 +67,10 @@ def list_by_resource_group( plan and plan/publisher and plan/name, identity and identity/principalId. :type filter: str - :param expand: The $expand query parameter. You can expand createdTime - and changedTime. For example, to expand both properties, use - $expand=changedTime,createdTime + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resources. @@ -79,9 +80,9 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2019_07_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2019_07_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2019_07_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2019_07_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -138,7 +139,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'} @@ -357,9 +358,10 @@ def list( plan and plan/publisher and plan/name, identity and identity/principalId. :type filter: str - :param expand: The $expand query parameter. You can expand createdTime - and changedTime. For example, to expand both properties, use - $expand=changedTime,createdTime + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resource groups. @@ -369,9 +371,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2019_07_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2019_07_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2019_07_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2019_07_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -427,7 +429,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resources'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/__init__.py index bee7b2ee4105..1b7c3ec2fdd3 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/__init__.py @@ -31,6 +31,7 @@ from ._models_py3 import ErrorResponse from ._models_py3 import ExportTemplateRequest from ._models_py3 import GenericResource + from ._models_py3 import GenericResourceExpanded from ._models_py3 import GenericResourceFilter from ._models_py3 import HttpMessage from ._models_py3 import Identity @@ -85,6 +86,7 @@ from ._models import ErrorResponse from ._models import ExportTemplateRequest from ._models import GenericResource + from ._models import GenericResourceExpanded from ._models import GenericResourceFilter from ._models import HttpMessage from ._models import Identity @@ -119,7 +121,7 @@ from ._models import WhatIfPropertyChange from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged -from ._paged_models import GenericResourcePaged +from ._paged_models import GenericResourceExpandedPaged from ._paged_models import OperationPaged from ._paged_models import ProviderPaged from ._paged_models import ResourceGroupPaged @@ -155,6 +157,7 @@ 'ErrorResponse', 'ExportTemplateRequest', 'GenericResource', + 'GenericResourceExpanded', 'GenericResourceFilter', 'HttpMessage', 'Identity', @@ -190,7 +193,7 @@ 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', - 'GenericResourcePaged', + 'GenericResourceExpandedPaged', 'ResourceGroupPaged', 'TagDetailsPaged', 'DeploymentOperationPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models.py index 626f842725b3..795db659f2b6 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models.py @@ -851,6 +851,79 @@ def __init__(self, **kwargs): self.identity = kwargs.get('identity', None) +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2019_08_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2019_08_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2019_08_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceExpanded, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models_py3.py index aaac8bcaffd6..3c9993b1d39b 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models_py3.py @@ -851,6 +851,79 @@ def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, self.identity = identity +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2019_08_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2019_08_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2019_08_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResourceExpanded, self).__init__(location=location, tags=tags, plan=plan, properties=properties, kind=kind, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_paged_models.py index 97ee608ecbc1..b254e60921b9 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_paged_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_paged_models.py @@ -51,19 +51,19 @@ class ProviderPaged(Paged): def __init__(self, *args, **kwargs): super(ProviderPaged, self).__init__(*args, **kwargs) -class GenericResourcePaged(Paged): +class GenericResourceExpandedPaged(Paged): """ - A paging container for iterating over a list of :class:`GenericResource ` object + A paging container for iterating over a list of :class:`GenericResourceExpanded ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[GenericResource]'} + 'current_page': {'key': 'value', 'type': '[GenericResourceExpanded]'} } def __init__(self, *args, **kwargs): - super(GenericResourcePaged, self).__init__(*args, **kwargs) + super(GenericResourceExpandedPaged, self).__init__(*args, **kwargs) class ResourceGroupPaged(Paged): """ A paging container for iterating over a list of :class:`ResourceGroup ` object diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_resources_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_resources_operations.py index 3afe6c9f44bd..9d601c73063e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_resources_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_resources_operations.py @@ -68,9 +68,10 @@ def list_by_resource_group( resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. :type filter: str - :param expand: The $expand query parameter. You can expand createdTime - and changedTime. For example, to expand both properties, use - $expand=changedTime,createdTime + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resources. @@ -80,9 +81,9 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -139,7 +140,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'} @@ -359,9 +360,10 @@ def list( resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. :type filter: str - :param expand: The $expand query parameter. You can expand createdTime - and changedTime. For example, to expand both properties, use - $expand=changedTime,createdTime + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resource groups. @@ -371,9 +373,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -429,7 +431,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resources'} 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..fdb12bcf9dc4 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 @@ -31,6 +31,7 @@ from ._models_py3 import ErrorResponse from ._models_py3 import ExportTemplateRequest from ._models_py3 import GenericResource + from ._models_py3 import GenericResourceExpanded from ._models_py3 import GenericResourceFilter from ._models_py3 import HttpMessage from ._models_py3 import Identity @@ -50,14 +51,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 @@ -88,6 +90,7 @@ from ._models import ErrorResponse from ._models import ExportTemplateRequest from ._models import GenericResource + from ._models import GenericResourceExpanded from ._models import GenericResourceFilter from ._models import HttpMessage from ._models import Identity @@ -107,14 +110,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 @@ -125,7 +129,7 @@ from ._models import WhatIfPropertyChange from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged -from ._paged_models import GenericResourcePaged +from ._paged_models import GenericResourceExpandedPaged from ._paged_models import OperationPaged from ._paged_models import ProviderPaged from ._paged_models import ResourceGroupPaged @@ -161,6 +165,7 @@ 'ErrorResponse', 'ExportTemplateRequest', 'GenericResource', + 'GenericResourceExpanded', 'GenericResourceFilter', 'HttpMessage', 'Identity', @@ -180,14 +185,15 @@ 'ResourceGroupPatchable', 'ResourceGroupProperties', 'ResourceProviderOperationDisplayProperties', + 'ResourceReference', 'ResourcesMoveInfo', 'ScopedDeployment', 'Sku', 'SubResource', 'TagCount', 'TagDetails', - 'TagPatchRequest', 'Tags', + 'TagsPatchResource', 'TagsResource', 'TagValue', 'TargetResource', @@ -199,7 +205,7 @@ 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', - 'GenericResourcePaged', + 'GenericResourceExpandedPaged', 'ResourceGroupPaged', 'TagDetailsPaged', 'DeploymentOperationPaged', 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..f6b10b7e8dd4 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 @@ -168,6 +168,8 @@ class Deployment(Model): :param properties: Required. The deployment properties. :type properties: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentProperties + :param tags: Deployment tags + :type tags: dict[str, str] """ _validation = { @@ -177,12 +179,14 @@ class Deployment(Model): _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__(self, **kwargs): super(Deployment, self).__init__(**kwargs) self.location = kwargs.get('location', None) self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) class DeploymentExportResult(Model): @@ -218,6 +222,8 @@ class DeploymentExtended(Model): :param properties: Deployment properties. :type properties: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentPropertiesExtended + :param tags: Deployment tags + :type tags: dict[str, str] """ _validation = { @@ -232,6 +238,7 @@ class DeploymentExtended(Model): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__(self, **kwargs): @@ -241,6 +248,7 @@ def __init__(self, **kwargs): self.type = None self.location = kwargs.get('location', None) self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) class DeploymentExtendedFilter(Model): @@ -441,39 +449,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 +493,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 +516,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 +534,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 +574,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) @@ -851,6 +889,79 @@ def __init__(self, **kwargs): self.identity = kwargs.get('identity', None) +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2019_10_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2019_10_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2019_10_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceExpanded, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. @@ -1393,6 +1504,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. @@ -1423,6 +1557,8 @@ class ScopedDeployment(Model): :param properties: Required. The deployment properties. :type properties: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentProperties + :param tags: Deployment tags + :type tags: dict[str, str] """ _validation = { @@ -1433,12 +1569,14 @@ class ScopedDeployment(Model): _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__(self, **kwargs): super(ScopedDeployment, self).__init__(**kwargs) self.location = kwargs.get('location', None) self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) class Sku(Model): @@ -1519,7 +1657,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 +1689,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 +1756,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 +1773,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..bd35d4c93eb9 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 @@ -168,6 +168,8 @@ class Deployment(Model): :param properties: Required. The deployment properties. :type properties: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentProperties + :param tags: Deployment tags + :type tags: dict[str, str] """ _validation = { @@ -177,12 +179,14 @@ class Deployment(Model): _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, properties, location: str=None, **kwargs) -> None: + def __init__(self, *, properties, location: str=None, tags=None, **kwargs) -> None: super(Deployment, self).__init__(**kwargs) self.location = location self.properties = properties + self.tags = tags class DeploymentExportResult(Model): @@ -218,6 +222,8 @@ class DeploymentExtended(Model): :param properties: Deployment properties. :type properties: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentPropertiesExtended + :param tags: Deployment tags + :type tags: dict[str, str] """ _validation = { @@ -232,15 +238,17 @@ class DeploymentExtended(Model): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str=None, properties=None, **kwargs) -> None: + def __init__(self, *, location: str=None, properties=None, tags=None, **kwargs) -> None: super(DeploymentExtended, self).__init__(**kwargs) self.id = None self.name = None self.type = None self.location = location self.properties = properties + self.tags = tags class DeploymentExtendedFilter(Model): @@ -441,39 +449,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 +493,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 +516,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 @@ -851,6 +889,79 @@ def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, self.identity = identity +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2019_10_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2019_10_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2019_10_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResourceExpanded, self).__init__(location=location, tags=tags, plan=plan, properties=properties, kind=kind, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + class GenericResourceFilter(Model): """Resource filter. @@ -1393,6 +1504,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. @@ -1423,6 +1557,8 @@ class ScopedDeployment(Model): :param properties: Required. The deployment properties. :type properties: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentProperties + :param tags: Deployment tags + :type tags: dict[str, str] """ _validation = { @@ -1433,12 +1569,14 @@ class ScopedDeployment(Model): _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, properties, **kwargs) -> None: + def __init__(self, *, location: str, properties, tags=None, **kwargs) -> None: super(ScopedDeployment, self).__init__(**kwargs) self.location = location self.properties = properties + self.tags = tags class Sku(Model): @@ -1519,7 +1657,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 +1689,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] + """ + + _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 + :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 +1722,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 +1756,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 +1773,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/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_paged_models.py index c5bc154746e3..8df0d703591e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_paged_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_paged_models.py @@ -51,19 +51,19 @@ class ProviderPaged(Paged): def __init__(self, *args, **kwargs): super(ProviderPaged, self).__init__(*args, **kwargs) -class GenericResourcePaged(Paged): +class GenericResourceExpandedPaged(Paged): """ - A paging container for iterating over a list of :class:`GenericResource ` object + A paging container for iterating over a list of :class:`GenericResourceExpanded ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[GenericResource]'} + 'current_page': {'key': 'value', 'type': '[GenericResourceExpanded]'} } def __init__(self, *args, **kwargs): - super(GenericResourcePaged, self).__init__(*args, **kwargs) + super(GenericResourceExpandedPaged, self).__init__(*args, **kwargs) class ResourceGroupPaged(Paged): """ A paging container for iterating over a list of :class:`ResourceGroup ` object diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_deployments_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_deployments_operations.py index cda0d0a582f8..c7fcd071377a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_deployments_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_deployments_operations.py @@ -186,9 +186,7 @@ def check_existence_at_scope( def _create_or_update_at_scope_initial( - self, scope, deployment_name, properties, location=None, custom_headers=None, raw=False, **operation_config): - parameters = models.Deployment(location=location, properties=properties) - + self, scope, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update_at_scope.metadata['url'] path_format_arguments = { @@ -238,7 +236,7 @@ def _create_or_update_at_scope_initial( return deserialized def create_or_update_at_scope( - self, scope, deployment_name, properties, location=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, scope, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Deploys resources at a given scope. You can provide the template and parameters directly in the request or @@ -248,11 +246,9 @@ def create_or_update_at_scope( :type scope: str :param deployment_name: The name of the deployment. :type deployment_name: str - :param properties: The deployment properties. - :type properties: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentProperties - :param location: The location to store the deployment data. - :type location: str + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.Deployment :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -269,8 +265,7 @@ def create_or_update_at_scope( raw_result = self._create_or_update_at_scope_initial( scope=scope, deployment_name=deployment_name, - properties=properties, - location=location, + parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config @@ -414,7 +409,7 @@ def cancel_at_scope( cancel_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} def validate_at_scope( - self, scope, deployment_name, properties, location=None, custom_headers=None, raw=False, **operation_config): + self, scope, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): """Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. @@ -422,11 +417,9 @@ def validate_at_scope( :type scope: str :param deployment_name: The name of the deployment. :type deployment_name: str - :param properties: The deployment properties. - :type properties: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentProperties - :param location: The location to store the deployment data. - :type location: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.Deployment :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -438,8 +431,6 @@ def validate_at_scope( or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.Deployment(location=location, properties=properties) - # Construct URL url = self.validate_at_scope.metadata['url'] path_format_arguments = { @@ -765,9 +756,7 @@ def check_existence_at_tenant_scope( def _create_or_update_at_tenant_scope_initial( - self, deployment_name, location, properties, custom_headers=None, raw=False, **operation_config): - parameters = models.ScopedDeployment(location=location, properties=properties) - + self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update_at_tenant_scope.metadata['url'] path_format_arguments = { @@ -816,7 +805,7 @@ def _create_or_update_at_tenant_scope_initial( return deserialized def create_or_update_at_tenant_scope( - self, deployment_name, location, properties, custom_headers=None, raw=False, polling=True, **operation_config): + self, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Deploys resources at tenant scope. You can provide the template and parameters directly in the request or @@ -824,11 +813,9 @@ def create_or_update_at_tenant_scope( :param deployment_name: The name of the deployment. :type deployment_name: str - :param location: The location to store the deployment data. - :type location: str - :param properties: The deployment properties. - :type properties: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentProperties + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.ScopedDeployment :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -844,8 +831,7 @@ def create_or_update_at_tenant_scope( """ raw_result = self._create_or_update_at_tenant_scope_initial( deployment_name=deployment_name, - location=location, - properties=properties, + parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config @@ -983,17 +969,15 @@ def cancel_at_tenant_scope( cancel_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} def validate_at_tenant_scope( - self, deployment_name, location, properties, custom_headers=None, raw=False, **operation_config): + self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): """Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. :param deployment_name: The name of the deployment. :type deployment_name: str - :param location: The location to store the deployment data. - :type location: str - :param properties: The deployment properties. - :type properties: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentProperties + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.ScopedDeployment :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -1005,8 +989,6 @@ def validate_at_tenant_scope( or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.ScopedDeployment(location=location, properties=properties) - # Construct URL url = self.validate_at_tenant_scope.metadata['url'] path_format_arguments = { @@ -1329,9 +1311,7 @@ def check_existence_at_management_group_scope( def _create_or_update_at_management_group_scope_initial( - self, group_id, deployment_name, location, properties, custom_headers=None, raw=False, **operation_config): - parameters = models.ScopedDeployment(location=location, properties=properties) - + self, group_id, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update_at_management_group_scope.metadata['url'] path_format_arguments = { @@ -1381,7 +1361,7 @@ def _create_or_update_at_management_group_scope_initial( return deserialized def create_or_update_at_management_group_scope( - self, group_id, deployment_name, location, properties, custom_headers=None, raw=False, polling=True, **operation_config): + self, group_id, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Deploys resources at management group scope. You can provide the template and parameters directly in the request or @@ -1391,11 +1371,9 @@ def create_or_update_at_management_group_scope( :type group_id: str :param deployment_name: The name of the deployment. :type deployment_name: str - :param location: The location to store the deployment data. - :type location: str - :param properties: The deployment properties. - :type properties: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentProperties + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.ScopedDeployment :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -1412,8 +1390,7 @@ def create_or_update_at_management_group_scope( raw_result = self._create_or_update_at_management_group_scope_initial( group_id=group_id, deployment_name=deployment_name, - location=location, - properties=properties, + parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config @@ -1557,7 +1534,7 @@ def cancel_at_management_group_scope( cancel_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} def validate_at_management_group_scope( - self, group_id, deployment_name, location, properties, custom_headers=None, raw=False, **operation_config): + self, group_id, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): """Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. @@ -1565,11 +1542,9 @@ def validate_at_management_group_scope( :type group_id: str :param deployment_name: The name of the deployment. :type deployment_name: str - :param location: The location to store the deployment data. - :type location: str - :param properties: The deployment properties. - :type properties: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentProperties + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.ScopedDeployment :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -1581,8 +1556,6 @@ def validate_at_management_group_scope( or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.ScopedDeployment(location=location, properties=properties) - # Construct URL url = self.validate_at_management_group_scope.metadata['url'] path_format_arguments = { @@ -1910,9 +1883,7 @@ def check_existence_at_subscription_scope( def _create_or_update_at_subscription_scope_initial( - self, deployment_name, properties, location=None, custom_headers=None, raw=False, **operation_config): - parameters = models.Deployment(location=location, properties=properties) - + self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update_at_subscription_scope.metadata['url'] path_format_arguments = { @@ -1962,7 +1933,7 @@ def _create_or_update_at_subscription_scope_initial( return deserialized def create_or_update_at_subscription_scope( - self, deployment_name, properties, location=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Deploys resources at subscription scope. You can provide the template and parameters directly in the request or @@ -1970,11 +1941,9 @@ def create_or_update_at_subscription_scope( :param deployment_name: The name of the deployment. :type deployment_name: str - :param properties: The deployment properties. - :type properties: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentProperties - :param location: The location to store the deployment data. - :type location: str + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.Deployment :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -1990,8 +1959,7 @@ def create_or_update_at_subscription_scope( """ raw_result = self._create_or_update_at_subscription_scope_initial( deployment_name=deployment_name, - properties=properties, - location=location, + parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config @@ -2131,17 +2099,15 @@ def cancel_at_subscription_scope( cancel_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} def validate_at_subscription_scope( - self, deployment_name, properties, location=None, custom_headers=None, raw=False, **operation_config): + self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): """Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. :param deployment_name: The name of the deployment. :type deployment_name: str - :param properties: The deployment properties. - :type properties: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentProperties - :param location: The location to store the deployment data. - :type location: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.Deployment :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -2153,8 +2119,6 @@ def validate_at_subscription_scope( or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.Deployment(location=location, properties=properties) - # Construct URL url = self.validate_at_subscription_scope.metadata['url'] path_format_arguments = { @@ -2602,9 +2566,7 @@ def check_existence( def _create_or_update_initial( - self, resource_group_name, deployment_name, properties, location=None, custom_headers=None, raw=False, **operation_config): - parameters = models.Deployment(location=location, properties=properties) - + self, resource_group_name, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -2655,7 +2617,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, deployment_name, properties, location=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Deploys resources to a resource group. You can provide the template and parameters directly in the request or @@ -2667,11 +2629,9 @@ def create_or_update( :type resource_group_name: str :param deployment_name: The name of the deployment. :type deployment_name: str - :param properties: The deployment properties. - :type properties: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentProperties - :param location: The location to store the deployment data. - :type location: str + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.Deployment :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -2688,8 +2648,7 @@ def create_or_update( raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, deployment_name=deployment_name, - properties=properties, - location=location, + parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config @@ -2837,7 +2796,7 @@ def cancel( cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} def validate( - self, resource_group_name, deployment_name, properties, location=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): """Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. @@ -2846,11 +2805,9 @@ def validate( :type resource_group_name: str :param deployment_name: The name of the deployment. :type deployment_name: str - :param properties: The deployment properties. - :type properties: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentProperties - :param location: The location to store the deployment data. - :type location: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.Deployment :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -2862,8 +2819,6 @@ def validate( or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.Deployment(location=location, properties=properties) - # Construct URL url = self.validate.metadata['url'] path_format_arguments = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_resources_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_resources_operations.py index 59684264f898..f763439d1ef9 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_resources_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_resources_operations.py @@ -68,9 +68,10 @@ def list_by_resource_group( resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. :type filter: str - :param expand: The $expand query parameter. You can expand createdTime - and changedTime. For example, to expand both properties, use - $expand=changedTime,createdTime + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resources. @@ -80,9 +81,9 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2019_10_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2019_10_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2019_10_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2019_10_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -139,7 +140,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'} @@ -359,9 +360,10 @@ def list( resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. :type filter: str - :param expand: The $expand query parameter. You can expand createdTime - and changedTime. For example, to expand both properties, use - $expand=changedTime,createdTime + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. :type expand: str :param top: The number of results to return. If null is passed, returns all resource groups. @@ -371,9 +373,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GenericResource + :return: An iterator like instance of GenericResourceExpanded :rtype: - ~azure.mgmt.resource.resources.v2019_10_01.models.GenericResourcePaged[~azure.mgmt.resource.resources.v2019_10_01.models.GenericResource] + ~azure.mgmt.resource.resources.v2019_10_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2019_10_01.models.GenericResourceExpanded] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -429,7 +431,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GenericResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resources'} 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'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_subscription_client.py index f3e3cf240e23..f90f6f82107d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_subscription_client.py @@ -42,7 +42,7 @@ class SubscriptionClient(MultiApiClientMixin, SDKClient): :type profile: azure.profiles.KnownProfiles """ - DEFAULT_API_VERSION = '2019-06-01' + DEFAULT_API_VERSION = '2019-11-01' _PROFILE_TAG = "azure.mgmt.resource.subscriptions.SubscriptionClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -71,6 +71,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2016-06-01: :mod:`v2016_06_01.models` * 2018-06-01: :mod:`v2018_06_01.models` * 2019-06-01: :mod:`v2019_06_01.models` + * 2019-11-01: :mod:`v2019_11_01.models` """ if api_version == '2016-06-01': from .v2016_06_01 import models @@ -81,6 +82,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2019-06-01': from .v2019_06_01 import models return models + elif api_version == '2019-11-01': + from .v2019_11_01 import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) @property @@ -90,6 +94,7 @@ def operations(self): * 2016-06-01: :class:`Operations` * 2018-06-01: :class:`Operations` * 2019-06-01: :class:`Operations` + * 2019-11-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2016-06-01': @@ -98,6 +103,8 @@ def operations(self): from .v2018_06_01.operations import Operations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import Operations as OperationClass + elif api_version == '2019-11-01': + from .v2019_11_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))) @@ -109,6 +116,7 @@ def subscriptions(self): * 2016-06-01: :class:`SubscriptionsOperations` * 2018-06-01: :class:`SubscriptionsOperations` * 2019-06-01: :class:`SubscriptionsOperations` + * 2019-11-01: :class:`SubscriptionsOperations` """ api_version = self._get_api_version('subscriptions') if api_version == '2016-06-01': @@ -117,6 +125,8 @@ def subscriptions(self): from .v2018_06_01.operations import SubscriptionsOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import SubscriptionsOperations as OperationClass + elif api_version == '2019-11-01': + from .v2019_11_01.operations import SubscriptionsOperations 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))) @@ -128,6 +138,7 @@ def tenants(self): * 2016-06-01: :class:`TenantsOperations` * 2018-06-01: :class:`TenantsOperations` * 2019-06-01: :class:`TenantsOperations` + * 2019-11-01: :class:`TenantsOperations` """ api_version = self._get_api_version('tenants') if api_version == '2016-06-01': @@ -136,6 +147,8 @@ def tenants(self): from .v2018_06_01.operations import TenantsOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import TenantsOperations as OperationClass + elif api_version == '2019-11-01': + from .v2019_11_01.operations import TenantsOperations 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/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/models.py index e14bb6e177c2..28ba9b61c72e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/models.py @@ -4,4 +4,4 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from .v2019_06_01.models import * +from .v2019_11_01.models import * diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/_models.py index b57b92b3e465..21ba7cc06de9 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/_models.py @@ -227,6 +227,10 @@ class TenantIdDescription(Model): :ivar tenant_id: The tenant ID. For example, 00000000-0000-0000-0000-000000000000. :vartype tenant_id: str + :ivar country: Country/region name of the address for the tenant. + :vartype country: str + :ivar country_code: Country/region abbreviation for the tenant. + :vartype country_code: str :ivar display_name: The display name of the tenant. :vartype display_name: str :ivar domains: The list of domains for the tenant. @@ -236,6 +240,8 @@ class TenantIdDescription(Model): _validation = { 'id': {'readonly': True}, 'tenant_id': {'readonly': True}, + 'country': {'readonly': True}, + 'country_code': {'readonly': True}, 'display_name': {'readonly': True}, 'domains': {'readonly': True}, } @@ -243,6 +249,8 @@ class TenantIdDescription(Model): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'domains': {'key': 'domains', 'type': '[str]'}, } @@ -251,5 +259,7 @@ def __init__(self, **kwargs): super(TenantIdDescription, self).__init__(**kwargs) self.id = None self.tenant_id = None + self.country = None + self.country_code = None self.display_name = None self.domains = None diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/_models_py3.py index b93102c1b939..b18427d606cc 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/_models_py3.py @@ -227,6 +227,10 @@ class TenantIdDescription(Model): :ivar tenant_id: The tenant ID. For example, 00000000-0000-0000-0000-000000000000. :vartype tenant_id: str + :ivar country: Country/region name of the address for the tenant. + :vartype country: str + :ivar country_code: Country/region abbreviation for the tenant. + :vartype country_code: str :ivar display_name: The display name of the tenant. :vartype display_name: str :ivar domains: The list of domains for the tenant. @@ -236,6 +240,8 @@ class TenantIdDescription(Model): _validation = { 'id': {'readonly': True}, 'tenant_id': {'readonly': True}, + 'country': {'readonly': True}, + 'country_code': {'readonly': True}, 'display_name': {'readonly': True}, 'domains': {'readonly': True}, } @@ -243,6 +249,8 @@ class TenantIdDescription(Model): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'domains': {'key': 'domains', 'type': '[str]'}, } @@ -251,5 +259,7 @@ def __init__(self, **kwargs) -> None: super(TenantIdDescription, self).__init__(**kwargs) self.id = None self.tenant_id = None + self.country = None + self.country_code = None self.display_name = None self.domains = None diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/__init__.py index e9e64cdae349..d7233118a968 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/__init__.py @@ -32,6 +32,7 @@ from ._subscription_client_enums import ( SubscriptionState, SpendingLimit, + TenantCategory, ) __all__ = [ @@ -48,4 +49,5 @@ 'TenantIdDescriptionPaged', 'SubscriptionState', 'SpendingLimit', + 'TenantCategory', ] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_models.py index 17c69ad30ee3..8d63331e9684 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_models.py @@ -256,19 +256,46 @@ class TenantIdDescription(Model): :ivar tenant_id: The tenant ID. For example, 00000000-0000-0000-0000-000000000000. :vartype tenant_id: str + :ivar tenant_category: The tenant category. Possible values include: + 'Home', 'ProjectedBy', 'ManagedBy' + :vartype tenant_category: str or + ~azure.mgmt.resource.subscriptions.v2019_06_01.models.TenantCategory + :ivar country: Country/region name of the address for the tenant. + :vartype country: str + :ivar country_code: Country/region abbreviation for the tenant. + :vartype country_code: str + :ivar display_name: The display name of the tenant. + :vartype display_name: str + :ivar domains: The list of domains for the tenant. + :vartype domains: list[str] """ _validation = { 'id': {'readonly': True}, 'tenant_id': {'readonly': True}, + 'tenant_category': {'readonly': True}, + 'country': {'readonly': True}, + 'country_code': {'readonly': True}, + 'display_name': {'readonly': True}, + 'domains': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'tenant_category': {'key': 'tenantCategory', 'type': 'TenantCategory'}, + 'country': {'key': 'country', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'domains': {'key': 'domains', 'type': '[str]'}, } def __init__(self, **kwargs): super(TenantIdDescription, self).__init__(**kwargs) self.id = None self.tenant_id = None + self.tenant_category = None + self.country = None + self.country_code = None + self.display_name = None + self.domains = None diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_models_py3.py index b58b89764e4b..fa15df1e87e3 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_models_py3.py @@ -256,19 +256,46 @@ class TenantIdDescription(Model): :ivar tenant_id: The tenant ID. For example, 00000000-0000-0000-0000-000000000000. :vartype tenant_id: str + :ivar tenant_category: The tenant category. Possible values include: + 'Home', 'ProjectedBy', 'ManagedBy' + :vartype tenant_category: str or + ~azure.mgmt.resource.subscriptions.v2019_06_01.models.TenantCategory + :ivar country: Country/region name of the address for the tenant. + :vartype country: str + :ivar country_code: Country/region abbreviation for the tenant. + :vartype country_code: str + :ivar display_name: The display name of the tenant. + :vartype display_name: str + :ivar domains: The list of domains for the tenant. + :vartype domains: list[str] """ _validation = { 'id': {'readonly': True}, 'tenant_id': {'readonly': True}, + 'tenant_category': {'readonly': True}, + 'country': {'readonly': True}, + 'country_code': {'readonly': True}, + 'display_name': {'readonly': True}, + 'domains': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'tenant_category': {'key': 'tenantCategory', 'type': 'TenantCategory'}, + 'country': {'key': 'country', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'domains': {'key': 'domains', 'type': '[str]'}, } def __init__(self, **kwargs) -> None: super(TenantIdDescription, self).__init__(**kwargs) self.id = None self.tenant_id = None + self.tenant_category = None + self.country = None + self.country_code = None + self.display_name = None + self.domains = None diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_subscription_client_enums.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_subscription_client_enums.py index bc846c09187b..7def5956d33d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_subscription_client_enums.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_subscription_client_enums.py @@ -26,3 +26,10 @@ class SpendingLimit(str, Enum): on = "On" off = "Off" current_period_off = "CurrentPeriodOff" + + +class TenantCategory(str, Enum): + + home = "Home" + projected_by = "ProjectedBy" + managed_by = "ManagedBy" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/__init__.py new file mode 100644 index 000000000000..399e93fb102f --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._configuration import SubscriptionClientConfiguration +from ._subscription_client import SubscriptionClient +__all__ = ['SubscriptionClient', 'SubscriptionClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_configuration.py new file mode 100644 index 000000000000..935bf662873f --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_configuration.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class SubscriptionClientConfiguration(AzureConfiguration): + """Configuration for SubscriptionClient + 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 str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(SubscriptionClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-resource/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_subscription_client.py new file mode 100644 index 000000000000..7b2d8ff052cc --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_subscription_client.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# 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 ._configuration import SubscriptionClientConfiguration +from .operations import Operations +from .operations import SubscriptionsOperations +from .operations import TenantsOperations +from . import models + + +class SubscriptionClient(SDKClient): + """All resource groups and resources exist within subscriptions. These operation enable you get information about your subscriptions and tenants. A tenant is a dedicated instance of Azure Active Directory (Azure AD) for your organization. + + :ivar config: Configuration for client. + :vartype config: SubscriptionClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.resource.subscriptions.v2019_11_01.operations.Operations + :ivar subscriptions: Subscriptions operations + :vartype subscriptions: azure.mgmt.resource.subscriptions.v2019_11_01.operations.SubscriptionsOperations + :ivar tenants: Tenants operations + :vartype tenants: azure.mgmt.resource.subscriptions.v2019_11_01.operations.TenantsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + self.config = SubscriptionClientConfiguration(credentials, base_url) + super(SubscriptionClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2019-11-01' + 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( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/__init__.py new file mode 100644 index 000000000000..ccb68724c045 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/__init__.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import Location + from ._models_py3 import LocationMetadata + from ._models_py3 import ManagedByTenant + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import PairedRegion + from ._models_py3 import Subscription + from ._models_py3 import SubscriptionPolicies + from ._models_py3 import TenantIdDescription +except (SyntaxError, ImportError): + from ._models import Location + from ._models import LocationMetadata + from ._models import ManagedByTenant + from ._models import Operation + from ._models import OperationDisplay + from ._models import PairedRegion + from ._models import Subscription + from ._models import SubscriptionPolicies + from ._models import TenantIdDescription +from ._paged_models import LocationPaged +from ._paged_models import OperationPaged +from ._paged_models import SubscriptionPaged +from ._paged_models import TenantIdDescriptionPaged +from ._subscription_client_enums import ( + RegionType, + RegionCategory, + SubscriptionState, + SpendingLimit, + TenantCategory, +) + +__all__ = [ + 'Location', + 'LocationMetadata', + 'ManagedByTenant', + 'Operation', + 'OperationDisplay', + 'PairedRegion', + 'Subscription', + 'SubscriptionPolicies', + 'TenantIdDescription', + 'OperationPaged', + 'LocationPaged', + 'SubscriptionPaged', + 'TenantIdDescriptionPaged', + 'RegionType', + 'RegionCategory', + 'SubscriptionState', + 'SpendingLimit', + 'TenantCategory', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_models.py new file mode 100644 index 000000000000..ce8cef294927 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_models.py @@ -0,0 +1,398 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class Location(Model): + """Location information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID of the location. For example, + /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. + :vartype id: str + :ivar subscription_id: The subscription ID. + :vartype subscription_id: str + :ivar name: The location name. + :vartype name: str + :ivar display_name: The display name of the location. + :vartype display_name: str + :ivar regional_display_name: The display name of the location and its + region. + :vartype regional_display_name: str + :param metadata: Metadata of the location, such as lat/long, paired + region, and others. + :type metadata: + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.LocationMetadata + """ + + _validation = { + 'id': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'name': {'readonly': True}, + 'display_name': {'readonly': True}, + 'regional_display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'regional_display_name': {'key': 'regionalDisplayName', 'type': 'str'}, + 'metadata': {'key': 'metadata', 'type': 'LocationMetadata'}, + } + + def __init__(self, **kwargs): + super(Location, self).__init__(**kwargs) + self.id = None + self.subscription_id = None + self.name = None + self.display_name = None + self.regional_display_name = None + self.metadata = kwargs.get('metadata', None) + + +class LocationMetadata(Model): + """Location metadata information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar region_type: The type of the region. Possible values include: + 'Physical', 'Logical' + :vartype region_type: str or + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.RegionType + :ivar region_category: The category of the region. Possible values + include: 'Recommended', 'Other' + :vartype region_category: str or + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.RegionCategory + :ivar geography_group: The geography group of the location. + :vartype geography_group: str + :ivar longitude: The longitude of the location. + :vartype longitude: str + :ivar latitude: The latitude of the location. + :vartype latitude: str + :ivar physical_location: The physical location of the Azure location. + :vartype physical_location: str + :param paired_region: The regions paired to this region. + :type paired_region: + list[~azure.mgmt.resource.subscriptions.v2019_11_01.models.PairedRegion] + """ + + _validation = { + 'region_type': {'readonly': True}, + 'region_category': {'readonly': True}, + 'geography_group': {'readonly': True}, + 'longitude': {'readonly': True}, + 'latitude': {'readonly': True}, + 'physical_location': {'readonly': True}, + } + + _attribute_map = { + 'region_type': {'key': 'regionType', 'type': 'str'}, + 'region_category': {'key': 'regionCategory', 'type': 'str'}, + 'geography_group': {'key': 'geographyGroup', 'type': 'str'}, + 'longitude': {'key': 'longitude', 'type': 'str'}, + 'latitude': {'key': 'latitude', 'type': 'str'}, + 'physical_location': {'key': 'physicalLocation', 'type': 'str'}, + 'paired_region': {'key': 'pairedRegion', 'type': '[PairedRegion]'}, + } + + def __init__(self, **kwargs): + super(LocationMetadata, self).__init__(**kwargs) + self.region_type = None + self.region_category = None + self.geography_group = None + self.longitude = None + self.latitude = None + self.physical_location = None + self.paired_region = kwargs.get('paired_region', None) + + +class ManagedByTenant(Model): + """Information about a tenant managing the subscription. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tenant_id: The tenant ID of the managing tenant. This is a GUID. + :vartype tenant_id: str + """ + + _validation = { + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagedByTenant, self).__init__(**kwargs) + self.tenant_id = None + + +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.v2019_11_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) + + +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) + + +class PairedRegion(Model): + """Information regarding paired region. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the paired region. + :vartype name: str + :ivar id: The fully qualified ID of the location. For example, + /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. + :vartype id: str + :ivar subscription_id: The subscription ID. + :vartype subscription_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'subscription_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PairedRegion, self).__init__(**kwargs) + self.name = None + self.id = None + self.subscription_id = None + + +class Subscription(Model): + """Subscription information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the subscription. For example, + /subscriptions/00000000-0000-0000-0000-000000000000. + :vartype id: str + :ivar subscription_id: The subscription ID. + :vartype subscription_id: str + :ivar display_name: The subscription display name. + :vartype display_name: str + :ivar tenant_id: The subscription tenant ID. + :vartype tenant_id: str + :ivar state: The subscription state. Possible values are Enabled, Warned, + PastDue, Disabled, and Deleted. Possible values include: 'Enabled', + 'Warned', 'PastDue', 'Disabled', 'Deleted' + :vartype state: str or + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.SubscriptionState + :param subscription_policies: The subscription policies. + :type subscription_policies: + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.SubscriptionPolicies + :param authorization_source: The authorization source of the request. + Valid values are one or more combinations of Legacy, RoleBased, Bypassed, + Direct and Management. For example, 'Legacy, RoleBased'. + :type authorization_source: str + :param managed_by_tenants: An array containing the tenants managing the + subscription. + :type managed_by_tenants: + list[~azure.mgmt.resource.subscriptions.v2019_11_01.models.ManagedByTenant] + :param tags: The tags attached to the subscription. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'SubscriptionState'}, + 'subscription_policies': {'key': 'subscriptionPolicies', 'type': 'SubscriptionPolicies'}, + 'authorization_source': {'key': 'authorizationSource', 'type': 'str'}, + 'managed_by_tenants': {'key': 'managedByTenants', 'type': '[ManagedByTenant]'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Subscription, self).__init__(**kwargs) + self.id = None + self.subscription_id = None + self.display_name = None + self.tenant_id = None + self.state = None + self.subscription_policies = kwargs.get('subscription_policies', None) + self.authorization_source = kwargs.get('authorization_source', None) + self.managed_by_tenants = kwargs.get('managed_by_tenants', None) + self.tags = kwargs.get('tags', None) + + +class SubscriptionPolicies(Model): + """Subscription policies. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar location_placement_id: The subscription location placement ID. The + ID indicates which regions are visible for a subscription. For example, a + subscription with a location placement Id of Public_2014-09-01 has access + to Azure public regions. + :vartype location_placement_id: str + :ivar quota_id: The subscription quota ID. + :vartype quota_id: str + :ivar spending_limit: The subscription spending limit. Possible values + include: 'On', 'Off', 'CurrentPeriodOff' + :vartype spending_limit: str or + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.SpendingLimit + """ + + _validation = { + 'location_placement_id': {'readonly': True}, + 'quota_id': {'readonly': True}, + 'spending_limit': {'readonly': True}, + } + + _attribute_map = { + 'location_placement_id': {'key': 'locationPlacementId', 'type': 'str'}, + 'quota_id': {'key': 'quotaId', 'type': 'str'}, + 'spending_limit': {'key': 'spendingLimit', 'type': 'SpendingLimit'}, + } + + def __init__(self, **kwargs): + super(SubscriptionPolicies, self).__init__(**kwargs) + self.location_placement_id = None + self.quota_id = None + self.spending_limit = None + + +class TenantIdDescription(Model): + """Tenant Id information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID of the tenant. For example, + /tenants/00000000-0000-0000-0000-000000000000. + :vartype id: str + :ivar tenant_id: The tenant ID. For example, + 00000000-0000-0000-0000-000000000000. + :vartype tenant_id: str + :ivar tenant_category: Category of the tenant. Possible values include: + 'Home', 'ProjectedBy', 'ManagedBy' + :vartype tenant_category: str or + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.TenantCategory + :ivar country: Country/region name of the address for the tenant. + :vartype country: str + :ivar country_code: Country/region abbreviation for the tenant. + :vartype country_code: str + :ivar display_name: The display name of the tenant. + :vartype display_name: str + :ivar domains: The list of domains for the tenant. + :vartype domains: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'tenant_category': {'readonly': True}, + 'country': {'readonly': True}, + 'country_code': {'readonly': True}, + 'display_name': {'readonly': True}, + 'domains': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'tenant_category': {'key': 'tenantCategory', 'type': 'TenantCategory'}, + 'country': {'key': 'country', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'domains': {'key': 'domains', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(TenantIdDescription, self).__init__(**kwargs) + self.id = None + self.tenant_id = None + self.tenant_category = None + self.country = None + self.country_code = None + self.display_name = None + self.domains = None diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_models_py3.py new file mode 100644 index 000000000000..b8c47711b3b9 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_models_py3.py @@ -0,0 +1,398 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class Location(Model): + """Location information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID of the location. For example, + /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. + :vartype id: str + :ivar subscription_id: The subscription ID. + :vartype subscription_id: str + :ivar name: The location name. + :vartype name: str + :ivar display_name: The display name of the location. + :vartype display_name: str + :ivar regional_display_name: The display name of the location and its + region. + :vartype regional_display_name: str + :param metadata: Metadata of the location, such as lat/long, paired + region, and others. + :type metadata: + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.LocationMetadata + """ + + _validation = { + 'id': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'name': {'readonly': True}, + 'display_name': {'readonly': True}, + 'regional_display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'regional_display_name': {'key': 'regionalDisplayName', 'type': 'str'}, + 'metadata': {'key': 'metadata', 'type': 'LocationMetadata'}, + } + + def __init__(self, *, metadata=None, **kwargs) -> None: + super(Location, self).__init__(**kwargs) + self.id = None + self.subscription_id = None + self.name = None + self.display_name = None + self.regional_display_name = None + self.metadata = metadata + + +class LocationMetadata(Model): + """Location metadata information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar region_type: The type of the region. Possible values include: + 'Physical', 'Logical' + :vartype region_type: str or + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.RegionType + :ivar region_category: The category of the region. Possible values + include: 'Recommended', 'Other' + :vartype region_category: str or + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.RegionCategory + :ivar geography_group: The geography group of the location. + :vartype geography_group: str + :ivar longitude: The longitude of the location. + :vartype longitude: str + :ivar latitude: The latitude of the location. + :vartype latitude: str + :ivar physical_location: The physical location of the Azure location. + :vartype physical_location: str + :param paired_region: The regions paired to this region. + :type paired_region: + list[~azure.mgmt.resource.subscriptions.v2019_11_01.models.PairedRegion] + """ + + _validation = { + 'region_type': {'readonly': True}, + 'region_category': {'readonly': True}, + 'geography_group': {'readonly': True}, + 'longitude': {'readonly': True}, + 'latitude': {'readonly': True}, + 'physical_location': {'readonly': True}, + } + + _attribute_map = { + 'region_type': {'key': 'regionType', 'type': 'str'}, + 'region_category': {'key': 'regionCategory', 'type': 'str'}, + 'geography_group': {'key': 'geographyGroup', 'type': 'str'}, + 'longitude': {'key': 'longitude', 'type': 'str'}, + 'latitude': {'key': 'latitude', 'type': 'str'}, + 'physical_location': {'key': 'physicalLocation', 'type': 'str'}, + 'paired_region': {'key': 'pairedRegion', 'type': '[PairedRegion]'}, + } + + def __init__(self, *, paired_region=None, **kwargs) -> None: + super(LocationMetadata, self).__init__(**kwargs) + self.region_type = None + self.region_category = None + self.geography_group = None + self.longitude = None + self.latitude = None + self.physical_location = None + self.paired_region = paired_region + + +class ManagedByTenant(Model): + """Information about a tenant managing the subscription. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tenant_id: The tenant ID of the managing tenant. This is a GUID. + :vartype tenant_id: str + """ + + _validation = { + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ManagedByTenant, self).__init__(**kwargs) + self.tenant_id = None + + +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.v2019_11_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 + + +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 + + +class PairedRegion(Model): + """Information regarding paired region. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the paired region. + :vartype name: str + :ivar id: The fully qualified ID of the location. For example, + /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. + :vartype id: str + :ivar subscription_id: The subscription ID. + :vartype subscription_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'subscription_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PairedRegion, self).__init__(**kwargs) + self.name = None + self.id = None + self.subscription_id = None + + +class Subscription(Model): + """Subscription information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the subscription. For example, + /subscriptions/00000000-0000-0000-0000-000000000000. + :vartype id: str + :ivar subscription_id: The subscription ID. + :vartype subscription_id: str + :ivar display_name: The subscription display name. + :vartype display_name: str + :ivar tenant_id: The subscription tenant ID. + :vartype tenant_id: str + :ivar state: The subscription state. Possible values are Enabled, Warned, + PastDue, Disabled, and Deleted. Possible values include: 'Enabled', + 'Warned', 'PastDue', 'Disabled', 'Deleted' + :vartype state: str or + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.SubscriptionState + :param subscription_policies: The subscription policies. + :type subscription_policies: + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.SubscriptionPolicies + :param authorization_source: The authorization source of the request. + Valid values are one or more combinations of Legacy, RoleBased, Bypassed, + Direct and Management. For example, 'Legacy, RoleBased'. + :type authorization_source: str + :param managed_by_tenants: An array containing the tenants managing the + subscription. + :type managed_by_tenants: + list[~azure.mgmt.resource.subscriptions.v2019_11_01.models.ManagedByTenant] + :param tags: The tags attached to the subscription. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'SubscriptionState'}, + 'subscription_policies': {'key': 'subscriptionPolicies', 'type': 'SubscriptionPolicies'}, + 'authorization_source': {'key': 'authorizationSource', 'type': 'str'}, + 'managed_by_tenants': {'key': 'managedByTenants', 'type': '[ManagedByTenant]'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, subscription_policies=None, authorization_source: str=None, managed_by_tenants=None, tags=None, **kwargs) -> None: + super(Subscription, self).__init__(**kwargs) + self.id = None + self.subscription_id = None + self.display_name = None + self.tenant_id = None + self.state = None + self.subscription_policies = subscription_policies + self.authorization_source = authorization_source + self.managed_by_tenants = managed_by_tenants + self.tags = tags + + +class SubscriptionPolicies(Model): + """Subscription policies. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar location_placement_id: The subscription location placement ID. The + ID indicates which regions are visible for a subscription. For example, a + subscription with a location placement Id of Public_2014-09-01 has access + to Azure public regions. + :vartype location_placement_id: str + :ivar quota_id: The subscription quota ID. + :vartype quota_id: str + :ivar spending_limit: The subscription spending limit. Possible values + include: 'On', 'Off', 'CurrentPeriodOff' + :vartype spending_limit: str or + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.SpendingLimit + """ + + _validation = { + 'location_placement_id': {'readonly': True}, + 'quota_id': {'readonly': True}, + 'spending_limit': {'readonly': True}, + } + + _attribute_map = { + 'location_placement_id': {'key': 'locationPlacementId', 'type': 'str'}, + 'quota_id': {'key': 'quotaId', 'type': 'str'}, + 'spending_limit': {'key': 'spendingLimit', 'type': 'SpendingLimit'}, + } + + def __init__(self, **kwargs) -> None: + super(SubscriptionPolicies, self).__init__(**kwargs) + self.location_placement_id = None + self.quota_id = None + self.spending_limit = None + + +class TenantIdDescription(Model): + """Tenant Id information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID of the tenant. For example, + /tenants/00000000-0000-0000-0000-000000000000. + :vartype id: str + :ivar tenant_id: The tenant ID. For example, + 00000000-0000-0000-0000-000000000000. + :vartype tenant_id: str + :ivar tenant_category: Category of the tenant. Possible values include: + 'Home', 'ProjectedBy', 'ManagedBy' + :vartype tenant_category: str or + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.TenantCategory + :ivar country: Country/region name of the address for the tenant. + :vartype country: str + :ivar country_code: Country/region abbreviation for the tenant. + :vartype country_code: str + :ivar display_name: The display name of the tenant. + :vartype display_name: str + :ivar domains: The list of domains for the tenant. + :vartype domains: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'tenant_category': {'readonly': True}, + 'country': {'readonly': True}, + 'country_code': {'readonly': True}, + 'display_name': {'readonly': True}, + 'domains': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'tenant_category': {'key': 'tenantCategory', 'type': 'TenantCategory'}, + 'country': {'key': 'country', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'domains': {'key': 'domains', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(TenantIdDescription, self).__init__(**kwargs) + self.id = None + self.tenant_id = None + self.tenant_category = None + self.country = None + self.country_code = None + self.display_name = None + self.domains = None diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_paged_models.py new file mode 100644 index 000000000000..b46b75589169 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_paged_models.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class LocationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Location ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Location]'} + } + + def __init__(self, *args, **kwargs): + + super(LocationPaged, self).__init__(*args, **kwargs) +class SubscriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`Subscription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Subscription]'} + } + + def __init__(self, *args, **kwargs): + + super(SubscriptionPaged, self).__init__(*args, **kwargs) +class TenantIdDescriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`TenantIdDescription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TenantIdDescription]'} + } + + def __init__(self, *args, **kwargs): + + super(TenantIdDescriptionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_subscription_client_enums.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_subscription_client_enums.py new file mode 100644 index 000000000000..3fee1db7fd51 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_subscription_client_enums.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class RegionType(str, Enum): + + physical = "Physical" + logical = "Logical" + + +class RegionCategory(str, Enum): + + recommended = "Recommended" + other = "Other" + + +class SubscriptionState(str, Enum): + + enabled = "Enabled" + warned = "Warned" + past_due = "PastDue" + disabled = "Disabled" + deleted = "Deleted" + + +class SpendingLimit(str, Enum): + + on = "On" + off = "Off" + current_period_off = "CurrentPeriodOff" + + +class TenantCategory(str, Enum): + + home = "Home" + projected_by = "ProjectedBy" + managed_by = "ManagedBy" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/__init__.py new file mode 100644 index 000000000000..5b07794f3097 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_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 ._operations import Operations +from ._subscriptions_operations import SubscriptionsOperations +from ._tenants_operations import TenantsOperations + +__all__ = [ + 'Operations', + 'SubscriptionsOperations', + 'TenantsOperations', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_operations.py new file mode 100644 index 000000000000..cd646a42e97f --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_operations.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the operation. Constant value: "2019-11-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-11-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.v2019_11_01.models.OperationPaged[~azure.mgmt.resource.subscriptions.v2019_11_01.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Resources/operations'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_subscriptions_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_subscriptions_operations.py new file mode 100644 index 000000000000..f89095a02e4d --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_subscriptions_operations.py @@ -0,0 +1,232 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 SubscriptionsOperations(object): + """SubscriptionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the operation. Constant value: "2019-11-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-11-01" + + self.config = config + + def list_locations( + self, subscription_id, custom_headers=None, raw=False, **operation_config): + """Gets all available geo-locations. + + This operation provides all the locations that are available for + resource providers; however, each resource provider may support a + subset of this list. + + :param subscription_id: The ID of the target subscription. + :type subscription_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 Location + :rtype: + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.LocationPaged[~azure.mgmt.resource.subscriptions.v2019_11_01.models.Location] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_locations.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("subscription_id", 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.LocationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_locations.metadata = {'url': '/subscriptions/{subscriptionId}/locations'} + + def get( + self, subscription_id, custom_headers=None, raw=False, **operation_config): + """Gets details about a specified subscription. + + :param subscription_id: The ID of the target subscription. + :type subscription_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: Subscription or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.Subscription or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("subscription_id", 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('Subscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets all subscriptions for a tenant. + + :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 Subscription + :rtype: + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.SubscriptionPaged[~azure.mgmt.resource.subscriptions.v2019_11_01.models.Subscription] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_tenants_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_tenants_operations.py new file mode 100644 index 000000000000..4da6dc3f13b9 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_tenants_operations.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 TenantsOperations(object): + """TenantsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the operation. Constant value: "2019-11-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-11-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets the tenants for your account. + + :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 TenantIdDescription + :rtype: + ~azure.mgmt.resource.subscriptions.v2019_11_01.models.TenantIdDescriptionPaged[~azure.mgmt.resource.subscriptions.v2019_11_01.models.TenantIdDescription] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TenantIdDescriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/tenants'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/version.py new file mode 100644 index 000000000000..93d376dfdcc7 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_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 = "2019-11-01" +