diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/_meta.json b/sdk/resourcemover/azure-mgmt-resourcemover/_meta.json index 20306ecb704f..b3c187b45307 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/_meta.json +++ b/sdk/resourcemover/azure-mgmt-resourcemover/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.2", + "autorest": "3.7.2", "use": [ - "@autorest/python@5.8.0", - "@autorest/modelerfour@4.19.1" + "@autorest/python@5.12.0", + "@autorest/modelerfour@4.19.3" ], - "commit": "2c9ddf48f96c0a78c5ec35ea3aaa636c303395d2", + "commit": "47e11d89b5c6220f62793bcee333ef435a1ceebf", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/resourcemover/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.0 --use=@autorest/modelerfour@4.19.1 --version=3.4.2", + "autorest_command": "autorest specification/resourcemover/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/resourcemover/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/__init__.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/__init__.py index 055e320b7ba3..451711af4a55 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/__init__.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/__init__.py @@ -12,8 +12,7 @@ __version__ = VERSION __all__ = ['ResourceMoverServiceAPI'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_configuration.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_configuration.py index c224389ed457..f10d1ec9a922 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_configuration.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION @@ -40,15 +40,15 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None + super(ResourceMoverServiceAPIConfiguration, self).__init__(**kwargs) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(ResourceMoverServiceAPIConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-01-01" + self.api_version = "2021-08-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-resourcemover/{}'.format(VERSION)) self._configure(**kwargs) @@ -68,4 +68,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_metadata.json b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_metadata.json index 603dcf52f645..ff010c0e540c 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_metadata.json +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_metadata.json @@ -1,17 +1,17 @@ { - "chosen_version": "2021-01-01", - "total_api_version_list": ["2021-01-01"], + "chosen_version": "2021-08-01", + "total_api_version_list": ["2021-08-01"], "client": { "name": "ResourceMoverServiceAPI", "filename": "_resource_mover_service_api", "description": "A first party Azure service orchestrating the move of Azure resources from one Azure region to another or between zones within a region.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ResourceMoverServiceAPIConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ResourceMoverServiceAPIConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ResourceMoverServiceAPIConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ResourceMoverServiceAPIConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "move_collections": "MoveCollectionsOperations", diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_patch.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_resource_mover_service_api.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_resource_mover_service_api.py index 3f5471df536a..23af3d30306a 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_resource_mover_service_api.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_resource_mover_service_api.py @@ -6,25 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from copy import deepcopy from typing import TYPE_CHECKING from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ResourceMoverServiceAPIConfiguration +from .operations import MoveCollectionsOperations, MoveResourcesOperations, OperationsDiscoveryOperations, UnresolvedDependenciesOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Optional from azure.core.credentials import TokenCredential - from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from ._configuration import ResourceMoverServiceAPIConfiguration -from .operations import MoveCollectionsOperations -from .operations import MoveResourcesOperations -from .operations import UnresolvedDependenciesOperations -from .operations import OperationsDiscoveryOperations -from . import models - + from azure.core.rest import HttpRequest, HttpResponse class ResourceMoverServiceAPI(object): """A first party Azure service orchestrating the move of Azure resources from one Azure region to another or between zones within a region. @@ -34,61 +31,68 @@ class ResourceMoverServiceAPI(object): :ivar move_resources: MoveResourcesOperations operations :vartype move_resources: resource_mover_service_api.operations.MoveResourcesOperations :ivar unresolved_dependencies: UnresolvedDependenciesOperations operations - :vartype unresolved_dependencies: resource_mover_service_api.operations.UnresolvedDependenciesOperations + :vartype unresolved_dependencies: + resource_mover_service_api.operations.UnresolvedDependenciesOperations :ivar operations_discovery: OperationsDiscoveryOperations operations - :vartype operations_discovery: resource_mover_service_api.operations.OperationsDiscoveryOperations + :vartype operations_discovery: + resource_mover_service_api.operations.OperationsDiscoveryOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The Subscription ID. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( self, credential, # type: "TokenCredential" subscription_id, # type: str - base_url=None, # type: Optional[str] + base_url="https://management.azure.com", # type: str **kwargs # type: Any ): # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = ResourceMoverServiceAPIConfiguration(credential, subscription_id, **kwargs) + self._config = ResourceMoverServiceAPIConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.move_collections = MoveCollectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.move_resources = MoveResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.unresolved_dependencies = UnresolvedDependenciesOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations_discovery = OperationsDiscoveryOperations(self._client, self._config, self._serialize, self._deserialize) + - self.move_collections = MoveCollectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.move_resources = MoveResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.unresolved_dependencies = UnresolvedDependenciesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations_discovery = OperationsDiscoveryOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs # type: Any + ): + # type: (...) -> HttpResponse """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.HttpResponse """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_vendor.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_version.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_version.py index f1fb63697cf5..e5754a47ce68 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_version.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/__init__.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/__init__.py index f487634cb60f..64d17a012f7a 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/__init__.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/__init__.py @@ -8,3 +8,8 @@ from ._resource_mover_service_api import ResourceMoverServiceAPI __all__ = ['ResourceMoverServiceAPI'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/_configuration.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/_configuration.py index adca560ec426..1af9103c28ab 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/_configuration.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -37,15 +37,15 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ResourceMoverServiceAPIConfiguration, self).__init__(**kwargs) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(ResourceMoverServiceAPIConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-01-01" + self.api_version = "2021-08-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-resourcemover/{}'.format(VERSION)) self._configure(**kwargs) @@ -64,4 +64,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/_patch.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/_resource_mover_service_api.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/_resource_mover_service_api.py index 854bc1e704d1..10011439478f 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/_resource_mover_service_api.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/_resource_mover_service_api.py @@ -6,25 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ResourceMoverServiceAPIConfiguration +from .operations import MoveCollectionsOperations, MoveResourcesOperations, OperationsDiscoveryOperations, UnresolvedDependenciesOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ResourceMoverServiceAPIConfiguration -from .operations import MoveCollectionsOperations -from .operations import MoveResourcesOperations -from .operations import UnresolvedDependenciesOperations -from .operations import OperationsDiscoveryOperations -from .. import models - - -class ResourceMoverServiceAPI(object): +class ResourceMoverServiceAPI: """A first party Azure service orchestrating the move of Azure resources from one Azure region to another or between zones within a region. :ivar move_collections: MoveCollectionsOperations operations @@ -32,59 +29,66 @@ class ResourceMoverServiceAPI(object): :ivar move_resources: MoveResourcesOperations operations :vartype move_resources: resource_mover_service_api.aio.operations.MoveResourcesOperations :ivar unresolved_dependencies: UnresolvedDependenciesOperations operations - :vartype unresolved_dependencies: resource_mover_service_api.aio.operations.UnresolvedDependenciesOperations + :vartype unresolved_dependencies: + resource_mover_service_api.aio.operations.UnresolvedDependenciesOperations :ivar operations_discovery: OperationsDiscoveryOperations operations - :vartype operations_discovery: resource_mover_service_api.aio.operations.OperationsDiscoveryOperations + :vartype operations_discovery: + resource_mover_service_api.aio.operations.OperationsDiscoveryOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Subscription ID. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - base_url: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ResourceMoverServiceAPIConfiguration(credential, subscription_id, **kwargs) + self._config = ResourceMoverServiceAPIConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.move_collections = MoveCollectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.move_resources = MoveResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.unresolved_dependencies = UnresolvedDependenciesOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations_discovery = OperationsDiscoveryOperations(self._client, self._config, self._serialize, self._deserialize) - self.move_collections = MoveCollectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.move_resources = MoveResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.unresolved_dependencies = UnresolvedDependenciesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations_discovery = OperationsDiscoveryOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.AsyncHttpResponse """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_move_collections_operations.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_move_collections_operations.py index 2ce39cf42e45..ed6050f72773 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_move_collections_operations.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_move_collections_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._move_collections_operations import build_bulk_remove_request_initial, build_commit_request_initial, build_create_request, build_delete_request_initial, build_discard_request_initial, build_get_request, build_initiate_move_request_initial, build_list_move_collections_by_resource_group_request, build_list_move_collections_by_subscription_request, build_list_required_for_request, build_prepare_request_initial, build_resolve_dependencies_request_initial, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def create( self, resource_group_name: str, @@ -68,35 +74,25 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'MoveCollection') + _json = self._serialize.body(body, 'MoveCollection') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_create_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + content_type=content_type, + json=_json, + template_url=self.create.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -114,8 +110,11 @@ async def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -141,35 +140,25 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'UpdateMoveCollectionRequest') + _json = self._serialize.body(body, 'UpdateMoveCollectionRequest') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -183,8 +172,10 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -196,27 +187,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -232,8 +213,11 @@ async def _delete_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -248,15 +232,18 @@ async def begin_delete( :type move_collection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -270,24 +257,17 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -299,8 +279,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -323,27 +305,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -357,8 +329,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}'} # type: ignore + async def _prepare_initial( self, resource_group_name: str, @@ -371,35 +345,25 @@ async def _prepare_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._prepare_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'PrepareRequest') + _json = self._serialize.body(body, 'PrepareRequest') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_prepare_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + content_type=content_type, + json=_json, + template_url=self._prepare_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -415,8 +379,11 @@ async def _prepare_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _prepare_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/prepare'} # type: ignore + + @distributed_trace_async async def begin_prepare( self, resource_group_name: str, @@ -438,15 +405,19 @@ async def begin_prepare( :type body: ~resource_mover_service_api.models.PrepareRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -458,27 +429,21 @@ async def begin_prepare( resource_group_name=resource_group_name, move_collection_name=move_collection_name, body=body, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -490,6 +455,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_prepare.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/prepare'} # type: ignore async def _initiate_move_initial( @@ -504,35 +470,25 @@ async def _initiate_move_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._initiate_move_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'ResourceMoveRequest') + _json = self._serialize.body(body, 'ResourceMoveRequest') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_initiate_move_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + content_type=content_type, + json=_json, + template_url=self._initiate_move_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -548,8 +504,11 @@ async def _initiate_move_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _initiate_move_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/initiateMove'} # type: ignore + + @distributed_trace_async async def begin_initiate_move( self, resource_group_name: str, @@ -571,15 +530,19 @@ async def begin_initiate_move( :type body: ~resource_mover_service_api.models.ResourceMoveRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -591,27 +554,21 @@ async def begin_initiate_move( resource_group_name=resource_group_name, move_collection_name=move_collection_name, body=body, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -623,6 +580,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_initiate_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/initiateMove'} # type: ignore async def _commit_initial( @@ -637,35 +595,25 @@ async def _commit_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._commit_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'CommitRequest') + _json = self._serialize.body(body, 'CommitRequest') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_commit_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + content_type=content_type, + json=_json, + template_url=self._commit_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -681,8 +629,11 @@ async def _commit_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _commit_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/commit'} # type: ignore + + @distributed_trace_async async def begin_commit( self, resource_group_name: str, @@ -704,15 +655,19 @@ async def begin_commit( :type body: ~resource_mover_service_api.models.CommitRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -724,27 +679,21 @@ async def begin_commit( resource_group_name=resource_group_name, move_collection_name=move_collection_name, body=body, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -756,6 +705,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_commit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/commit'} # type: ignore async def _discard_initial( @@ -770,35 +720,25 @@ async def _discard_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._discard_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'DiscardRequest') + _json = self._serialize.body(body, 'DiscardRequest') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_discard_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + content_type=content_type, + json=_json, + template_url=self._discard_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -814,8 +754,11 @@ async def _discard_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _discard_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/discard'} # type: ignore + + @distributed_trace_async async def begin_discard( self, resource_group_name: str, @@ -837,15 +780,19 @@ async def begin_discard( :type body: ~resource_mover_service_api.models.DiscardRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -857,27 +804,21 @@ async def begin_discard( resource_group_name=resource_group_name, move_collection_name=move_collection_name, body=body, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -889,6 +830,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_discard.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/discard'} # type: ignore async def _resolve_dependencies_initial( @@ -902,27 +844,17 @@ async def _resolve_dependencies_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self._resolve_dependencies_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_resolve_dependencies_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + template_url=self._resolve_dependencies_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -938,8 +870,11 @@ async def _resolve_dependencies_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _resolve_dependencies_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/resolveDependencies'} # type: ignore + + @distributed_trace_async async def begin_resolve_dependencies( self, resource_group_name: str, @@ -954,15 +889,18 @@ async def begin_resolve_dependencies( :type move_collection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -976,24 +914,17 @@ async def begin_resolve_dependencies( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1005,6 +936,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_resolve_dependencies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/resolveDependencies'} # type: ignore async def _bulk_remove_initial( @@ -1019,35 +951,25 @@ async def _bulk_remove_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._bulk_remove_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'BulkRemoveRequest') + _json = self._serialize.body(body, 'BulkRemoveRequest') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_bulk_remove_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + content_type=content_type, + json=_json, + template_url=self._bulk_remove_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1063,8 +985,11 @@ async def _bulk_remove_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _bulk_remove_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/bulkRemove'} # type: ignore + + @distributed_trace_async async def begin_bulk_remove( self, resource_group_name: str, @@ -1084,15 +1009,19 @@ async def begin_bulk_remove( :type body: ~resource_mover_service_api.models.BulkRemoveRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -1104,27 +1033,21 @@ async def begin_bulk_remove( resource_group_name=resource_group_name, move_collection_name=move_collection_name, body=body, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1136,8 +1059,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_bulk_remove.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/bulkRemove'} # type: ignore + @distributed_trace def list_move_collections_by_subscription( self, **kwargs: Any @@ -1147,8 +1072,10 @@ def list_move_collections_by_subscription( Get all the Move Collections in the subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MoveCollectionResultList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~resource_mover_service_api.models.MoveCollectionResultList] + :return: An iterator like instance of either MoveCollectionResultList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~resource_mover_service_api.models.MoveCollectionResultList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MoveCollectionResultList"] @@ -1156,34 +1083,29 @@ def list_move_collections_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_move_collections_by_subscription.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_move_collections_by_subscription_request( + subscription_id=self._config.subscription_id, + template_url=self.list_move_collections_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_move_collections_by_subscription_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('MoveCollectionResultList', pipeline_response) + deserialized = self._deserialize("MoveCollectionResultList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1201,11 +1123,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_move_collections_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/moveCollections'} # type: ignore + @distributed_trace def list_move_collections_by_resource_group( self, resource_group_name: str, @@ -1218,8 +1142,10 @@ def list_move_collections_by_resource_group( :param resource_group_name: The Resource Group Name. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MoveCollectionResultList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~resource_mover_service_api.models.MoveCollectionResultList] + :return: An iterator like instance of either MoveCollectionResultList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~resource_mover_service_api.models.MoveCollectionResultList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MoveCollectionResultList"] @@ -1227,35 +1153,31 @@ def list_move_collections_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_move_collections_by_resource_group.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_move_collections_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_move_collections_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_move_collections_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('MoveCollectionResultList', pipeline_response) + deserialized = self._deserialize("MoveCollectionResultList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1273,11 +1195,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_move_collections_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections'} # type: ignore + @distributed_trace_async async def list_required_for( self, resource_group_name: str, @@ -1303,28 +1227,18 @@ async def list_required_for( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.list_required_for.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_required_for_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + source_id=source_id, + template_url=self.list_required_for.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1338,4 +1252,6 @@ async def list_required_for( return cls(pipeline_response, deserialized, {}) return deserialized + list_required_for.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/requiredFor'} # type: ignore + diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_move_resources_operations.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_move_resources_operations.py index fa7acfac20c8..d4b5322fce06 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_move_resources_operations.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_move_resources_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._move_resources_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,8 +66,10 @@ def list( $filter=Properties/ProvisioningState eq 'Succeeded'. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MoveResourceCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~resource_mover_service_api.models.MoveResourceCollection] + :return: An iterator like instance of either MoveResourceCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~resource_mover_service_api.models.MoveResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MoveResourceCollection"] @@ -69,38 +77,35 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + filter=filter, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('MoveResourceCollection', pipeline_response) + deserialized = self._deserialize("MoveResourceCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,6 +123,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) @@ -136,36 +142,26 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - 'moveResourceName': self._serialize.url("move_resource_name", move_resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'MoveResource') + _json = self._serialize.body(body, 'MoveResource') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + move_resource_name=move_resource_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -181,8 +177,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, resource_group_name: str, @@ -203,15 +202,19 @@ async def begin_create( :type body: ~resource_mover_service_api.models.MoveResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either MoveResource or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MoveResource or the result of + cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~resource_mover_service_api.models.MoveResource] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.MoveResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -224,28 +227,21 @@ async def begin_create( move_collection_name=move_collection_name, move_resource_name=move_resource_name, body=body, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('MoveResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - 'moveResourceName': self._serialize.url("move_resource_name", move_resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -257,6 +253,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore async def _delete_initial( @@ -271,28 +268,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - 'moveResourceName': self._serialize.url("move_resource_name", move_resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + move_resource_name=move_resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -308,8 +295,11 @@ async def _delete_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -327,15 +317,18 @@ async def begin_delete( :type move_resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -350,25 +343,17 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - 'moveResourceName': self._serialize.url("move_resource_name", move_resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -380,8 +365,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -407,28 +394,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - 'moveResourceName': self._serialize.url("move_resource_name", move_resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + move_resource_name=move_resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -442,4 +419,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore + diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_operations_discovery_operations.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_operations_discovery_operations.py index a89870d8f55d..0c1c991ff3cf 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_operations_discovery_operations.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_operations_discovery_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations_discovery_operations import build_get_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def get( self, **kwargs: Any @@ -56,21 +61,14 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -84,4 +82,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/providers/Microsoft.Migrate/operations'} # type: ignore + diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_unresolved_dependencies_operations.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_unresolved_dependencies_operations.py index 74fb5a39f29c..741d57989f74 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_unresolved_dependencies_operations.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/_unresolved_dependencies_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._unresolved_dependencies_operations import build_get_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def get( self, resource_group_name: str, @@ -63,8 +69,10 @@ def get( :param filter: The filter to apply on the operation. For example, $apply=filter(count eq 2). :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnresolvedDependencyCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~resource_mover_service_api.models.UnresolvedDependencyCollection] + :return: An iterator like instance of either UnresolvedDependencyCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~resource_mover_service_api.models.UnresolvedDependencyCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UnresolvedDependencyCollection"] @@ -72,42 +80,39 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if dependency_level is not None: - query_parameters['dependencyLevel'] = self._serialize.query("dependency_level", dependency_level, 'str') - if orderby is not None: - query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + dependency_level=dependency_level, + orderby=orderby, + filter=filter, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + dependency_level=dependency_level, + orderby=orderby, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('UnresolvedDependencyCollection', pipeline_response) + deserialized = self._deserialize("UnresolvedDependencyCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -125,6 +130,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/__init__.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/__init__.py index e98cd9047dbc..5c8504cfdc16 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/__init__.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/__init__.py @@ -68,6 +68,7 @@ from ._models_py3 import SubnetResourceSettings from ._models_py3 import Summary from ._models_py3 import SummaryCollection + from ._models_py3 import SystemData from ._models_py3 import UnresolvedDependenciesFilter from ._models_py3 import UnresolvedDependenciesFilterProperties from ._models_py3 import UnresolvedDependency @@ -137,6 +138,7 @@ from ._models import SubnetResourceSettings # type: ignore from ._models import Summary # type: ignore from ._models import SummaryCollection # type: ignore + from ._models import SystemData # type: ignore from ._models import UnresolvedDependenciesFilter # type: ignore from ._models import UnresolvedDependenciesFilterProperties # type: ignore from ._models import UnresolvedDependency # type: ignore @@ -146,6 +148,7 @@ from ._models import VirtualNetworkResourceSettings # type: ignore from ._resource_mover_service_api_enums import ( + CreatedByType, DependencyLevel, DependencyType, JobName, @@ -220,6 +223,7 @@ 'SubnetResourceSettings', 'Summary', 'SummaryCollection', + 'SystemData', 'UnresolvedDependenciesFilter', 'UnresolvedDependenciesFilterProperties', 'UnresolvedDependency', @@ -227,6 +231,7 @@ 'UpdateMoveCollectionRequest', 'VirtualMachineResourceSettings', 'VirtualNetworkResourceSettings', + 'CreatedByType', 'DependencyLevel', 'DependencyType', 'JobName', diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models.py index 955a6d742206..fbcfce1f21e1 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models.py @@ -38,6 +38,8 @@ def __init__( self, **kwargs ): + """ + """ super(AffectedMoveResource, self).__init__(**kwargs) self.id = None self.source_id = None @@ -47,9 +49,9 @@ def __init__( class AutomaticResolutionProperties(msrest.serialization.Model): """Defines the properties for automatic resolution. - :param move_resource_id: Gets the MoveResource ARM ID of + :ivar move_resource_id: Gets the MoveResource ARM ID of the dependent resource if the resolution type is Automatic. - :type move_resource_id: str + :vartype move_resource_id: str """ _attribute_map = { @@ -60,6 +62,11 @@ def __init__( self, **kwargs ): + """ + :keyword move_resource_id: Gets the MoveResource ARM ID of + the dependent resource if the resolution type is Automatic. + :paramtype move_resource_id: str + """ super(AutomaticResolutionProperties, self).__init__(**kwargs) self.move_resource_id = kwargs.get('move_resource_id', None) @@ -72,11 +79,11 @@ class ResourceSettings(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str """ _validation = { @@ -97,6 +104,10 @@ def __init__( self, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + """ super(ResourceSettings, self).__init__(**kwargs) self.resource_type = None # type: Optional[str] self.target_resource_name = kwargs['target_resource_name'] @@ -107,15 +118,17 @@ class AvailabilitySetResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param fault_domain: Gets or sets the target fault domain. - :type fault_domain: int - :param update_domain: Gets or sets the target update domain. - :type update_domain: int + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar fault_domain: Gets or sets the target fault domain. + :vartype fault_domain: int + :ivar update_domain: Gets or sets the target update domain. + :vartype update_domain: int """ _validation = { @@ -128,6 +141,7 @@ class AvailabilitySetResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'fault_domain': {'key': 'faultDomain', 'type': 'int'}, 'update_domain': {'key': 'updateDomain', 'type': 'int'}, } @@ -136,8 +150,19 @@ def __init__( self, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword fault_domain: Gets or sets the target fault domain. + :paramtype fault_domain: int + :keyword update_domain: Gets or sets the target update domain. + :paramtype update_domain: int + """ super(AvailabilitySetResourceSettings, self).__init__(**kwargs) self.resource_type = 'Microsoft.Compute/availabilitySets' # type: str + self.tags = kwargs.get('tags', None) self.fault_domain = kwargs.get('fault_domain', None) self.update_domain = kwargs.get('update_domain', None) @@ -147,9 +172,9 @@ class AzureResourceReference(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being + :ivar source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being referenced. - :type source_arm_resource_id: str + :vartype source_arm_resource_id: str """ _validation = { @@ -164,6 +189,11 @@ def __init__( self, **kwargs ): + """ + :keyword source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource + being referenced. + :paramtype source_arm_resource_id: str + """ super(AzureResourceReference, self).__init__(**kwargs) self.source_arm_resource_id = kwargs['source_arm_resource_id'] @@ -171,15 +201,16 @@ def __init__( class BulkRemoveRequest(msrest.serialization.Model): """Defines the request body for bulk remove of move resources operation. - :param validate_only: Gets or sets a value indicating whether the operation needs to only run + :ivar validate_only: Gets or sets a value indicating whether the operation needs to only run pre-requisite. - :type validate_only: bool - :param move_resources: Gets or sets the list of resource Id's, by default it accepts move + :vartype validate_only: bool + :ivar move_resources: Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property. - :type move_resources: list[str] - :param move_resource_input_type: Defines the move resource input type. Possible values include: + :vartype move_resources: list[str] + :ivar move_resource_input_type: Defines the move resource input type. Possible values include: "MoveResourceId", "MoveResourceSourceId". - :type move_resource_input_type: str or ~resource_mover_service_api.models.MoveResourceInputType + :vartype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType """ _attribute_map = { @@ -192,6 +223,18 @@ def __init__( self, **kwargs ): + """ + :keyword validate_only: Gets or sets a value indicating whether the operation needs to only run + pre-requisite. + :paramtype validate_only: bool + :keyword move_resources: Gets or sets the list of resource Id's, by default it accepts move + resource id's unless the input type is switched via moveResourceInputType property. + :paramtype move_resources: list[str] + :keyword move_resource_input_type: Defines the move resource input type. Possible values + include: "MoveResourceId", "MoveResourceSourceId". + :paramtype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType + """ super(BulkRemoveRequest, self).__init__(**kwargs) self.validate_only = kwargs.get('validate_only', None) self.move_resources = kwargs.get('move_resources', None) @@ -201,17 +244,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - :type code: str - :param message: A message describing the error, intended to be suitable for display in a user + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~resource_mover_service_api.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~resource_mover_service_api.models.CloudErrorBody] """ _attribute_map = { @@ -225,6 +268,19 @@ def __init__( self, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~resource_mover_service_api.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -237,15 +293,16 @@ class CommitRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validate_only: Gets or sets a value indicating whether the operation needs to only run + :ivar validate_only: Gets or sets a value indicating whether the operation needs to only run pre-requisite. - :type validate_only: bool - :param move_resources: Required. Gets or sets the list of resource Id's, by default it accepts + :vartype validate_only: bool + :ivar move_resources: Required. Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property. - :type move_resources: list[str] - :param move_resource_input_type: Defines the move resource input type. Possible values include: + :vartype move_resources: list[str] + :ivar move_resource_input_type: Defines the move resource input type. Possible values include: "MoveResourceId", "MoveResourceSourceId". - :type move_resource_input_type: str or ~resource_mover_service_api.models.MoveResourceInputType + :vartype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType """ _validation = { @@ -262,6 +319,19 @@ def __init__( self, **kwargs ): + """ + :keyword validate_only: Gets or sets a value indicating whether the operation needs to only run + pre-requisite. + :paramtype validate_only: bool + :keyword move_resources: Required. Gets or sets the list of resource Id's, by default it + accepts move resource id's unless the input type is switched via moveResourceInputType + property. + :paramtype move_resources: list[str] + :keyword move_resource_input_type: Defines the move resource input type. Possible values + include: "MoveResourceId", "MoveResourceSourceId". + :paramtype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType + """ super(CommitRequest, self).__init__(**kwargs) self.validate_only = kwargs.get('validate_only', None) self.move_resources = kwargs['move_resources'] @@ -273,15 +343,16 @@ class DiscardRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validate_only: Gets or sets a value indicating whether the operation needs to only run + :ivar validate_only: Gets or sets a value indicating whether the operation needs to only run pre-requisite. - :type validate_only: bool - :param move_resources: Required. Gets or sets the list of resource Id's, by default it accepts + :vartype validate_only: bool + :ivar move_resources: Required. Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property. - :type move_resources: list[str] - :param move_resource_input_type: Defines the move resource input type. Possible values include: + :vartype move_resources: list[str] + :ivar move_resource_input_type: Defines the move resource input type. Possible values include: "MoveResourceId", "MoveResourceSourceId". - :type move_resource_input_type: str or ~resource_mover_service_api.models.MoveResourceInputType + :vartype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType """ _validation = { @@ -298,6 +369,19 @@ def __init__( self, **kwargs ): + """ + :keyword validate_only: Gets or sets a value indicating whether the operation needs to only run + pre-requisite. + :paramtype validate_only: bool + :keyword move_resources: Required. Gets or sets the list of resource Id's, by default it + accepts move resource id's unless the input type is switched via moveResourceInputType + property. + :paramtype move_resources: list[str] + :keyword move_resource_input_type: Defines the move resource input type. Possible values + include: "MoveResourceId", "MoveResourceSourceId". + :paramtype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType + """ super(DiscardRequest, self).__init__(**kwargs) self.validate_only = kwargs.get('validate_only', None) self.move_resources = kwargs['move_resources'] @@ -309,11 +393,11 @@ class DiskEncryptionSetResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str """ _validation = { @@ -330,6 +414,10 @@ def __init__( self, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + """ super(DiskEncryptionSetResourceSettings, self).__init__(**kwargs) self.resource_type = 'Microsoft.Compute/diskEncryptionSets' # type: str @@ -341,13 +429,13 @@ class Display(msrest.serialization.Model): (2) complex query filters for the event service; and (3) audit history / records for management operations. - :param provider: Gets or sets the provider. + :ivar provider: Gets or sets the provider. The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". - :type provider: str - :param resource: Gets or sets the resource. + :vartype provider: str + :ivar resource: Gets or sets the resource. The localized friendly form of the resource related to this action/operation – it should match the public documentation for the resource provider. It should use Title Casing. @@ -355,14 +443,14 @@ class Display(msrest.serialization.Model): reuse their parent’s display.resource field) e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler Jobs". - :type resource: str - :param operation: Gets or sets the operation. + :vartype resource: str + :ivar operation: Gets or sets the operation. The localized friendly name for the operation, as it should be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. - :type operation: str - :param description: Gets or sets the description. + :vartype operation: str + :ivar description: Gets or sets the description. The localized friendly description for the operation, as it should be shown to the user. It should be thorough, yet concise – it will be used in tool tips and detailed views. @@ -374,7 +462,7 @@ class Display(msrest.serialization.Model): Prescriptive guidance for namespace: Read any 'display.resource' Create or Update any 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. - :type description: str + :vartype description: str """ _attribute_map = { @@ -388,6 +476,42 @@ def __init__( self, **kwargs ): + """ + :keyword provider: Gets or sets the provider. + The localized friendly form of the resource provider name – it is expected to also + include the publisher/company responsible. + It should use Title Casing and begin with "Microsoft" for 1st party services. + e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + :paramtype provider: str + :keyword resource: Gets or sets the resource. + The localized friendly form of the resource related to this action/operation – it + should match the public documentation for the resource provider. + It should use Title Casing. + This value should be unique for a particular URL type (e.g. nested types should *not* + reuse their parent’s display.resource field) + e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" + or "Scheduler Jobs". + :paramtype resource: str + :keyword operation: Gets or sets the operation. + The localized friendly name for the operation, as it should be shown to the user. + It should be concise (to fit in drop downs) but clear (i.e. self-documenting). + It should use Title Casing. + Prescriptive guidance: Read Create or Update Delete 'ActionName'. + :paramtype operation: str + :keyword description: Gets or sets the description. + The localized friendly description for the operation, as it should be shown to the + user. + It should be thorough, yet concise – it will be used in tool tips and detailed views. + Prescriptive guidance for namespace: + Read any 'display.provider' resource + Create or Update any 'display.provider' resource + Delete any 'display.provider' resource + Perform any other action on any 'display.provider' resource + Prescriptive guidance for namespace: + Read any 'display.resource' Create or Update any 'display.resource' Delete any + 'display.resource' 'ActionName' any 'display.resources'. + :paramtype description: str + """ super(Display, self).__init__(**kwargs) self.provider = kwargs.get('provider', None) self.resource = kwargs.get('resource', None) @@ -398,13 +522,13 @@ def __init__( class Identity(msrest.serialization.Model): """Defines the MSI properties of the Move Collection. - :param type: The type of identity used for the resource mover service. Possible values include: + :ivar type: The type of identity used for the resource mover service. Possible values include: "None", "SystemAssigned", "UserAssigned". - :type type: str or ~resource_mover_service_api.models.ResourceIdentityType - :param principal_id: Gets or sets the principal id. - :type principal_id: str - :param tenant_id: Gets or sets the tenant id. - :type tenant_id: str + :vartype type: str or ~resource_mover_service_api.models.ResourceIdentityType + :ivar principal_id: Gets or sets the principal id. + :vartype principal_id: str + :ivar tenant_id: Gets or sets the tenant id. + :vartype tenant_id: str """ _attribute_map = { @@ -417,6 +541,15 @@ def __init__( self, **kwargs ): + """ + :keyword type: The type of identity used for the resource mover service. Possible values + include: "None", "SystemAssigned", "UserAssigned". + :paramtype type: str or ~resource_mover_service_api.models.ResourceIdentityType + :keyword principal_id: Gets or sets the principal id. + :paramtype principal_id: str + :keyword tenant_id: Gets or sets the tenant id. + :paramtype tenant_id: str + """ super(Identity, self).__init__(**kwargs) self.type = kwargs.get('type', None) self.principal_id = kwargs.get('principal_id', None) @@ -448,6 +581,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobStatus, self).__init__(**kwargs) self.job_name = None self.job_progress = None @@ -458,11 +593,11 @@ class KeyVaultResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str """ _validation = { @@ -479,6 +614,10 @@ def __init__( self, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + """ super(KeyVaultResourceSettings, self).__init__(**kwargs) self.resource_type = 'Microsoft.KeyVault/vaults' # type: str @@ -486,8 +625,8 @@ def __init__( class LBBackendAddressPoolResourceSettings(msrest.serialization.Model): """Defines load balancer backend address pool properties. - :param name: Gets or sets the backend address pool name. - :type name: str + :ivar name: Gets or sets the backend address pool name. + :vartype name: str """ _attribute_map = { @@ -498,6 +637,10 @@ def __init__( self, **kwargs ): + """ + :keyword name: Gets or sets the backend address pool name. + :paramtype name: str + """ super(LBBackendAddressPoolResourceSettings, self).__init__(**kwargs) self.name = kwargs.get('name', None) @@ -505,18 +648,18 @@ def __init__( class LBFrontendIPConfigurationResourceSettings(msrest.serialization.Model): """Defines load balancer frontend IP configuration properties. - :param name: Gets or sets the frontend IP configuration name. - :type name: str - :param private_ip_address: Gets or sets the IP address of the Load Balancer.This is only + :ivar name: Gets or sets the frontend IP configuration name. + :vartype name: str + :ivar private_ip_address: Gets or sets the IP address of the Load Balancer.This is only specified if a specific private IP address shall be allocated from the subnet specified in subnetRef. - :type private_ip_address: str - :param private_ip_allocation_method: Gets or sets PrivateIP allocation method (Static/Dynamic). - :type private_ip_allocation_method: str - :param subnet: Defines reference to subnet. - :type subnet: ~resource_mover_service_api.models.SubnetReference - :param zones: Gets or sets the csv list of zones. - :type zones: str + :vartype private_ip_address: str + :ivar private_ip_allocation_method: Gets or sets PrivateIP allocation method (Static/Dynamic). + :vartype private_ip_allocation_method: str + :ivar subnet: Defines reference to subnet. + :vartype subnet: ~resource_mover_service_api.models.SubnetReference + :ivar zones: Gets or sets the csv list of zones. + :vartype zones: str """ _attribute_map = { @@ -531,6 +674,21 @@ def __init__( self, **kwargs ): + """ + :keyword name: Gets or sets the frontend IP configuration name. + :paramtype name: str + :keyword private_ip_address: Gets or sets the IP address of the Load Balancer.This is only + specified if a specific + private IP address shall be allocated from the subnet specified in subnetRef. + :paramtype private_ip_address: str + :keyword private_ip_allocation_method: Gets or sets PrivateIP allocation method + (Static/Dynamic). + :paramtype private_ip_allocation_method: str + :keyword subnet: Defines reference to subnet. + :paramtype subnet: ~resource_mover_service_api.models.SubnetReference + :keyword zones: Gets or sets the csv list of zones. + :paramtype zones: str + """ super(LBFrontendIPConfigurationResourceSettings, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.private_ip_address = kwargs.get('private_ip_address', None) @@ -544,11 +702,11 @@ class ProxyResourceReference(AzureResourceReference): All required parameters must be populated in order to send to Azure. - :param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being + :ivar source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being referenced. - :type source_arm_resource_id: str - :param name: Gets the name of the proxy resource on the target side. - :type name: str + :vartype source_arm_resource_id: str + :ivar name: Gets the name of the proxy resource on the target side. + :vartype name: str """ _validation = { @@ -564,6 +722,13 @@ def __init__( self, **kwargs ): + """ + :keyword source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource + being referenced. + :paramtype source_arm_resource_id: str + :keyword name: Gets the name of the proxy resource on the target side. + :paramtype name: str + """ super(ProxyResourceReference, self).__init__(**kwargs) self.name = kwargs.get('name', None) @@ -573,11 +738,11 @@ class LoadBalancerBackendAddressPoolReference(ProxyResourceReference): All required parameters must be populated in order to send to Azure. - :param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being + :ivar source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being referenced. - :type source_arm_resource_id: str - :param name: Gets the name of the proxy resource on the target side. - :type name: str + :vartype source_arm_resource_id: str + :ivar name: Gets the name of the proxy resource on the target side. + :vartype name: str """ _validation = { @@ -593,6 +758,13 @@ def __init__( self, **kwargs ): + """ + :keyword source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource + being referenced. + :paramtype source_arm_resource_id: str + :keyword name: Gets the name of the proxy resource on the target side. + :paramtype name: str + """ super(LoadBalancerBackendAddressPoolReference, self).__init__(**kwargs) @@ -601,11 +773,11 @@ class LoadBalancerNatRuleReference(ProxyResourceReference): All required parameters must be populated in order to send to Azure. - :param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being + :ivar source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being referenced. - :type source_arm_resource_id: str - :param name: Gets the name of the proxy resource on the target side. - :type name: str + :vartype source_arm_resource_id: str + :ivar name: Gets the name of the proxy resource on the target side. + :vartype name: str """ _validation = { @@ -621,6 +793,13 @@ def __init__( self, **kwargs ): + """ + :keyword source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource + being referenced. + :paramtype source_arm_resource_id: str + :keyword name: Gets the name of the proxy resource on the target side. + :paramtype name: str + """ super(LoadBalancerNatRuleReference, self).__init__(**kwargs) @@ -629,24 +808,26 @@ class LoadBalancerResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param sku: Gets or sets load balancer sku (Basic/Standard). - :type sku: str - :param frontend_ip_configurations: Gets or sets the frontend IP configurations of the load + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar sku: Gets or sets load balancer sku (Basic/Standard). + :vartype sku: str + :ivar frontend_ip_configurations: Gets or sets the frontend IP configurations of the load balancer. - :type frontend_ip_configurations: + :vartype frontend_ip_configurations: list[~resource_mover_service_api.models.LBFrontendIPConfigurationResourceSettings] - :param backend_address_pools: Gets or sets the backend address pools of the load balancer. - :type backend_address_pools: + :ivar backend_address_pools: Gets or sets the backend address pools of the load balancer. + :vartype backend_address_pools: list[~resource_mover_service_api.models.LBBackendAddressPoolResourceSettings] - :param zones: Gets or sets the csv list of zones common for all frontend IP configurations. - Note this is given + :ivar zones: Gets or sets the csv list of zones common for all frontend IP configurations. Note + this is given precedence only if frontend IP configurations settings are not present. - :type zones: str + :vartype zones: str """ _validation = { @@ -657,6 +838,7 @@ class LoadBalancerResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'str'}, 'frontend_ip_configurations': {'key': 'frontendIPConfigurations', 'type': '[LBFrontendIPConfigurationResourceSettings]'}, 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[LBBackendAddressPoolResourceSettings]'}, @@ -667,8 +849,28 @@ def __init__( self, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: Gets or sets load balancer sku (Basic/Standard). + :paramtype sku: str + :keyword frontend_ip_configurations: Gets or sets the frontend IP configurations of the load + balancer. + :paramtype frontend_ip_configurations: + list[~resource_mover_service_api.models.LBFrontendIPConfigurationResourceSettings] + :keyword backend_address_pools: Gets or sets the backend address pools of the load balancer. + :paramtype backend_address_pools: + list[~resource_mover_service_api.models.LBBackendAddressPoolResourceSettings] + :keyword zones: Gets or sets the csv list of zones common for all frontend IP configurations. + Note this is given + precedence only if frontend IP configurations settings are not present. + :paramtype zones: str + """ super(LoadBalancerResourceSettings, self).__init__(**kwargs) self.resource_type = 'Microsoft.Network/loadBalancers' # type: str + self.tags = kwargs.get('tags', None) self.sku = kwargs.get('sku', None) self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) self.backend_address_pools = kwargs.get('backend_address_pools', None) @@ -678,9 +880,9 @@ def __init__( class ManualResolutionProperties(msrest.serialization.Model): """Defines the properties for manual resolution. - :param target_id: Gets or sets the target resource ARM ID of the dependent resource if the + :ivar target_id: Gets or sets the target resource ARM ID of the dependent resource if the resource type is Manual. - :type target_id: str + :vartype target_id: str """ _attribute_map = { @@ -691,6 +893,11 @@ def __init__( self, **kwargs ): + """ + :keyword target_id: Gets or sets the target resource ARM ID of the dependent resource if the + resource type is Manual. + :paramtype target_id: str + """ super(ManualResolutionProperties, self).__init__(**kwargs) self.target_id = kwargs.get('target_id', None) @@ -708,14 +915,16 @@ class MoveCollection(msrest.serialization.Model): :vartype type: str :ivar etag: The etag of the resource. :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: The geo-location where the resource lives. - :type location: str - :param identity: Defines the MSI properties of the Move Collection. - :type identity: ~resource_mover_service_api.models.Identity - :param properties: Defines the move collection properties. - :type properties: ~resource_mover_service_api.models.MoveCollectionProperties + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. + :vartype location: str + :ivar identity: Defines the MSI properties of the Move Collection. + :vartype identity: ~resource_mover_service_api.models.Identity + :ivar properties: Defines the move collection properties. + :vartype properties: ~resource_mover_service_api.models.MoveCollectionProperties + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~resource_mover_service_api.models.SystemData """ _validation = { @@ -723,6 +932,7 @@ class MoveCollection(msrest.serialization.Model): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -734,12 +944,23 @@ class MoveCollection(msrest.serialization.Model): 'location': {'key': 'location', 'type': 'str'}, 'identity': {'key': 'identity', 'type': 'Identity'}, 'properties': {'key': 'properties', 'type': 'MoveCollectionProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( self, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. + :paramtype location: str + :keyword identity: Defines the MSI properties of the Move Collection. + :paramtype identity: ~resource_mover_service_api.models.Identity + :keyword properties: Defines the move collection properties. + :paramtype properties: ~resource_mover_service_api.models.MoveCollectionProperties + """ super(MoveCollection, self).__init__(**kwargs) self.id = None self.name = None @@ -749,6 +970,7 @@ def __init__( self.location = kwargs.get('location', None) self.identity = kwargs.get('identity', None) self.properties = kwargs.get('properties', None) + self.system_data = None class MoveCollectionProperties(msrest.serialization.Model): @@ -758,10 +980,10 @@ class MoveCollectionProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_region: Required. Gets or sets the source region. - :type source_region: str - :param target_region: Required. Gets or sets the target region. - :type target_region: str + :ivar source_region: Required. Gets or sets the source region. + :vartype source_region: str + :ivar target_region: Required. Gets or sets the target region. + :vartype target_region: str :ivar provisioning_state: Defines the provisioning states. Possible values include: "Succeeded", "Updating", "Creating", "Failed". :vartype provisioning_state: str or ~resource_mover_service_api.models.ProvisioningState @@ -787,6 +1009,12 @@ def __init__( self, **kwargs ): + """ + :keyword source_region: Required. Gets or sets the source region. + :paramtype source_region: str + :keyword target_region: Required. Gets or sets the target region. + :paramtype target_region: str + """ super(MoveCollectionProperties, self).__init__(**kwargs) self.source_region = kwargs['source_region'] self.target_region = kwargs['target_region'] @@ -797,8 +1025,8 @@ def __init__( class MoveResourceError(msrest.serialization.Model): """An error response from the azure resource mover service. - :param properties: The move resource error body. - :type properties: ~resource_mover_service_api.models.MoveResourceErrorBody + :ivar properties: The move resource error body. + :vartype properties: ~resource_mover_service_api.models.MoveResourceErrorBody """ _attribute_map = { @@ -809,6 +1037,10 @@ def __init__( self, **kwargs ): + """ + :keyword properties: The move resource error body. + :paramtype properties: ~resource_mover_service_api.models.MoveResourceErrorBody + """ super(MoveResourceError, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) @@ -816,8 +1048,8 @@ def __init__( class MoveCollectionPropertiesErrors(MoveResourceError): """Defines the move collection errors. - :param properties: The move resource error body. - :type properties: ~resource_mover_service_api.models.MoveResourceErrorBody + :ivar properties: The move resource error body. + :vartype properties: ~resource_mover_service_api.models.MoveResourceErrorBody """ _attribute_map = { @@ -828,16 +1060,20 @@ def __init__( self, **kwargs ): + """ + :keyword properties: The move resource error body. + :paramtype properties: ~resource_mover_service_api.models.MoveResourceErrorBody + """ super(MoveCollectionPropertiesErrors, self).__init__(**kwargs) class MoveCollectionResultList(msrest.serialization.Model): """Defines the collection of move collections. - :param value: Gets the list of move collections. - :type value: list[~resource_mover_service_api.models.MoveCollection] - :param next_link: Gets the value of next link. - :type next_link: str + :ivar value: Gets the list of move collections. + :vartype value: list[~resource_mover_service_api.models.MoveCollection] + :ivar next_link: Gets the value of next link. + :vartype next_link: str """ _attribute_map = { @@ -849,6 +1085,12 @@ def __init__( self, **kwargs ): + """ + :keyword value: Gets the list of move collections. + :paramtype value: list[~resource_mover_service_api.models.MoveCollection] + :keyword next_link: Gets the value of next link. + :paramtype next_link: str + """ super(MoveCollectionResultList, self).__init__(**kwargs) self.value = kwargs.get('value', None) self.next_link = kwargs.get('next_link', None) @@ -875,6 +1117,8 @@ def __init__( self, **kwargs ): + """ + """ super(MoveErrorInfo, self).__init__(**kwargs) self.move_resources = None @@ -890,14 +1134,17 @@ class MoveResource(msrest.serialization.Model): :vartype name: str :ivar type: The type of the resource. :vartype type: str - :param properties: Defines the move resource properties. - :type properties: ~resource_mover_service_api.models.MoveResourceProperties + :ivar properties: Defines the move resource properties. + :vartype properties: ~resource_mover_service_api.models.MoveResourceProperties + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~resource_mover_service_api.models.SystemData """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -905,17 +1152,23 @@ class MoveResource(msrest.serialization.Model): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'MoveResourceProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( self, **kwargs ): + """ + :keyword properties: Defines the move resource properties. + :paramtype properties: ~resource_mover_service_api.models.MoveResourceProperties + """ super(MoveResource, self).__init__(**kwargs) self.id = None self.name = None self.type = None self.properties = kwargs.get('properties', None) + self.system_data = None class MoveResourceCollection(msrest.serialization.Model): @@ -923,13 +1176,13 @@ class MoveResourceCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: Gets the list of move resources. - :type value: list[~resource_mover_service_api.models.MoveResource] - :param next_link: Gets the value of next link. - :type next_link: str - :param summary_collection: Gets or sets the list of summary items and the field on which - summary is done. - :type summary_collection: ~resource_mover_service_api.models.SummaryCollection + :ivar value: Gets the list of move resources. + :vartype value: list[~resource_mover_service_api.models.MoveResource] + :ivar next_link: Gets the value of next link. + :vartype next_link: str + :ivar summary_collection: Gets or sets the list of summary items and the field on which summary + is done. + :vartype summary_collection: ~resource_mover_service_api.models.SummaryCollection :ivar total_count: Gets the total count. :vartype total_count: long """ @@ -949,6 +1202,15 @@ def __init__( self, **kwargs ): + """ + :keyword value: Gets the list of move resources. + :paramtype value: list[~resource_mover_service_api.models.MoveResource] + :keyword next_link: Gets the value of next link. + :paramtype next_link: str + :keyword summary_collection: Gets or sets the list of summary items and the field on which + summary is done. + :paramtype summary_collection: ~resource_mover_service_api.models.SummaryCollection + """ super(MoveResourceCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) self.next_link = kwargs.get('next_link', None) @@ -959,22 +1221,22 @@ def __init__( class MoveResourceDependency(msrest.serialization.Model): """Defines the dependency of the move resource. - :param id: Gets the source ARM ID of the dependent resource. - :type id: str - :param resolution_status: Gets the dependency resolution status. - :type resolution_status: str - :param resolution_type: Defines the resolution type. Possible values include: "Manual", + :ivar id: Gets the source ARM ID of the dependent resource. + :vartype id: str + :ivar resolution_status: Gets the dependency resolution status. + :vartype resolution_status: str + :ivar resolution_type: Defines the resolution type. Possible values include: "Manual", "Automatic". - :type resolution_type: str or ~resource_mover_service_api.models.ResolutionType - :param dependency_type: Defines the dependency type. Possible values include: + :vartype resolution_type: str or ~resource_mover_service_api.models.ResolutionType + :ivar dependency_type: Defines the dependency type. Possible values include: "RequiredForPrepare", "RequiredForMove". - :type dependency_type: str or ~resource_mover_service_api.models.DependencyType - :param manual_resolution: Defines the properties for manual resolution. - :type manual_resolution: ~resource_mover_service_api.models.ManualResolutionProperties - :param automatic_resolution: Defines the properties for automatic resolution. - :type automatic_resolution: ~resource_mover_service_api.models.AutomaticResolutionProperties - :param is_optional: Gets or sets a value indicating whether the dependency is optional. - :type is_optional: str + :vartype dependency_type: str or ~resource_mover_service_api.models.DependencyType + :ivar manual_resolution: Defines the properties for manual resolution. + :vartype manual_resolution: ~resource_mover_service_api.models.ManualResolutionProperties + :ivar automatic_resolution: Defines the properties for automatic resolution. + :vartype automatic_resolution: ~resource_mover_service_api.models.AutomaticResolutionProperties + :ivar is_optional: Gets or sets a value indicating whether the dependency is optional. + :vartype is_optional: str """ _attribute_map = { @@ -991,6 +1253,25 @@ def __init__( self, **kwargs ): + """ + :keyword id: Gets the source ARM ID of the dependent resource. + :paramtype id: str + :keyword resolution_status: Gets the dependency resolution status. + :paramtype resolution_status: str + :keyword resolution_type: Defines the resolution type. Possible values include: "Manual", + "Automatic". + :paramtype resolution_type: str or ~resource_mover_service_api.models.ResolutionType + :keyword dependency_type: Defines the dependency type. Possible values include: + "RequiredForPrepare", "RequiredForMove". + :paramtype dependency_type: str or ~resource_mover_service_api.models.DependencyType + :keyword manual_resolution: Defines the properties for manual resolution. + :paramtype manual_resolution: ~resource_mover_service_api.models.ManualResolutionProperties + :keyword automatic_resolution: Defines the properties for automatic resolution. + :paramtype automatic_resolution: + ~resource_mover_service_api.models.AutomaticResolutionProperties + :keyword is_optional: Gets or sets a value indicating whether the dependency is optional. + :paramtype is_optional: str + """ super(MoveResourceDependency, self).__init__(**kwargs) self.id = kwargs.get('id', None) self.resolution_status = kwargs.get('resolution_status', None) @@ -1004,12 +1285,12 @@ def __init__( class MoveResourceDependencyOverride(msrest.serialization.Model): """Defines the dependency override of the move resource. - :param id: Gets or sets the ARM ID of the dependent resource. - :type id: str - :param target_id: Gets or sets the resource ARM id of either the MoveResource or the resource + :ivar id: Gets or sets the ARM ID of the dependent resource. + :vartype id: str + :ivar target_id: Gets or sets the resource ARM id of either the MoveResource or the resource ARM ID of the dependent resource. - :type target_id: str + :vartype target_id: str """ _attribute_map = { @@ -1021,6 +1302,14 @@ def __init__( self, **kwargs ): + """ + :keyword id: Gets or sets the ARM ID of the dependent resource. + :paramtype id: str + :keyword target_id: Gets or sets the resource ARM id of either the MoveResource or the resource + ARM ID of + the dependent resource. + :paramtype target_id: str + """ super(MoveResourceDependencyOverride, self).__init__(**kwargs) self.id = kwargs.get('id', None) self.target_id = kwargs.get('target_id', None) @@ -1062,6 +1351,8 @@ def __init__( self, **kwargs ): + """ + """ super(MoveResourceErrorBody, self).__init__(**kwargs) self.code = None self.message = None @@ -1072,8 +1363,8 @@ def __init__( class MoveResourceFilter(msrest.serialization.Model): """Move resource filter. - :param properties: - :type properties: ~resource_mover_service_api.models.MoveResourceFilterProperties + :ivar properties: + :vartype properties: ~resource_mover_service_api.models.MoveResourceFilterProperties """ _attribute_map = { @@ -1084,6 +1375,10 @@ def __init__( self, **kwargs ): + """ + :keyword properties: + :paramtype properties: ~resource_mover_service_api.models.MoveResourceFilterProperties + """ super(MoveResourceFilter, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) @@ -1091,8 +1386,8 @@ def __init__( class MoveResourceFilterProperties(msrest.serialization.Model): """MoveResourceFilterProperties. - :param provisioning_state: The provisioning state. - :type provisioning_state: str + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str """ _attribute_map = { @@ -1103,6 +1398,10 @@ def __init__( self, **kwargs ): + """ + :keyword provisioning_state: The provisioning state. + :paramtype provisioning_state: str + """ super(MoveResourceFilterProperties, self).__init__(**kwargs) self.provisioning_state = kwargs.get('provisioning_state', None) @@ -1117,22 +1416,22 @@ class MoveResourceProperties(msrest.serialization.Model): :ivar provisioning_state: Defines the provisioning states. Possible values include: "Succeeded", "Updating", "Creating", "Failed". :vartype provisioning_state: str or ~resource_mover_service_api.models.ProvisioningState - :param source_id: Required. Gets or sets the Source ARM Id of the resource. - :type source_id: str + :ivar source_id: Required. Gets or sets the Source ARM Id of the resource. + :vartype source_id: str :ivar target_id: Gets or sets the Target ARM Id of the resource. :vartype target_id: str - :param existing_target_id: Gets or sets the existing target ARM Id of the resource. - :type existing_target_id: str - :param resource_settings: Gets or sets the resource settings. - :type resource_settings: ~resource_mover_service_api.models.ResourceSettings + :ivar existing_target_id: Gets or sets the existing target ARM Id of the resource. + :vartype existing_target_id: str + :ivar resource_settings: Gets or sets the resource settings. + :vartype resource_settings: ~resource_mover_service_api.models.ResourceSettings :ivar source_resource_settings: Gets or sets the source resource settings. :vartype source_resource_settings: ~resource_mover_service_api.models.ResourceSettings :ivar move_status: Defines the move resource status. :vartype move_status: ~resource_mover_service_api.models.MoveResourcePropertiesMoveStatus :ivar depends_on: Gets or sets the move resource dependencies. :vartype depends_on: list[~resource_mover_service_api.models.MoveResourceDependency] - :param depends_on_overrides: Gets or sets the move resource dependencies overrides. - :type depends_on_overrides: + :ivar depends_on_overrides: Gets or sets the move resource dependencies overrides. + :vartype depends_on_overrides: list[~resource_mover_service_api.models.MoveResourceDependencyOverride] :ivar is_resolve_required: Gets a value indicating whether the resolve action is required over the move collection. @@ -1170,6 +1469,17 @@ def __init__( self, **kwargs ): + """ + :keyword source_id: Required. Gets or sets the Source ARM Id of the resource. + :paramtype source_id: str + :keyword existing_target_id: Gets or sets the existing target ARM Id of the resource. + :paramtype existing_target_id: str + :keyword resource_settings: Gets or sets the resource settings. + :paramtype resource_settings: ~resource_mover_service_api.models.ResourceSettings + :keyword depends_on_overrides: Gets or sets the move resource dependencies overrides. + :paramtype depends_on_overrides: + list[~resource_mover_service_api.models.MoveResourceDependencyOverride] + """ super(MoveResourceProperties, self).__init__(**kwargs) self.provisioning_state = None self.source_id = kwargs['source_id'] @@ -1187,8 +1497,8 @@ def __init__( class MoveResourcePropertiesErrors(MoveResourceError): """Defines the move resource errors. - :param properties: The move resource error body. - :type properties: ~resource_mover_service_api.models.MoveResourceErrorBody + :ivar properties: The move resource error body. + :vartype properties: ~resource_mover_service_api.models.MoveResourceErrorBody """ _attribute_map = { @@ -1199,6 +1509,10 @@ def __init__( self, **kwargs ): + """ + :keyword properties: The move resource error body. + :paramtype properties: ~resource_mover_service_api.models.MoveResourceErrorBody + """ super(MoveResourcePropertiesErrors, self).__init__(**kwargs) @@ -1213,10 +1527,10 @@ class MoveResourceStatus(msrest.serialization.Model): "CommitInProgress", "CommitFailed", "Committed", "DeleteSourcePending", "ResourceMoveCompleted". :vartype move_state: str or ~resource_mover_service_api.models.MoveState - :param job_status: Defines the job status. - :type job_status: ~resource_mover_service_api.models.JobStatus - :param errors: An error response from the azure resource mover service. - :type errors: ~resource_mover_service_api.models.MoveResourceError + :ivar job_status: Defines the job status. + :vartype job_status: ~resource_mover_service_api.models.JobStatus + :ivar errors: An error response from the azure resource mover service. + :vartype errors: ~resource_mover_service_api.models.MoveResourceError """ _validation = { @@ -1233,6 +1547,12 @@ def __init__( self, **kwargs ): + """ + :keyword job_status: Defines the job status. + :paramtype job_status: ~resource_mover_service_api.models.JobStatus + :keyword errors: An error response from the azure resource mover service. + :paramtype errors: ~resource_mover_service_api.models.MoveResourceError + """ super(MoveResourceStatus, self).__init__(**kwargs) self.move_state = None self.job_status = kwargs.get('job_status', None) @@ -1250,10 +1570,10 @@ class MoveResourcePropertiesMoveStatus(MoveResourceStatus): "CommitInProgress", "CommitFailed", "Committed", "DeleteSourcePending", "ResourceMoveCompleted". :vartype move_state: str or ~resource_mover_service_api.models.MoveState - :param job_status: Defines the job status. - :type job_status: ~resource_mover_service_api.models.JobStatus - :param errors: An error response from the azure resource mover service. - :type errors: ~resource_mover_service_api.models.MoveResourceError + :ivar job_status: Defines the job status. + :vartype job_status: ~resource_mover_service_api.models.JobStatus + :ivar errors: An error response from the azure resource mover service. + :vartype errors: ~resource_mover_service_api.models.MoveResourceError """ _validation = { @@ -1270,6 +1590,12 @@ def __init__( self, **kwargs ): + """ + :keyword job_status: Defines the job status. + :paramtype job_status: ~resource_mover_service_api.models.JobStatus + :keyword errors: An error response from the azure resource mover service. + :paramtype errors: ~resource_mover_service_api.models.MoveResourceError + """ super(MoveResourcePropertiesMoveStatus, self).__init__(**kwargs) @@ -1278,17 +1604,19 @@ class NetworkInterfaceResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param ip_configurations: Gets or sets the IP configurations of the NIC. - :type ip_configurations: + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar ip_configurations: Gets or sets the IP configurations of the NIC. + :vartype ip_configurations: list[~resource_mover_service_api.models.NicIpConfigurationResourceSettings] - :param enable_accelerated_networking: Gets or sets a value indicating whether accelerated + :ivar enable_accelerated_networking: Gets or sets a value indicating whether accelerated networking is enabled. - :type enable_accelerated_networking: bool + :vartype enable_accelerated_networking: bool """ _validation = { @@ -1299,6 +1627,7 @@ class NetworkInterfaceResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'ip_configurations': {'key': 'ipConfigurations', 'type': '[NicIpConfigurationResourceSettings]'}, 'enable_accelerated_networking': {'key': 'enableAcceleratedNetworking', 'type': 'bool'}, } @@ -1307,8 +1636,21 @@ def __init__( self, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword ip_configurations: Gets or sets the IP configurations of the NIC. + :paramtype ip_configurations: + list[~resource_mover_service_api.models.NicIpConfigurationResourceSettings] + :keyword enable_accelerated_networking: Gets or sets a value indicating whether accelerated + networking is enabled. + :paramtype enable_accelerated_networking: bool + """ super(NetworkInterfaceResourceSettings, self).__init__(**kwargs) self.resource_type = 'Microsoft.Network/networkInterfaces' # type: str + self.tags = kwargs.get('tags', None) self.ip_configurations = kwargs.get('ip_configurations', None) self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) @@ -1318,13 +1660,15 @@ class NetworkSecurityGroupResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param security_rules: Gets or sets Security rules of network security group. - :type security_rules: list[~resource_mover_service_api.models.NsgSecurityRule] + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar security_rules: Gets or sets Security rules of network security group. + :vartype security_rules: list[~resource_mover_service_api.models.NsgSecurityRule] """ _validation = { @@ -1335,6 +1679,7 @@ class NetworkSecurityGroupResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'security_rules': {'key': 'securityRules', 'type': '[NsgSecurityRule]'}, } @@ -1342,34 +1687,43 @@ def __init__( self, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword security_rules: Gets or sets Security rules of network security group. + :paramtype security_rules: list[~resource_mover_service_api.models.NsgSecurityRule] + """ super(NetworkSecurityGroupResourceSettings, self).__init__(**kwargs) self.resource_type = 'Microsoft.Network/networkSecurityGroups' # type: str + self.tags = kwargs.get('tags', None) self.security_rules = kwargs.get('security_rules', None) class NicIpConfigurationResourceSettings(msrest.serialization.Model): """Defines NIC IP configuration properties. - :param name: Gets or sets the IP configuration name. - :type name: str - :param private_ip_address: Gets or sets the private IP address of the network interface IP + :ivar name: Gets or sets the IP configuration name. + :vartype name: str + :ivar private_ip_address: Gets or sets the private IP address of the network interface IP Configuration. - :type private_ip_address: str - :param private_ip_allocation_method: Gets or sets the private IP address allocation method. - :type private_ip_allocation_method: str - :param subnet: Defines reference to subnet. - :type subnet: ~resource_mover_service_api.models.SubnetReference - :param primary: Gets or sets a value indicating whether this IP configuration is the primary. - :type primary: bool - :param load_balancer_backend_address_pools: Gets or sets the references of the load balancer + :vartype private_ip_address: str + :ivar private_ip_allocation_method: Gets or sets the private IP address allocation method. + :vartype private_ip_allocation_method: str + :ivar subnet: Defines reference to subnet. + :vartype subnet: ~resource_mover_service_api.models.SubnetReference + :ivar primary: Gets or sets a value indicating whether this IP configuration is the primary. + :vartype primary: bool + :ivar load_balancer_backend_address_pools: Gets or sets the references of the load balancer backend address pools. - :type load_balancer_backend_address_pools: + :vartype load_balancer_backend_address_pools: list[~resource_mover_service_api.models.LoadBalancerBackendAddressPoolReference] - :param load_balancer_nat_rules: Gets or sets the references of the load balancer NAT rules. - :type load_balancer_nat_rules: + :ivar load_balancer_nat_rules: Gets or sets the references of the load balancer NAT rules. + :vartype load_balancer_nat_rules: list[~resource_mover_service_api.models.LoadBalancerNatRuleReference] - :param public_ip: Defines reference to a public IP. - :type public_ip: ~resource_mover_service_api.models.PublicIpReference + :ivar public_ip: Defines reference to a public IP. + :vartype public_ip: ~resource_mover_service_api.models.PublicIpReference """ _attribute_map = { @@ -1387,6 +1741,28 @@ def __init__( self, **kwargs ): + """ + :keyword name: Gets or sets the IP configuration name. + :paramtype name: str + :keyword private_ip_address: Gets or sets the private IP address of the network interface IP + Configuration. + :paramtype private_ip_address: str + :keyword private_ip_allocation_method: Gets or sets the private IP address allocation method. + :paramtype private_ip_allocation_method: str + :keyword subnet: Defines reference to subnet. + :paramtype subnet: ~resource_mover_service_api.models.SubnetReference + :keyword primary: Gets or sets a value indicating whether this IP configuration is the primary. + :paramtype primary: bool + :keyword load_balancer_backend_address_pools: Gets or sets the references of the load balancer + backend address pools. + :paramtype load_balancer_backend_address_pools: + list[~resource_mover_service_api.models.LoadBalancerBackendAddressPoolReference] + :keyword load_balancer_nat_rules: Gets or sets the references of the load balancer NAT rules. + :paramtype load_balancer_nat_rules: + list[~resource_mover_service_api.models.LoadBalancerNatRuleReference] + :keyword public_ip: Defines reference to a public IP. + :paramtype public_ip: ~resource_mover_service_api.models.PublicIpReference + """ super(NicIpConfigurationResourceSettings, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.private_ip_address = kwargs.get('private_ip_address', None) @@ -1403,9 +1779,9 @@ class NsgReference(AzureResourceReference): All required parameters must be populated in order to send to Azure. - :param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being + :ivar source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being referenced. - :type source_arm_resource_id: str + :vartype source_arm_resource_id: str """ _validation = { @@ -1420,46 +1796,51 @@ def __init__( self, **kwargs ): + """ + :keyword source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource + being referenced. + :paramtype source_arm_resource_id: str + """ super(NsgReference, self).__init__(**kwargs) class NsgSecurityRule(msrest.serialization.Model): """Security Rule data model for Network Security Groups. - :param name: Gets or sets the Security rule name. - :type name: str - :param access: Gets or sets whether network traffic is allowed or denied. + :ivar name: Gets or sets the Security rule name. + :vartype name: str + :ivar access: Gets or sets whether network traffic is allowed or denied. Possible values are “Allow” and “Deny”. - :type access: str - :param description: Gets or sets a description for this rule. Restricted to 140 chars. - :type description: str - :param destination_address_prefix: Gets or sets destination address prefix. CIDR or source IP + :vartype access: str + :ivar description: Gets or sets a description for this rule. Restricted to 140 chars. + :vartype description: str + :ivar destination_address_prefix: Gets or sets destination address prefix. CIDR or source IP range. A “*” can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used. - :type destination_address_prefix: str - :param destination_port_range: Gets or sets Destination Port or Range. Integer or range between + :vartype destination_address_prefix: str + :ivar destination_port_range: Gets or sets Destination Port or Range. Integer or range between 0 and 65535. A “*” can also be used to match all ports. - :type destination_port_range: str - :param direction: Gets or sets the direction of the rule.InBound or Outbound. The + :vartype destination_port_range: str + :ivar direction: Gets or sets the direction of the rule.InBound or Outbound. The direction specifies if rule will be evaluated on incoming or outgoing traffic. - :type direction: str - :param priority: Gets or sets the priority of the rule. The value can be between + :vartype direction: str + :ivar priority: Gets or sets the priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. - :type priority: int - :param protocol: Gets or sets Network protocol this rule applies to. Can be Tcp, Udp or All(*). - :type protocol: str - :param source_address_prefix: Gets or sets source address prefix. CIDR or source IP range. A + :vartype priority: int + :ivar protocol: Gets or sets Network protocol this rule applies to. Can be Tcp, Udp or All(*). + :vartype protocol: str + :ivar source_address_prefix: Gets or sets source address prefix. CIDR or source IP range. A “*” can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used. If this is an ingress rule, specifies where network traffic originates from. - :type source_address_prefix: str - :param source_port_range: Gets or sets Source Port or Range. Integer or range between 0 and + :vartype source_address_prefix: str + :ivar source_port_range: Gets or sets Source Port or Range. Integer or range between 0 and #. A “*” can also be used to match all ports. - :type source_port_range: str + :vartype source_port_range: str """ _attribute_map = { @@ -1479,6 +1860,44 @@ def __init__( self, **kwargs ): + """ + :keyword name: Gets or sets the Security rule name. + :paramtype name: str + :keyword access: Gets or sets whether network traffic is allowed or denied. + Possible values are “Allow” and “Deny”. + :paramtype access: str + :keyword description: Gets or sets a description for this rule. Restricted to 140 chars. + :paramtype description: str + :keyword destination_address_prefix: Gets or sets destination address prefix. CIDR or source IP + range. + A “*” can also be used to match all source IPs. Default tags such + as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used. + :paramtype destination_address_prefix: str + :keyword destination_port_range: Gets or sets Destination Port or Range. Integer or range + between + 0 and 65535. A “*” can also be used to match all ports. + :paramtype destination_port_range: str + :keyword direction: Gets or sets the direction of the rule.InBound or Outbound. The + direction specifies if rule will be evaluated on incoming or outgoing traffic. + :paramtype direction: str + :keyword priority: Gets or sets the priority of the rule. The value can be between + 100 and 4096. The priority number must be unique for each rule in the collection. + The lower the priority number, the higher the priority of the rule. + :paramtype priority: int + :keyword protocol: Gets or sets Network protocol this rule applies to. Can be Tcp, Udp or + All(*). + :paramtype protocol: str + :keyword source_address_prefix: Gets or sets source address prefix. CIDR or source IP range. A + “*” can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, + ‘AzureLoadBalancer’ and ‘Internet’ can also be used. If this is an ingress + rule, specifies where network traffic originates from. + :paramtype source_address_prefix: str + :keyword source_port_range: Gets or sets Source Port or Range. Integer or range between 0 and + + + #. A “*” can also be used to match all ports. + :paramtype source_port_range: str + """ super(NsgSecurityRule, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.access = kwargs.get('access', None) @@ -1517,6 +1936,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -1525,7 +1946,7 @@ def __init__( class OperationsDiscovery(msrest.serialization.Model): """Operations discovery class. - :param name: Gets or sets Name of the API. + :ivar name: Gets or sets Name of the API. The name of the operation being performed on this particular object. It should match the action name that appears in RBAC / the event service. Examples of operations include: @@ -1549,23 +1970,23 @@ class OperationsDiscovery(msrest.serialization.Model): This API is used to register for their service, and should include details about the operation (e.g. a localized name for the resource provider + any special considerations like PII release). - :type name: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool - :param display: Contains the localized display information for this particular operation / + :vartype name: str + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool + :ivar display: Contains the localized display information for this particular operation / action. These value will be used by several clients for (1) custom role definitions for RBAC; (2) complex query filters for the event service; and (3) audit history / records for management operations. - :type display: ~resource_mover_service_api.models.Display - :param origin: Gets or sets Origin. + :vartype display: ~resource_mover_service_api.models.Display + :ivar origin: Gets or sets Origin. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is "user,system". - :type origin: str - :param properties: Any object. - :type properties: any + :vartype origin: str + :ivar properties: Any object. + :vartype properties: any """ _attribute_map = { @@ -1580,6 +2001,49 @@ def __init__( self, **kwargs ): + """ + :keyword name: Gets or sets Name of the API. + The name of the operation being performed on this particular object. It should + match the action name that appears in RBAC / the event service. + Examples of operations include: + + + * Microsoft.Compute/virtualMachine/capture/action + * Microsoft.Compute/virtualMachine/restart/action + * Microsoft.Compute/virtualMachine/write + * Microsoft.Compute/virtualMachine/read + * Microsoft.Compute/virtualMachine/delete + Each action should include, in order: + (1) Resource Provider Namespace + (2) Type hierarchy for which the action applies (e.g. server/databases for a SQL + Azure database) + (3) Read, Write, Action or Delete indicating which type applies. If it is a PUT/PATCH + on a collection or named value, Write should be used. + If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it + is a POST, Action should be used. + As a note: all resource providers would need to include the "{Resource Provider + Namespace}/register/action" operation in their response. + This API is used to register for their service, and should include details about the + operation (e.g. a localized name for the resource provider + any special + considerations like PII release). + :paramtype name: str + :keyword is_data_action: Indicates whether the operation is a data action. + :paramtype is_data_action: bool + :keyword display: Contains the localized display information for this particular operation / + action. These + value will be used by several clients for + (1) custom role definitions for RBAC; + (2) complex query filters for the event service; and + (3) audit history / records for management operations. + :paramtype display: ~resource_mover_service_api.models.Display + :keyword origin: Gets or sets Origin. + The intended executor of the operation; governs the display of the operation in the + RBAC UX and the audit logs UX. + Default value is "user,system". + :paramtype origin: str + :keyword properties: Any object. + :paramtype properties: any + """ super(OperationsDiscovery, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.is_data_action = kwargs.get('is_data_action', None) @@ -1591,10 +2055,10 @@ def __init__( class OperationsDiscoveryCollection(msrest.serialization.Model): """Collection of ClientDiscovery details. - :param value: Gets or sets the ClientDiscovery details. - :type value: list[~resource_mover_service_api.models.OperationsDiscovery] - :param next_link: Gets or sets the value of next link. - :type next_link: str + :ivar value: Gets or sets the ClientDiscovery details. + :vartype value: list[~resource_mover_service_api.models.OperationsDiscovery] + :ivar next_link: Gets or sets the value of next link. + :vartype next_link: str """ _attribute_map = { @@ -1606,6 +2070,12 @@ def __init__( self, **kwargs ): + """ + :keyword value: Gets or sets the ClientDiscovery details. + :paramtype value: list[~resource_mover_service_api.models.OperationsDiscovery] + :keyword next_link: Gets or sets the value of next link. + :paramtype next_link: str + """ super(OperationsDiscoveryCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) self.next_link = kwargs.get('next_link', None) @@ -1657,6 +2127,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationStatus, self).__init__(**kwargs) self.id = None self.name = None @@ -1700,6 +2172,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationStatusError, self).__init__(**kwargs) self.code = None self.message = None @@ -1712,15 +2186,16 @@ class PrepareRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validate_only: Gets or sets a value indicating whether the operation needs to only run + :ivar validate_only: Gets or sets a value indicating whether the operation needs to only run pre-requisite. - :type validate_only: bool - :param move_resources: Required. Gets or sets the list of resource Id's, by default it accepts + :vartype validate_only: bool + :ivar move_resources: Required. Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property. - :type move_resources: list[str] - :param move_resource_input_type: Defines the move resource input type. Possible values include: + :vartype move_resources: list[str] + :ivar move_resource_input_type: Defines the move resource input type. Possible values include: "MoveResourceId", "MoveResourceSourceId". - :type move_resource_input_type: str or ~resource_mover_service_api.models.MoveResourceInputType + :vartype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType """ _validation = { @@ -1737,6 +2212,19 @@ def __init__( self, **kwargs ): + """ + :keyword validate_only: Gets or sets a value indicating whether the operation needs to only run + pre-requisite. + :paramtype validate_only: bool + :keyword move_resources: Required. Gets or sets the list of resource Id's, by default it + accepts move resource id's unless the input type is switched via moveResourceInputType + property. + :paramtype move_resources: list[str] + :keyword move_resource_input_type: Defines the move resource input type. Possible values + include: "MoveResourceId", "MoveResourceSourceId". + :paramtype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType + """ super(PrepareRequest, self).__init__(**kwargs) self.validate_only = kwargs.get('validate_only', None) self.move_resources = kwargs['move_resources'] @@ -1748,21 +2236,23 @@ class PublicIPAddressResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param domain_name_label: Gets or sets the domain name label. - :type domain_name_label: str - :param fqdn: Gets or sets the fully qualified domain name. - :type fqdn: str - :param public_ip_allocation_method: Gets or sets public IP allocation method. - :type public_ip_allocation_method: str - :param sku: Gets or sets public IP sku. - :type sku: str - :param zones: Gets or sets public IP zones. - :type zones: str + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar domain_name_label: Gets or sets the domain name label. + :vartype domain_name_label: str + :ivar fqdn: Gets or sets the fully qualified domain name. + :vartype fqdn: str + :ivar public_ip_allocation_method: Gets or sets public IP allocation method. + :vartype public_ip_allocation_method: str + :ivar sku: Gets or sets public IP sku. + :vartype sku: str + :ivar zones: Gets or sets public IP zones. + :vartype zones: str """ _validation = { @@ -1773,6 +2263,7 @@ class PublicIPAddressResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, 'fqdn': {'key': 'fqdn', 'type': 'str'}, 'public_ip_allocation_method': {'key': 'publicIpAllocationMethod', 'type': 'str'}, @@ -1784,8 +2275,25 @@ def __init__( self, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword domain_name_label: Gets or sets the domain name label. + :paramtype domain_name_label: str + :keyword fqdn: Gets or sets the fully qualified domain name. + :paramtype fqdn: str + :keyword public_ip_allocation_method: Gets or sets public IP allocation method. + :paramtype public_ip_allocation_method: str + :keyword sku: Gets or sets public IP sku. + :paramtype sku: str + :keyword zones: Gets or sets public IP zones. + :paramtype zones: str + """ super(PublicIPAddressResourceSettings, self).__init__(**kwargs) self.resource_type = 'Microsoft.Network/publicIPAddresses' # type: str + self.tags = kwargs.get('tags', None) self.domain_name_label = kwargs.get('domain_name_label', None) self.fqdn = kwargs.get('fqdn', None) self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) @@ -1798,9 +2306,9 @@ class PublicIpReference(AzureResourceReference): All required parameters must be populated in order to send to Azure. - :param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being + :ivar source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being referenced. - :type source_arm_resource_id: str + :vartype source_arm_resource_id: str """ _validation = { @@ -1815,15 +2323,19 @@ def __init__( self, **kwargs ): + """ + :keyword source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource + being referenced. + :paramtype source_arm_resource_id: str + """ super(PublicIpReference, self).__init__(**kwargs) class RequiredForResourcesCollection(msrest.serialization.Model): """Required for resources collection. - :param source_ids: Gets or sets the list of source Ids for which the input resource is - required. - :type source_ids: list[str] + :ivar source_ids: Gets or sets the list of source Ids for which the input resource is required. + :vartype source_ids: list[str] """ _attribute_map = { @@ -1834,6 +2346,11 @@ def __init__( self, **kwargs ): + """ + :keyword source_ids: Gets or sets the list of source Ids for which the input resource is + required. + :paramtype source_ids: list[str] + """ super(RequiredForResourcesCollection, self).__init__(**kwargs) self.source_ids = kwargs.get('source_ids', None) @@ -1843,11 +2360,11 @@ class ResourceGroupResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str """ _validation = { @@ -1864,6 +2381,10 @@ def __init__( self, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + """ super(ResourceGroupResourceSettings, self).__init__(**kwargs) self.resource_type = 'resourceGroups' # type: str @@ -1873,15 +2394,16 @@ class ResourceMoveRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validate_only: Gets or sets a value indicating whether the operation needs to only run + :ivar validate_only: Gets or sets a value indicating whether the operation needs to only run pre-requisite. - :type validate_only: bool - :param move_resources: Required. Gets or sets the list of resource Id's, by default it accepts + :vartype validate_only: bool + :ivar move_resources: Required. Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property. - :type move_resources: list[str] - :param move_resource_input_type: Defines the move resource input type. Possible values include: + :vartype move_resources: list[str] + :ivar move_resource_input_type: Defines the move resource input type. Possible values include: "MoveResourceId", "MoveResourceSourceId". - :type move_resource_input_type: str or ~resource_mover_service_api.models.MoveResourceInputType + :vartype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType """ _validation = { @@ -1898,6 +2420,19 @@ def __init__( self, **kwargs ): + """ + :keyword validate_only: Gets or sets a value indicating whether the operation needs to only run + pre-requisite. + :paramtype validate_only: bool + :keyword move_resources: Required. Gets or sets the list of resource Id's, by default it + accepts move resource id's unless the input type is switched via moveResourceInputType + property. + :paramtype move_resources: list[str] + :keyword move_resource_input_type: Defines the move resource input type. Possible values + include: "MoveResourceId", "MoveResourceSourceId". + :paramtype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType + """ super(ResourceMoveRequest, self).__init__(**kwargs) self.validate_only = kwargs.get('validate_only', None) self.move_resources = kwargs['move_resources'] @@ -1909,14 +2444,16 @@ class SqlDatabaseResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param zone_redundant: Defines the zone redundant resource setting. Possible values include: + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar zone_redundant: Defines the zone redundant resource setting. Possible values include: "Enable", "Disable". - :type zone_redundant: str or ~resource_mover_service_api.models.ZoneRedundant + :vartype zone_redundant: str or ~resource_mover_service_api.models.ZoneRedundant """ _validation = { @@ -1927,6 +2464,7 @@ class SqlDatabaseResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'zone_redundant': {'key': 'zoneRedundant', 'type': 'str'}, } @@ -1934,8 +2472,18 @@ def __init__( self, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword zone_redundant: Defines the zone redundant resource setting. Possible values include: + "Enable", "Disable". + :paramtype zone_redundant: str or ~resource_mover_service_api.models.ZoneRedundant + """ super(SqlDatabaseResourceSettings, self).__init__(**kwargs) self.resource_type = 'Microsoft.Sql/servers/databases' # type: str + self.tags = kwargs.get('tags', None) self.zone_redundant = kwargs.get('zone_redundant', None) @@ -1944,14 +2492,16 @@ class SqlElasticPoolResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param zone_redundant: Defines the zone redundant resource setting. Possible values include: + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar zone_redundant: Defines the zone redundant resource setting. Possible values include: "Enable", "Disable". - :type zone_redundant: str or ~resource_mover_service_api.models.ZoneRedundant + :vartype zone_redundant: str or ~resource_mover_service_api.models.ZoneRedundant """ _validation = { @@ -1962,6 +2512,7 @@ class SqlElasticPoolResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'zone_redundant': {'key': 'zoneRedundant', 'type': 'str'}, } @@ -1969,8 +2520,18 @@ def __init__( self, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword zone_redundant: Defines the zone redundant resource setting. Possible values include: + "Enable", "Disable". + :paramtype zone_redundant: str or ~resource_mover_service_api.models.ZoneRedundant + """ super(SqlElasticPoolResourceSettings, self).__init__(**kwargs) self.resource_type = 'Microsoft.Sql/servers/elasticPools' # type: str + self.tags = kwargs.get('tags', None) self.zone_redundant = kwargs.get('zone_redundant', None) @@ -1979,11 +2540,11 @@ class SqlServerResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str """ _validation = { @@ -2000,6 +2561,10 @@ def __init__( self, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + """ super(SqlServerResourceSettings, self).__init__(**kwargs) self.resource_type = 'Microsoft.Sql/servers' # type: str @@ -2009,11 +2574,11 @@ class SubnetReference(ProxyResourceReference): All required parameters must be populated in order to send to Azure. - :param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being + :ivar source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being referenced. - :type source_arm_resource_id: str - :param name: Gets the name of the proxy resource on the target side. - :type name: str + :vartype source_arm_resource_id: str + :ivar name: Gets the name of the proxy resource on the target side. + :vartype name: str """ _validation = { @@ -2029,18 +2594,25 @@ def __init__( self, **kwargs ): + """ + :keyword source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource + being referenced. + :paramtype source_arm_resource_id: str + :keyword name: Gets the name of the proxy resource on the target side. + :paramtype name: str + """ super(SubnetReference, self).__init__(**kwargs) class SubnetResourceSettings(msrest.serialization.Model): """Defines the virtual network subnets resource settings. - :param name: Gets or sets the Subnet name. - :type name: str - :param address_prefix: Gets or sets address prefix for the subnet. - :type address_prefix: str - :param network_security_group: Defines reference to NSG. - :type network_security_group: ~resource_mover_service_api.models.NsgReference + :ivar name: Gets or sets the Subnet name. + :vartype name: str + :ivar address_prefix: Gets or sets address prefix for the subnet. + :vartype address_prefix: str + :ivar network_security_group: Defines reference to NSG. + :vartype network_security_group: ~resource_mover_service_api.models.NsgReference """ _attribute_map = { @@ -2053,6 +2625,14 @@ def __init__( self, **kwargs ): + """ + :keyword name: Gets or sets the Subnet name. + :paramtype name: str + :keyword address_prefix: Gets or sets address prefix for the subnet. + :paramtype address_prefix: str + :keyword network_security_group: Defines reference to NSG. + :paramtype network_security_group: ~resource_mover_service_api.models.NsgReference + """ super(SubnetResourceSettings, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.address_prefix = kwargs.get('address_prefix', None) @@ -2062,10 +2642,10 @@ def __init__( class Summary(msrest.serialization.Model): """Summary item. - :param count: Gets the count. - :type count: int - :param item: Gets the item. - :type item: str + :ivar count: Gets the count. + :vartype count: int + :ivar item: Gets the item. + :vartype item: str """ _attribute_map = { @@ -2077,6 +2657,12 @@ def __init__( self, **kwargs ): + """ + :keyword count: Gets the count. + :paramtype count: int + :keyword item: Gets the item. + :paramtype item: str + """ super(Summary, self).__init__(**kwargs) self.count = kwargs.get('count', None) self.item = kwargs.get('item', None) @@ -2085,10 +2671,10 @@ def __init__( class SummaryCollection(msrest.serialization.Model): """Summary Collection. - :param field_name: Gets or sets the field name on which summary is done. - :type field_name: str - :param summary: Gets or sets the list of summary items. - :type summary: list[~resource_mover_service_api.models.Summary] + :ivar field_name: Gets or sets the field name on which summary is done. + :vartype field_name: str + :ivar summary: Gets or sets the list of summary items. + :vartype summary: list[~resource_mover_service_api.models.Summary] """ _attribute_map = { @@ -2100,16 +2686,79 @@ def __init__( self, **kwargs ): + """ + :keyword field_name: Gets or sets the field name on which summary is done. + :paramtype field_name: str + :keyword summary: Gets or sets the list of summary items. + :paramtype summary: list[~resource_mover_service_api.models.Summary] + """ super(SummaryCollection, self).__init__(**kwargs) self.field_name = kwargs.get('field_name', None) self.summary = kwargs.get('summary', None) +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~resource_mover_service_api.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or ~resource_mover_service_api.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or ~resource_mover_service_api.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or ~resource_mover_service_api.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + class UnresolvedDependenciesFilter(msrest.serialization.Model): """Unresolved dependencies contract. - :param properties: - :type properties: ~resource_mover_service_api.models.UnresolvedDependenciesFilterProperties + :ivar properties: + :vartype properties: ~resource_mover_service_api.models.UnresolvedDependenciesFilterProperties """ _attribute_map = { @@ -2120,6 +2769,11 @@ def __init__( self, **kwargs ): + """ + :keyword properties: + :paramtype properties: + ~resource_mover_service_api.models.UnresolvedDependenciesFilterProperties + """ super(UnresolvedDependenciesFilter, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) @@ -2127,8 +2781,8 @@ def __init__( class UnresolvedDependenciesFilterProperties(msrest.serialization.Model): """UnresolvedDependenciesFilterProperties. - :param count: The count of the resource. - :type count: int + :ivar count: The count of the resource. + :vartype count: int """ _attribute_map = { @@ -2139,6 +2793,10 @@ def __init__( self, **kwargs ): + """ + :keyword count: The count of the resource. + :paramtype count: int + """ super(UnresolvedDependenciesFilterProperties, self).__init__(**kwargs) self.count = kwargs.get('count', None) @@ -2146,10 +2804,10 @@ def __init__( class UnresolvedDependency(msrest.serialization.Model): """Unresolved dependency. - :param count: Gets or sets the count. - :type count: int - :param id: Gets or sets the arm id of the dependency. - :type id: str + :ivar count: Gets or sets the count. + :vartype count: int + :ivar id: Gets or sets the arm id of the dependency. + :vartype id: str """ _attribute_map = { @@ -2161,6 +2819,12 @@ def __init__( self, **kwargs ): + """ + :keyword count: Gets or sets the count. + :paramtype count: int + :keyword id: Gets or sets the arm id of the dependency. + :paramtype id: str + """ super(UnresolvedDependency, self).__init__(**kwargs) self.count = kwargs.get('count', None) self.id = kwargs.get('id', None) @@ -2171,10 +2835,10 @@ class UnresolvedDependencyCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: Gets or sets the list of unresolved dependencies. - :type value: list[~resource_mover_service_api.models.UnresolvedDependency] - :param next_link: Gets or sets the value of next link. - :type next_link: str + :ivar value: Gets or sets the list of unresolved dependencies. + :vartype value: list[~resource_mover_service_api.models.UnresolvedDependency] + :ivar next_link: Gets or sets the value of next link. + :vartype next_link: str :ivar summary_collection: Gets or sets the list of summary items and the field on which summary is done. :vartype summary_collection: ~resource_mover_service_api.models.SummaryCollection @@ -2198,6 +2862,12 @@ def __init__( self, **kwargs ): + """ + :keyword value: Gets or sets the list of unresolved dependencies. + :paramtype value: list[~resource_mover_service_api.models.UnresolvedDependency] + :keyword next_link: Gets or sets the value of next link. + :paramtype next_link: str + """ super(UnresolvedDependencyCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) self.next_link = kwargs.get('next_link', None) @@ -2208,10 +2878,10 @@ def __init__( class UpdateMoveCollectionRequest(msrest.serialization.Model): """Defines the request body for updating move collection. - :param tags: A set of tags. Gets or sets the Resource tags. - :type tags: dict[str, str] - :param identity: Defines the MSI properties of the Move Collection. - :type identity: ~resource_mover_service_api.models.Identity + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar identity: Defines the MSI properties of the Move Collection. + :vartype identity: ~resource_mover_service_api.models.Identity """ _attribute_map = { @@ -2223,6 +2893,12 @@ def __init__( self, **kwargs ): + """ + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: Defines the MSI properties of the Move Collection. + :paramtype identity: ~resource_mover_service_api.models.Identity + """ super(UpdateMoveCollectionRequest, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) self.identity = kwargs.get('identity', None) @@ -2233,20 +2909,24 @@ class VirtualMachineResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param target_availability_zone: Gets or sets the target availability zone. Possible values + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar user_managed_identities: Gets or sets user-managed identities. + :vartype user_managed_identities: list[str] + :ivar target_availability_zone: Gets or sets the target availability zone. Possible values include: "1", "2", "3", "NA". - :type target_availability_zone: str or + :vartype target_availability_zone: str or ~resource_mover_service_api.models.TargetAvailabilityZone - :param target_vm_size: Gets or sets the target virtual machine size. - :type target_vm_size: str - :param target_availability_set_id: Gets or sets the target availability set id for virtual + :ivar target_vm_size: Gets or sets the target virtual machine size. + :vartype target_vm_size: str + :ivar target_availability_set_id: Gets or sets the target availability set id for virtual machines not in an availability set at source. - :type target_availability_set_id: str + :vartype target_availability_set_id: str """ _validation = { @@ -2257,6 +2937,8 @@ class VirtualMachineResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'user_managed_identities': {'key': 'userManagedIdentities', 'type': '[str]'}, 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, 'target_vm_size': {'key': 'targetVmSize', 'type': 'str'}, 'target_availability_set_id': {'key': 'targetAvailabilitySetId', 'type': 'str'}, @@ -2266,8 +2948,27 @@ def __init__( self, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword user_managed_identities: Gets or sets user-managed identities. + :paramtype user_managed_identities: list[str] + :keyword target_availability_zone: Gets or sets the target availability zone. Possible values + include: "1", "2", "3", "NA". + :paramtype target_availability_zone: str or + ~resource_mover_service_api.models.TargetAvailabilityZone + :keyword target_vm_size: Gets or sets the target virtual machine size. + :paramtype target_vm_size: str + :keyword target_availability_set_id: Gets or sets the target availability set id for virtual + machines not in an availability set at source. + :paramtype target_availability_set_id: str + """ super(VirtualMachineResourceSettings, self).__init__(**kwargs) self.resource_type = 'Microsoft.Compute/virtualMachines' # type: str + self.tags = kwargs.get('tags', None) + self.user_managed_identities = kwargs.get('user_managed_identities', None) self.target_availability_zone = kwargs.get('target_availability_zone', None) self.target_vm_size = kwargs.get('target_vm_size', None) self.target_availability_set_id = kwargs.get('target_availability_set_id', None) @@ -2278,22 +2979,24 @@ class VirtualNetworkResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param enable_ddos_protection: Gets or sets a value indicating whether gets or sets whether the + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar enable_ddos_protection: Gets or sets a value indicating whether gets or sets whether the DDOS protection should be switched on. - :type enable_ddos_protection: bool - :param address_space: Gets or sets the address prefixes for the virtual network. - :type address_space: list[str] - :param dns_servers: Gets or sets DHCPOptions that contains an array of DNS servers available to + :vartype enable_ddos_protection: bool + :ivar address_space: Gets or sets the address prefixes for the virtual network. + :vartype address_space: list[str] + :ivar dns_servers: Gets or sets DHCPOptions that contains an array of DNS servers available to VMs deployed in the virtual network. - :type dns_servers: list[str] - :param subnets: Gets or sets List of subnets in a VirtualNetwork. - :type subnets: list[~resource_mover_service_api.models.SubnetResourceSettings] + :vartype dns_servers: list[str] + :ivar subnets: Gets or sets List of subnets in a VirtualNetwork. + :vartype subnets: list[~resource_mover_service_api.models.SubnetResourceSettings] """ _validation = { @@ -2304,6 +3007,7 @@ class VirtualNetworkResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'enable_ddos_protection': {'key': 'enableDdosProtection', 'type': 'bool'}, 'address_space': {'key': 'addressSpace', 'type': '[str]'}, 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, @@ -2314,8 +3018,27 @@ def __init__( self, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword enable_ddos_protection: Gets or sets a value indicating whether gets or sets whether + the + DDOS protection should be switched on. + :paramtype enable_ddos_protection: bool + :keyword address_space: Gets or sets the address prefixes for the virtual network. + :paramtype address_space: list[str] + :keyword dns_servers: Gets or sets DHCPOptions that contains an array of DNS servers available + to VMs + deployed in the virtual network. + :paramtype dns_servers: list[str] + :keyword subnets: Gets or sets List of subnets in a VirtualNetwork. + :paramtype subnets: list[~resource_mover_service_api.models.SubnetResourceSettings] + """ super(VirtualNetworkResourceSettings, self).__init__(**kwargs) self.resource_type = 'Microsoft.Network/virtualNetworks' # type: str + self.tags = kwargs.get('tags', None) self.enable_ddos_protection = kwargs.get('enable_ddos_protection', None) self.address_space = kwargs.get('address_space', None) self.dns_servers = kwargs.get('dns_servers', None) diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models_py3.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models_py3.py index 103aacce22b7..5bf74f6ddd65 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models_py3.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models_py3.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime from typing import Any, Dict, List, Optional, Union import msrest.serialization @@ -42,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(AffectedMoveResource, self).__init__(**kwargs) self.id = None self.source_id = None @@ -51,9 +54,9 @@ def __init__( class AutomaticResolutionProperties(msrest.serialization.Model): """Defines the properties for automatic resolution. - :param move_resource_id: Gets the MoveResource ARM ID of + :ivar move_resource_id: Gets the MoveResource ARM ID of the dependent resource if the resolution type is Automatic. - :type move_resource_id: str + :vartype move_resource_id: str """ _attribute_map = { @@ -66,6 +69,11 @@ def __init__( move_resource_id: Optional[str] = None, **kwargs ): + """ + :keyword move_resource_id: Gets the MoveResource ARM ID of + the dependent resource if the resolution type is Automatic. + :paramtype move_resource_id: str + """ super(AutomaticResolutionProperties, self).__init__(**kwargs) self.move_resource_id = move_resource_id @@ -78,11 +86,11 @@ class ResourceSettings(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str """ _validation = { @@ -105,6 +113,10 @@ def __init__( target_resource_name: str, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + """ super(ResourceSettings, self).__init__(**kwargs) self.resource_type = None # type: Optional[str] self.target_resource_name = target_resource_name @@ -115,15 +127,17 @@ class AvailabilitySetResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param fault_domain: Gets or sets the target fault domain. - :type fault_domain: int - :param update_domain: Gets or sets the target update domain. - :type update_domain: int + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar fault_domain: Gets or sets the target fault domain. + :vartype fault_domain: int + :ivar update_domain: Gets or sets the target update domain. + :vartype update_domain: int """ _validation = { @@ -136,6 +150,7 @@ class AvailabilitySetResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'fault_domain': {'key': 'faultDomain', 'type': 'int'}, 'update_domain': {'key': 'updateDomain', 'type': 'int'}, } @@ -144,12 +159,24 @@ def __init__( self, *, target_resource_name: str, + tags: Optional[Dict[str, str]] = None, fault_domain: Optional[int] = None, update_domain: Optional[int] = None, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword fault_domain: Gets or sets the target fault domain. + :paramtype fault_domain: int + :keyword update_domain: Gets or sets the target update domain. + :paramtype update_domain: int + """ super(AvailabilitySetResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) self.resource_type = 'Microsoft.Compute/availabilitySets' # type: str + self.tags = tags self.fault_domain = fault_domain self.update_domain = update_domain @@ -159,9 +186,9 @@ class AzureResourceReference(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being + :ivar source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being referenced. - :type source_arm_resource_id: str + :vartype source_arm_resource_id: str """ _validation = { @@ -178,6 +205,11 @@ def __init__( source_arm_resource_id: str, **kwargs ): + """ + :keyword source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource + being referenced. + :paramtype source_arm_resource_id: str + """ super(AzureResourceReference, self).__init__(**kwargs) self.source_arm_resource_id = source_arm_resource_id @@ -185,15 +217,16 @@ def __init__( class BulkRemoveRequest(msrest.serialization.Model): """Defines the request body for bulk remove of move resources operation. - :param validate_only: Gets or sets a value indicating whether the operation needs to only run + :ivar validate_only: Gets or sets a value indicating whether the operation needs to only run pre-requisite. - :type validate_only: bool - :param move_resources: Gets or sets the list of resource Id's, by default it accepts move + :vartype validate_only: bool + :ivar move_resources: Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property. - :type move_resources: list[str] - :param move_resource_input_type: Defines the move resource input type. Possible values include: + :vartype move_resources: list[str] + :ivar move_resource_input_type: Defines the move resource input type. Possible values include: "MoveResourceId", "MoveResourceSourceId". - :type move_resource_input_type: str or ~resource_mover_service_api.models.MoveResourceInputType + :vartype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType """ _attribute_map = { @@ -210,6 +243,18 @@ def __init__( move_resource_input_type: Optional[Union[str, "MoveResourceInputType"]] = None, **kwargs ): + """ + :keyword validate_only: Gets or sets a value indicating whether the operation needs to only run + pre-requisite. + :paramtype validate_only: bool + :keyword move_resources: Gets or sets the list of resource Id's, by default it accepts move + resource id's unless the input type is switched via moveResourceInputType property. + :paramtype move_resources: list[str] + :keyword move_resource_input_type: Defines the move resource input type. Possible values + include: "MoveResourceId", "MoveResourceSourceId". + :paramtype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType + """ super(BulkRemoveRequest, self).__init__(**kwargs) self.validate_only = validate_only self.move_resources = move_resources @@ -219,17 +264,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - :type code: str - :param message: A message describing the error, intended to be suitable for display in a user + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~resource_mover_service_api.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~resource_mover_service_api.models.CloudErrorBody] """ _attribute_map = { @@ -248,6 +293,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~resource_mover_service_api.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -260,15 +318,16 @@ class CommitRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validate_only: Gets or sets a value indicating whether the operation needs to only run + :ivar validate_only: Gets or sets a value indicating whether the operation needs to only run pre-requisite. - :type validate_only: bool - :param move_resources: Required. Gets or sets the list of resource Id's, by default it accepts + :vartype validate_only: bool + :ivar move_resources: Required. Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property. - :type move_resources: list[str] - :param move_resource_input_type: Defines the move resource input type. Possible values include: + :vartype move_resources: list[str] + :ivar move_resource_input_type: Defines the move resource input type. Possible values include: "MoveResourceId", "MoveResourceSourceId". - :type move_resource_input_type: str or ~resource_mover_service_api.models.MoveResourceInputType + :vartype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType """ _validation = { @@ -289,6 +348,19 @@ def __init__( move_resource_input_type: Optional[Union[str, "MoveResourceInputType"]] = None, **kwargs ): + """ + :keyword validate_only: Gets or sets a value indicating whether the operation needs to only run + pre-requisite. + :paramtype validate_only: bool + :keyword move_resources: Required. Gets or sets the list of resource Id's, by default it + accepts move resource id's unless the input type is switched via moveResourceInputType + property. + :paramtype move_resources: list[str] + :keyword move_resource_input_type: Defines the move resource input type. Possible values + include: "MoveResourceId", "MoveResourceSourceId". + :paramtype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType + """ super(CommitRequest, self).__init__(**kwargs) self.validate_only = validate_only self.move_resources = move_resources @@ -300,15 +372,16 @@ class DiscardRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validate_only: Gets or sets a value indicating whether the operation needs to only run + :ivar validate_only: Gets or sets a value indicating whether the operation needs to only run pre-requisite. - :type validate_only: bool - :param move_resources: Required. Gets or sets the list of resource Id's, by default it accepts + :vartype validate_only: bool + :ivar move_resources: Required. Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property. - :type move_resources: list[str] - :param move_resource_input_type: Defines the move resource input type. Possible values include: + :vartype move_resources: list[str] + :ivar move_resource_input_type: Defines the move resource input type. Possible values include: "MoveResourceId", "MoveResourceSourceId". - :type move_resource_input_type: str or ~resource_mover_service_api.models.MoveResourceInputType + :vartype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType """ _validation = { @@ -329,6 +402,19 @@ def __init__( move_resource_input_type: Optional[Union[str, "MoveResourceInputType"]] = None, **kwargs ): + """ + :keyword validate_only: Gets or sets a value indicating whether the operation needs to only run + pre-requisite. + :paramtype validate_only: bool + :keyword move_resources: Required. Gets or sets the list of resource Id's, by default it + accepts move resource id's unless the input type is switched via moveResourceInputType + property. + :paramtype move_resources: list[str] + :keyword move_resource_input_type: Defines the move resource input type. Possible values + include: "MoveResourceId", "MoveResourceSourceId". + :paramtype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType + """ super(DiscardRequest, self).__init__(**kwargs) self.validate_only = validate_only self.move_resources = move_resources @@ -340,11 +426,11 @@ class DiskEncryptionSetResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str """ _validation = { @@ -363,6 +449,10 @@ def __init__( target_resource_name: str, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + """ super(DiskEncryptionSetResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) self.resource_type = 'Microsoft.Compute/diskEncryptionSets' # type: str @@ -374,13 +464,13 @@ class Display(msrest.serialization.Model): (2) complex query filters for the event service; and (3) audit history / records for management operations. - :param provider: Gets or sets the provider. + :ivar provider: Gets or sets the provider. The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". - :type provider: str - :param resource: Gets or sets the resource. + :vartype provider: str + :ivar resource: Gets or sets the resource. The localized friendly form of the resource related to this action/operation – it should match the public documentation for the resource provider. It should use Title Casing. @@ -388,14 +478,14 @@ class Display(msrest.serialization.Model): reuse their parent’s display.resource field) e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler Jobs". - :type resource: str - :param operation: Gets or sets the operation. + :vartype resource: str + :ivar operation: Gets or sets the operation. The localized friendly name for the operation, as it should be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. - :type operation: str - :param description: Gets or sets the description. + :vartype operation: str + :ivar description: Gets or sets the description. The localized friendly description for the operation, as it should be shown to the user. It should be thorough, yet concise – it will be used in tool tips and detailed views. @@ -407,7 +497,7 @@ class Display(msrest.serialization.Model): Prescriptive guidance for namespace: Read any 'display.resource' Create or Update any 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. - :type description: str + :vartype description: str """ _attribute_map = { @@ -426,6 +516,42 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword provider: Gets or sets the provider. + The localized friendly form of the resource provider name – it is expected to also + include the publisher/company responsible. + It should use Title Casing and begin with "Microsoft" for 1st party services. + e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + :paramtype provider: str + :keyword resource: Gets or sets the resource. + The localized friendly form of the resource related to this action/operation – it + should match the public documentation for the resource provider. + It should use Title Casing. + This value should be unique for a particular URL type (e.g. nested types should *not* + reuse their parent’s display.resource field) + e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" + or "Scheduler Jobs". + :paramtype resource: str + :keyword operation: Gets or sets the operation. + The localized friendly name for the operation, as it should be shown to the user. + It should be concise (to fit in drop downs) but clear (i.e. self-documenting). + It should use Title Casing. + Prescriptive guidance: Read Create or Update Delete 'ActionName'. + :paramtype operation: str + :keyword description: Gets or sets the description. + The localized friendly description for the operation, as it should be shown to the + user. + It should be thorough, yet concise – it will be used in tool tips and detailed views. + Prescriptive guidance for namespace: + Read any 'display.provider' resource + Create or Update any 'display.provider' resource + Delete any 'display.provider' resource + Perform any other action on any 'display.provider' resource + Prescriptive guidance for namespace: + Read any 'display.resource' Create or Update any 'display.resource' Delete any + 'display.resource' 'ActionName' any 'display.resources'. + :paramtype description: str + """ super(Display, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -436,13 +562,13 @@ def __init__( class Identity(msrest.serialization.Model): """Defines the MSI properties of the Move Collection. - :param type: The type of identity used for the resource mover service. Possible values include: + :ivar type: The type of identity used for the resource mover service. Possible values include: "None", "SystemAssigned", "UserAssigned". - :type type: str or ~resource_mover_service_api.models.ResourceIdentityType - :param principal_id: Gets or sets the principal id. - :type principal_id: str - :param tenant_id: Gets or sets the tenant id. - :type tenant_id: str + :vartype type: str or ~resource_mover_service_api.models.ResourceIdentityType + :ivar principal_id: Gets or sets the principal id. + :vartype principal_id: str + :ivar tenant_id: Gets or sets the tenant id. + :vartype tenant_id: str """ _attribute_map = { @@ -459,6 +585,15 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword type: The type of identity used for the resource mover service. Possible values + include: "None", "SystemAssigned", "UserAssigned". + :paramtype type: str or ~resource_mover_service_api.models.ResourceIdentityType + :keyword principal_id: Gets or sets the principal id. + :paramtype principal_id: str + :keyword tenant_id: Gets or sets the tenant id. + :paramtype tenant_id: str + """ super(Identity, self).__init__(**kwargs) self.type = type self.principal_id = principal_id @@ -490,6 +625,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobStatus, self).__init__(**kwargs) self.job_name = None self.job_progress = None @@ -500,11 +637,11 @@ class KeyVaultResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str """ _validation = { @@ -523,6 +660,10 @@ def __init__( target_resource_name: str, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + """ super(KeyVaultResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) self.resource_type = 'Microsoft.KeyVault/vaults' # type: str @@ -530,8 +671,8 @@ def __init__( class LBBackendAddressPoolResourceSettings(msrest.serialization.Model): """Defines load balancer backend address pool properties. - :param name: Gets or sets the backend address pool name. - :type name: str + :ivar name: Gets or sets the backend address pool name. + :vartype name: str """ _attribute_map = { @@ -544,6 +685,10 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword name: Gets or sets the backend address pool name. + :paramtype name: str + """ super(LBBackendAddressPoolResourceSettings, self).__init__(**kwargs) self.name = name @@ -551,18 +696,18 @@ def __init__( class LBFrontendIPConfigurationResourceSettings(msrest.serialization.Model): """Defines load balancer frontend IP configuration properties. - :param name: Gets or sets the frontend IP configuration name. - :type name: str - :param private_ip_address: Gets or sets the IP address of the Load Balancer.This is only + :ivar name: Gets or sets the frontend IP configuration name. + :vartype name: str + :ivar private_ip_address: Gets or sets the IP address of the Load Balancer.This is only specified if a specific private IP address shall be allocated from the subnet specified in subnetRef. - :type private_ip_address: str - :param private_ip_allocation_method: Gets or sets PrivateIP allocation method (Static/Dynamic). - :type private_ip_allocation_method: str - :param subnet: Defines reference to subnet. - :type subnet: ~resource_mover_service_api.models.SubnetReference - :param zones: Gets or sets the csv list of zones. - :type zones: str + :vartype private_ip_address: str + :ivar private_ip_allocation_method: Gets or sets PrivateIP allocation method (Static/Dynamic). + :vartype private_ip_allocation_method: str + :ivar subnet: Defines reference to subnet. + :vartype subnet: ~resource_mover_service_api.models.SubnetReference + :ivar zones: Gets or sets the csv list of zones. + :vartype zones: str """ _attribute_map = { @@ -583,6 +728,21 @@ def __init__( zones: Optional[str] = None, **kwargs ): + """ + :keyword name: Gets or sets the frontend IP configuration name. + :paramtype name: str + :keyword private_ip_address: Gets or sets the IP address of the Load Balancer.This is only + specified if a specific + private IP address shall be allocated from the subnet specified in subnetRef. + :paramtype private_ip_address: str + :keyword private_ip_allocation_method: Gets or sets PrivateIP allocation method + (Static/Dynamic). + :paramtype private_ip_allocation_method: str + :keyword subnet: Defines reference to subnet. + :paramtype subnet: ~resource_mover_service_api.models.SubnetReference + :keyword zones: Gets or sets the csv list of zones. + :paramtype zones: str + """ super(LBFrontendIPConfigurationResourceSettings, self).__init__(**kwargs) self.name = name self.private_ip_address = private_ip_address @@ -596,11 +756,11 @@ class ProxyResourceReference(AzureResourceReference): All required parameters must be populated in order to send to Azure. - :param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being + :ivar source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being referenced. - :type source_arm_resource_id: str - :param name: Gets the name of the proxy resource on the target side. - :type name: str + :vartype source_arm_resource_id: str + :ivar name: Gets the name of the proxy resource on the target side. + :vartype name: str """ _validation = { @@ -619,6 +779,13 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource + being referenced. + :paramtype source_arm_resource_id: str + :keyword name: Gets the name of the proxy resource on the target side. + :paramtype name: str + """ super(ProxyResourceReference, self).__init__(source_arm_resource_id=source_arm_resource_id, **kwargs) self.name = name @@ -628,11 +795,11 @@ class LoadBalancerBackendAddressPoolReference(ProxyResourceReference): All required parameters must be populated in order to send to Azure. - :param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being + :ivar source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being referenced. - :type source_arm_resource_id: str - :param name: Gets the name of the proxy resource on the target side. - :type name: str + :vartype source_arm_resource_id: str + :ivar name: Gets the name of the proxy resource on the target side. + :vartype name: str """ _validation = { @@ -651,6 +818,13 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource + being referenced. + :paramtype source_arm_resource_id: str + :keyword name: Gets the name of the proxy resource on the target side. + :paramtype name: str + """ super(LoadBalancerBackendAddressPoolReference, self).__init__(source_arm_resource_id=source_arm_resource_id, name=name, **kwargs) @@ -659,11 +833,11 @@ class LoadBalancerNatRuleReference(ProxyResourceReference): All required parameters must be populated in order to send to Azure. - :param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being + :ivar source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being referenced. - :type source_arm_resource_id: str - :param name: Gets the name of the proxy resource on the target side. - :type name: str + :vartype source_arm_resource_id: str + :ivar name: Gets the name of the proxy resource on the target side. + :vartype name: str """ _validation = { @@ -682,6 +856,13 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource + being referenced. + :paramtype source_arm_resource_id: str + :keyword name: Gets the name of the proxy resource on the target side. + :paramtype name: str + """ super(LoadBalancerNatRuleReference, self).__init__(source_arm_resource_id=source_arm_resource_id, name=name, **kwargs) @@ -690,24 +871,26 @@ class LoadBalancerResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param sku: Gets or sets load balancer sku (Basic/Standard). - :type sku: str - :param frontend_ip_configurations: Gets or sets the frontend IP configurations of the load + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar sku: Gets or sets load balancer sku (Basic/Standard). + :vartype sku: str + :ivar frontend_ip_configurations: Gets or sets the frontend IP configurations of the load balancer. - :type frontend_ip_configurations: + :vartype frontend_ip_configurations: list[~resource_mover_service_api.models.LBFrontendIPConfigurationResourceSettings] - :param backend_address_pools: Gets or sets the backend address pools of the load balancer. - :type backend_address_pools: + :ivar backend_address_pools: Gets or sets the backend address pools of the load balancer. + :vartype backend_address_pools: list[~resource_mover_service_api.models.LBBackendAddressPoolResourceSettings] - :param zones: Gets or sets the csv list of zones common for all frontend IP configurations. - Note this is given + :ivar zones: Gets or sets the csv list of zones common for all frontend IP configurations. Note + this is given precedence only if frontend IP configurations settings are not present. - :type zones: str + :vartype zones: str """ _validation = { @@ -718,6 +901,7 @@ class LoadBalancerResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'str'}, 'frontend_ip_configurations': {'key': 'frontendIPConfigurations', 'type': '[LBFrontendIPConfigurationResourceSettings]'}, 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[LBBackendAddressPoolResourceSettings]'}, @@ -728,14 +912,35 @@ def __init__( self, *, target_resource_name: str, + tags: Optional[Dict[str, str]] = None, sku: Optional[str] = None, frontend_ip_configurations: Optional[List["LBFrontendIPConfigurationResourceSettings"]] = None, backend_address_pools: Optional[List["LBBackendAddressPoolResourceSettings"]] = None, zones: Optional[str] = None, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: Gets or sets load balancer sku (Basic/Standard). + :paramtype sku: str + :keyword frontend_ip_configurations: Gets or sets the frontend IP configurations of the load + balancer. + :paramtype frontend_ip_configurations: + list[~resource_mover_service_api.models.LBFrontendIPConfigurationResourceSettings] + :keyword backend_address_pools: Gets or sets the backend address pools of the load balancer. + :paramtype backend_address_pools: + list[~resource_mover_service_api.models.LBBackendAddressPoolResourceSettings] + :keyword zones: Gets or sets the csv list of zones common for all frontend IP configurations. + Note this is given + precedence only if frontend IP configurations settings are not present. + :paramtype zones: str + """ super(LoadBalancerResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) self.resource_type = 'Microsoft.Network/loadBalancers' # type: str + self.tags = tags self.sku = sku self.frontend_ip_configurations = frontend_ip_configurations self.backend_address_pools = backend_address_pools @@ -745,9 +950,9 @@ def __init__( class ManualResolutionProperties(msrest.serialization.Model): """Defines the properties for manual resolution. - :param target_id: Gets or sets the target resource ARM ID of the dependent resource if the + :ivar target_id: Gets or sets the target resource ARM ID of the dependent resource if the resource type is Manual. - :type target_id: str + :vartype target_id: str """ _attribute_map = { @@ -760,6 +965,11 @@ def __init__( target_id: Optional[str] = None, **kwargs ): + """ + :keyword target_id: Gets or sets the target resource ARM ID of the dependent resource if the + resource type is Manual. + :paramtype target_id: str + """ super(ManualResolutionProperties, self).__init__(**kwargs) self.target_id = target_id @@ -777,14 +987,16 @@ class MoveCollection(msrest.serialization.Model): :vartype type: str :ivar etag: The etag of the resource. :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: The geo-location where the resource lives. - :type location: str - :param identity: Defines the MSI properties of the Move Collection. - :type identity: ~resource_mover_service_api.models.Identity - :param properties: Defines the move collection properties. - :type properties: ~resource_mover_service_api.models.MoveCollectionProperties + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. + :vartype location: str + :ivar identity: Defines the MSI properties of the Move Collection. + :vartype identity: ~resource_mover_service_api.models.Identity + :ivar properties: Defines the move collection properties. + :vartype properties: ~resource_mover_service_api.models.MoveCollectionProperties + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~resource_mover_service_api.models.SystemData """ _validation = { @@ -792,6 +1004,7 @@ class MoveCollection(msrest.serialization.Model): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -803,6 +1016,7 @@ class MoveCollection(msrest.serialization.Model): 'location': {'key': 'location', 'type': 'str'}, 'identity': {'key': 'identity', 'type': 'Identity'}, 'properties': {'key': 'properties', 'type': 'MoveCollectionProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( @@ -814,6 +1028,16 @@ def __init__( properties: Optional["MoveCollectionProperties"] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. + :paramtype location: str + :keyword identity: Defines the MSI properties of the Move Collection. + :paramtype identity: ~resource_mover_service_api.models.Identity + :keyword properties: Defines the move collection properties. + :paramtype properties: ~resource_mover_service_api.models.MoveCollectionProperties + """ super(MoveCollection, self).__init__(**kwargs) self.id = None self.name = None @@ -823,6 +1047,7 @@ def __init__( self.location = location self.identity = identity self.properties = properties + self.system_data = None class MoveCollectionProperties(msrest.serialization.Model): @@ -832,10 +1057,10 @@ class MoveCollectionProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_region: Required. Gets or sets the source region. - :type source_region: str - :param target_region: Required. Gets or sets the target region. - :type target_region: str + :ivar source_region: Required. Gets or sets the source region. + :vartype source_region: str + :ivar target_region: Required. Gets or sets the target region. + :vartype target_region: str :ivar provisioning_state: Defines the provisioning states. Possible values include: "Succeeded", "Updating", "Creating", "Failed". :vartype provisioning_state: str or ~resource_mover_service_api.models.ProvisioningState @@ -864,6 +1089,12 @@ def __init__( target_region: str, **kwargs ): + """ + :keyword source_region: Required. Gets or sets the source region. + :paramtype source_region: str + :keyword target_region: Required. Gets or sets the target region. + :paramtype target_region: str + """ super(MoveCollectionProperties, self).__init__(**kwargs) self.source_region = source_region self.target_region = target_region @@ -874,8 +1105,8 @@ def __init__( class MoveResourceError(msrest.serialization.Model): """An error response from the azure resource mover service. - :param properties: The move resource error body. - :type properties: ~resource_mover_service_api.models.MoveResourceErrorBody + :ivar properties: The move resource error body. + :vartype properties: ~resource_mover_service_api.models.MoveResourceErrorBody """ _attribute_map = { @@ -888,6 +1119,10 @@ def __init__( properties: Optional["MoveResourceErrorBody"] = None, **kwargs ): + """ + :keyword properties: The move resource error body. + :paramtype properties: ~resource_mover_service_api.models.MoveResourceErrorBody + """ super(MoveResourceError, self).__init__(**kwargs) self.properties = properties @@ -895,8 +1130,8 @@ def __init__( class MoveCollectionPropertiesErrors(MoveResourceError): """Defines the move collection errors. - :param properties: The move resource error body. - :type properties: ~resource_mover_service_api.models.MoveResourceErrorBody + :ivar properties: The move resource error body. + :vartype properties: ~resource_mover_service_api.models.MoveResourceErrorBody """ _attribute_map = { @@ -909,16 +1144,20 @@ def __init__( properties: Optional["MoveResourceErrorBody"] = None, **kwargs ): + """ + :keyword properties: The move resource error body. + :paramtype properties: ~resource_mover_service_api.models.MoveResourceErrorBody + """ super(MoveCollectionPropertiesErrors, self).__init__(properties=properties, **kwargs) class MoveCollectionResultList(msrest.serialization.Model): """Defines the collection of move collections. - :param value: Gets the list of move collections. - :type value: list[~resource_mover_service_api.models.MoveCollection] - :param next_link: Gets the value of next link. - :type next_link: str + :ivar value: Gets the list of move collections. + :vartype value: list[~resource_mover_service_api.models.MoveCollection] + :ivar next_link: Gets the value of next link. + :vartype next_link: str """ _attribute_map = { @@ -933,6 +1172,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: Gets the list of move collections. + :paramtype value: list[~resource_mover_service_api.models.MoveCollection] + :keyword next_link: Gets the value of next link. + :paramtype next_link: str + """ super(MoveCollectionResultList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -959,6 +1204,8 @@ def __init__( self, **kwargs ): + """ + """ super(MoveErrorInfo, self).__init__(**kwargs) self.move_resources = None @@ -974,14 +1221,17 @@ class MoveResource(msrest.serialization.Model): :vartype name: str :ivar type: The type of the resource. :vartype type: str - :param properties: Defines the move resource properties. - :type properties: ~resource_mover_service_api.models.MoveResourceProperties + :ivar properties: Defines the move resource properties. + :vartype properties: ~resource_mover_service_api.models.MoveResourceProperties + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~resource_mover_service_api.models.SystemData """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -989,6 +1239,7 @@ class MoveResource(msrest.serialization.Model): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'MoveResourceProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( @@ -997,11 +1248,16 @@ def __init__( properties: Optional["MoveResourceProperties"] = None, **kwargs ): + """ + :keyword properties: Defines the move resource properties. + :paramtype properties: ~resource_mover_service_api.models.MoveResourceProperties + """ super(MoveResource, self).__init__(**kwargs) self.id = None self.name = None self.type = None self.properties = properties + self.system_data = None class MoveResourceCollection(msrest.serialization.Model): @@ -1009,13 +1265,13 @@ class MoveResourceCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: Gets the list of move resources. - :type value: list[~resource_mover_service_api.models.MoveResource] - :param next_link: Gets the value of next link. - :type next_link: str - :param summary_collection: Gets or sets the list of summary items and the field on which - summary is done. - :type summary_collection: ~resource_mover_service_api.models.SummaryCollection + :ivar value: Gets the list of move resources. + :vartype value: list[~resource_mover_service_api.models.MoveResource] + :ivar next_link: Gets the value of next link. + :vartype next_link: str + :ivar summary_collection: Gets or sets the list of summary items and the field on which summary + is done. + :vartype summary_collection: ~resource_mover_service_api.models.SummaryCollection :ivar total_count: Gets the total count. :vartype total_count: long """ @@ -1039,6 +1295,15 @@ def __init__( summary_collection: Optional["SummaryCollection"] = None, **kwargs ): + """ + :keyword value: Gets the list of move resources. + :paramtype value: list[~resource_mover_service_api.models.MoveResource] + :keyword next_link: Gets the value of next link. + :paramtype next_link: str + :keyword summary_collection: Gets or sets the list of summary items and the field on which + summary is done. + :paramtype summary_collection: ~resource_mover_service_api.models.SummaryCollection + """ super(MoveResourceCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -1049,22 +1314,22 @@ def __init__( class MoveResourceDependency(msrest.serialization.Model): """Defines the dependency of the move resource. - :param id: Gets the source ARM ID of the dependent resource. - :type id: str - :param resolution_status: Gets the dependency resolution status. - :type resolution_status: str - :param resolution_type: Defines the resolution type. Possible values include: "Manual", + :ivar id: Gets the source ARM ID of the dependent resource. + :vartype id: str + :ivar resolution_status: Gets the dependency resolution status. + :vartype resolution_status: str + :ivar resolution_type: Defines the resolution type. Possible values include: "Manual", "Automatic". - :type resolution_type: str or ~resource_mover_service_api.models.ResolutionType - :param dependency_type: Defines the dependency type. Possible values include: + :vartype resolution_type: str or ~resource_mover_service_api.models.ResolutionType + :ivar dependency_type: Defines the dependency type. Possible values include: "RequiredForPrepare", "RequiredForMove". - :type dependency_type: str or ~resource_mover_service_api.models.DependencyType - :param manual_resolution: Defines the properties for manual resolution. - :type manual_resolution: ~resource_mover_service_api.models.ManualResolutionProperties - :param automatic_resolution: Defines the properties for automatic resolution. - :type automatic_resolution: ~resource_mover_service_api.models.AutomaticResolutionProperties - :param is_optional: Gets or sets a value indicating whether the dependency is optional. - :type is_optional: str + :vartype dependency_type: str or ~resource_mover_service_api.models.DependencyType + :ivar manual_resolution: Defines the properties for manual resolution. + :vartype manual_resolution: ~resource_mover_service_api.models.ManualResolutionProperties + :ivar automatic_resolution: Defines the properties for automatic resolution. + :vartype automatic_resolution: ~resource_mover_service_api.models.AutomaticResolutionProperties + :ivar is_optional: Gets or sets a value indicating whether the dependency is optional. + :vartype is_optional: str """ _attribute_map = { @@ -1089,6 +1354,25 @@ def __init__( is_optional: Optional[str] = None, **kwargs ): + """ + :keyword id: Gets the source ARM ID of the dependent resource. + :paramtype id: str + :keyword resolution_status: Gets the dependency resolution status. + :paramtype resolution_status: str + :keyword resolution_type: Defines the resolution type. Possible values include: "Manual", + "Automatic". + :paramtype resolution_type: str or ~resource_mover_service_api.models.ResolutionType + :keyword dependency_type: Defines the dependency type. Possible values include: + "RequiredForPrepare", "RequiredForMove". + :paramtype dependency_type: str or ~resource_mover_service_api.models.DependencyType + :keyword manual_resolution: Defines the properties for manual resolution. + :paramtype manual_resolution: ~resource_mover_service_api.models.ManualResolutionProperties + :keyword automatic_resolution: Defines the properties for automatic resolution. + :paramtype automatic_resolution: + ~resource_mover_service_api.models.AutomaticResolutionProperties + :keyword is_optional: Gets or sets a value indicating whether the dependency is optional. + :paramtype is_optional: str + """ super(MoveResourceDependency, self).__init__(**kwargs) self.id = id self.resolution_status = resolution_status @@ -1102,12 +1386,12 @@ def __init__( class MoveResourceDependencyOverride(msrest.serialization.Model): """Defines the dependency override of the move resource. - :param id: Gets or sets the ARM ID of the dependent resource. - :type id: str - :param target_id: Gets or sets the resource ARM id of either the MoveResource or the resource + :ivar id: Gets or sets the ARM ID of the dependent resource. + :vartype id: str + :ivar target_id: Gets or sets the resource ARM id of either the MoveResource or the resource ARM ID of the dependent resource. - :type target_id: str + :vartype target_id: str """ _attribute_map = { @@ -1122,6 +1406,14 @@ def __init__( target_id: Optional[str] = None, **kwargs ): + """ + :keyword id: Gets or sets the ARM ID of the dependent resource. + :paramtype id: str + :keyword target_id: Gets or sets the resource ARM id of either the MoveResource or the resource + ARM ID of + the dependent resource. + :paramtype target_id: str + """ super(MoveResourceDependencyOverride, self).__init__(**kwargs) self.id = id self.target_id = target_id @@ -1163,6 +1455,8 @@ def __init__( self, **kwargs ): + """ + """ super(MoveResourceErrorBody, self).__init__(**kwargs) self.code = None self.message = None @@ -1173,8 +1467,8 @@ def __init__( class MoveResourceFilter(msrest.serialization.Model): """Move resource filter. - :param properties: - :type properties: ~resource_mover_service_api.models.MoveResourceFilterProperties + :ivar properties: + :vartype properties: ~resource_mover_service_api.models.MoveResourceFilterProperties """ _attribute_map = { @@ -1187,6 +1481,10 @@ def __init__( properties: Optional["MoveResourceFilterProperties"] = None, **kwargs ): + """ + :keyword properties: + :paramtype properties: ~resource_mover_service_api.models.MoveResourceFilterProperties + """ super(MoveResourceFilter, self).__init__(**kwargs) self.properties = properties @@ -1194,8 +1492,8 @@ def __init__( class MoveResourceFilterProperties(msrest.serialization.Model): """MoveResourceFilterProperties. - :param provisioning_state: The provisioning state. - :type provisioning_state: str + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str """ _attribute_map = { @@ -1208,6 +1506,10 @@ def __init__( provisioning_state: Optional[str] = None, **kwargs ): + """ + :keyword provisioning_state: The provisioning state. + :paramtype provisioning_state: str + """ super(MoveResourceFilterProperties, self).__init__(**kwargs) self.provisioning_state = provisioning_state @@ -1222,22 +1524,22 @@ class MoveResourceProperties(msrest.serialization.Model): :ivar provisioning_state: Defines the provisioning states. Possible values include: "Succeeded", "Updating", "Creating", "Failed". :vartype provisioning_state: str or ~resource_mover_service_api.models.ProvisioningState - :param source_id: Required. Gets or sets the Source ARM Id of the resource. - :type source_id: str + :ivar source_id: Required. Gets or sets the Source ARM Id of the resource. + :vartype source_id: str :ivar target_id: Gets or sets the Target ARM Id of the resource. :vartype target_id: str - :param existing_target_id: Gets or sets the existing target ARM Id of the resource. - :type existing_target_id: str - :param resource_settings: Gets or sets the resource settings. - :type resource_settings: ~resource_mover_service_api.models.ResourceSettings + :ivar existing_target_id: Gets or sets the existing target ARM Id of the resource. + :vartype existing_target_id: str + :ivar resource_settings: Gets or sets the resource settings. + :vartype resource_settings: ~resource_mover_service_api.models.ResourceSettings :ivar source_resource_settings: Gets or sets the source resource settings. :vartype source_resource_settings: ~resource_mover_service_api.models.ResourceSettings :ivar move_status: Defines the move resource status. :vartype move_status: ~resource_mover_service_api.models.MoveResourcePropertiesMoveStatus :ivar depends_on: Gets or sets the move resource dependencies. :vartype depends_on: list[~resource_mover_service_api.models.MoveResourceDependency] - :param depends_on_overrides: Gets or sets the move resource dependencies overrides. - :type depends_on_overrides: + :ivar depends_on_overrides: Gets or sets the move resource dependencies overrides. + :vartype depends_on_overrides: list[~resource_mover_service_api.models.MoveResourceDependencyOverride] :ivar is_resolve_required: Gets a value indicating whether the resolve action is required over the move collection. @@ -1280,6 +1582,17 @@ def __init__( depends_on_overrides: Optional[List["MoveResourceDependencyOverride"]] = None, **kwargs ): + """ + :keyword source_id: Required. Gets or sets the Source ARM Id of the resource. + :paramtype source_id: str + :keyword existing_target_id: Gets or sets the existing target ARM Id of the resource. + :paramtype existing_target_id: str + :keyword resource_settings: Gets or sets the resource settings. + :paramtype resource_settings: ~resource_mover_service_api.models.ResourceSettings + :keyword depends_on_overrides: Gets or sets the move resource dependencies overrides. + :paramtype depends_on_overrides: + list[~resource_mover_service_api.models.MoveResourceDependencyOverride] + """ super(MoveResourceProperties, self).__init__(**kwargs) self.provisioning_state = None self.source_id = source_id @@ -1297,8 +1610,8 @@ def __init__( class MoveResourcePropertiesErrors(MoveResourceError): """Defines the move resource errors. - :param properties: The move resource error body. - :type properties: ~resource_mover_service_api.models.MoveResourceErrorBody + :ivar properties: The move resource error body. + :vartype properties: ~resource_mover_service_api.models.MoveResourceErrorBody """ _attribute_map = { @@ -1311,6 +1624,10 @@ def __init__( properties: Optional["MoveResourceErrorBody"] = None, **kwargs ): + """ + :keyword properties: The move resource error body. + :paramtype properties: ~resource_mover_service_api.models.MoveResourceErrorBody + """ super(MoveResourcePropertiesErrors, self).__init__(properties=properties, **kwargs) @@ -1325,10 +1642,10 @@ class MoveResourceStatus(msrest.serialization.Model): "CommitInProgress", "CommitFailed", "Committed", "DeleteSourcePending", "ResourceMoveCompleted". :vartype move_state: str or ~resource_mover_service_api.models.MoveState - :param job_status: Defines the job status. - :type job_status: ~resource_mover_service_api.models.JobStatus - :param errors: An error response from the azure resource mover service. - :type errors: ~resource_mover_service_api.models.MoveResourceError + :ivar job_status: Defines the job status. + :vartype job_status: ~resource_mover_service_api.models.JobStatus + :ivar errors: An error response from the azure resource mover service. + :vartype errors: ~resource_mover_service_api.models.MoveResourceError """ _validation = { @@ -1348,6 +1665,12 @@ def __init__( errors: Optional["MoveResourceError"] = None, **kwargs ): + """ + :keyword job_status: Defines the job status. + :paramtype job_status: ~resource_mover_service_api.models.JobStatus + :keyword errors: An error response from the azure resource mover service. + :paramtype errors: ~resource_mover_service_api.models.MoveResourceError + """ super(MoveResourceStatus, self).__init__(**kwargs) self.move_state = None self.job_status = job_status @@ -1365,10 +1688,10 @@ class MoveResourcePropertiesMoveStatus(MoveResourceStatus): "CommitInProgress", "CommitFailed", "Committed", "DeleteSourcePending", "ResourceMoveCompleted". :vartype move_state: str or ~resource_mover_service_api.models.MoveState - :param job_status: Defines the job status. - :type job_status: ~resource_mover_service_api.models.JobStatus - :param errors: An error response from the azure resource mover service. - :type errors: ~resource_mover_service_api.models.MoveResourceError + :ivar job_status: Defines the job status. + :vartype job_status: ~resource_mover_service_api.models.JobStatus + :ivar errors: An error response from the azure resource mover service. + :vartype errors: ~resource_mover_service_api.models.MoveResourceError """ _validation = { @@ -1388,6 +1711,12 @@ def __init__( errors: Optional["MoveResourceError"] = None, **kwargs ): + """ + :keyword job_status: Defines the job status. + :paramtype job_status: ~resource_mover_service_api.models.JobStatus + :keyword errors: An error response from the azure resource mover service. + :paramtype errors: ~resource_mover_service_api.models.MoveResourceError + """ super(MoveResourcePropertiesMoveStatus, self).__init__(job_status=job_status, errors=errors, **kwargs) @@ -1396,17 +1725,19 @@ class NetworkInterfaceResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param ip_configurations: Gets or sets the IP configurations of the NIC. - :type ip_configurations: + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar ip_configurations: Gets or sets the IP configurations of the NIC. + :vartype ip_configurations: list[~resource_mover_service_api.models.NicIpConfigurationResourceSettings] - :param enable_accelerated_networking: Gets or sets a value indicating whether accelerated + :ivar enable_accelerated_networking: Gets or sets a value indicating whether accelerated networking is enabled. - :type enable_accelerated_networking: bool + :vartype enable_accelerated_networking: bool """ _validation = { @@ -1417,6 +1748,7 @@ class NetworkInterfaceResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'ip_configurations': {'key': 'ipConfigurations', 'type': '[NicIpConfigurationResourceSettings]'}, 'enable_accelerated_networking': {'key': 'enableAcceleratedNetworking', 'type': 'bool'}, } @@ -1425,12 +1757,26 @@ def __init__( self, *, target_resource_name: str, + tags: Optional[Dict[str, str]] = None, ip_configurations: Optional[List["NicIpConfigurationResourceSettings"]] = None, enable_accelerated_networking: Optional[bool] = None, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword ip_configurations: Gets or sets the IP configurations of the NIC. + :paramtype ip_configurations: + list[~resource_mover_service_api.models.NicIpConfigurationResourceSettings] + :keyword enable_accelerated_networking: Gets or sets a value indicating whether accelerated + networking is enabled. + :paramtype enable_accelerated_networking: bool + """ super(NetworkInterfaceResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) self.resource_type = 'Microsoft.Network/networkInterfaces' # type: str + self.tags = tags self.ip_configurations = ip_configurations self.enable_accelerated_networking = enable_accelerated_networking @@ -1440,13 +1786,15 @@ class NetworkSecurityGroupResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param security_rules: Gets or sets Security rules of network security group. - :type security_rules: list[~resource_mover_service_api.models.NsgSecurityRule] + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar security_rules: Gets or sets Security rules of network security group. + :vartype security_rules: list[~resource_mover_service_api.models.NsgSecurityRule] """ _validation = { @@ -1457,6 +1805,7 @@ class NetworkSecurityGroupResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'security_rules': {'key': 'securityRules', 'type': '[NsgSecurityRule]'}, } @@ -1464,37 +1813,47 @@ def __init__( self, *, target_resource_name: str, + tags: Optional[Dict[str, str]] = None, security_rules: Optional[List["NsgSecurityRule"]] = None, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword security_rules: Gets or sets Security rules of network security group. + :paramtype security_rules: list[~resource_mover_service_api.models.NsgSecurityRule] + """ super(NetworkSecurityGroupResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) self.resource_type = 'Microsoft.Network/networkSecurityGroups' # type: str + self.tags = tags self.security_rules = security_rules class NicIpConfigurationResourceSettings(msrest.serialization.Model): """Defines NIC IP configuration properties. - :param name: Gets or sets the IP configuration name. - :type name: str - :param private_ip_address: Gets or sets the private IP address of the network interface IP + :ivar name: Gets or sets the IP configuration name. + :vartype name: str + :ivar private_ip_address: Gets or sets the private IP address of the network interface IP Configuration. - :type private_ip_address: str - :param private_ip_allocation_method: Gets or sets the private IP address allocation method. - :type private_ip_allocation_method: str - :param subnet: Defines reference to subnet. - :type subnet: ~resource_mover_service_api.models.SubnetReference - :param primary: Gets or sets a value indicating whether this IP configuration is the primary. - :type primary: bool - :param load_balancer_backend_address_pools: Gets or sets the references of the load balancer + :vartype private_ip_address: str + :ivar private_ip_allocation_method: Gets or sets the private IP address allocation method. + :vartype private_ip_allocation_method: str + :ivar subnet: Defines reference to subnet. + :vartype subnet: ~resource_mover_service_api.models.SubnetReference + :ivar primary: Gets or sets a value indicating whether this IP configuration is the primary. + :vartype primary: bool + :ivar load_balancer_backend_address_pools: Gets or sets the references of the load balancer backend address pools. - :type load_balancer_backend_address_pools: + :vartype load_balancer_backend_address_pools: list[~resource_mover_service_api.models.LoadBalancerBackendAddressPoolReference] - :param load_balancer_nat_rules: Gets or sets the references of the load balancer NAT rules. - :type load_balancer_nat_rules: + :ivar load_balancer_nat_rules: Gets or sets the references of the load balancer NAT rules. + :vartype load_balancer_nat_rules: list[~resource_mover_service_api.models.LoadBalancerNatRuleReference] - :param public_ip: Defines reference to a public IP. - :type public_ip: ~resource_mover_service_api.models.PublicIpReference + :ivar public_ip: Defines reference to a public IP. + :vartype public_ip: ~resource_mover_service_api.models.PublicIpReference """ _attribute_map = { @@ -1521,6 +1880,28 @@ def __init__( public_ip: Optional["PublicIpReference"] = None, **kwargs ): + """ + :keyword name: Gets or sets the IP configuration name. + :paramtype name: str + :keyword private_ip_address: Gets or sets the private IP address of the network interface IP + Configuration. + :paramtype private_ip_address: str + :keyword private_ip_allocation_method: Gets or sets the private IP address allocation method. + :paramtype private_ip_allocation_method: str + :keyword subnet: Defines reference to subnet. + :paramtype subnet: ~resource_mover_service_api.models.SubnetReference + :keyword primary: Gets or sets a value indicating whether this IP configuration is the primary. + :paramtype primary: bool + :keyword load_balancer_backend_address_pools: Gets or sets the references of the load balancer + backend address pools. + :paramtype load_balancer_backend_address_pools: + list[~resource_mover_service_api.models.LoadBalancerBackendAddressPoolReference] + :keyword load_balancer_nat_rules: Gets or sets the references of the load balancer NAT rules. + :paramtype load_balancer_nat_rules: + list[~resource_mover_service_api.models.LoadBalancerNatRuleReference] + :keyword public_ip: Defines reference to a public IP. + :paramtype public_ip: ~resource_mover_service_api.models.PublicIpReference + """ super(NicIpConfigurationResourceSettings, self).__init__(**kwargs) self.name = name self.private_ip_address = private_ip_address @@ -1537,9 +1918,9 @@ class NsgReference(AzureResourceReference): All required parameters must be populated in order to send to Azure. - :param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being + :ivar source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being referenced. - :type source_arm_resource_id: str + :vartype source_arm_resource_id: str """ _validation = { @@ -1556,46 +1937,51 @@ def __init__( source_arm_resource_id: str, **kwargs ): + """ + :keyword source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource + being referenced. + :paramtype source_arm_resource_id: str + """ super(NsgReference, self).__init__(source_arm_resource_id=source_arm_resource_id, **kwargs) class NsgSecurityRule(msrest.serialization.Model): """Security Rule data model for Network Security Groups. - :param name: Gets or sets the Security rule name. - :type name: str - :param access: Gets or sets whether network traffic is allowed or denied. + :ivar name: Gets or sets the Security rule name. + :vartype name: str + :ivar access: Gets or sets whether network traffic is allowed or denied. Possible values are “Allow” and “Deny”. - :type access: str - :param description: Gets or sets a description for this rule. Restricted to 140 chars. - :type description: str - :param destination_address_prefix: Gets or sets destination address prefix. CIDR or source IP + :vartype access: str + :ivar description: Gets or sets a description for this rule. Restricted to 140 chars. + :vartype description: str + :ivar destination_address_prefix: Gets or sets destination address prefix. CIDR or source IP range. A “*” can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used. - :type destination_address_prefix: str - :param destination_port_range: Gets or sets Destination Port or Range. Integer or range between + :vartype destination_address_prefix: str + :ivar destination_port_range: Gets or sets Destination Port or Range. Integer or range between 0 and 65535. A “*” can also be used to match all ports. - :type destination_port_range: str - :param direction: Gets or sets the direction of the rule.InBound or Outbound. The + :vartype destination_port_range: str + :ivar direction: Gets or sets the direction of the rule.InBound or Outbound. The direction specifies if rule will be evaluated on incoming or outgoing traffic. - :type direction: str - :param priority: Gets or sets the priority of the rule. The value can be between + :vartype direction: str + :ivar priority: Gets or sets the priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. - :type priority: int - :param protocol: Gets or sets Network protocol this rule applies to. Can be Tcp, Udp or All(*). - :type protocol: str - :param source_address_prefix: Gets or sets source address prefix. CIDR or source IP range. A + :vartype priority: int + :ivar protocol: Gets or sets Network protocol this rule applies to. Can be Tcp, Udp or All(*). + :vartype protocol: str + :ivar source_address_prefix: Gets or sets source address prefix. CIDR or source IP range. A “*” can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used. If this is an ingress rule, specifies where network traffic originates from. - :type source_address_prefix: str - :param source_port_range: Gets or sets Source Port or Range. Integer or range between 0 and + :vartype source_address_prefix: str + :ivar source_port_range: Gets or sets Source Port or Range. Integer or range between 0 and #. A “*” can also be used to match all ports. - :type source_port_range: str + :vartype source_port_range: str """ _attribute_map = { @@ -1626,6 +2012,44 @@ def __init__( source_port_range: Optional[str] = None, **kwargs ): + """ + :keyword name: Gets or sets the Security rule name. + :paramtype name: str + :keyword access: Gets or sets whether network traffic is allowed or denied. + Possible values are “Allow” and “Deny”. + :paramtype access: str + :keyword description: Gets or sets a description for this rule. Restricted to 140 chars. + :paramtype description: str + :keyword destination_address_prefix: Gets or sets destination address prefix. CIDR or source IP + range. + A “*” can also be used to match all source IPs. Default tags such + as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used. + :paramtype destination_address_prefix: str + :keyword destination_port_range: Gets or sets Destination Port or Range. Integer or range + between + 0 and 65535. A “*” can also be used to match all ports. + :paramtype destination_port_range: str + :keyword direction: Gets or sets the direction of the rule.InBound or Outbound. The + direction specifies if rule will be evaluated on incoming or outgoing traffic. + :paramtype direction: str + :keyword priority: Gets or sets the priority of the rule. The value can be between + 100 and 4096. The priority number must be unique for each rule in the collection. + The lower the priority number, the higher the priority of the rule. + :paramtype priority: int + :keyword protocol: Gets or sets Network protocol this rule applies to. Can be Tcp, Udp or + All(*). + :paramtype protocol: str + :keyword source_address_prefix: Gets or sets source address prefix. CIDR or source IP range. A + “*” can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, + ‘AzureLoadBalancer’ and ‘Internet’ can also be used. If this is an ingress + rule, specifies where network traffic originates from. + :paramtype source_address_prefix: str + :keyword source_port_range: Gets or sets Source Port or Range. Integer or range between 0 and + + + #. A “*” can also be used to match all ports. + :paramtype source_port_range: str + """ super(NsgSecurityRule, self).__init__(**kwargs) self.name = name self.access = access @@ -1664,6 +2088,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -1672,7 +2098,7 @@ def __init__( class OperationsDiscovery(msrest.serialization.Model): """Operations discovery class. - :param name: Gets or sets Name of the API. + :ivar name: Gets or sets Name of the API. The name of the operation being performed on this particular object. It should match the action name that appears in RBAC / the event service. Examples of operations include: @@ -1696,23 +2122,23 @@ class OperationsDiscovery(msrest.serialization.Model): This API is used to register for their service, and should include details about the operation (e.g. a localized name for the resource provider + any special considerations like PII release). - :type name: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool - :param display: Contains the localized display information for this particular operation / + :vartype name: str + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool + :ivar display: Contains the localized display information for this particular operation / action. These value will be used by several clients for (1) custom role definitions for RBAC; (2) complex query filters for the event service; and (3) audit history / records for management operations. - :type display: ~resource_mover_service_api.models.Display - :param origin: Gets or sets Origin. + :vartype display: ~resource_mover_service_api.models.Display + :ivar origin: Gets or sets Origin. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is "user,system". - :type origin: str - :param properties: Any object. - :type properties: any + :vartype origin: str + :ivar properties: Any object. + :vartype properties: any """ _attribute_map = { @@ -1733,6 +2159,49 @@ def __init__( properties: Optional[Any] = None, **kwargs ): + """ + :keyword name: Gets or sets Name of the API. + The name of the operation being performed on this particular object. It should + match the action name that appears in RBAC / the event service. + Examples of operations include: + + + * Microsoft.Compute/virtualMachine/capture/action + * Microsoft.Compute/virtualMachine/restart/action + * Microsoft.Compute/virtualMachine/write + * Microsoft.Compute/virtualMachine/read + * Microsoft.Compute/virtualMachine/delete + Each action should include, in order: + (1) Resource Provider Namespace + (2) Type hierarchy for which the action applies (e.g. server/databases for a SQL + Azure database) + (3) Read, Write, Action or Delete indicating which type applies. If it is a PUT/PATCH + on a collection or named value, Write should be used. + If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it + is a POST, Action should be used. + As a note: all resource providers would need to include the "{Resource Provider + Namespace}/register/action" operation in their response. + This API is used to register for their service, and should include details about the + operation (e.g. a localized name for the resource provider + any special + considerations like PII release). + :paramtype name: str + :keyword is_data_action: Indicates whether the operation is a data action. + :paramtype is_data_action: bool + :keyword display: Contains the localized display information for this particular operation / + action. These + value will be used by several clients for + (1) custom role definitions for RBAC; + (2) complex query filters for the event service; and + (3) audit history / records for management operations. + :paramtype display: ~resource_mover_service_api.models.Display + :keyword origin: Gets or sets Origin. + The intended executor of the operation; governs the display of the operation in the + RBAC UX and the audit logs UX. + Default value is "user,system". + :paramtype origin: str + :keyword properties: Any object. + :paramtype properties: any + """ super(OperationsDiscovery, self).__init__(**kwargs) self.name = name self.is_data_action = is_data_action @@ -1744,10 +2213,10 @@ def __init__( class OperationsDiscoveryCollection(msrest.serialization.Model): """Collection of ClientDiscovery details. - :param value: Gets or sets the ClientDiscovery details. - :type value: list[~resource_mover_service_api.models.OperationsDiscovery] - :param next_link: Gets or sets the value of next link. - :type next_link: str + :ivar value: Gets or sets the ClientDiscovery details. + :vartype value: list[~resource_mover_service_api.models.OperationsDiscovery] + :ivar next_link: Gets or sets the value of next link. + :vartype next_link: str """ _attribute_map = { @@ -1762,6 +2231,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: Gets or sets the ClientDiscovery details. + :paramtype value: list[~resource_mover_service_api.models.OperationsDiscovery] + :keyword next_link: Gets or sets the value of next link. + :paramtype next_link: str + """ super(OperationsDiscoveryCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -1813,6 +2288,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationStatus, self).__init__(**kwargs) self.id = None self.name = None @@ -1856,6 +2333,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationStatusError, self).__init__(**kwargs) self.code = None self.message = None @@ -1868,15 +2347,16 @@ class PrepareRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validate_only: Gets or sets a value indicating whether the operation needs to only run + :ivar validate_only: Gets or sets a value indicating whether the operation needs to only run pre-requisite. - :type validate_only: bool - :param move_resources: Required. Gets or sets the list of resource Id's, by default it accepts + :vartype validate_only: bool + :ivar move_resources: Required. Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property. - :type move_resources: list[str] - :param move_resource_input_type: Defines the move resource input type. Possible values include: + :vartype move_resources: list[str] + :ivar move_resource_input_type: Defines the move resource input type. Possible values include: "MoveResourceId", "MoveResourceSourceId". - :type move_resource_input_type: str or ~resource_mover_service_api.models.MoveResourceInputType + :vartype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType """ _validation = { @@ -1897,6 +2377,19 @@ def __init__( move_resource_input_type: Optional[Union[str, "MoveResourceInputType"]] = None, **kwargs ): + """ + :keyword validate_only: Gets or sets a value indicating whether the operation needs to only run + pre-requisite. + :paramtype validate_only: bool + :keyword move_resources: Required. Gets or sets the list of resource Id's, by default it + accepts move resource id's unless the input type is switched via moveResourceInputType + property. + :paramtype move_resources: list[str] + :keyword move_resource_input_type: Defines the move resource input type. Possible values + include: "MoveResourceId", "MoveResourceSourceId". + :paramtype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType + """ super(PrepareRequest, self).__init__(**kwargs) self.validate_only = validate_only self.move_resources = move_resources @@ -1908,21 +2401,23 @@ class PublicIPAddressResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param domain_name_label: Gets or sets the domain name label. - :type domain_name_label: str - :param fqdn: Gets or sets the fully qualified domain name. - :type fqdn: str - :param public_ip_allocation_method: Gets or sets public IP allocation method. - :type public_ip_allocation_method: str - :param sku: Gets or sets public IP sku. - :type sku: str - :param zones: Gets or sets public IP zones. - :type zones: str + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar domain_name_label: Gets or sets the domain name label. + :vartype domain_name_label: str + :ivar fqdn: Gets or sets the fully qualified domain name. + :vartype fqdn: str + :ivar public_ip_allocation_method: Gets or sets public IP allocation method. + :vartype public_ip_allocation_method: str + :ivar sku: Gets or sets public IP sku. + :vartype sku: str + :ivar zones: Gets or sets public IP zones. + :vartype zones: str """ _validation = { @@ -1933,6 +2428,7 @@ class PublicIPAddressResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, 'fqdn': {'key': 'fqdn', 'type': 'str'}, 'public_ip_allocation_method': {'key': 'publicIpAllocationMethod', 'type': 'str'}, @@ -1944,6 +2440,7 @@ def __init__( self, *, target_resource_name: str, + tags: Optional[Dict[str, str]] = None, domain_name_label: Optional[str] = None, fqdn: Optional[str] = None, public_ip_allocation_method: Optional[str] = None, @@ -1951,8 +2448,25 @@ def __init__( zones: Optional[str] = None, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword domain_name_label: Gets or sets the domain name label. + :paramtype domain_name_label: str + :keyword fqdn: Gets or sets the fully qualified domain name. + :paramtype fqdn: str + :keyword public_ip_allocation_method: Gets or sets public IP allocation method. + :paramtype public_ip_allocation_method: str + :keyword sku: Gets or sets public IP sku. + :paramtype sku: str + :keyword zones: Gets or sets public IP zones. + :paramtype zones: str + """ super(PublicIPAddressResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) self.resource_type = 'Microsoft.Network/publicIPAddresses' # type: str + self.tags = tags self.domain_name_label = domain_name_label self.fqdn = fqdn self.public_ip_allocation_method = public_ip_allocation_method @@ -1965,9 +2479,9 @@ class PublicIpReference(AzureResourceReference): All required parameters must be populated in order to send to Azure. - :param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being + :ivar source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being referenced. - :type source_arm_resource_id: str + :vartype source_arm_resource_id: str """ _validation = { @@ -1984,15 +2498,19 @@ def __init__( source_arm_resource_id: str, **kwargs ): + """ + :keyword source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource + being referenced. + :paramtype source_arm_resource_id: str + """ super(PublicIpReference, self).__init__(source_arm_resource_id=source_arm_resource_id, **kwargs) class RequiredForResourcesCollection(msrest.serialization.Model): """Required for resources collection. - :param source_ids: Gets or sets the list of source Ids for which the input resource is - required. - :type source_ids: list[str] + :ivar source_ids: Gets or sets the list of source Ids for which the input resource is required. + :vartype source_ids: list[str] """ _attribute_map = { @@ -2005,6 +2523,11 @@ def __init__( source_ids: Optional[List[str]] = None, **kwargs ): + """ + :keyword source_ids: Gets or sets the list of source Ids for which the input resource is + required. + :paramtype source_ids: list[str] + """ super(RequiredForResourcesCollection, self).__init__(**kwargs) self.source_ids = source_ids @@ -2014,11 +2537,11 @@ class ResourceGroupResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str """ _validation = { @@ -2037,6 +2560,10 @@ def __init__( target_resource_name: str, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + """ super(ResourceGroupResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) self.resource_type = 'resourceGroups' # type: str @@ -2046,15 +2573,16 @@ class ResourceMoveRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validate_only: Gets or sets a value indicating whether the operation needs to only run + :ivar validate_only: Gets or sets a value indicating whether the operation needs to only run pre-requisite. - :type validate_only: bool - :param move_resources: Required. Gets or sets the list of resource Id's, by default it accepts + :vartype validate_only: bool + :ivar move_resources: Required. Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property. - :type move_resources: list[str] - :param move_resource_input_type: Defines the move resource input type. Possible values include: + :vartype move_resources: list[str] + :ivar move_resource_input_type: Defines the move resource input type. Possible values include: "MoveResourceId", "MoveResourceSourceId". - :type move_resource_input_type: str or ~resource_mover_service_api.models.MoveResourceInputType + :vartype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType """ _validation = { @@ -2075,6 +2603,19 @@ def __init__( move_resource_input_type: Optional[Union[str, "MoveResourceInputType"]] = None, **kwargs ): + """ + :keyword validate_only: Gets or sets a value indicating whether the operation needs to only run + pre-requisite. + :paramtype validate_only: bool + :keyword move_resources: Required. Gets or sets the list of resource Id's, by default it + accepts move resource id's unless the input type is switched via moveResourceInputType + property. + :paramtype move_resources: list[str] + :keyword move_resource_input_type: Defines the move resource input type. Possible values + include: "MoveResourceId", "MoveResourceSourceId". + :paramtype move_resource_input_type: str or + ~resource_mover_service_api.models.MoveResourceInputType + """ super(ResourceMoveRequest, self).__init__(**kwargs) self.validate_only = validate_only self.move_resources = move_resources @@ -2086,14 +2627,16 @@ class SqlDatabaseResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param zone_redundant: Defines the zone redundant resource setting. Possible values include: + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar zone_redundant: Defines the zone redundant resource setting. Possible values include: "Enable", "Disable". - :type zone_redundant: str or ~resource_mover_service_api.models.ZoneRedundant + :vartype zone_redundant: str or ~resource_mover_service_api.models.ZoneRedundant """ _validation = { @@ -2104,6 +2647,7 @@ class SqlDatabaseResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'zone_redundant': {'key': 'zoneRedundant', 'type': 'str'}, } @@ -2111,11 +2655,22 @@ def __init__( self, *, target_resource_name: str, + tags: Optional[Dict[str, str]] = None, zone_redundant: Optional[Union[str, "ZoneRedundant"]] = None, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword zone_redundant: Defines the zone redundant resource setting. Possible values include: + "Enable", "Disable". + :paramtype zone_redundant: str or ~resource_mover_service_api.models.ZoneRedundant + """ super(SqlDatabaseResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) self.resource_type = 'Microsoft.Sql/servers/databases' # type: str + self.tags = tags self.zone_redundant = zone_redundant @@ -2124,14 +2679,16 @@ class SqlElasticPoolResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param zone_redundant: Defines the zone redundant resource setting. Possible values include: + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar zone_redundant: Defines the zone redundant resource setting. Possible values include: "Enable", "Disable". - :type zone_redundant: str or ~resource_mover_service_api.models.ZoneRedundant + :vartype zone_redundant: str or ~resource_mover_service_api.models.ZoneRedundant """ _validation = { @@ -2142,6 +2699,7 @@ class SqlElasticPoolResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'zone_redundant': {'key': 'zoneRedundant', 'type': 'str'}, } @@ -2149,11 +2707,22 @@ def __init__( self, *, target_resource_name: str, + tags: Optional[Dict[str, str]] = None, zone_redundant: Optional[Union[str, "ZoneRedundant"]] = None, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword zone_redundant: Defines the zone redundant resource setting. Possible values include: + "Enable", "Disable". + :paramtype zone_redundant: str or ~resource_mover_service_api.models.ZoneRedundant + """ super(SqlElasticPoolResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) self.resource_type = 'Microsoft.Sql/servers/elasticPools' # type: str + self.tags = tags self.zone_redundant = zone_redundant @@ -2162,11 +2731,11 @@ class SqlServerResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str """ _validation = { @@ -2185,6 +2754,10 @@ def __init__( target_resource_name: str, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + """ super(SqlServerResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) self.resource_type = 'Microsoft.Sql/servers' # type: str @@ -2194,11 +2767,11 @@ class SubnetReference(ProxyResourceReference): All required parameters must be populated in order to send to Azure. - :param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being + :ivar source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being referenced. - :type source_arm_resource_id: str - :param name: Gets the name of the proxy resource on the target side. - :type name: str + :vartype source_arm_resource_id: str + :ivar name: Gets the name of the proxy resource on the target side. + :vartype name: str """ _validation = { @@ -2217,18 +2790,25 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource + being referenced. + :paramtype source_arm_resource_id: str + :keyword name: Gets the name of the proxy resource on the target side. + :paramtype name: str + """ super(SubnetReference, self).__init__(source_arm_resource_id=source_arm_resource_id, name=name, **kwargs) class SubnetResourceSettings(msrest.serialization.Model): """Defines the virtual network subnets resource settings. - :param name: Gets or sets the Subnet name. - :type name: str - :param address_prefix: Gets or sets address prefix for the subnet. - :type address_prefix: str - :param network_security_group: Defines reference to NSG. - :type network_security_group: ~resource_mover_service_api.models.NsgReference + :ivar name: Gets or sets the Subnet name. + :vartype name: str + :ivar address_prefix: Gets or sets address prefix for the subnet. + :vartype address_prefix: str + :ivar network_security_group: Defines reference to NSG. + :vartype network_security_group: ~resource_mover_service_api.models.NsgReference """ _attribute_map = { @@ -2245,6 +2825,14 @@ def __init__( network_security_group: Optional["NsgReference"] = None, **kwargs ): + """ + :keyword name: Gets or sets the Subnet name. + :paramtype name: str + :keyword address_prefix: Gets or sets address prefix for the subnet. + :paramtype address_prefix: str + :keyword network_security_group: Defines reference to NSG. + :paramtype network_security_group: ~resource_mover_service_api.models.NsgReference + """ super(SubnetResourceSettings, self).__init__(**kwargs) self.name = name self.address_prefix = address_prefix @@ -2254,10 +2842,10 @@ def __init__( class Summary(msrest.serialization.Model): """Summary item. - :param count: Gets the count. - :type count: int - :param item: Gets the item. - :type item: str + :ivar count: Gets the count. + :vartype count: int + :ivar item: Gets the item. + :vartype item: str """ _attribute_map = { @@ -2272,6 +2860,12 @@ def __init__( item: Optional[str] = None, **kwargs ): + """ + :keyword count: Gets the count. + :paramtype count: int + :keyword item: Gets the item. + :paramtype item: str + """ super(Summary, self).__init__(**kwargs) self.count = count self.item = item @@ -2280,10 +2874,10 @@ def __init__( class SummaryCollection(msrest.serialization.Model): """Summary Collection. - :param field_name: Gets or sets the field name on which summary is done. - :type field_name: str - :param summary: Gets or sets the list of summary items. - :type summary: list[~resource_mover_service_api.models.Summary] + :ivar field_name: Gets or sets the field name on which summary is done. + :vartype field_name: str + :ivar summary: Gets or sets the list of summary items. + :vartype summary: list[~resource_mover_service_api.models.Summary] """ _attribute_map = { @@ -2298,16 +2892,86 @@ def __init__( summary: Optional[List["Summary"]] = None, **kwargs ): + """ + :keyword field_name: Gets or sets the field name on which summary is done. + :paramtype field_name: str + :keyword summary: Gets or sets the list of summary items. + :paramtype summary: list[~resource_mover_service_api.models.Summary] + """ super(SummaryCollection, self).__init__(**kwargs) self.field_name = field_name self.summary = summary +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~resource_mover_service_api.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or ~resource_mover_service_api.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or ~resource_mover_service_api.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or ~resource_mover_service_api.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + class UnresolvedDependenciesFilter(msrest.serialization.Model): """Unresolved dependencies contract. - :param properties: - :type properties: ~resource_mover_service_api.models.UnresolvedDependenciesFilterProperties + :ivar properties: + :vartype properties: ~resource_mover_service_api.models.UnresolvedDependenciesFilterProperties """ _attribute_map = { @@ -2320,6 +2984,11 @@ def __init__( properties: Optional["UnresolvedDependenciesFilterProperties"] = None, **kwargs ): + """ + :keyword properties: + :paramtype properties: + ~resource_mover_service_api.models.UnresolvedDependenciesFilterProperties + """ super(UnresolvedDependenciesFilter, self).__init__(**kwargs) self.properties = properties @@ -2327,8 +2996,8 @@ def __init__( class UnresolvedDependenciesFilterProperties(msrest.serialization.Model): """UnresolvedDependenciesFilterProperties. - :param count: The count of the resource. - :type count: int + :ivar count: The count of the resource. + :vartype count: int """ _attribute_map = { @@ -2341,6 +3010,10 @@ def __init__( count: Optional[int] = None, **kwargs ): + """ + :keyword count: The count of the resource. + :paramtype count: int + """ super(UnresolvedDependenciesFilterProperties, self).__init__(**kwargs) self.count = count @@ -2348,10 +3021,10 @@ def __init__( class UnresolvedDependency(msrest.serialization.Model): """Unresolved dependency. - :param count: Gets or sets the count. - :type count: int - :param id: Gets or sets the arm id of the dependency. - :type id: str + :ivar count: Gets or sets the count. + :vartype count: int + :ivar id: Gets or sets the arm id of the dependency. + :vartype id: str """ _attribute_map = { @@ -2366,6 +3039,12 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword count: Gets or sets the count. + :paramtype count: int + :keyword id: Gets or sets the arm id of the dependency. + :paramtype id: str + """ super(UnresolvedDependency, self).__init__(**kwargs) self.count = count self.id = id @@ -2376,10 +3055,10 @@ class UnresolvedDependencyCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: Gets or sets the list of unresolved dependencies. - :type value: list[~resource_mover_service_api.models.UnresolvedDependency] - :param next_link: Gets or sets the value of next link. - :type next_link: str + :ivar value: Gets or sets the list of unresolved dependencies. + :vartype value: list[~resource_mover_service_api.models.UnresolvedDependency] + :ivar next_link: Gets or sets the value of next link. + :vartype next_link: str :ivar summary_collection: Gets or sets the list of summary items and the field on which summary is done. :vartype summary_collection: ~resource_mover_service_api.models.SummaryCollection @@ -2406,6 +3085,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: Gets or sets the list of unresolved dependencies. + :paramtype value: list[~resource_mover_service_api.models.UnresolvedDependency] + :keyword next_link: Gets or sets the value of next link. + :paramtype next_link: str + """ super(UnresolvedDependencyCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -2416,10 +3101,10 @@ def __init__( class UpdateMoveCollectionRequest(msrest.serialization.Model): """Defines the request body for updating move collection. - :param tags: A set of tags. Gets or sets the Resource tags. - :type tags: dict[str, str] - :param identity: Defines the MSI properties of the Move Collection. - :type identity: ~resource_mover_service_api.models.Identity + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar identity: Defines the MSI properties of the Move Collection. + :vartype identity: ~resource_mover_service_api.models.Identity """ _attribute_map = { @@ -2434,6 +3119,12 @@ def __init__( identity: Optional["Identity"] = None, **kwargs ): + """ + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: Defines the MSI properties of the Move Collection. + :paramtype identity: ~resource_mover_service_api.models.Identity + """ super(UpdateMoveCollectionRequest, self).__init__(**kwargs) self.tags = tags self.identity = identity @@ -2444,20 +3135,24 @@ class VirtualMachineResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param target_availability_zone: Gets or sets the target availability zone. Possible values + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar user_managed_identities: Gets or sets user-managed identities. + :vartype user_managed_identities: list[str] + :ivar target_availability_zone: Gets or sets the target availability zone. Possible values include: "1", "2", "3", "NA". - :type target_availability_zone: str or + :vartype target_availability_zone: str or ~resource_mover_service_api.models.TargetAvailabilityZone - :param target_vm_size: Gets or sets the target virtual machine size. - :type target_vm_size: str - :param target_availability_set_id: Gets or sets the target availability set id for virtual + :ivar target_vm_size: Gets or sets the target virtual machine size. + :vartype target_vm_size: str + :ivar target_availability_set_id: Gets or sets the target availability set id for virtual machines not in an availability set at source. - :type target_availability_set_id: str + :vartype target_availability_set_id: str """ _validation = { @@ -2468,6 +3163,8 @@ class VirtualMachineResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'user_managed_identities': {'key': 'userManagedIdentities', 'type': '[str]'}, 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, 'target_vm_size': {'key': 'targetVmSize', 'type': 'str'}, 'target_availability_set_id': {'key': 'targetAvailabilitySetId', 'type': 'str'}, @@ -2477,13 +3174,34 @@ def __init__( self, *, target_resource_name: str, + tags: Optional[Dict[str, str]] = None, + user_managed_identities: Optional[List[str]] = None, target_availability_zone: Optional[Union[str, "TargetAvailabilityZone"]] = None, target_vm_size: Optional[str] = None, target_availability_set_id: Optional[str] = None, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword user_managed_identities: Gets or sets user-managed identities. + :paramtype user_managed_identities: list[str] + :keyword target_availability_zone: Gets or sets the target availability zone. Possible values + include: "1", "2", "3", "NA". + :paramtype target_availability_zone: str or + ~resource_mover_service_api.models.TargetAvailabilityZone + :keyword target_vm_size: Gets or sets the target virtual machine size. + :paramtype target_vm_size: str + :keyword target_availability_set_id: Gets or sets the target availability set id for virtual + machines not in an availability set at source. + :paramtype target_availability_set_id: str + """ super(VirtualMachineResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) self.resource_type = 'Microsoft.Compute/virtualMachines' # type: str + self.tags = tags + self.user_managed_identities = user_managed_identities self.target_availability_zone = target_availability_zone self.target_vm_size = target_vm_size self.target_availability_set_id = target_availability_set_id @@ -2494,22 +3212,24 @@ class VirtualNetworkResourceSettings(ResourceSettings): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The resource type. For example, the value can be + :ivar resource_type: Required. The resource type. For example, the value can be Microsoft.Compute/virtualMachines.Constant filled by server. - :type resource_type: str - :param target_resource_name: Required. Gets or sets the target Resource name. - :type target_resource_name: str - :param enable_ddos_protection: Gets or sets a value indicating whether gets or sets whether the + :vartype resource_type: str + :ivar target_resource_name: Required. Gets or sets the target Resource name. + :vartype target_resource_name: str + :ivar tags: A set of tags. Gets or sets the Resource tags. + :vartype tags: dict[str, str] + :ivar enable_ddos_protection: Gets or sets a value indicating whether gets or sets whether the DDOS protection should be switched on. - :type enable_ddos_protection: bool - :param address_space: Gets or sets the address prefixes for the virtual network. - :type address_space: list[str] - :param dns_servers: Gets or sets DHCPOptions that contains an array of DNS servers available to + :vartype enable_ddos_protection: bool + :ivar address_space: Gets or sets the address prefixes for the virtual network. + :vartype address_space: list[str] + :ivar dns_servers: Gets or sets DHCPOptions that contains an array of DNS servers available to VMs deployed in the virtual network. - :type dns_servers: list[str] - :param subnets: Gets or sets List of subnets in a VirtualNetwork. - :type subnets: list[~resource_mover_service_api.models.SubnetResourceSettings] + :vartype dns_servers: list[str] + :ivar subnets: Gets or sets List of subnets in a VirtualNetwork. + :vartype subnets: list[~resource_mover_service_api.models.SubnetResourceSettings] """ _validation = { @@ -2520,6 +3240,7 @@ class VirtualNetworkResourceSettings(ResourceSettings): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'enable_ddos_protection': {'key': 'enableDdosProtection', 'type': 'bool'}, 'address_space': {'key': 'addressSpace', 'type': '[str]'}, 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, @@ -2530,14 +3251,34 @@ def __init__( self, *, target_resource_name: str, + tags: Optional[Dict[str, str]] = None, enable_ddos_protection: Optional[bool] = None, address_space: Optional[List[str]] = None, dns_servers: Optional[List[str]] = None, subnets: Optional[List["SubnetResourceSettings"]] = None, **kwargs ): + """ + :keyword target_resource_name: Required. Gets or sets the target Resource name. + :paramtype target_resource_name: str + :keyword tags: A set of tags. Gets or sets the Resource tags. + :paramtype tags: dict[str, str] + :keyword enable_ddos_protection: Gets or sets a value indicating whether gets or sets whether + the + DDOS protection should be switched on. + :paramtype enable_ddos_protection: bool + :keyword address_space: Gets or sets the address prefixes for the virtual network. + :paramtype address_space: list[str] + :keyword dns_servers: Gets or sets DHCPOptions that contains an array of DNS servers available + to VMs + deployed in the virtual network. + :paramtype dns_servers: list[str] + :keyword subnets: Gets or sets List of subnets in a VirtualNetwork. + :paramtype subnets: list[~resource_mover_service_api.models.SubnetResourceSettings] + """ super(VirtualNetworkResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) self.resource_type = 'Microsoft.Network/virtualNetworks' # type: str + self.tags = tags self.enable_ddos_protection = enable_ddos_protection self.address_space = address_space self.dns_servers = dns_servers diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_resource_mover_service_api_enums.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_resource_mover_service_api_enums.py index c1480e111a72..de37912c1cfb 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_resource_mover_service_api_enums.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_resource_mover_service_api_enums.py @@ -6,52 +6,46 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" -class DependencyLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DependencyLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): DIRECT = "Direct" DESCENDANT = "Descendant" -class DependencyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DependencyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the dependency type. """ REQUIRED_FOR_PREPARE = "RequiredForPrepare" REQUIRED_FOR_MOVE = "RequiredForMove" -class JobName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class JobName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the job name. """ INITIAL_SYNC = "InitialSync" -class MoveResourceInputType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MoveResourceInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the move resource input type. """ MOVE_RESOURCE_ID = "MoveResourceId" MOVE_RESOURCE_SOURCE_ID = "MoveResourceSourceId" -class MoveState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MoveState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the MoveResource states. """ @@ -71,7 +65,7 @@ class MoveState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): DELETE_SOURCE_PENDING = "DeleteSourcePending" RESOURCE_MOVE_COMPLETED = "ResourceMoveCompleted" -class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the provisioning states. """ @@ -80,14 +74,14 @@ class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): CREATING = "Creating" FAILED = "Failed" -class ResolutionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResolutionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the resolution type. """ MANUAL = "Manual" AUTOMATIC = "Automatic" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the resource mover service. """ @@ -95,7 +89,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SYSTEM_ASSIGNED = "SystemAssigned" USER_ASSIGNED = "UserAssigned" -class TargetAvailabilityZone(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TargetAvailabilityZone(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Gets or sets the target availability zone. """ @@ -104,7 +98,7 @@ class TargetAvailabilityZone(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) THREE = "3" NA = "NA" -class ZoneRedundant(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ZoneRedundant(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the zone redundant resource setting. """ diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_collections_operations.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_collections_operations.py index e8b86493b7e3..b670378183ea 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_collections_operations.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_collections_operations.py @@ -5,26 +5,527 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_create_request( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_prepare_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/prepare') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_initiate_move_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/initiateMove') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_commit_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/commit') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_discard_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/discard') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_resolve_dependencies_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/resolveDependencies') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_bulk_remove_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/bulkRemove') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_move_collections_by_subscription_request( + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/moveCollections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_move_collections_by_resource_group_request( + subscription_id, # type: str + resource_group_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_required_for_request( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + source_id = kwargs.pop('source_id') # type: str + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/requiredFor') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['sourceId'] = _SERIALIZER.query("source_id", source_id, 'str') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class MoveCollectionsOperations(object): """MoveCollectionsOperations operations. @@ -47,6 +548,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def create( self, resource_group_name, # type: str @@ -73,35 +575,25 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'MoveCollection') + _json = self._serialize.body(body, 'MoveCollection') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_create_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + content_type=content_type, + json=_json, + template_url=self.create.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -119,8 +611,11 @@ def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}'} # type: ignore + + @distributed_trace def update( self, resource_group_name, # type: str @@ -147,35 +642,25 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'UpdateMoveCollectionRequest') + _json = self._serialize.body(body, 'UpdateMoveCollectionRequest') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -189,8 +674,10 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}'} # type: ignore + def _delete_initial( self, resource_group_name, # type: str @@ -203,27 +690,17 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -239,8 +716,11 @@ def _delete_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}'} # type: ignore + + @distributed_trace def begin_delete( self, resource_group_name, # type: str @@ -256,15 +736,18 @@ def begin_delete( :type move_collection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -278,24 +761,17 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -307,8 +783,10 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}'} # type: ignore + @distributed_trace def get( self, resource_group_name, # type: str @@ -332,27 +810,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -366,8 +834,10 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}'} # type: ignore + def _prepare_initial( self, resource_group_name, # type: str @@ -381,35 +851,25 @@ def _prepare_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._prepare_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'PrepareRequest') + _json = self._serialize.body(body, 'PrepareRequest') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_prepare_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + content_type=content_type, + json=_json, + template_url=self._prepare_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -425,8 +885,11 @@ def _prepare_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _prepare_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/prepare'} # type: ignore + + @distributed_trace def begin_prepare( self, resource_group_name, # type: str @@ -449,15 +912,19 @@ def begin_prepare( :type body: ~resource_mover_service_api.models.PrepareRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -469,27 +936,21 @@ def begin_prepare( resource_group_name=resource_group_name, move_collection_name=move_collection_name, body=body, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -501,6 +962,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_prepare.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/prepare'} # type: ignore def _initiate_move_initial( @@ -516,35 +978,25 @@ def _initiate_move_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._initiate_move_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'ResourceMoveRequest') + _json = self._serialize.body(body, 'ResourceMoveRequest') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_initiate_move_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + content_type=content_type, + json=_json, + template_url=self._initiate_move_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -560,8 +1012,11 @@ def _initiate_move_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _initiate_move_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/initiateMove'} # type: ignore + + @distributed_trace def begin_initiate_move( self, resource_group_name, # type: str @@ -584,15 +1039,19 @@ def begin_initiate_move( :type body: ~resource_mover_service_api.models.ResourceMoveRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -604,27 +1063,21 @@ def begin_initiate_move( resource_group_name=resource_group_name, move_collection_name=move_collection_name, body=body, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -636,6 +1089,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_initiate_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/initiateMove'} # type: ignore def _commit_initial( @@ -651,35 +1105,25 @@ def _commit_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._commit_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'CommitRequest') + _json = self._serialize.body(body, 'CommitRequest') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_commit_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + content_type=content_type, + json=_json, + template_url=self._commit_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -695,8 +1139,11 @@ def _commit_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _commit_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/commit'} # type: ignore + + @distributed_trace def begin_commit( self, resource_group_name, # type: str @@ -719,15 +1166,19 @@ def begin_commit( :type body: ~resource_mover_service_api.models.CommitRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -739,27 +1190,21 @@ def begin_commit( resource_group_name=resource_group_name, move_collection_name=move_collection_name, body=body, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -771,6 +1216,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_commit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/commit'} # type: ignore def _discard_initial( @@ -786,35 +1232,25 @@ def _discard_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._discard_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'DiscardRequest') + _json = self._serialize.body(body, 'DiscardRequest') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_discard_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + content_type=content_type, + json=_json, + template_url=self._discard_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -830,8 +1266,11 @@ def _discard_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _discard_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/discard'} # type: ignore + + @distributed_trace def begin_discard( self, resource_group_name, # type: str @@ -854,15 +1293,19 @@ def begin_discard( :type body: ~resource_mover_service_api.models.DiscardRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -874,27 +1317,21 @@ def begin_discard( resource_group_name=resource_group_name, move_collection_name=move_collection_name, body=body, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -906,6 +1343,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_discard.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/discard'} # type: ignore def _resolve_dependencies_initial( @@ -920,27 +1358,17 @@ def _resolve_dependencies_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self._resolve_dependencies_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_resolve_dependencies_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + template_url=self._resolve_dependencies_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,8 +1384,11 @@ def _resolve_dependencies_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _resolve_dependencies_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/resolveDependencies'} # type: ignore + + @distributed_trace def begin_resolve_dependencies( self, resource_group_name, # type: str @@ -973,15 +1404,18 @@ def begin_resolve_dependencies( :type move_collection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -995,24 +1429,17 @@ def begin_resolve_dependencies( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1024,6 +1451,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_resolve_dependencies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/resolveDependencies'} # type: ignore def _bulk_remove_initial( @@ -1039,35 +1467,25 @@ def _bulk_remove_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._bulk_remove_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'BulkRemoveRequest') + _json = self._serialize.body(body, 'BulkRemoveRequest') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_bulk_remove_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + content_type=content_type, + json=_json, + template_url=self._bulk_remove_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1083,8 +1501,11 @@ def _bulk_remove_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _bulk_remove_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/bulkRemove'} # type: ignore + + @distributed_trace def begin_bulk_remove( self, resource_group_name, # type: str @@ -1105,15 +1526,19 @@ def begin_bulk_remove( :type body: ~resource_mover_service_api.models.BulkRemoveRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -1125,27 +1550,21 @@ def begin_bulk_remove( resource_group_name=resource_group_name, move_collection_name=move_collection_name, body=body, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1157,8 +1576,10 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_bulk_remove.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/bulkRemove'} # type: ignore + @distributed_trace def list_move_collections_by_subscription( self, **kwargs # type: Any @@ -1169,8 +1590,10 @@ def list_move_collections_by_subscription( Get all the Move Collections in the subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MoveCollectionResultList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~resource_mover_service_api.models.MoveCollectionResultList] + :return: An iterator like instance of either MoveCollectionResultList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~resource_mover_service_api.models.MoveCollectionResultList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MoveCollectionResultList"] @@ -1178,34 +1601,29 @@ def list_move_collections_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_move_collections_by_subscription.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_move_collections_by_subscription_request( + subscription_id=self._config.subscription_id, + template_url=self.list_move_collections_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_move_collections_by_subscription_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('MoveCollectionResultList', pipeline_response) + deserialized = self._deserialize("MoveCollectionResultList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1223,11 +1641,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_move_collections_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/moveCollections'} # type: ignore + @distributed_trace def list_move_collections_by_resource_group( self, resource_group_name, # type: str @@ -1241,8 +1661,10 @@ def list_move_collections_by_resource_group( :param resource_group_name: The Resource Group Name. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MoveCollectionResultList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~resource_mover_service_api.models.MoveCollectionResultList] + :return: An iterator like instance of either MoveCollectionResultList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~resource_mover_service_api.models.MoveCollectionResultList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MoveCollectionResultList"] @@ -1250,35 +1672,31 @@ def list_move_collections_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_move_collections_by_resource_group.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_move_collections_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_move_collections_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_move_collections_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('MoveCollectionResultList', pipeline_response) + deserialized = self._deserialize("MoveCollectionResultList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1296,11 +1714,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_move_collections_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections'} # type: ignore + @distributed_trace def list_required_for( self, resource_group_name, # type: str @@ -1327,28 +1747,18 @@ def list_required_for( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.list_required_for.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_required_for_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + source_id=source_id, + template_url=self.list_required_for.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1362,4 +1772,6 @@ def list_required_for( return cls(pipeline_response, deserialized, {}) return deserialized + list_required_for.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/requiredFor'} # type: ignore + diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_resources_operations.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_resources_operations.py index 78513121e40a..17a780bdac48 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_resources_operations.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_resources_operations.py @@ -5,26 +5,192 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_request( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + filter = kwargs.pop('filter', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + move_resource_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + "moveResourceName": _SERIALIZER.url("move_resource_name", move_resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + move_resource_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + "moveResourceName": _SERIALIZER.url("move_resource_name", move_resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + move_resource_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + "moveResourceName": _SERIALIZER.url("move_resource_name", move_resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class MoveResourcesOperations(object): """MoveResourcesOperations operations. @@ -47,6 +213,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name, # type: str @@ -65,7 +232,8 @@ def list( $filter=Properties/ProvisioningState eq 'Succeeded'. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MoveResourceCollection or the result of cls(response) + :return: An iterator like instance of either MoveResourceCollection or the result of + cls(response) :rtype: ~azure.core.paging.ItemPaged[~resource_mover_service_api.models.MoveResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ @@ -74,38 +242,35 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + filter=filter, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('MoveResourceCollection', pipeline_response) + deserialized = self._deserialize("MoveResourceCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -123,6 +288,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) @@ -142,36 +308,26 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - 'moveResourceName': self._serialize.url("move_resource_name", move_resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - body_content_kwargs = {} # type: Dict[str, Any] if body is not None: - body_content = self._serialize.body(body, 'MoveResource') + _json = self._serialize.body(body, 'MoveResource') else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + _json = None + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + move_resource_name=move_resource_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,8 +343,11 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore + + @distributed_trace def begin_create( self, resource_group_name, # type: str @@ -210,15 +369,19 @@ def begin_create( :type body: ~resource_mover_service_api.models.MoveResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either MoveResource or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either MoveResource or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~resource_mover_service_api.models.MoveResource] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.MoveResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -231,28 +394,21 @@ def begin_create( move_collection_name=move_collection_name, move_resource_name=move_resource_name, body=body, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('MoveResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - 'moveResourceName': self._serialize.url("move_resource_name", move_resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -264,6 +420,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore def _delete_initial( @@ -279,28 +436,18 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - 'moveResourceName': self._serialize.url("move_resource_name", move_resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + move_resource_name=move_resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -316,8 +463,11 @@ def _delete_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, resource_group_name, # type: str @@ -336,15 +486,18 @@ def begin_delete( :type move_resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~resource_mover_service_api.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( 'polling_interval', @@ -359,25 +512,17 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - 'moveResourceName': self._serialize.url("move_resource_name", move_resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,8 +534,10 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore + @distributed_trace def get( self, resource_group_name, # type: str @@ -417,28 +564,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - 'moveResourceName': self._serialize.url("move_resource_name", move_resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + move_resource_name=move_resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -452,4 +589,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore + diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_operations_discovery_operations.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_operations_discovery_operations.py index 1bb1c87caf65..39545efe1565 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_operations_discovery_operations.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_operations_discovery_operations.py @@ -5,23 +5,57 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_get_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.Migrate/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class OperationsDiscoveryOperations(object): """OperationsDiscoveryOperations operations. @@ -44,6 +78,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get( self, **kwargs # type: Any @@ -61,21 +96,14 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -89,4 +117,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/providers/Microsoft.Migrate/operations'} # type: ignore + diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_unresolved_dependencies_operations.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_unresolved_dependencies_operations.py index f93d0a4a4392..90cf8286da7d 100644 --- a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_unresolved_dependencies_operations.py +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_unresolved_dependencies_operations.py @@ -5,24 +5,78 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + move_collection_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + dependency_level = kwargs.pop('dependency_level', None) # type: Optional[Union[str, "_models.DependencyLevel"]] + orderby = kwargs.pop('orderby', None) # type: Optional[str] + filter = kwargs.pop('filter', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/unresolvedDependencies') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "moveCollectionName": _SERIALIZER.url("move_collection_name", move_collection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if dependency_level is not None: + query_parameters['dependencyLevel'] = _SERIALIZER.query("dependency_level", dependency_level, 'str') + if orderby is not None: + query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, 'str') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class UnresolvedDependenciesOperations(object): """UnresolvedDependenciesOperations operations. @@ -45,6 +99,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get( self, resource_group_name, # type: str @@ -68,8 +123,10 @@ def get( :param filter: The filter to apply on the operation. For example, $apply=filter(count eq 2). :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnresolvedDependencyCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~resource_mover_service_api.models.UnresolvedDependencyCollection] + :return: An iterator like instance of either UnresolvedDependencyCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~resource_mover_service_api.models.UnresolvedDependencyCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UnresolvedDependencyCollection"] @@ -77,42 +134,39 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if dependency_level is not None: - query_parameters['dependencyLevel'] = self._serialize.query("dependency_level", dependency_level, 'str') - if orderby is not None: - query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + dependency_level=dependency_level, + orderby=orderby, + filter=filter, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + dependency_level=dependency_level, + orderby=orderby, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('UnresolvedDependencyCollection', pipeline_response) + deserialized = self._deserialize("UnresolvedDependencyCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -130,6 +184,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data )