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

[AutoPR] restapi_auto_containerregistry/resource-manager #1935

Merged
merged 10 commits into from
Apr 30, 2018
38 changes: 38 additions & 0 deletions azure-mgmt-containerregistry/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,44 @@
Release History
===============

2.0.0 (2018-04-30)
++++++++++++++++++

**Features**

- Support for build steps/taks (ApiVersion 2018-02-01-preview)
- Support for Azure Profiles
- Client class can be used as a context manager to keep the underlying HTTP session open for performance

**General Breaking changes**

This version uses a next-generation code generator that *might* introduce breaking changes.

- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments.
To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments.
- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered.
While this is not a breaking change, the distinctions are important, and are documented here:
https://docs.python.org/3/library/enum.html#others
At a glance:

- "is" should not be used at all.
- "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered.

- New Long Running Operation:

- Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same.
- Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used.
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`.
- New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`,
the response of the initial call will be returned without polling.
- `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`.
- `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away.

**Bugfixes**

- Compatibility of the sdist with wheel 0.31.0

1.0.1 (2017-10-09)
++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-containerregistry/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Usage
=====

For code examples, see `Container Registry
<https://azure-sdk-for-python.readthedocs.org/en/latest/sample_azure-mgmt-containerregistry.html>`__
<https://docs.microsoft.com/python/api/overview/azure/container-registry>`__
on readthedocs.org.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import ServiceClient
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration

from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from .version import VERSION


Expand Down Expand Up @@ -47,7 +50,7 @@ def __init__(
self.subscription_id = subscription_id


class ContainerRegistryManagementClient(object):
class ContainerRegistryManagementClient(MultiApiClientMixin, SDKClient):
"""ContainerRegistryManagementClient

:ivar config: Configuration for client.
Expand All @@ -58,89 +61,160 @@ class ContainerRegistryManagementClient(object):
object<msrestazure.azure_active_directory>`
:param subscription_id: The Microsoft Azure subscription ID.
:type subscription_id: str
:param str api_version: API version to use if no profile is provided, or if
missing in profile.
:param str base_url: Service URL
"""
:param profile: A dict using operation group name to API version.
:type profile: dict[str, str] """

DEFAULT_API_VERSION = '2017-10-01'

def __init__(
self, credentials, subscription_id, api_version=DEFAULT_API_VERSION, base_url=None):

_PROFILE_TAG = "azure.mgmt.containerregistry.ContainerRegistryManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION
}},
_PROFILE_TAG + " latest"
)

def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default):
self.config = ContainerRegistryManagementClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)

client_models = {k: v for k, v in self.models(api_version).__dict__.items() if isinstance(v, type)}
self.api_version = api_version
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
super(ContainerRegistryManagementClient, self).__init__(
credentials,
self.config,
api_version=api_version,
profile=profile
)

############ Generated from here ############

@classmethod
def _models_dict(cls, api_version):
return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}

@classmethod
def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:

* 2017-03-01: :mod:`v2017_03_01.models<azure.mgmt.containerregistry.v2017_03_01.models>`
* 2017-10-01: :mod:`v2017_10_01.models<azure.mgmt.containerregistry.v2017_10_01.models>`
* 2018-02-01-preview: :mod:`v2018_02_01_preview.models<azure.mgmt.containerregistry.v2018_02_01_preview.models>`
"""
if api_version == '2017-03-01':
from .v2017_03_01 import models
return models
elif api_version == '2017-10-01':
from .v2017_10_01 import models
return models
elif api_version == '2018-02-01-preview':
from .v2018_02_01_preview import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

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

* 2018-02-01-preview: :class:`BuildStepsOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildStepsOperations>`
"""
api_version = self._get_api_version('build_steps')
if api_version == '2018-02-01-preview':
from .v2018_02_01_preview.operations import BuildStepsOperations 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)))

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

* 2018-02-01-preview: :class:`BuildTasksOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildTasksOperations>`
"""
api_version = self._get_api_version('build_tasks')
if api_version == '2018-02-01-preview':
from .v2018_02_01_preview.operations import BuildTasksOperations 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)))

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

* 2018-02-01-preview: :class:`BuildsOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildsOperations>`
"""
api_version = self._get_api_version('builds')
if api_version == '2018-02-01-preview':
from .v2018_02_01_preview.operations import BuildsOperations 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)))

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

* 2017-03-01: :class:`Operations<azure.mgmt.containerregistry.v2017_03_01.operations.Operations>`
* 2017-10-01: :class:`Operations<azure.mgmt.containerregistry.v2017_10_01.operations.Operations>`
* 2018-02-01-preview: :class:`Operations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.Operations>`
"""
if self.api_version == '2017-03-01':
api_version = self._get_api_version('operations')
if api_version == '2017-03-01':
from .v2017_03_01.operations import Operations as OperationClass
elif self.api_version == '2017-10-01':
elif api_version == '2017-10-01':
from .v2017_10_01.operations import Operations as OperationClass
elif api_version == '2018-02-01-preview':
from .v2018_02_01_preview.operations import Operations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(self.api_version))
return OperationClass(self._client, self.config, self._serialize, self._deserialize)
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)))

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

* 2017-03-01: :class:`RegistriesOperations<azure.mgmt.containerregistry.v2017_03_01.operations.RegistriesOperations>`
* 2017-10-01: :class:`RegistriesOperations<azure.mgmt.containerregistry.v2017_10_01.operations.RegistriesOperations>`
* 2018-02-01-preview: :class:`RegistriesOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.RegistriesOperations>`
"""
if self.api_version == '2017-03-01':
api_version = self._get_api_version('registries')
if api_version == '2017-03-01':
from .v2017_03_01.operations import RegistriesOperations as OperationClass
elif self.api_version == '2017-10-01':
elif api_version == '2017-10-01':
from .v2017_10_01.operations import RegistriesOperations as OperationClass
elif api_version == '2018-02-01-preview':
from .v2018_02_01_preview.operations import RegistriesOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(self.api_version))
return OperationClass(self._client, self.config, self._serialize, self._deserialize)
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)))

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

* 2017-10-01: :class:`ReplicationsOperations<azure.mgmt.containerregistry.v2017_10_01.operations.ReplicationsOperations>`
* 2018-02-01-preview: :class:`ReplicationsOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.ReplicationsOperations>`
"""
if self.api_version == '2017-10-01':
api_version = self._get_api_version('replications')
if api_version == '2017-10-01':
from .v2017_10_01.operations import ReplicationsOperations as OperationClass
elif api_version == '2018-02-01-preview':
from .v2018_02_01_preview.operations import ReplicationsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(self.api_version))
return OperationClass(self._client, self.config, self._serialize, self._deserialize)
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)))

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

* 2017-10-01: :class:`WebhooksOperations<azure.mgmt.containerregistry.v2017_10_01.operations.WebhooksOperations>`
* 2018-02-01-preview: :class:`WebhooksOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.WebhooksOperations>`
"""
if self.api_version == '2017-10-01':
api_version = self._get_api_version('webhooks')
if api_version == '2017-10-01':
from .v2017_10_01.operations import WebhooksOperations as OperationClass
elif api_version == '2018-02-01-preview':
from .v2018_02_01_preview.operations import WebhooksOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(self.api_version))
return OperationClass(self._client, self.config, self._serialize, self._deserialize)
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)))
Loading