9
9
# regenerated.
10
10
# --------------------------------------------------------------------------
11
11
12
- from msrest .service_client import ServiceClient
12
+ from msrest .service_client import SDKClient
13
13
from msrest import Serializer , Deserializer
14
14
from msrestazure import AzureConfiguration
15
+
16
+ from azure .profiles import KnownProfiles , ProfileDefinition
17
+ from azure .profiles .multiapiclient import MultiApiClientMixin
15
18
from .version import VERSION
16
19
17
20
@@ -47,7 +50,7 @@ def __init__(
47
50
self .subscription_id = subscription_id
48
51
49
52
50
- class ContainerRegistryManagementClient (object ):
53
+ class ContainerRegistryManagementClient (MultiApiClientMixin , SDKClient ):
51
54
"""ContainerRegistryManagementClient
52
55
53
56
:ivar config: Configuration for client.
@@ -58,89 +61,160 @@ class ContainerRegistryManagementClient(object):
58
61
object<msrestazure.azure_active_directory>`
59
62
:param subscription_id: The Microsoft Azure subscription ID.
60
63
:type subscription_id: str
64
+ :param str api_version: API version to use if no profile is provided, or if
65
+ missing in profile.
61
66
:param str base_url: Service URL
62
- """
67
+ :param profile: A dict using operation group name to API version.
68
+ :type profile: dict[str, str] """
63
69
64
70
DEFAULT_API_VERSION = '2017-10-01'
65
-
66
- def __init__ (
67
- self , credentials , subscription_id , api_version = DEFAULT_API_VERSION , base_url = None ):
68
-
71
+ _PROFILE_TAG = "azure.mgmt.containerregistry.ContainerRegistryManagementClient"
72
+ LATEST_PROFILE = ProfileDefinition ({
73
+ _PROFILE_TAG : {
74
+ None : DEFAULT_API_VERSION
75
+ }},
76
+ _PROFILE_TAG + " latest"
77
+ )
78
+
79
+ def __init__ (self , credentials , subscription_id , api_version = None , base_url = None , profile = KnownProfiles .default ):
69
80
self .config = ContainerRegistryManagementClientConfiguration (credentials , subscription_id , base_url )
70
- self . _client = ServiceClient ( self . config . credentials , self . config )
71
-
72
- client_models = { k : v for k , v in self .models ( api_version ). __dict__ . items () if isinstance ( v , type )}
73
- self . api_version = api_version
74
- self . _serialize = Serializer ( client_models )
75
- self . _deserialize = Deserializer ( client_models )
81
+ super ( ContainerRegistryManagementClient , self ). __init__ (
82
+ credentials ,
83
+ self .config ,
84
+ api_version = api_version ,
85
+ profile = profile
86
+ )
76
87
77
88
############ Generated from here ############
78
89
90
+ @classmethod
91
+ def _models_dict (cls , api_version ):
92
+ return {k : v for k , v in cls .models (api_version ).__dict__ .items () if isinstance (v , type )}
93
+
79
94
@classmethod
80
95
def models (cls , api_version = DEFAULT_API_VERSION ):
81
96
"""Module depends on the API version:
82
97
83
98
* 2017-03-01: :mod:`v2017_03_01.models<azure.mgmt.containerregistry.v2017_03_01.models>`
84
99
* 2017-10-01: :mod:`v2017_10_01.models<azure.mgmt.containerregistry.v2017_10_01.models>`
100
+ * 2018-02-01-preview: :mod:`v2018_02_01_preview.models<azure.mgmt.containerregistry.v2018_02_01_preview.models>`
85
101
"""
86
102
if api_version == '2017-03-01' :
87
103
from .v2017_03_01 import models
88
104
return models
89
105
elif api_version == '2017-10-01' :
90
106
from .v2017_10_01 import models
91
107
return models
108
+ elif api_version == '2018-02-01-preview' :
109
+ from .v2018_02_01_preview import models
110
+ return models
92
111
raise NotImplementedError ("APIVersion {} is not available" .format (api_version ))
112
+
113
+ @property
114
+ def build_steps (self ):
115
+ """Instance depends on the API version:
116
+
117
+ * 2018-02-01-preview: :class:`BuildStepsOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildStepsOperations>`
118
+ """
119
+ api_version = self ._get_api_version ('build_steps' )
120
+ if api_version == '2018-02-01-preview' :
121
+ from .v2018_02_01_preview .operations import BuildStepsOperations as OperationClass
122
+ else :
123
+ raise NotImplementedError ("APIVersion {} is not available" .format (api_version ))
124
+ return OperationClass (self ._client , self .config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )))
125
+
126
+ @property
127
+ def build_tasks (self ):
128
+ """Instance depends on the API version:
129
+
130
+ * 2018-02-01-preview: :class:`BuildTasksOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildTasksOperations>`
131
+ """
132
+ api_version = self ._get_api_version ('build_tasks' )
133
+ if api_version == '2018-02-01-preview' :
134
+ from .v2018_02_01_preview .operations import BuildTasksOperations as OperationClass
135
+ else :
136
+ raise NotImplementedError ("APIVersion {} is not available" .format (api_version ))
137
+ return OperationClass (self ._client , self .config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )))
138
+
139
+ @property
140
+ def builds (self ):
141
+ """Instance depends on the API version:
142
+
143
+ * 2018-02-01-preview: :class:`BuildsOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildsOperations>`
144
+ """
145
+ api_version = self ._get_api_version ('builds' )
146
+ if api_version == '2018-02-01-preview' :
147
+ from .v2018_02_01_preview .operations import BuildsOperations as OperationClass
148
+ else :
149
+ raise NotImplementedError ("APIVersion {} is not available" .format (api_version ))
150
+ return OperationClass (self ._client , self .config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )))
93
151
94
152
@property
95
153
def operations (self ):
96
154
"""Instance depends on the API version:
97
155
98
156
* 2017-03-01: :class:`Operations<azure.mgmt.containerregistry.v2017_03_01.operations.Operations>`
99
157
* 2017-10-01: :class:`Operations<azure.mgmt.containerregistry.v2017_10_01.operations.Operations>`
158
+ * 2018-02-01-preview: :class:`Operations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.Operations>`
100
159
"""
101
- if self .api_version == '2017-03-01' :
160
+ api_version = self ._get_api_version ('operations' )
161
+ if api_version == '2017-03-01' :
102
162
from .v2017_03_01 .operations import Operations as OperationClass
103
- elif self . api_version == '2017-10-01' :
163
+ elif api_version == '2017-10-01' :
104
164
from .v2017_10_01 .operations import Operations as OperationClass
165
+ elif api_version == '2018-02-01-preview' :
166
+ from .v2018_02_01_preview .operations import Operations as OperationClass
105
167
else :
106
- raise NotImplementedError ("APIVersion {} is not available" .format (self . api_version ))
107
- return OperationClass (self ._client , self .config , self ._serialize , self ._deserialize )
168
+ raise NotImplementedError ("APIVersion {} is not available" .format (api_version ))
169
+ return OperationClass (self ._client , self .config , Serializer ( self ._models_dict ( api_version )), Deserializer ( self ._models_dict ( api_version )) )
108
170
109
171
@property
110
172
def registries (self ):
111
173
"""Instance depends on the API version:
112
174
113
175
* 2017-03-01: :class:`RegistriesOperations<azure.mgmt.containerregistry.v2017_03_01.operations.RegistriesOperations>`
114
176
* 2017-10-01: :class:`RegistriesOperations<azure.mgmt.containerregistry.v2017_10_01.operations.RegistriesOperations>`
177
+ * 2018-02-01-preview: :class:`RegistriesOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.RegistriesOperations>`
115
178
"""
116
- if self .api_version == '2017-03-01' :
179
+ api_version = self ._get_api_version ('registries' )
180
+ if api_version == '2017-03-01' :
117
181
from .v2017_03_01 .operations import RegistriesOperations as OperationClass
118
- elif self . api_version == '2017-10-01' :
182
+ elif api_version == '2017-10-01' :
119
183
from .v2017_10_01 .operations import RegistriesOperations as OperationClass
184
+ elif api_version == '2018-02-01-preview' :
185
+ from .v2018_02_01_preview .operations import RegistriesOperations as OperationClass
120
186
else :
121
- raise NotImplementedError ("APIVersion {} is not available" .format (self . api_version ))
122
- return OperationClass (self ._client , self .config , self ._serialize , self ._deserialize )
187
+ raise NotImplementedError ("APIVersion {} is not available" .format (api_version ))
188
+ return OperationClass (self ._client , self .config , Serializer ( self ._models_dict ( api_version )), Deserializer ( self ._models_dict ( api_version )) )
123
189
124
190
@property
125
191
def replications (self ):
126
192
"""Instance depends on the API version:
127
193
128
194
* 2017-10-01: :class:`ReplicationsOperations<azure.mgmt.containerregistry.v2017_10_01.operations.ReplicationsOperations>`
195
+ * 2018-02-01-preview: :class:`ReplicationsOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.ReplicationsOperations>`
129
196
"""
130
- if self .api_version == '2017-10-01' :
197
+ api_version = self ._get_api_version ('replications' )
198
+ if api_version == '2017-10-01' :
131
199
from .v2017_10_01 .operations import ReplicationsOperations as OperationClass
200
+ elif api_version == '2018-02-01-preview' :
201
+ from .v2018_02_01_preview .operations import ReplicationsOperations as OperationClass
132
202
else :
133
- raise NotImplementedError ("APIVersion {} is not available" .format (self . api_version ))
134
- return OperationClass (self ._client , self .config , self ._serialize , self ._deserialize )
203
+ raise NotImplementedError ("APIVersion {} is not available" .format (api_version ))
204
+ return OperationClass (self ._client , self .config , Serializer ( self ._models_dict ( api_version )), Deserializer ( self ._models_dict ( api_version )) )
135
205
136
206
@property
137
207
def webhooks (self ):
138
208
"""Instance depends on the API version:
139
209
140
210
* 2017-10-01: :class:`WebhooksOperations<azure.mgmt.containerregistry.v2017_10_01.operations.WebhooksOperations>`
211
+ * 2018-02-01-preview: :class:`WebhooksOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.WebhooksOperations>`
141
212
"""
142
- if self .api_version == '2017-10-01' :
213
+ api_version = self ._get_api_version ('webhooks' )
214
+ if api_version == '2017-10-01' :
143
215
from .v2017_10_01 .operations import WebhooksOperations as OperationClass
216
+ elif api_version == '2018-02-01-preview' :
217
+ from .v2018_02_01_preview .operations import WebhooksOperations as OperationClass
144
218
else :
145
- raise NotImplementedError ("APIVersion {} is not available" .format (self . api_version ))
146
- return OperationClass (self ._client , self .config , self ._serialize , self ._deserialize )
219
+ raise NotImplementedError ("APIVersion {} is not available" .format (api_version ))
220
+ return OperationClass (self ._client , self .config , Serializer ( self ._models_dict ( api_version )), Deserializer ( self ._models_dict ( api_version )) )
0 commit comments