Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ReleasePR azure-mgmt-resource] [Resources] Add support for MG and tenant level What-If #12242

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ResourceManagementClient(MultiApiClientMixin, SDKClient):
:type profile: azure.profiles.KnownProfiles
"""

DEFAULT_API_VERSION = '2019-10-01'
DEFAULT_API_VERSION = '2020-06-01'
_PROFILE_TAG = "azure.mgmt.resource.resources.ResourceManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand Down Expand Up @@ -82,6 +82,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2019-07-01: :mod:`v2019_07_01.models<azure.mgmt.resource.resources.v2019_07_01.models>`
* 2019-08-01: :mod:`v2019_08_01.models<azure.mgmt.resource.resources.v2019_08_01.models>`
* 2019-10-01: :mod:`v2019_10_01.models<azure.mgmt.resource.resources.v2019_10_01.models>`
* 2020-06-01: :mod:`v2020_06_01.models<azure.mgmt.resource.resources.v2020_06_01.models>`
"""
if api_version == '2016-02-01':
from .v2016_02_01 import models
Expand Down Expand Up @@ -113,6 +114,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2019-10-01':
from .v2019_10_01 import models
return models
elif api_version == '2020-06-01':
from .v2020_06_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
Expand All @@ -129,6 +133,7 @@ def deployment_operations(self):
* 2019-07-01: :class:`DeploymentOperations<azure.mgmt.resource.resources.v2019_07_01.operations.DeploymentOperations>`
* 2019-08-01: :class:`DeploymentOperations<azure.mgmt.resource.resources.v2019_08_01.operations.DeploymentOperations>`
* 2019-10-01: :class:`DeploymentOperations<azure.mgmt.resource.resources.v2019_10_01.operations.DeploymentOperations>`
* 2020-06-01: :class:`DeploymentOperations<azure.mgmt.resource.resources.v2020_06_01.operations.DeploymentOperations>`
"""
api_version = self._get_api_version('deployment_operations')
if api_version == '2016-02-01':
Expand All @@ -151,6 +156,8 @@ def deployment_operations(self):
from .v2019_08_01.operations import DeploymentOperations as OperationClass
elif api_version == '2019-10-01':
from .v2019_10_01.operations import DeploymentOperations as OperationClass
elif api_version == '2020-06-01':
from .v2020_06_01.operations import DeploymentOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -169,6 +176,7 @@ def deployments(self):
* 2019-07-01: :class:`DeploymentsOperations<azure.mgmt.resource.resources.v2019_07_01.operations.DeploymentsOperations>`
* 2019-08-01: :class:`DeploymentsOperations<azure.mgmt.resource.resources.v2019_08_01.operations.DeploymentsOperations>`
* 2019-10-01: :class:`DeploymentsOperations<azure.mgmt.resource.resources.v2019_10_01.operations.DeploymentsOperations>`
* 2020-06-01: :class:`DeploymentsOperations<azure.mgmt.resource.resources.v2020_06_01.operations.DeploymentsOperations>`
"""
api_version = self._get_api_version('deployments')
if api_version == '2016-02-01':
Expand All @@ -191,6 +199,8 @@ def deployments(self):
from .v2019_08_01.operations import DeploymentsOperations as OperationClass
elif api_version == '2019-10-01':
from .v2019_10_01.operations import DeploymentsOperations as OperationClass
elif api_version == '2020-06-01':
from .v2020_06_01.operations import DeploymentsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -205,6 +215,7 @@ def operations(self):
* 2019-07-01: :class:`Operations<azure.mgmt.resource.resources.v2019_07_01.operations.Operations>`
* 2019-08-01: :class:`Operations<azure.mgmt.resource.resources.v2019_08_01.operations.Operations>`
* 2019-10-01: :class:`Operations<azure.mgmt.resource.resources.v2019_10_01.operations.Operations>`
* 2020-06-01: :class:`Operations<azure.mgmt.resource.resources.v2020_06_01.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2018-05-01':
Expand All @@ -219,6 +230,8 @@ def operations(self):
from .v2019_08_01.operations import Operations as OperationClass
elif api_version == '2019-10-01':
from .v2019_10_01.operations import Operations as OperationClass
elif api_version == '2020-06-01':
from .v2020_06_01.operations import Operations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -237,6 +250,7 @@ def providers(self):
* 2019-07-01: :class:`ProvidersOperations<azure.mgmt.resource.resources.v2019_07_01.operations.ProvidersOperations>`
* 2019-08-01: :class:`ProvidersOperations<azure.mgmt.resource.resources.v2019_08_01.operations.ProvidersOperations>`
* 2019-10-01: :class:`ProvidersOperations<azure.mgmt.resource.resources.v2019_10_01.operations.ProvidersOperations>`
* 2020-06-01: :class:`ProvidersOperations<azure.mgmt.resource.resources.v2020_06_01.operations.ProvidersOperations>`
"""
api_version = self._get_api_version('providers')
if api_version == '2016-02-01':
Expand All @@ -259,6 +273,8 @@ def providers(self):
from .v2019_08_01.operations import ProvidersOperations as OperationClass
elif api_version == '2019-10-01':
from .v2019_10_01.operations import ProvidersOperations as OperationClass
elif api_version == '2020-06-01':
from .v2020_06_01.operations import ProvidersOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -277,6 +293,7 @@ def resource_groups(self):
* 2019-07-01: :class:`ResourceGroupsOperations<azure.mgmt.resource.resources.v2019_07_01.operations.ResourceGroupsOperations>`
* 2019-08-01: :class:`ResourceGroupsOperations<azure.mgmt.resource.resources.v2019_08_01.operations.ResourceGroupsOperations>`
* 2019-10-01: :class:`ResourceGroupsOperations<azure.mgmt.resource.resources.v2019_10_01.operations.ResourceGroupsOperations>`
* 2020-06-01: :class:`ResourceGroupsOperations<azure.mgmt.resource.resources.v2020_06_01.operations.ResourceGroupsOperations>`
"""
api_version = self._get_api_version('resource_groups')
if api_version == '2016-02-01':
Expand All @@ -299,6 +316,8 @@ def resource_groups(self):
from .v2019_08_01.operations import ResourceGroupsOperations as OperationClass
elif api_version == '2019-10-01':
from .v2019_10_01.operations import ResourceGroupsOperations as OperationClass
elif api_version == '2020-06-01':
from .v2020_06_01.operations import ResourceGroupsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -317,6 +336,7 @@ def resources(self):
* 2019-07-01: :class:`ResourcesOperations<azure.mgmt.resource.resources.v2019_07_01.operations.ResourcesOperations>`
* 2019-08-01: :class:`ResourcesOperations<azure.mgmt.resource.resources.v2019_08_01.operations.ResourcesOperations>`
* 2019-10-01: :class:`ResourcesOperations<azure.mgmt.resource.resources.v2019_10_01.operations.ResourcesOperations>`
* 2020-06-01: :class:`ResourcesOperations<azure.mgmt.resource.resources.v2020_06_01.operations.ResourcesOperations>`
"""
api_version = self._get_api_version('resources')
if api_version == '2016-02-01':
Expand All @@ -339,6 +359,8 @@ def resources(self):
from .v2019_08_01.operations import ResourcesOperations as OperationClass
elif api_version == '2019-10-01':
from .v2019_10_01.operations import ResourcesOperations as OperationClass
elif api_version == '2020-06-01':
from .v2020_06_01.operations import ResourcesOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -357,6 +379,7 @@ def tags(self):
* 2019-07-01: :class:`TagsOperations<azure.mgmt.resource.resources.v2019_07_01.operations.TagsOperations>`
* 2019-08-01: :class:`TagsOperations<azure.mgmt.resource.resources.v2019_08_01.operations.TagsOperations>`
* 2019-10-01: :class:`TagsOperations<azure.mgmt.resource.resources.v2019_10_01.operations.TagsOperations>`
* 2020-06-01: :class:`TagsOperations<azure.mgmt.resource.resources.v2020_06_01.operations.TagsOperations>`
"""
api_version = self._get_api_version('tags')
if api_version == '2016-02-01':
Expand All @@ -379,6 +402,8 @@ def tags(self):
from .v2019_08_01.operations import TagsOperations as OperationClass
elif api_version == '2019-10-01':
from .v2019_10_01.operations import TagsOperations as OperationClass
elif api_version == '2020-06-01':
from .v2020_06_01.operations import TagsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from .v2019_10_01.models import *
from .v2020_06_01.models import *
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
from ._models_py3 import ResourceReference
from ._models_py3 import ResourcesMoveInfo
from ._models_py3 import ScopedDeployment
from ._models_py3 import ScopedDeploymentWhatIf
from ._models_py3 import Sku
from ._models_py3 import SubResource
from ._models_py3 import TagCount
Expand Down Expand Up @@ -115,6 +116,7 @@
from ._models import ResourceReference
from ._models import ResourcesMoveInfo
from ._models import ScopedDeployment
from ._models import ScopedDeploymentWhatIf
from ._models import Sku
from ._models import SubResource
from ._models import TagCount
Expand Down Expand Up @@ -194,6 +196,7 @@
'ResourceReference',
'ResourcesMoveInfo',
'ScopedDeployment',
'ScopedDeploymentWhatIf',
'Sku',
'SubResource',
'TagCount',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,34 @@ def __init__(self, **kwargs):
self.tags = kwargs.get('tags', None)


class ScopedDeploymentWhatIf(Model):
"""Deployment What-if operation parameters.

All required parameters must be populated in order to send to Azure.

:param location: Required. The location to store the deployment data.
:type location: str
:param properties: Required. The deployment properties.
:type properties:
~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentWhatIfProperties
"""

_validation = {
'location': {'required': True},
'properties': {'required': True},
}

_attribute_map = {
'location': {'key': 'location', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'DeploymentWhatIfProperties'},
}

def __init__(self, **kwargs):
super(ScopedDeploymentWhatIf, self).__init__(**kwargs)
self.location = kwargs.get('location', None)
self.properties = kwargs.get('properties', None)


class Sku(Model):
"""SKU for the resource.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,34 @@ def __init__(self, *, location: str, properties, tags=None, **kwargs) -> None:
self.tags = tags


class ScopedDeploymentWhatIf(Model):
"""Deployment What-if operation parameters.

All required parameters must be populated in order to send to Azure.

:param location: Required. The location to store the deployment data.
:type location: str
:param properties: Required. The deployment properties.
:type properties:
~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentWhatIfProperties
"""

_validation = {
'location': {'required': True},
'properties': {'required': True},
}

_attribute_map = {
'location': {'key': 'location', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'DeploymentWhatIfProperties'},
}

def __init__(self, *, location: str, properties, **kwargs) -> None:
super(ScopedDeploymentWhatIf, self).__init__(**kwargs)
self.location = location
self.properties = properties


class Sku(Model):
"""SKU for the resource.

Expand Down
Loading