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

[T2-GA] Resource #13833

Merged
merged 2 commits into from
Sep 18, 2020
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions sdk/resources/azure-mgmt-resource/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Release History

## 15.0.0 (2020-09-17)

**Features**

- Model ProviderResourceType has a new parameter default_api_version
- Model ProviderResourceType has a new parameter api_profiles
- Model AzureResourceBase has a new parameter system_data
- Model AliasPath has a new parameter metadata
- Model TemplateLink has a new parameter id
- Model TemplateLink has a new parameter relative_path
- Model Alias has a new parameter default_metadata
- Added operation DeploymentsOperations.begin_what_if_at_management_group_scope
- Added operation DeploymentsOperations.begin_what_if_at_tenant_scope
- Added operation group TemplateSpecsOperations
- Added operation group TemplateSpecVersionsOperations
- Added operation group SubscriptionClientOperationsMixin

## 15.0.0b1 (2020-06-17)

This is beta preview version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# license information.
# --------------------------------------------------------------------------

VERSION = "15.0.0b1"
VERSION = "15.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
__all__ = ['DeploymentScriptsClient']

try:
from ._patch import patch_sdk
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy

from ._version import VERSION

Expand Down Expand Up @@ -43,8 +44,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.credential_scopes = ['https://management.azure.com/.default']
self.credential_scopes.extend(kwargs.pop('credential_scopes', []))
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'azure-mgmt-resource/{}'.format(VERSION))
self._configure(**kwargs)

Expand All @@ -57,6 +57,7 @@ def _configure(
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DeploymentScriptsClient(MultiApiClientMixin, _SDKClient):
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

DEFAULT_API_VERSION = '2019-10-01-preview'
DEFAULT_API_VERSION = '2020-10-01'
_PROFILE_TAG = "azure.mgmt.resource.DeploymentScriptsClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand All @@ -69,8 +69,6 @@ def __init__(
self._config = DeploymentScriptsClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(DeploymentScriptsClient, self).__init__(
credential,
self._config,
api_version=api_version,
profile=profile
)
Expand All @@ -83,24 +81,31 @@ def _models_dict(cls, api_version):
def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:

* 2019-10-01-preview: :mod:`v2019_10_preview.models<azure.mgmt.resource.v2019_10_preview.models>`
* 2019-10-01-preview: :mod:`v2019_10_01_preview.models<azure.mgmt.resource.v2019_10_01_preview.models>`
* 2020-10-01: :mod:`v2020_10_01.models<azure.mgmt.resource.v2020_10_01.models>`
"""
if api_version == '2019-10-01-preview':
from .v2019_10_preview import models
from .v2019_10_01_preview import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))
elif api_version == '2020-10-01':
from .v2020_10_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
def deployment_scripts(self):
"""Instance depends on the API version:

* 2019-10-01-preview: :class:`DeploymentScriptsOperations<azure.mgmt.resource.v2019_10_preview.operations.DeploymentScriptsOperations>`
* 2019-10-01-preview: :class:`DeploymentScriptsOperations<azure.mgmt.resource.v2019_10_01_preview.operations.DeploymentScriptsOperations>`
* 2020-10-01: :class:`DeploymentScriptsOperations<azure.mgmt.resource.v2020_10_01.operations.DeploymentScriptsOperations>`
"""
api_version = self._get_api_version('deployment_scripts')
if api_version == '2019-10-01-preview':
from .v2019_10_preview.operations import DeploymentScriptsOperations as OperationClass
from .v2019_10_01_preview.operations import DeploymentScriptsOperations as OperationClass
elif api_version == '2020-10-01':
from .v2020_10_01.operations import DeploymentScriptsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
raise ValueError("API version {} does not have operation group 'deployment_scripts'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

def close(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._deployment_scripts_client_async import DeploymentScriptsClient
from ._deployment_scripts_client import DeploymentScriptsClient
__all__ = ['DeploymentScriptsClient']
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy

from .._version import VERSION

Expand All @@ -34,7 +35,6 @@ def __init__(
subscription_id, # type: str
**kwargs # type: Any
) -> None:
# type: (...) -> None
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
Expand All @@ -43,8 +43,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.credential_scopes = ['https://management.azure.com/.default']
self.credential_scopes.extend(kwargs.pop('credential_scopes', []))
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'azure-mgmt-resource/{}'.format(VERSION))
self._configure(**kwargs)

Expand All @@ -56,6 +55,7 @@ def _configure(
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from ._configuration_async import DeploymentScriptsClientConfiguration
from ._configuration import DeploymentScriptsClientConfiguration

class _SDKClient(object):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -46,7 +46,7 @@ class DeploymentScriptsClient(MultiApiClientMixin, _SDKClient):
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

DEFAULT_API_VERSION = '2019-10-01-preview'
DEFAULT_API_VERSION = '2020-10-01'
_PROFILE_TAG = "azure.mgmt.resource.DeploymentScriptsClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand All @@ -69,8 +69,6 @@ def __init__(
self._config = DeploymentScriptsClientConfiguration(credential, subscription_id, **kwargs)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(DeploymentScriptsClient, self).__init__(
credential,
self._config,
api_version=api_version,
profile=profile
)
Expand All @@ -83,24 +81,31 @@ def _models_dict(cls, api_version):
def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:

* 2019-10-01-preview: :mod:`v2019_10_preview.models<azure.mgmt.resource.v2019_10_preview.models>`
* 2019-10-01-preview: :mod:`v2019_10_01_preview.models<azure.mgmt.resource.v2019_10_01_preview.models>`
* 2020-10-01: :mod:`v2020_10_01.models<azure.mgmt.resource.v2020_10_01.models>`
"""
if api_version == '2019-10-01-preview':
from ..v2019_10_preview import models
from ..v2019_10_01_preview import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))
elif api_version == '2020-10-01':
from ..v2020_10_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
def deployment_scripts(self):
"""Instance depends on the API version:

* 2019-10-01-preview: :class:`DeploymentScriptsOperations<azure.mgmt.resource.v2019_10_preview.aio.operations_async.DeploymentScriptsOperations>`
* 2019-10-01-preview: :class:`DeploymentScriptsOperations<azure.mgmt.resource.v2019_10_01_preview.aio.operations.DeploymentScriptsOperations>`
* 2020-10-01: :class:`DeploymentScriptsOperations<azure.mgmt.resource.v2020_10_01.aio.operations.DeploymentScriptsOperations>`
"""
api_version = self._get_api_version('deployment_scripts')
if api_version == '2019-10-01-preview':
from ..v2019_10_preview.aio.operations_async import DeploymentScriptsOperations as OperationClass
from ..v2019_10_01_preview.aio.operations import DeploymentScriptsOperations as OperationClass
elif api_version == '2020-10-01':
from ..v2020_10_01.aio.operations import DeploymentScriptsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
raise ValueError("API version {} does not have operation group 'deployment_scripts'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

async def close(self):
Expand Down
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_preview.models import *
from .v2020_10_01.models import *
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
__all__ = ['DeploymentScriptsClient']

try:
from ._patch import patch_sdk
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
Expand Down Expand Up @@ -47,8 +48,7 @@ def __init__(
self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2019-10-01-preview"
self.credential_scopes = ['https://management.azure.com/.default']
self.credential_scopes.extend(kwargs.pop('credential_scopes', []))
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-resource/{}'.format(VERSION))
self._configure(**kwargs)

Expand All @@ -61,6 +61,7 @@ def _configure(
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING

from azure.mgmt.core import ARMPipelineClient
from msrest import Deserializer, Serializer

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Optional

from azure.core.credentials import TokenCredential

from ._configuration import DeploymentScriptsClientConfiguration
from .operations import DeploymentScriptsOperations
from . import models


class DeploymentScriptsClient(object):
"""The APIs listed in this specification can be used to manage Deployment Scripts resource through the Azure Resource Manager.

:ivar deployment_scripts: DeploymentScriptsOperations operations
:vartype deployment_scripts: azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.operations.DeploymentScriptsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Subscription Id which forms part of the URI for every service call.
:type subscription_id: str
:param str base_url: Service URL
: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]
**kwargs # type: Any
):
# type: (...) -> None
if not base_url:
base_url = 'https://management.azure.com'
self._config = DeploymentScriptsClientConfiguration(credential, 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.deployment_scripts = DeploymentScriptsOperations(
self._client, self._config, self._serialize, self._deserialize)

def close(self):
# type: () -> None
self._client.close()

def __enter__(self):
# type: () -> DeploymentScriptsClient
self._client.__enter__()
return self

def __exit__(self, *exc_details):
# type: (Any) -> None
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
"client": {
"name": "DeploymentScriptsClient",
"filename": "_deployment_scripts_client",
"description": "The APIs listed in this specification can be used to manage Deployment Scripts resource through the Azure Resource Manager."
"description": "The APIs listed in this specification can be used to manage Deployment Scripts resource through the Azure Resource Manager.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true
},
"global_parameters": {
"sync_method": {
Expand Down Expand Up @@ -41,7 +45,10 @@
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"]
"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
},
"operation_groups": {
"deployment_scripts": "DeploymentScriptsOperations"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._deployment_scripts_client_async import DeploymentScriptsClient
from ._deployment_scripts_client import DeploymentScriptsClient
__all__ = ['DeploymentScriptsClient']
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
Expand Down Expand Up @@ -44,8 +45,7 @@ def __init__(
self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2019-10-01-preview"
self.credential_scopes = ['https://management.azure.com/.default']
self.credential_scopes.extend(kwargs.pop('credential_scopes', []))
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-resource/{}'.format(VERSION))
self._configure(**kwargs)

Expand All @@ -57,6 +57,7 @@ def _configure(
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
Expand Down
Loading