1# coding=utf-8
2# --------------------------------------------------------------------------
3# Copyright (c) Microsoft Corporation. All rights reserved.
4# Licensed under the MIT License. See License.txt in the project root for license information.
5# Code generated by Microsoft (R) AutoRest Code Generator.
6# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7# --------------------------------------------------------------------------
8
9from typing import Dict, List, Optional, Union
10
11import msrest.serialization
12
13from ._container_registry_management_client_enums import *
14
15
16class OperationDefinition(msrest.serialization.Model):
17    """The definition of a container registry operation.
18
19    :param name: Operation name: {provider}/{resource}/{operation}.
20    :type name: str
21    :param display: The display information for the container registry operation.
22    :type display: ~azure.mgmt.containerregistry.v2017_03_01.models.OperationDisplayDefinition
23    """
24
25    _attribute_map = {
26        'name': {'key': 'name', 'type': 'str'},
27        'display': {'key': 'display', 'type': 'OperationDisplayDefinition'},
28    }
29
30    def __init__(
31        self,
32        *,
33        name: Optional[str] = None,
34        display: Optional["OperationDisplayDefinition"] = None,
35        **kwargs
36    ):
37        super(OperationDefinition, self).__init__(**kwargs)
38        self.name = name
39        self.display = display
40
41
42class OperationDisplayDefinition(msrest.serialization.Model):
43    """The display information for a container registry operation.
44
45    :param provider: The resource provider name: Microsoft.ContainerRegistry.
46    :type provider: str
47    :param resource: The resource on which the operation is performed.
48    :type resource: str
49    :param operation: The operation that users can perform.
50    :type operation: str
51    :param description: The description for the operation.
52    :type description: str
53    """
54
55    _attribute_map = {
56        'provider': {'key': 'provider', 'type': 'str'},
57        'resource': {'key': 'resource', 'type': 'str'},
58        'operation': {'key': 'operation', 'type': 'str'},
59        'description': {'key': 'description', 'type': 'str'},
60    }
61
62    def __init__(
63        self,
64        *,
65        provider: Optional[str] = None,
66        resource: Optional[str] = None,
67        operation: Optional[str] = None,
68        description: Optional[str] = None,
69        **kwargs
70    ):
71        super(OperationDisplayDefinition, self).__init__(**kwargs)
72        self.provider = provider
73        self.resource = resource
74        self.operation = operation
75        self.description = description
76
77
78class OperationListResult(msrest.serialization.Model):
79    """The result of a request to list container registry operations.
80
81    :param value: The list of container registry operations. Since this list may be incomplete, the
82     nextLink field should be used to request the next list of operations.
83    :type value: list[~azure.mgmt.containerregistry.v2017_03_01.models.OperationDefinition]
84    :param next_link: The URI that can be used to request the next list of container registry
85     operations.
86    :type next_link: str
87    """
88
89    _attribute_map = {
90        'value': {'key': 'value', 'type': '[OperationDefinition]'},
91        'next_link': {'key': 'nextLink', 'type': 'str'},
92    }
93
94    def __init__(
95        self,
96        *,
97        value: Optional[List["OperationDefinition"]] = None,
98        next_link: Optional[str] = None,
99        **kwargs
100    ):
101        super(OperationListResult, self).__init__(**kwargs)
102        self.value = value
103        self.next_link = next_link
104
105
106class RegenerateCredentialParameters(msrest.serialization.Model):
107    """The parameters used to regenerate the login credential.
108
109    All required parameters must be populated in order to send to Azure.
110
111    :param name: Required. Specifies name of the password which should be regenerated -- password
112     or password2. Possible values include: "password", "password2".
113    :type name: str or ~azure.mgmt.containerregistry.v2017_03_01.models.PasswordName
114    """
115
116    _validation = {
117        'name': {'required': True},
118    }
119
120    _attribute_map = {
121        'name': {'key': 'name', 'type': 'str'},
122    }
123
124    def __init__(
125        self,
126        *,
127        name: Union[str, "PasswordName"],
128        **kwargs
129    ):
130        super(RegenerateCredentialParameters, self).__init__(**kwargs)
131        self.name = name
132
133
134class Resource(msrest.serialization.Model):
135    """An Azure resource.
136
137    Variables are only populated by the server, and will be ignored when sending a request.
138
139    All required parameters must be populated in order to send to Azure.
140
141    :ivar id: The resource ID.
142    :vartype id: str
143    :ivar name: The name of the resource.
144    :vartype name: str
145    :ivar type: The type of the resource.
146    :vartype type: str
147    :param location: Required. The location of the resource. This cannot be changed after the
148     resource is created.
149    :type location: str
150    :param tags: A set of tags. The tags of the resource.
151    :type tags: dict[str, str]
152    """
153
154    _validation = {
155        'id': {'readonly': True},
156        'name': {'readonly': True},
157        'type': {'readonly': True},
158        'location': {'required': True},
159    }
160
161    _attribute_map = {
162        'id': {'key': 'id', 'type': 'str'},
163        'name': {'key': 'name', 'type': 'str'},
164        'type': {'key': 'type', 'type': 'str'},
165        'location': {'key': 'location', 'type': 'str'},
166        'tags': {'key': 'tags', 'type': '{str}'},
167    }
168
169    def __init__(
170        self,
171        *,
172        location: str,
173        tags: Optional[Dict[str, str]] = None,
174        **kwargs
175    ):
176        super(Resource, self).__init__(**kwargs)
177        self.id = None
178        self.name = None
179        self.type = None
180        self.location = location
181        self.tags = tags
182
183
184class Registry(Resource):
185    """An object that represents a container registry.
186
187    Variables are only populated by the server, and will be ignored when sending a request.
188
189    All required parameters must be populated in order to send to Azure.
190
191    :ivar id: The resource ID.
192    :vartype id: str
193    :ivar name: The name of the resource.
194    :vartype name: str
195    :ivar type: The type of the resource.
196    :vartype type: str
197    :param location: Required. The location of the resource. This cannot be changed after the
198     resource is created.
199    :type location: str
200    :param tags: A set of tags. The tags of the resource.
201    :type tags: dict[str, str]
202    :param sku: Required. The SKU of the container registry.
203    :type sku: ~azure.mgmt.containerregistry.v2017_03_01.models.Sku
204    :ivar login_server: The URL that can be used to log into the container registry.
205    :vartype login_server: str
206    :ivar creation_date: The creation date of the container registry in ISO8601 format.
207    :vartype creation_date: ~datetime.datetime
208    :ivar provisioning_state: The provisioning state of the container registry at the time the
209     operation was called. Possible values include: "Creating", "Succeeded".
210    :vartype provisioning_state: str or
211     ~azure.mgmt.containerregistry.v2017_03_01.models.ProvisioningState
212    :param admin_user_enabled: The value that indicates whether the admin user is enabled.
213    :type admin_user_enabled: bool
214    :param storage_account: The properties of the storage account for the container registry.
215    :type storage_account:
216     ~azure.mgmt.containerregistry.v2017_03_01.models.StorageAccountProperties
217    """
218
219    _validation = {
220        'id': {'readonly': True},
221        'name': {'readonly': True},
222        'type': {'readonly': True},
223        'location': {'required': True},
224        'sku': {'required': True},
225        'login_server': {'readonly': True},
226        'creation_date': {'readonly': True},
227        'provisioning_state': {'readonly': True},
228    }
229
230    _attribute_map = {
231        'id': {'key': 'id', 'type': 'str'},
232        'name': {'key': 'name', 'type': 'str'},
233        'type': {'key': 'type', 'type': 'str'},
234        'location': {'key': 'location', 'type': 'str'},
235        'tags': {'key': 'tags', 'type': '{str}'},
236        'sku': {'key': 'sku', 'type': 'Sku'},
237        'login_server': {'key': 'properties.loginServer', 'type': 'str'},
238        'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'},
239        'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
240        'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'},
241        'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'},
242    }
243
244    def __init__(
245        self,
246        *,
247        location: str,
248        sku: "Sku",
249        tags: Optional[Dict[str, str]] = None,
250        admin_user_enabled: Optional[bool] = False,
251        storage_account: Optional["StorageAccountProperties"] = None,
252        **kwargs
253    ):
254        super(Registry, self).__init__(location=location, tags=tags, **kwargs)
255        self.sku = sku
256        self.login_server = None
257        self.creation_date = None
258        self.provisioning_state = None
259        self.admin_user_enabled = admin_user_enabled
260        self.storage_account = storage_account
261
262
263class RegistryCreateParameters(msrest.serialization.Model):
264    """The parameters for creating a container registry.
265
266    All required parameters must be populated in order to send to Azure.
267
268    :param tags: A set of tags. The tags for the container registry.
269    :type tags: dict[str, str]
270    :param location: Required. The location of the container registry. This cannot be changed after
271     the resource is created.
272    :type location: str
273    :param sku: Required. The SKU of the container registry.
274    :type sku: ~azure.mgmt.containerregistry.v2017_03_01.models.Sku
275    :param admin_user_enabled: The value that indicates whether the admin user is enabled.
276    :type admin_user_enabled: bool
277    :param storage_account: The parameters of a storage account for the container registry. If
278     specified, the storage account must be in the same physical location as the container registry.
279    :type storage_account:
280     ~azure.mgmt.containerregistry.v2017_03_01.models.StorageAccountParameters
281    """
282
283    _validation = {
284        'location': {'required': True},
285        'sku': {'required': True},
286    }
287
288    _attribute_map = {
289        'tags': {'key': 'tags', 'type': '{str}'},
290        'location': {'key': 'location', 'type': 'str'},
291        'sku': {'key': 'sku', 'type': 'Sku'},
292        'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'},
293        'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountParameters'},
294    }
295
296    def __init__(
297        self,
298        *,
299        location: str,
300        sku: "Sku",
301        tags: Optional[Dict[str, str]] = None,
302        admin_user_enabled: Optional[bool] = False,
303        storage_account: Optional["StorageAccountParameters"] = None,
304        **kwargs
305    ):
306        super(RegistryCreateParameters, self).__init__(**kwargs)
307        self.tags = tags
308        self.location = location
309        self.sku = sku
310        self.admin_user_enabled = admin_user_enabled
311        self.storage_account = storage_account
312
313
314class RegistryListCredentialsResult(msrest.serialization.Model):
315    """The response from the ListCredentials operation.
316
317    :param username: The username for a container registry.
318    :type username: str
319    :param passwords: The list of passwords for a container registry.
320    :type passwords: list[~azure.mgmt.containerregistry.v2017_03_01.models.RegistryPassword]
321    """
322
323    _attribute_map = {
324        'username': {'key': 'username', 'type': 'str'},
325        'passwords': {'key': 'passwords', 'type': '[RegistryPassword]'},
326    }
327
328    def __init__(
329        self,
330        *,
331        username: Optional[str] = None,
332        passwords: Optional[List["RegistryPassword"]] = None,
333        **kwargs
334    ):
335        super(RegistryListCredentialsResult, self).__init__(**kwargs)
336        self.username = username
337        self.passwords = passwords
338
339
340class RegistryListResult(msrest.serialization.Model):
341    """The result of a request to list container registries.
342
343    :param value: The list of container registries. Since this list may be incomplete, the nextLink
344     field should be used to request the next list of container registries.
345    :type value: list[~azure.mgmt.containerregistry.v2017_03_01.models.Registry]
346    :param next_link: The URI that can be used to request the next list of container registries.
347    :type next_link: str
348    """
349
350    _attribute_map = {
351        'value': {'key': 'value', 'type': '[Registry]'},
352        'next_link': {'key': 'nextLink', 'type': 'str'},
353    }
354
355    def __init__(
356        self,
357        *,
358        value: Optional[List["Registry"]] = None,
359        next_link: Optional[str] = None,
360        **kwargs
361    ):
362        super(RegistryListResult, self).__init__(**kwargs)
363        self.value = value
364        self.next_link = next_link
365
366
367class RegistryNameCheckRequest(msrest.serialization.Model):
368    """A request to check whether a container registry name is available.
369
370    Variables are only populated by the server, and will be ignored when sending a request.
371
372    All required parameters must be populated in order to send to Azure.
373
374    :param name: Required. The name of the container registry.
375    :type name: str
376    :ivar type: The resource type of the container registry. This field must be set to
377     'Microsoft.ContainerRegistry/registries'. Has constant value:
378     "Microsoft.ContainerRegistry/registries".
379    :vartype type: str
380    """
381
382    _validation = {
383        'name': {'required': True, 'max_length': 50, 'min_length': 5, 'pattern': r'^[a-zA-Z0-9]*$'},
384        'type': {'required': True, 'constant': True},
385    }
386
387    _attribute_map = {
388        'name': {'key': 'name', 'type': 'str'},
389        'type': {'key': 'type', 'type': 'str'},
390    }
391
392    type = "Microsoft.ContainerRegistry/registries"
393
394    def __init__(
395        self,
396        *,
397        name: str,
398        **kwargs
399    ):
400        super(RegistryNameCheckRequest, self).__init__(**kwargs)
401        self.name = name
402
403
404class RegistryNameStatus(msrest.serialization.Model):
405    """The result of a request to check the availability of a container registry name.
406
407    :param name_available: The value that indicates whether the name is available.
408    :type name_available: bool
409    :param reason: If any, the reason that the name is not available.
410    :type reason: str
411    :param message: If any, the error message that provides more detail for the reason that the
412     name is not available.
413    :type message: str
414    """
415
416    _attribute_map = {
417        'name_available': {'key': 'nameAvailable', 'type': 'bool'},
418        'reason': {'key': 'reason', 'type': 'str'},
419        'message': {'key': 'message', 'type': 'str'},
420    }
421
422    def __init__(
423        self,
424        *,
425        name_available: Optional[bool] = None,
426        reason: Optional[str] = None,
427        message: Optional[str] = None,
428        **kwargs
429    ):
430        super(RegistryNameStatus, self).__init__(**kwargs)
431        self.name_available = name_available
432        self.reason = reason
433        self.message = message
434
435
436class RegistryPassword(msrest.serialization.Model):
437    """The login password for the container registry.
438
439    :param name: The password name. Possible values include: "password", "password2".
440    :type name: str or ~azure.mgmt.containerregistry.v2017_03_01.models.PasswordName
441    :param value: The password value.
442    :type value: str
443    """
444
445    _attribute_map = {
446        'name': {'key': 'name', 'type': 'str'},
447        'value': {'key': 'value', 'type': 'str'},
448    }
449
450    def __init__(
451        self,
452        *,
453        name: Optional[Union[str, "PasswordName"]] = None,
454        value: Optional[str] = None,
455        **kwargs
456    ):
457        super(RegistryPassword, self).__init__(**kwargs)
458        self.name = name
459        self.value = value
460
461
462class RegistryUpdateParameters(msrest.serialization.Model):
463    """The parameters for updating a container registry.
464
465    :param tags: A set of tags. The tags for the container registry.
466    :type tags: dict[str, str]
467    :param admin_user_enabled: The value that indicates whether the admin user is enabled.
468    :type admin_user_enabled: bool
469    :param storage_account: The parameters of a storage account for the container registry. If
470     specified, the storage account must be in the same physical location as the container registry.
471    :type storage_account:
472     ~azure.mgmt.containerregistry.v2017_03_01.models.StorageAccountParameters
473    """
474
475    _attribute_map = {
476        'tags': {'key': 'tags', 'type': '{str}'},
477        'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'},
478        'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountParameters'},
479    }
480
481    def __init__(
482        self,
483        *,
484        tags: Optional[Dict[str, str]] = None,
485        admin_user_enabled: Optional[bool] = None,
486        storage_account: Optional["StorageAccountParameters"] = None,
487        **kwargs
488    ):
489        super(RegistryUpdateParameters, self).__init__(**kwargs)
490        self.tags = tags
491        self.admin_user_enabled = admin_user_enabled
492        self.storage_account = storage_account
493
494
495class Sku(msrest.serialization.Model):
496    """The SKU of a container registry.
497
498    Variables are only populated by the server, and will be ignored when sending a request.
499
500    All required parameters must be populated in order to send to Azure.
501
502    :param name: Required. The SKU name of the container registry. Required for registry creation.
503     Allowed value: Basic.
504    :type name: str
505    :ivar tier: The SKU tier based on the SKU name. Possible values include: "Basic".
506    :vartype tier: str or ~azure.mgmt.containerregistry.v2017_03_01.models.SkuTier
507    """
508
509    _validation = {
510        'name': {'required': True},
511        'tier': {'readonly': True},
512    }
513
514    _attribute_map = {
515        'name': {'key': 'name', 'type': 'str'},
516        'tier': {'key': 'tier', 'type': 'str'},
517    }
518
519    def __init__(
520        self,
521        *,
522        name: str,
523        **kwargs
524    ):
525        super(Sku, self).__init__(**kwargs)
526        self.name = name
527        self.tier = None
528
529
530class StorageAccountParameters(msrest.serialization.Model):
531    """The parameters of a storage account for a container registry.
532
533    All required parameters must be populated in order to send to Azure.
534
535    :param name: Required. The name of the storage account.
536    :type name: str
537    :param access_key: Required. The access key to the storage account.
538    :type access_key: str
539    """
540
541    _validation = {
542        'name': {'required': True},
543        'access_key': {'required': True},
544    }
545
546    _attribute_map = {
547        'name': {'key': 'name', 'type': 'str'},
548        'access_key': {'key': 'accessKey', 'type': 'str'},
549    }
550
551    def __init__(
552        self,
553        *,
554        name: str,
555        access_key: str,
556        **kwargs
557    ):
558        super(StorageAccountParameters, self).__init__(**kwargs)
559        self.name = name
560        self.access_key = access_key
561
562
563class StorageAccountProperties(msrest.serialization.Model):
564    """The properties of a storage account for a container registry.
565
566    :param name: The name of the storage account.
567    :type name: str
568    """
569
570    _attribute_map = {
571        'name': {'key': 'name', 'type': 'str'},
572    }
573
574    def __init__(
575        self,
576        *,
577        name: Optional[str] = None,
578        **kwargs
579    ):
580        super(StorageAccountProperties, self).__init__(**kwargs)
581        self.name = name
582