Skip to content
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 @@ -58,89 +58,154 @@ 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'
DEFAULT_PROFILE = None

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

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)
self.profile = dict(profile) if profile is not None else {}

############ 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>`
* 2017-10-01: :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 == '2017-10-01':
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:

* 2017-10-01: :class:`BuildStepsOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildStepsOperations>`
"""
api_version = self.profile.get('build_steps', self.api_version)
if api_version == '2017-10-01':
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:

* 2017-10-01: :class:`BuildTasksOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildTasksOperations>`
"""
api_version = self.profile.get('build_tasks', self.api_version)
if api_version == '2017-10-01':
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:

* 2017-10-01: :class:`BuildsOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildsOperations>`
"""
api_version = self.profile.get('builds', self.api_version)
if api_version == '2017-10-01':
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>`
* 2017-10-01: :class:`Operations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.Operations>`
"""
if self.api_version == '2017-03-01':
api_version = self.profile.get('operations', self.api_version)
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 == '2017-10-01':
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>`
* 2017-10-01: :class:`RegistriesOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.RegistriesOperations>`
"""
if self.api_version == '2017-03-01':
api_version = self.profile.get('registries', self.api_version)
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 == '2017-10-01':
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>`
* 2017-10-01: :class:`ReplicationsOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.ReplicationsOperations>`
"""
if self.api_version == '2017-10-01':
api_version = self.profile.get('replications', self.api_version)
if api_version == '2017-10-01':
from .v2017_10_01.operations import ReplicationsOperations as OperationClass
elif api_version == '2017-10-01':
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>`
* 2017-10-01: :class:`WebhooksOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.WebhooksOperations>`
"""
if self.api_version == '2017-10-01':
api_version = self.profile.get('webhooks', self.api_version)
if api_version == '2017-10-01':
from .v2017_10_01.operations import WebhooksOperations as OperationClass
elif api_version == '2017-10-01':
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