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
9import datetime
10from typing import Dict, List, Optional, Union
11
12import msrest.serialization
13
14from ._container_registry_management_client_enums import *
15
16
17class Actor(msrest.serialization.Model):
18    """The agent that initiated the event. For most situations, this could be from the authorization context of the request.
19
20    :param name: The subject or username associated with the request context that generated the
21     event.
22    :type name: str
23    """
24
25    _attribute_map = {
26        'name': {'key': 'name', 'type': 'str'},
27    }
28
29    def __init__(
30        self,
31        *,
32        name: Optional[str] = None,
33        **kwargs
34    ):
35        super(Actor, self).__init__(**kwargs)
36        self.name = name
37
38
39class CallbackConfig(msrest.serialization.Model):
40    """The configuration of service URI and custom headers for the webhook.
41
42    All required parameters must be populated in order to send to Azure.
43
44    :param service_uri: Required. The service URI for the webhook to post notifications.
45    :type service_uri: str
46    :param custom_headers: Custom headers that will be added to the webhook notifications.
47    :type custom_headers: dict[str, str]
48    """
49
50    _validation = {
51        'service_uri': {'required': True},
52    }
53
54    _attribute_map = {
55        'service_uri': {'key': 'serviceUri', 'type': 'str'},
56        'custom_headers': {'key': 'customHeaders', 'type': '{str}'},
57    }
58
59    def __init__(
60        self,
61        *,
62        service_uri: str,
63        custom_headers: Optional[Dict[str, str]] = None,
64        **kwargs
65    ):
66        super(CallbackConfig, self).__init__(**kwargs)
67        self.service_uri = service_uri
68        self.custom_headers = custom_headers
69
70
71class EventInfo(msrest.serialization.Model):
72    """The basic information of an event.
73
74    :param id: The event ID.
75    :type id: str
76    """
77
78    _attribute_map = {
79        'id': {'key': 'id', 'type': 'str'},
80    }
81
82    def __init__(
83        self,
84        *,
85        id: Optional[str] = None,
86        **kwargs
87    ):
88        super(EventInfo, self).__init__(**kwargs)
89        self.id = id
90
91
92class Event(EventInfo):
93    """The event for a webhook.
94
95    :param id: The event ID.
96    :type id: str
97    :param event_request_message: The event request message sent to the service URI.
98    :type event_request_message:
99     ~azure.mgmt.containerregistry.v2019_05_01.models.EventRequestMessage
100    :param event_response_message: The event response message received from the service URI.
101    :type event_response_message:
102     ~azure.mgmt.containerregistry.v2019_05_01.models.EventResponseMessage
103    """
104
105    _attribute_map = {
106        'id': {'key': 'id', 'type': 'str'},
107        'event_request_message': {'key': 'eventRequestMessage', 'type': 'EventRequestMessage'},
108        'event_response_message': {'key': 'eventResponseMessage', 'type': 'EventResponseMessage'},
109    }
110
111    def __init__(
112        self,
113        *,
114        id: Optional[str] = None,
115        event_request_message: Optional["EventRequestMessage"] = None,
116        event_response_message: Optional["EventResponseMessage"] = None,
117        **kwargs
118    ):
119        super(Event, self).__init__(id=id, **kwargs)
120        self.event_request_message = event_request_message
121        self.event_response_message = event_response_message
122
123
124class EventContent(msrest.serialization.Model):
125    """The content of the event request message.
126
127    :param id: The event ID.
128    :type id: str
129    :param timestamp: The time at which the event occurred.
130    :type timestamp: ~datetime.datetime
131    :param action: The action that encompasses the provided event.
132    :type action: str
133    :param target: The target of the event.
134    :type target: ~azure.mgmt.containerregistry.v2019_05_01.models.Target
135    :param request: The request that generated the event.
136    :type request: ~azure.mgmt.containerregistry.v2019_05_01.models.Request
137    :param actor: The agent that initiated the event. For most situations, this could be from the
138     authorization context of the request.
139    :type actor: ~azure.mgmt.containerregistry.v2019_05_01.models.Actor
140    :param source: The registry node that generated the event. Put differently, while the actor
141     initiates the event, the source generates it.
142    :type source: ~azure.mgmt.containerregistry.v2019_05_01.models.Source
143    """
144
145    _attribute_map = {
146        'id': {'key': 'id', 'type': 'str'},
147        'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
148        'action': {'key': 'action', 'type': 'str'},
149        'target': {'key': 'target', 'type': 'Target'},
150        'request': {'key': 'request', 'type': 'Request'},
151        'actor': {'key': 'actor', 'type': 'Actor'},
152        'source': {'key': 'source', 'type': 'Source'},
153    }
154
155    def __init__(
156        self,
157        *,
158        id: Optional[str] = None,
159        timestamp: Optional[datetime.datetime] = None,
160        action: Optional[str] = None,
161        target: Optional["Target"] = None,
162        request: Optional["Request"] = None,
163        actor: Optional["Actor"] = None,
164        source: Optional["Source"] = None,
165        **kwargs
166    ):
167        super(EventContent, self).__init__(**kwargs)
168        self.id = id
169        self.timestamp = timestamp
170        self.action = action
171        self.target = target
172        self.request = request
173        self.actor = actor
174        self.source = source
175
176
177class EventListResult(msrest.serialization.Model):
178    """The result of a request to list events for a webhook.
179
180    :param value: The list of events. Since this list may be incomplete, the nextLink field should
181     be used to request the next list of events.
182    :type value: list[~azure.mgmt.containerregistry.v2019_05_01.models.Event]
183    :param next_link: The URI that can be used to request the next list of events.
184    :type next_link: str
185    """
186
187    _attribute_map = {
188        'value': {'key': 'value', 'type': '[Event]'},
189        'next_link': {'key': 'nextLink', 'type': 'str'},
190    }
191
192    def __init__(
193        self,
194        *,
195        value: Optional[List["Event"]] = None,
196        next_link: Optional[str] = None,
197        **kwargs
198    ):
199        super(EventListResult, self).__init__(**kwargs)
200        self.value = value
201        self.next_link = next_link
202
203
204class EventRequestMessage(msrest.serialization.Model):
205    """The event request message sent to the service URI.
206
207    :param content: The content of the event request message.
208    :type content: ~azure.mgmt.containerregistry.v2019_05_01.models.EventContent
209    :param headers: The headers of the event request message.
210    :type headers: dict[str, str]
211    :param method: The HTTP method used to send the event request message.
212    :type method: str
213    :param request_uri: The URI used to send the event request message.
214    :type request_uri: str
215    :param version: The HTTP message version.
216    :type version: str
217    """
218
219    _attribute_map = {
220        'content': {'key': 'content', 'type': 'EventContent'},
221        'headers': {'key': 'headers', 'type': '{str}'},
222        'method': {'key': 'method', 'type': 'str'},
223        'request_uri': {'key': 'requestUri', 'type': 'str'},
224        'version': {'key': 'version', 'type': 'str'},
225    }
226
227    def __init__(
228        self,
229        *,
230        content: Optional["EventContent"] = None,
231        headers: Optional[Dict[str, str]] = None,
232        method: Optional[str] = None,
233        request_uri: Optional[str] = None,
234        version: Optional[str] = None,
235        **kwargs
236    ):
237        super(EventRequestMessage, self).__init__(**kwargs)
238        self.content = content
239        self.headers = headers
240        self.method = method
241        self.request_uri = request_uri
242        self.version = version
243
244
245class EventResponseMessage(msrest.serialization.Model):
246    """The event response message received from the service URI.
247
248    :param content: The content of the event response message.
249    :type content: str
250    :param headers: The headers of the event response message.
251    :type headers: dict[str, str]
252    :param reason_phrase: The reason phrase of the event response message.
253    :type reason_phrase: str
254    :param status_code: The status code of the event response message.
255    :type status_code: str
256    :param version: The HTTP message version.
257    :type version: str
258    """
259
260    _attribute_map = {
261        'content': {'key': 'content', 'type': 'str'},
262        'headers': {'key': 'headers', 'type': '{str}'},
263        'reason_phrase': {'key': 'reasonPhrase', 'type': 'str'},
264        'status_code': {'key': 'statusCode', 'type': 'str'},
265        'version': {'key': 'version', 'type': 'str'},
266    }
267
268    def __init__(
269        self,
270        *,
271        content: Optional[str] = None,
272        headers: Optional[Dict[str, str]] = None,
273        reason_phrase: Optional[str] = None,
274        status_code: Optional[str] = None,
275        version: Optional[str] = None,
276        **kwargs
277    ):
278        super(EventResponseMessage, self).__init__(**kwargs)
279        self.content = content
280        self.headers = headers
281        self.reason_phrase = reason_phrase
282        self.status_code = status_code
283        self.version = version
284
285
286class ImportImageParameters(msrest.serialization.Model):
287    """ImportImageParameters.
288
289    All required parameters must be populated in order to send to Azure.
290
291    :param source: Required. The source of the image.
292    :type source: ~azure.mgmt.containerregistry.v2019_05_01.models.ImportSource
293    :param target_tags: List of strings of the form repo[:tag]. When tag is omitted the source will
294     be used (or 'latest' if source tag is also omitted).
295    :type target_tags: list[str]
296    :param untagged_target_repositories: List of strings of repository names to do a manifest only
297     copy. No tag will be created.
298    :type untagged_target_repositories: list[str]
299    :param mode: When Force, any existing target tags will be overwritten. When NoForce, any
300     existing target tags will fail the operation before any copying begins. Possible values
301     include: "NoForce", "Force". Default value: "NoForce".
302    :type mode: str or ~azure.mgmt.containerregistry.v2019_05_01.models.ImportMode
303    """
304
305    _validation = {
306        'source': {'required': True},
307    }
308
309    _attribute_map = {
310        'source': {'key': 'source', 'type': 'ImportSource'},
311        'target_tags': {'key': 'targetTags', 'type': '[str]'},
312        'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'},
313        'mode': {'key': 'mode', 'type': 'str'},
314    }
315
316    def __init__(
317        self,
318        *,
319        source: "ImportSource",
320        target_tags: Optional[List[str]] = None,
321        untagged_target_repositories: Optional[List[str]] = None,
322        mode: Optional[Union[str, "ImportMode"]] = "NoForce",
323        **kwargs
324    ):
325        super(ImportImageParameters, self).__init__(**kwargs)
326        self.source = source
327        self.target_tags = target_tags
328        self.untagged_target_repositories = untagged_target_repositories
329        self.mode = mode
330
331
332class ImportSource(msrest.serialization.Model):
333    """ImportSource.
334
335    All required parameters must be populated in order to send to Azure.
336
337    :param resource_id: The resource identifier of the source Azure Container Registry.
338    :type resource_id: str
339    :param registry_uri: The address of the source registry (e.g. 'mcr.microsoft.com').
340    :type registry_uri: str
341    :param credentials: Credentials used when importing from a registry uri.
342    :type credentials: ~azure.mgmt.containerregistry.v2019_05_01.models.ImportSourceCredentials
343    :param source_image: Required. Repository name of the source image.
344     Specify an image by repository ('hello-world'). This will use the 'latest' tag.
345     Specify an image by tag ('hello-world:latest').
346     Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123').
347    :type source_image: str
348    """
349
350    _validation = {
351        'source_image': {'required': True},
352    }
353
354    _attribute_map = {
355        'resource_id': {'key': 'resourceId', 'type': 'str'},
356        'registry_uri': {'key': 'registryUri', 'type': 'str'},
357        'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'},
358        'source_image': {'key': 'sourceImage', 'type': 'str'},
359    }
360
361    def __init__(
362        self,
363        *,
364        source_image: str,
365        resource_id: Optional[str] = None,
366        registry_uri: Optional[str] = None,
367        credentials: Optional["ImportSourceCredentials"] = None,
368        **kwargs
369    ):
370        super(ImportSource, self).__init__(**kwargs)
371        self.resource_id = resource_id
372        self.registry_uri = registry_uri
373        self.credentials = credentials
374        self.source_image = source_image
375
376
377class ImportSourceCredentials(msrest.serialization.Model):
378    """ImportSourceCredentials.
379
380    All required parameters must be populated in order to send to Azure.
381
382    :param username: The username to authenticate with the source registry.
383    :type username: str
384    :param password: Required. The password used to authenticate with the source registry.
385    :type password: str
386    """
387
388    _validation = {
389        'password': {'required': True},
390    }
391
392    _attribute_map = {
393        'username': {'key': 'username', 'type': 'str'},
394        'password': {'key': 'password', 'type': 'str'},
395    }
396
397    def __init__(
398        self,
399        *,
400        password: str,
401        username: Optional[str] = None,
402        **kwargs
403    ):
404        super(ImportSourceCredentials, self).__init__(**kwargs)
405        self.username = username
406        self.password = password
407
408
409class IPRule(msrest.serialization.Model):
410    """IP rule with specific IP or IP range in CIDR format.
411
412    All required parameters must be populated in order to send to Azure.
413
414    :param action: The action of IP ACL rule. Possible values include: "Allow".
415    :type action: str or ~azure.mgmt.containerregistry.v2019_05_01.models.Action
416    :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4
417     address is allowed.
418    :type ip_address_or_range: str
419    """
420
421    _validation = {
422        'ip_address_or_range': {'required': True},
423    }
424
425    _attribute_map = {
426        'action': {'key': 'action', 'type': 'str'},
427        'ip_address_or_range': {'key': 'value', 'type': 'str'},
428    }
429
430    def __init__(
431        self,
432        *,
433        ip_address_or_range: str,
434        action: Optional[Union[str, "Action"]] = None,
435        **kwargs
436    ):
437        super(IPRule, self).__init__(**kwargs)
438        self.action = action
439        self.ip_address_or_range = ip_address_or_range
440
441
442class NetworkRuleSet(msrest.serialization.Model):
443    """The network rule set for a container registry.
444
445    All required parameters must be populated in order to send to Azure.
446
447    :param default_action: Required. The default action of allow or deny when no other rules match.
448     Possible values include: "Allow", "Deny". Default value: "Allow".
449    :type default_action: str or ~azure.mgmt.containerregistry.v2019_05_01.models.DefaultAction
450    :param virtual_network_rules: The virtual network rules.
451    :type virtual_network_rules:
452     list[~azure.mgmt.containerregistry.v2019_05_01.models.VirtualNetworkRule]
453    :param ip_rules: The IP ACL rules.
454    :type ip_rules: list[~azure.mgmt.containerregistry.v2019_05_01.models.IPRule]
455    """
456
457    _validation = {
458        'default_action': {'required': True},
459    }
460
461    _attribute_map = {
462        'default_action': {'key': 'defaultAction', 'type': 'str'},
463        'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'},
464        'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'},
465    }
466
467    def __init__(
468        self,
469        *,
470        default_action: Union[str, "DefaultAction"] = "Allow",
471        virtual_network_rules: Optional[List["VirtualNetworkRule"]] = None,
472        ip_rules: Optional[List["IPRule"]] = None,
473        **kwargs
474    ):
475        super(NetworkRuleSet, self).__init__(**kwargs)
476        self.default_action = default_action
477        self.virtual_network_rules = virtual_network_rules
478        self.ip_rules = ip_rules
479
480
481class OperationDefinition(msrest.serialization.Model):
482    """The definition of a container registry operation.
483
484    :param origin: The origin information of the container registry operation.
485    :type origin: str
486    :param name: Operation name: {provider}/{resource}/{operation}.
487    :type name: str
488    :param display: The display information for the container registry operation.
489    :type display: ~azure.mgmt.containerregistry.v2019_05_01.models.OperationDisplayDefinition
490    :param service_specification: The definition of Azure Monitoring service.
491    :type service_specification:
492     ~azure.mgmt.containerregistry.v2019_05_01.models.OperationServiceSpecificationDefinition
493    """
494
495    _attribute_map = {
496        'origin': {'key': 'origin', 'type': 'str'},
497        'name': {'key': 'name', 'type': 'str'},
498        'display': {'key': 'display', 'type': 'OperationDisplayDefinition'},
499        'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'},
500    }
501
502    def __init__(
503        self,
504        *,
505        origin: Optional[str] = None,
506        name: Optional[str] = None,
507        display: Optional["OperationDisplayDefinition"] = None,
508        service_specification: Optional["OperationServiceSpecificationDefinition"] = None,
509        **kwargs
510    ):
511        super(OperationDefinition, self).__init__(**kwargs)
512        self.origin = origin
513        self.name = name
514        self.display = display
515        self.service_specification = service_specification
516
517
518class OperationDisplayDefinition(msrest.serialization.Model):
519    """The display information for a container registry operation.
520
521    :param provider: The resource provider name: Microsoft.ContainerRegistry.
522    :type provider: str
523    :param resource: The resource on which the operation is performed.
524    :type resource: str
525    :param operation: The operation that users can perform.
526    :type operation: str
527    :param description: The description for the operation.
528    :type description: str
529    """
530
531    _attribute_map = {
532        'provider': {'key': 'provider', 'type': 'str'},
533        'resource': {'key': 'resource', 'type': 'str'},
534        'operation': {'key': 'operation', 'type': 'str'},
535        'description': {'key': 'description', 'type': 'str'},
536    }
537
538    def __init__(
539        self,
540        *,
541        provider: Optional[str] = None,
542        resource: Optional[str] = None,
543        operation: Optional[str] = None,
544        description: Optional[str] = None,
545        **kwargs
546    ):
547        super(OperationDisplayDefinition, self).__init__(**kwargs)
548        self.provider = provider
549        self.resource = resource
550        self.operation = operation
551        self.description = description
552
553
554class OperationListResult(msrest.serialization.Model):
555    """The result of a request to list container registry operations.
556
557    :param value: The list of container registry operations. Since this list may be incomplete, the
558     nextLink field should be used to request the next list of operations.
559    :type value: list[~azure.mgmt.containerregistry.v2019_05_01.models.OperationDefinition]
560    :param next_link: The URI that can be used to request the next list of container registry
561     operations.
562    :type next_link: str
563    """
564
565    _attribute_map = {
566        'value': {'key': 'value', 'type': '[OperationDefinition]'},
567        'next_link': {'key': 'nextLink', 'type': 'str'},
568    }
569
570    def __init__(
571        self,
572        *,
573        value: Optional[List["OperationDefinition"]] = None,
574        next_link: Optional[str] = None,
575        **kwargs
576    ):
577        super(OperationListResult, self).__init__(**kwargs)
578        self.value = value
579        self.next_link = next_link
580
581
582class OperationMetricSpecificationDefinition(msrest.serialization.Model):
583    """The definition of Azure Monitoring metric.
584
585    :param name: Metric name.
586    :type name: str
587    :param display_name: Metric display name.
588    :type display_name: str
589    :param display_description: Metric description.
590    :type display_description: str
591    :param unit: Metric unit.
592    :type unit: str
593    :param aggregation_type: Metric aggregation type.
594    :type aggregation_type: str
595    :param internal_metric_name: Internal metric name.
596    :type internal_metric_name: str
597    """
598
599    _attribute_map = {
600        'name': {'key': 'name', 'type': 'str'},
601        'display_name': {'key': 'displayName', 'type': 'str'},
602        'display_description': {'key': 'displayDescription', 'type': 'str'},
603        'unit': {'key': 'unit', 'type': 'str'},
604        'aggregation_type': {'key': 'aggregationType', 'type': 'str'},
605        'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'},
606    }
607
608    def __init__(
609        self,
610        *,
611        name: Optional[str] = None,
612        display_name: Optional[str] = None,
613        display_description: Optional[str] = None,
614        unit: Optional[str] = None,
615        aggregation_type: Optional[str] = None,
616        internal_metric_name: Optional[str] = None,
617        **kwargs
618    ):
619        super(OperationMetricSpecificationDefinition, self).__init__(**kwargs)
620        self.name = name
621        self.display_name = display_name
622        self.display_description = display_description
623        self.unit = unit
624        self.aggregation_type = aggregation_type
625        self.internal_metric_name = internal_metric_name
626
627
628class OperationServiceSpecificationDefinition(msrest.serialization.Model):
629    """The definition of Azure Monitoring list.
630
631    :param metric_specifications: A list of Azure Monitoring metrics definition.
632    :type metric_specifications:
633     list[~azure.mgmt.containerregistry.v2019_05_01.models.OperationMetricSpecificationDefinition]
634    """
635
636    _attribute_map = {
637        'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'},
638    }
639
640    def __init__(
641        self,
642        *,
643        metric_specifications: Optional[List["OperationMetricSpecificationDefinition"]] = None,
644        **kwargs
645    ):
646        super(OperationServiceSpecificationDefinition, self).__init__(**kwargs)
647        self.metric_specifications = metric_specifications
648
649
650class Policies(msrest.serialization.Model):
651    """The policies for a container registry.
652
653    :param quarantine_policy: The quarantine policy for a container registry.
654    :type quarantine_policy: ~azure.mgmt.containerregistry.v2019_05_01.models.QuarantinePolicy
655    :param trust_policy: The content trust policy for a container registry.
656    :type trust_policy: ~azure.mgmt.containerregistry.v2019_05_01.models.TrustPolicy
657    :param retention_policy: The retention policy for a container registry.
658    :type retention_policy: ~azure.mgmt.containerregistry.v2019_05_01.models.RetentionPolicy
659    """
660
661    _attribute_map = {
662        'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'},
663        'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'},
664        'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'},
665    }
666
667    def __init__(
668        self,
669        *,
670        quarantine_policy: Optional["QuarantinePolicy"] = None,
671        trust_policy: Optional["TrustPolicy"] = None,
672        retention_policy: Optional["RetentionPolicy"] = None,
673        **kwargs
674    ):
675        super(Policies, self).__init__(**kwargs)
676        self.quarantine_policy = quarantine_policy
677        self.trust_policy = trust_policy
678        self.retention_policy = retention_policy
679
680
681class QuarantinePolicy(msrest.serialization.Model):
682    """The quarantine policy for a container registry.
683
684    :param status: The value that indicates whether the policy is enabled or not. Possible values
685     include: "enabled", "disabled".
686    :type status: str or ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus
687    """
688
689    _attribute_map = {
690        'status': {'key': 'status', 'type': 'str'},
691    }
692
693    def __init__(
694        self,
695        *,
696        status: Optional[Union[str, "PolicyStatus"]] = None,
697        **kwargs
698    ):
699        super(QuarantinePolicy, self).__init__(**kwargs)
700        self.status = status
701
702
703class RegenerateCredentialParameters(msrest.serialization.Model):
704    """The parameters used to regenerate the login credential.
705
706    All required parameters must be populated in order to send to Azure.
707
708    :param name: Required. Specifies name of the password which should be regenerated -- password
709     or password2. Possible values include: "password", "password2".
710    :type name: str or ~azure.mgmt.containerregistry.v2019_05_01.models.PasswordName
711    """
712
713    _validation = {
714        'name': {'required': True},
715    }
716
717    _attribute_map = {
718        'name': {'key': 'name', 'type': 'str'},
719    }
720
721    def __init__(
722        self,
723        *,
724        name: Union[str, "PasswordName"],
725        **kwargs
726    ):
727        super(RegenerateCredentialParameters, self).__init__(**kwargs)
728        self.name = name
729
730
731class Resource(msrest.serialization.Model):
732    """An Azure resource.
733
734    Variables are only populated by the server, and will be ignored when sending a request.
735
736    All required parameters must be populated in order to send to Azure.
737
738    :ivar id: The resource ID.
739    :vartype id: str
740    :ivar name: The name of the resource.
741    :vartype name: str
742    :ivar type: The type of the resource.
743    :vartype type: str
744    :param location: Required. The location of the resource. This cannot be changed after the
745     resource is created.
746    :type location: str
747    :param tags: A set of tags. The tags of the resource.
748    :type tags: dict[str, str]
749    """
750
751    _validation = {
752        'id': {'readonly': True},
753        'name': {'readonly': True},
754        'type': {'readonly': True},
755        'location': {'required': True},
756    }
757
758    _attribute_map = {
759        'id': {'key': 'id', 'type': 'str'},
760        'name': {'key': 'name', 'type': 'str'},
761        'type': {'key': 'type', 'type': 'str'},
762        'location': {'key': 'location', 'type': 'str'},
763        'tags': {'key': 'tags', 'type': '{str}'},
764    }
765
766    def __init__(
767        self,
768        *,
769        location: str,
770        tags: Optional[Dict[str, str]] = None,
771        **kwargs
772    ):
773        super(Resource, self).__init__(**kwargs)
774        self.id = None
775        self.name = None
776        self.type = None
777        self.location = location
778        self.tags = tags
779
780
781class Registry(Resource):
782    """An object that represents a container registry.
783
784    Variables are only populated by the server, and will be ignored when sending a request.
785
786    All required parameters must be populated in order to send to Azure.
787
788    :ivar id: The resource ID.
789    :vartype id: str
790    :ivar name: The name of the resource.
791    :vartype name: str
792    :ivar type: The type of the resource.
793    :vartype type: str
794    :param location: Required. The location of the resource. This cannot be changed after the
795     resource is created.
796    :type location: str
797    :param tags: A set of tags. The tags of the resource.
798    :type tags: dict[str, str]
799    :param sku: Required. The SKU of the container registry.
800    :type sku: ~azure.mgmt.containerregistry.v2019_05_01.models.Sku
801    :ivar login_server: The URL that can be used to log into the container registry.
802    :vartype login_server: str
803    :ivar creation_date: The creation date of the container registry in ISO8601 format.
804    :vartype creation_date: ~datetime.datetime
805    :ivar provisioning_state: The provisioning state of the container registry at the time the
806     operation was called. Possible values include: "Creating", "Updating", "Deleting", "Succeeded",
807     "Failed", "Canceled".
808    :vartype provisioning_state: str or
809     ~azure.mgmt.containerregistry.v2019_05_01.models.ProvisioningState
810    :ivar status: The status of the container registry at the time the operation was called.
811    :vartype status: ~azure.mgmt.containerregistry.v2019_05_01.models.Status
812    :param admin_user_enabled: The value that indicates whether the admin user is enabled.
813    :type admin_user_enabled: bool
814    :param storage_account: The properties of the storage account for the container registry. Only
815     applicable to Classic SKU.
816    :type storage_account:
817     ~azure.mgmt.containerregistry.v2019_05_01.models.StorageAccountProperties
818    :param network_rule_set: The network rule set for a container registry.
819    :type network_rule_set: ~azure.mgmt.containerregistry.v2019_05_01.models.NetworkRuleSet
820    :param policies: The policies for a container registry.
821    :type policies: ~azure.mgmt.containerregistry.v2019_05_01.models.Policies
822    """
823
824    _validation = {
825        'id': {'readonly': True},
826        'name': {'readonly': True},
827        'type': {'readonly': True},
828        'location': {'required': True},
829        'sku': {'required': True},
830        'login_server': {'readonly': True},
831        'creation_date': {'readonly': True},
832        'provisioning_state': {'readonly': True},
833        'status': {'readonly': True},
834    }
835
836    _attribute_map = {
837        'id': {'key': 'id', 'type': 'str'},
838        'name': {'key': 'name', 'type': 'str'},
839        'type': {'key': 'type', 'type': 'str'},
840        'location': {'key': 'location', 'type': 'str'},
841        'tags': {'key': 'tags', 'type': '{str}'},
842        'sku': {'key': 'sku', 'type': 'Sku'},
843        'login_server': {'key': 'properties.loginServer', 'type': 'str'},
844        'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'},
845        'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
846        'status': {'key': 'properties.status', 'type': 'Status'},
847        'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'},
848        'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'},
849        'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'},
850        'policies': {'key': 'properties.policies', 'type': 'Policies'},
851    }
852
853    def __init__(
854        self,
855        *,
856        location: str,
857        sku: "Sku",
858        tags: Optional[Dict[str, str]] = None,
859        admin_user_enabled: Optional[bool] = False,
860        storage_account: Optional["StorageAccountProperties"] = None,
861        network_rule_set: Optional["NetworkRuleSet"] = None,
862        policies: Optional["Policies"] = None,
863        **kwargs
864    ):
865        super(Registry, self).__init__(location=location, tags=tags, **kwargs)
866        self.sku = sku
867        self.login_server = None
868        self.creation_date = None
869        self.provisioning_state = None
870        self.status = None
871        self.admin_user_enabled = admin_user_enabled
872        self.storage_account = storage_account
873        self.network_rule_set = network_rule_set
874        self.policies = policies
875
876
877class RegistryListCredentialsResult(msrest.serialization.Model):
878    """The response from the ListCredentials operation.
879
880    :param username: The username for a container registry.
881    :type username: str
882    :param passwords: The list of passwords for a container registry.
883    :type passwords: list[~azure.mgmt.containerregistry.v2019_05_01.models.RegistryPassword]
884    """
885
886    _attribute_map = {
887        'username': {'key': 'username', 'type': 'str'},
888        'passwords': {'key': 'passwords', 'type': '[RegistryPassword]'},
889    }
890
891    def __init__(
892        self,
893        *,
894        username: Optional[str] = None,
895        passwords: Optional[List["RegistryPassword"]] = None,
896        **kwargs
897    ):
898        super(RegistryListCredentialsResult, self).__init__(**kwargs)
899        self.username = username
900        self.passwords = passwords
901
902
903class RegistryListResult(msrest.serialization.Model):
904    """The result of a request to list container registries.
905
906    :param value: The list of container registries. Since this list may be incomplete, the nextLink
907     field should be used to request the next list of container registries.
908    :type value: list[~azure.mgmt.containerregistry.v2019_05_01.models.Registry]
909    :param next_link: The URI that can be used to request the next list of container registries.
910    :type next_link: str
911    """
912
913    _attribute_map = {
914        'value': {'key': 'value', 'type': '[Registry]'},
915        'next_link': {'key': 'nextLink', 'type': 'str'},
916    }
917
918    def __init__(
919        self,
920        *,
921        value: Optional[List["Registry"]] = None,
922        next_link: Optional[str] = None,
923        **kwargs
924    ):
925        super(RegistryListResult, self).__init__(**kwargs)
926        self.value = value
927        self.next_link = next_link
928
929
930class RegistryNameCheckRequest(msrest.serialization.Model):
931    """A request to check whether a container registry name is available.
932
933    Variables are only populated by the server, and will be ignored when sending a request.
934
935    All required parameters must be populated in order to send to Azure.
936
937    :param name: Required. The name of the container registry.
938    :type name: str
939    :ivar type: The resource type of the container registry. This field must be set to
940     'Microsoft.ContainerRegistry/registries'. Has constant value:
941     "Microsoft.ContainerRegistry/registries".
942    :vartype type: str
943    """
944
945    _validation = {
946        'name': {'required': True, 'max_length': 50, 'min_length': 5, 'pattern': r'^[a-zA-Z0-9]*$'},
947        'type': {'required': True, 'constant': True},
948    }
949
950    _attribute_map = {
951        'name': {'key': 'name', 'type': 'str'},
952        'type': {'key': 'type', 'type': 'str'},
953    }
954
955    type = "Microsoft.ContainerRegistry/registries"
956
957    def __init__(
958        self,
959        *,
960        name: str,
961        **kwargs
962    ):
963        super(RegistryNameCheckRequest, self).__init__(**kwargs)
964        self.name = name
965
966
967class RegistryNameStatus(msrest.serialization.Model):
968    """The result of a request to check the availability of a container registry name.
969
970    :param name_available: The value that indicates whether the name is available.
971    :type name_available: bool
972    :param reason: If any, the reason that the name is not available.
973    :type reason: str
974    :param message: If any, the error message that provides more detail for the reason that the
975     name is not available.
976    :type message: str
977    """
978
979    _attribute_map = {
980        'name_available': {'key': 'nameAvailable', 'type': 'bool'},
981        'reason': {'key': 'reason', 'type': 'str'},
982        'message': {'key': 'message', 'type': 'str'},
983    }
984
985    def __init__(
986        self,
987        *,
988        name_available: Optional[bool] = None,
989        reason: Optional[str] = None,
990        message: Optional[str] = None,
991        **kwargs
992    ):
993        super(RegistryNameStatus, self).__init__(**kwargs)
994        self.name_available = name_available
995        self.reason = reason
996        self.message = message
997
998
999class RegistryPassword(msrest.serialization.Model):
1000    """The login password for the container registry.
1001
1002    :param name: The password name. Possible values include: "password", "password2".
1003    :type name: str or ~azure.mgmt.containerregistry.v2019_05_01.models.PasswordName
1004    :param value: The password value.
1005    :type value: str
1006    """
1007
1008    _attribute_map = {
1009        'name': {'key': 'name', 'type': 'str'},
1010        'value': {'key': 'value', 'type': 'str'},
1011    }
1012
1013    def __init__(
1014        self,
1015        *,
1016        name: Optional[Union[str, "PasswordName"]] = None,
1017        value: Optional[str] = None,
1018        **kwargs
1019    ):
1020        super(RegistryPassword, self).__init__(**kwargs)
1021        self.name = name
1022        self.value = value
1023
1024
1025class RegistryUpdateParameters(msrest.serialization.Model):
1026    """The parameters for updating a container registry.
1027
1028    :param tags: A set of tags. The tags for the container registry.
1029    :type tags: dict[str, str]
1030    :param sku: The SKU of the container registry.
1031    :type sku: ~azure.mgmt.containerregistry.v2019_05_01.models.Sku
1032    :param admin_user_enabled: The value that indicates whether the admin user is enabled.
1033    :type admin_user_enabled: bool
1034    :param network_rule_set: The network rule set for a container registry.
1035    :type network_rule_set: ~azure.mgmt.containerregistry.v2019_05_01.models.NetworkRuleSet
1036    :param policies: The policies for a container registry.
1037    :type policies: ~azure.mgmt.containerregistry.v2019_05_01.models.Policies
1038    """
1039
1040    _attribute_map = {
1041        'tags': {'key': 'tags', 'type': '{str}'},
1042        'sku': {'key': 'sku', 'type': 'Sku'},
1043        'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'},
1044        'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'},
1045        'policies': {'key': 'properties.policies', 'type': 'Policies'},
1046    }
1047
1048    def __init__(
1049        self,
1050        *,
1051        tags: Optional[Dict[str, str]] = None,
1052        sku: Optional["Sku"] = None,
1053        admin_user_enabled: Optional[bool] = None,
1054        network_rule_set: Optional["NetworkRuleSet"] = None,
1055        policies: Optional["Policies"] = None,
1056        **kwargs
1057    ):
1058        super(RegistryUpdateParameters, self).__init__(**kwargs)
1059        self.tags = tags
1060        self.sku = sku
1061        self.admin_user_enabled = admin_user_enabled
1062        self.network_rule_set = network_rule_set
1063        self.policies = policies
1064
1065
1066class RegistryUsage(msrest.serialization.Model):
1067    """The quota usage for a container registry.
1068
1069    :param name: The name of the usage.
1070    :type name: str
1071    :param limit: The limit of the usage.
1072    :type limit: long
1073    :param current_value: The current value of the usage.
1074    :type current_value: long
1075    :param unit: The unit of measurement. Possible values include: "Count", "Bytes".
1076    :type unit: str or ~azure.mgmt.containerregistry.v2019_05_01.models.RegistryUsageUnit
1077    """
1078
1079    _attribute_map = {
1080        'name': {'key': 'name', 'type': 'str'},
1081        'limit': {'key': 'limit', 'type': 'long'},
1082        'current_value': {'key': 'currentValue', 'type': 'long'},
1083        'unit': {'key': 'unit', 'type': 'str'},
1084    }
1085
1086    def __init__(
1087        self,
1088        *,
1089        name: Optional[str] = None,
1090        limit: Optional[int] = None,
1091        current_value: Optional[int] = None,
1092        unit: Optional[Union[str, "RegistryUsageUnit"]] = None,
1093        **kwargs
1094    ):
1095        super(RegistryUsage, self).__init__(**kwargs)
1096        self.name = name
1097        self.limit = limit
1098        self.current_value = current_value
1099        self.unit = unit
1100
1101
1102class RegistryUsageListResult(msrest.serialization.Model):
1103    """The result of a request to get container registry quota usages.
1104
1105    :param value: The list of container registry quota usages.
1106    :type value: list[~azure.mgmt.containerregistry.v2019_05_01.models.RegistryUsage]
1107    """
1108
1109    _attribute_map = {
1110        'value': {'key': 'value', 'type': '[RegistryUsage]'},
1111    }
1112
1113    def __init__(
1114        self,
1115        *,
1116        value: Optional[List["RegistryUsage"]] = None,
1117        **kwargs
1118    ):
1119        super(RegistryUsageListResult, self).__init__(**kwargs)
1120        self.value = value
1121
1122
1123class Replication(Resource):
1124    """An object that represents a replication for a container registry.
1125
1126    Variables are only populated by the server, and will be ignored when sending a request.
1127
1128    All required parameters must be populated in order to send to Azure.
1129
1130    :ivar id: The resource ID.
1131    :vartype id: str
1132    :ivar name: The name of the resource.
1133    :vartype name: str
1134    :ivar type: The type of the resource.
1135    :vartype type: str
1136    :param location: Required. The location of the resource. This cannot be changed after the
1137     resource is created.
1138    :type location: str
1139    :param tags: A set of tags. The tags of the resource.
1140    :type tags: dict[str, str]
1141    :ivar provisioning_state: The provisioning state of the replication at the time the operation
1142     was called. Possible values include: "Creating", "Updating", "Deleting", "Succeeded", "Failed",
1143     "Canceled".
1144    :vartype provisioning_state: str or
1145     ~azure.mgmt.containerregistry.v2019_05_01.models.ProvisioningState
1146    :ivar status: The status of the replication at the time the operation was called.
1147    :vartype status: ~azure.mgmt.containerregistry.v2019_05_01.models.Status
1148    """
1149
1150    _validation = {
1151        'id': {'readonly': True},
1152        'name': {'readonly': True},
1153        'type': {'readonly': True},
1154        'location': {'required': True},
1155        'provisioning_state': {'readonly': True},
1156        'status': {'readonly': True},
1157    }
1158
1159    _attribute_map = {
1160        'id': {'key': 'id', 'type': 'str'},
1161        'name': {'key': 'name', 'type': 'str'},
1162        'type': {'key': 'type', 'type': 'str'},
1163        'location': {'key': 'location', 'type': 'str'},
1164        'tags': {'key': 'tags', 'type': '{str}'},
1165        'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
1166        'status': {'key': 'properties.status', 'type': 'Status'},
1167    }
1168
1169    def __init__(
1170        self,
1171        *,
1172        location: str,
1173        tags: Optional[Dict[str, str]] = None,
1174        **kwargs
1175    ):
1176        super(Replication, self).__init__(location=location, tags=tags, **kwargs)
1177        self.provisioning_state = None
1178        self.status = None
1179
1180
1181class ReplicationListResult(msrest.serialization.Model):
1182    """The result of a request to list replications for a container registry.
1183
1184    :param value: The list of replications. Since this list may be incomplete, the nextLink field
1185     should be used to request the next list of replications.
1186    :type value: list[~azure.mgmt.containerregistry.v2019_05_01.models.Replication]
1187    :param next_link: The URI that can be used to request the next list of replications.
1188    :type next_link: str
1189    """
1190
1191    _attribute_map = {
1192        'value': {'key': 'value', 'type': '[Replication]'},
1193        'next_link': {'key': 'nextLink', 'type': 'str'},
1194    }
1195
1196    def __init__(
1197        self,
1198        *,
1199        value: Optional[List["Replication"]] = None,
1200        next_link: Optional[str] = None,
1201        **kwargs
1202    ):
1203        super(ReplicationListResult, self).__init__(**kwargs)
1204        self.value = value
1205        self.next_link = next_link
1206
1207
1208class ReplicationUpdateParameters(msrest.serialization.Model):
1209    """The parameters for updating a replication.
1210
1211    :param tags: A set of tags. The tags for the replication.
1212    :type tags: dict[str, str]
1213    """
1214
1215    _attribute_map = {
1216        'tags': {'key': 'tags', 'type': '{str}'},
1217    }
1218
1219    def __init__(
1220        self,
1221        *,
1222        tags: Optional[Dict[str, str]] = None,
1223        **kwargs
1224    ):
1225        super(ReplicationUpdateParameters, self).__init__(**kwargs)
1226        self.tags = tags
1227
1228
1229class Request(msrest.serialization.Model):
1230    """The request that generated the event.
1231
1232    :param id: The ID of the request that initiated the event.
1233    :type id: str
1234    :param addr: The IP or hostname and possibly port of the client connection that initiated the
1235     event. This is the RemoteAddr from the standard http request.
1236    :type addr: str
1237    :param host: The externally accessible hostname of the registry instance, as specified by the
1238     http host header on incoming requests.
1239    :type host: str
1240    :param method: The request method that generated the event.
1241    :type method: str
1242    :param useragent: The user agent header of the request.
1243    :type useragent: str
1244    """
1245
1246    _attribute_map = {
1247        'id': {'key': 'id', 'type': 'str'},
1248        'addr': {'key': 'addr', 'type': 'str'},
1249        'host': {'key': 'host', 'type': 'str'},
1250        'method': {'key': 'method', 'type': 'str'},
1251        'useragent': {'key': 'useragent', 'type': 'str'},
1252    }
1253
1254    def __init__(
1255        self,
1256        *,
1257        id: Optional[str] = None,
1258        addr: Optional[str] = None,
1259        host: Optional[str] = None,
1260        method: Optional[str] = None,
1261        useragent: Optional[str] = None,
1262        **kwargs
1263    ):
1264        super(Request, self).__init__(**kwargs)
1265        self.id = id
1266        self.addr = addr
1267        self.host = host
1268        self.method = method
1269        self.useragent = useragent
1270
1271
1272class RetentionPolicy(msrest.serialization.Model):
1273    """The retention policy for a container registry.
1274
1275    Variables are only populated by the server, and will be ignored when sending a request.
1276
1277    :param days: The number of days to retain an untagged manifest after which it gets purged.
1278    :type days: int
1279    :ivar last_updated_time: The timestamp when the policy was last updated.
1280    :vartype last_updated_time: ~datetime.datetime
1281    :param status: The value that indicates whether the policy is enabled or not. Possible values
1282     include: "enabled", "disabled".
1283    :type status: str or ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus
1284    """
1285
1286    _validation = {
1287        'last_updated_time': {'readonly': True},
1288    }
1289
1290    _attribute_map = {
1291        'days': {'key': 'days', 'type': 'int'},
1292        'last_updated_time': {'key': 'lastUpdatedTime', 'type': 'iso-8601'},
1293        'status': {'key': 'status', 'type': 'str'},
1294    }
1295
1296    def __init__(
1297        self,
1298        *,
1299        days: Optional[int] = 7,
1300        status: Optional[Union[str, "PolicyStatus"]] = None,
1301        **kwargs
1302    ):
1303        super(RetentionPolicy, self).__init__(**kwargs)
1304        self.days = days
1305        self.last_updated_time = None
1306        self.status = status
1307
1308
1309class Sku(msrest.serialization.Model):
1310    """The SKU of a container registry.
1311
1312    Variables are only populated by the server, and will be ignored when sending a request.
1313
1314    All required parameters must be populated in order to send to Azure.
1315
1316    :param name: Required. The SKU name of the container registry. Required for registry creation.
1317     Possible values include: "Classic", "Basic", "Standard", "Premium".
1318    :type name: str or ~azure.mgmt.containerregistry.v2019_05_01.models.SkuName
1319    :ivar tier: The SKU tier based on the SKU name. Possible values include: "Classic", "Basic",
1320     "Standard", "Premium".
1321    :vartype tier: str or ~azure.mgmt.containerregistry.v2019_05_01.models.SkuTier
1322    """
1323
1324    _validation = {
1325        'name': {'required': True},
1326        'tier': {'readonly': True},
1327    }
1328
1329    _attribute_map = {
1330        'name': {'key': 'name', 'type': 'str'},
1331        'tier': {'key': 'tier', 'type': 'str'},
1332    }
1333
1334    def __init__(
1335        self,
1336        *,
1337        name: Union[str, "SkuName"],
1338        **kwargs
1339    ):
1340        super(Sku, self).__init__(**kwargs)
1341        self.name = name
1342        self.tier = None
1343
1344
1345class Source(msrest.serialization.Model):
1346    """The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it.
1347
1348    :param addr: The IP or hostname and the port of the registry node that generated the event.
1349     Generally, this will be resolved by os.Hostname() along with the running port.
1350    :type addr: str
1351    :param instance_id: The running instance of an application. Changes after each restart.
1352    :type instance_id: str
1353    """
1354
1355    _attribute_map = {
1356        'addr': {'key': 'addr', 'type': 'str'},
1357        'instance_id': {'key': 'instanceID', 'type': 'str'},
1358    }
1359
1360    def __init__(
1361        self,
1362        *,
1363        addr: Optional[str] = None,
1364        instance_id: Optional[str] = None,
1365        **kwargs
1366    ):
1367        super(Source, self).__init__(**kwargs)
1368        self.addr = addr
1369        self.instance_id = instance_id
1370
1371
1372class Status(msrest.serialization.Model):
1373    """The status of an Azure resource at the time the operation was called.
1374
1375    Variables are only populated by the server, and will be ignored when sending a request.
1376
1377    :ivar display_status: The short label for the status.
1378    :vartype display_status: str
1379    :ivar message: The detailed message for the status, including alerts and error messages.
1380    :vartype message: str
1381    :ivar timestamp: The timestamp when the status was changed to the current value.
1382    :vartype timestamp: ~datetime.datetime
1383    """
1384
1385    _validation = {
1386        'display_status': {'readonly': True},
1387        'message': {'readonly': True},
1388        'timestamp': {'readonly': True},
1389    }
1390
1391    _attribute_map = {
1392        'display_status': {'key': 'displayStatus', 'type': 'str'},
1393        'message': {'key': 'message', 'type': 'str'},
1394        'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
1395    }
1396
1397    def __init__(
1398        self,
1399        **kwargs
1400    ):
1401        super(Status, self).__init__(**kwargs)
1402        self.display_status = None
1403        self.message = None
1404        self.timestamp = None
1405
1406
1407class StorageAccountProperties(msrest.serialization.Model):
1408    """The properties of a storage account for a container registry. Only applicable to Classic SKU.
1409
1410    All required parameters must be populated in order to send to Azure.
1411
1412    :param id: Required. The resource ID of the storage account.
1413    :type id: str
1414    """
1415
1416    _validation = {
1417        'id': {'required': True},
1418    }
1419
1420    _attribute_map = {
1421        'id': {'key': 'id', 'type': 'str'},
1422    }
1423
1424    def __init__(
1425        self,
1426        *,
1427        id: str,
1428        **kwargs
1429    ):
1430        super(StorageAccountProperties, self).__init__(**kwargs)
1431        self.id = id
1432
1433
1434class Target(msrest.serialization.Model):
1435    """The target of the event.
1436
1437    :param media_type: The MIME type of the referenced object.
1438    :type media_type: str
1439    :param size: The number of bytes of the content. Same as Length field.
1440    :type size: long
1441    :param digest: The digest of the content, as defined by the Registry V2 HTTP API Specification.
1442    :type digest: str
1443    :param length: The number of bytes of the content. Same as Size field.
1444    :type length: long
1445    :param repository: The repository name.
1446    :type repository: str
1447    :param url: The direct URL to the content.
1448    :type url: str
1449    :param tag: The tag name.
1450    :type tag: str
1451    :param name: The name of the artifact.
1452    :type name: str
1453    :param version: The version of the artifact.
1454    :type version: str
1455    """
1456
1457    _attribute_map = {
1458        'media_type': {'key': 'mediaType', 'type': 'str'},
1459        'size': {'key': 'size', 'type': 'long'},
1460        'digest': {'key': 'digest', 'type': 'str'},
1461        'length': {'key': 'length', 'type': 'long'},
1462        'repository': {'key': 'repository', 'type': 'str'},
1463        'url': {'key': 'url', 'type': 'str'},
1464        'tag': {'key': 'tag', 'type': 'str'},
1465        'name': {'key': 'name', 'type': 'str'},
1466        'version': {'key': 'version', 'type': 'str'},
1467    }
1468
1469    def __init__(
1470        self,
1471        *,
1472        media_type: Optional[str] = None,
1473        size: Optional[int] = None,
1474        digest: Optional[str] = None,
1475        length: Optional[int] = None,
1476        repository: Optional[str] = None,
1477        url: Optional[str] = None,
1478        tag: Optional[str] = None,
1479        name: Optional[str] = None,
1480        version: Optional[str] = None,
1481        **kwargs
1482    ):
1483        super(Target, self).__init__(**kwargs)
1484        self.media_type = media_type
1485        self.size = size
1486        self.digest = digest
1487        self.length = length
1488        self.repository = repository
1489        self.url = url
1490        self.tag = tag
1491        self.name = name
1492        self.version = version
1493
1494
1495class TrustPolicy(msrest.serialization.Model):
1496    """The content trust policy for a container registry.
1497
1498    :param type: The type of trust policy. Possible values include: "Notary". Default value:
1499     "Notary".
1500    :type type: str or ~azure.mgmt.containerregistry.v2019_05_01.models.TrustPolicyType
1501    :param status: The value that indicates whether the policy is enabled or not. Possible values
1502     include: "enabled", "disabled".
1503    :type status: str or ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus
1504    """
1505
1506    _attribute_map = {
1507        'type': {'key': 'type', 'type': 'str'},
1508        'status': {'key': 'status', 'type': 'str'},
1509    }
1510
1511    def __init__(
1512        self,
1513        *,
1514        type: Optional[Union[str, "TrustPolicyType"]] = "Notary",
1515        status: Optional[Union[str, "PolicyStatus"]] = None,
1516        **kwargs
1517    ):
1518        super(TrustPolicy, self).__init__(**kwargs)
1519        self.type = type
1520        self.status = status
1521
1522
1523class VirtualNetworkRule(msrest.serialization.Model):
1524    """Virtual network rule.
1525
1526    All required parameters must be populated in order to send to Azure.
1527
1528    :param action: The action of virtual network rule. Possible values include: "Allow".
1529    :type action: str or ~azure.mgmt.containerregistry.v2019_05_01.models.Action
1530    :param virtual_network_resource_id: Required. Resource ID of a subnet, for example:
1531     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.
1532    :type virtual_network_resource_id: str
1533    """
1534
1535    _validation = {
1536        'virtual_network_resource_id': {'required': True},
1537    }
1538
1539    _attribute_map = {
1540        'action': {'key': 'action', 'type': 'str'},
1541        'virtual_network_resource_id': {'key': 'id', 'type': 'str'},
1542    }
1543
1544    def __init__(
1545        self,
1546        *,
1547        virtual_network_resource_id: str,
1548        action: Optional[Union[str, "Action"]] = None,
1549        **kwargs
1550    ):
1551        super(VirtualNetworkRule, self).__init__(**kwargs)
1552        self.action = action
1553        self.virtual_network_resource_id = virtual_network_resource_id
1554
1555
1556class Webhook(Resource):
1557    """An object that represents a webhook for a container registry.
1558
1559    Variables are only populated by the server, and will be ignored when sending a request.
1560
1561    All required parameters must be populated in order to send to Azure.
1562
1563    :ivar id: The resource ID.
1564    :vartype id: str
1565    :ivar name: The name of the resource.
1566    :vartype name: str
1567    :ivar type: The type of the resource.
1568    :vartype type: str
1569    :param location: Required. The location of the resource. This cannot be changed after the
1570     resource is created.
1571    :type location: str
1572    :param tags: A set of tags. The tags of the resource.
1573    :type tags: dict[str, str]
1574    :param status: The status of the webhook at the time the operation was called. Possible values
1575     include: "enabled", "disabled".
1576    :type status: str or ~azure.mgmt.containerregistry.v2019_05_01.models.WebhookStatus
1577    :param scope: The scope of repositories where the event can be triggered. For example, 'foo:*'
1578     means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only.
1579     'foo' is equivalent to 'foo:latest'. Empty means all events.
1580    :type scope: str
1581    :param actions: The list of actions that trigger the webhook to post notifications.
1582    :type actions: list[str or ~azure.mgmt.containerregistry.v2019_05_01.models.WebhookAction]
1583    :ivar provisioning_state: The provisioning state of the webhook at the time the operation was
1584     called. Possible values include: "Creating", "Updating", "Deleting", "Succeeded", "Failed",
1585     "Canceled".
1586    :vartype provisioning_state: str or
1587     ~azure.mgmt.containerregistry.v2019_05_01.models.ProvisioningState
1588    """
1589
1590    _validation = {
1591        'id': {'readonly': True},
1592        'name': {'readonly': True},
1593        'type': {'readonly': True},
1594        'location': {'required': True},
1595        'provisioning_state': {'readonly': True},
1596    }
1597
1598    _attribute_map = {
1599        'id': {'key': 'id', 'type': 'str'},
1600        'name': {'key': 'name', 'type': 'str'},
1601        'type': {'key': 'type', 'type': 'str'},
1602        'location': {'key': 'location', 'type': 'str'},
1603        'tags': {'key': 'tags', 'type': '{str}'},
1604        'status': {'key': 'properties.status', 'type': 'str'},
1605        'scope': {'key': 'properties.scope', 'type': 'str'},
1606        'actions': {'key': 'properties.actions', 'type': '[str]'},
1607        'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
1608    }
1609
1610    def __init__(
1611        self,
1612        *,
1613        location: str,
1614        tags: Optional[Dict[str, str]] = None,
1615        status: Optional[Union[str, "WebhookStatus"]] = None,
1616        scope: Optional[str] = None,
1617        actions: Optional[List[Union[str, "WebhookAction"]]] = None,
1618        **kwargs
1619    ):
1620        super(Webhook, self).__init__(location=location, tags=tags, **kwargs)
1621        self.status = status
1622        self.scope = scope
1623        self.actions = actions
1624        self.provisioning_state = None
1625
1626
1627class WebhookCreateParameters(msrest.serialization.Model):
1628    """The parameters for creating a webhook.
1629
1630    All required parameters must be populated in order to send to Azure.
1631
1632    :param tags: A set of tags. The tags for the webhook.
1633    :type tags: dict[str, str]
1634    :param location: Required. The location of the webhook. This cannot be changed after the
1635     resource is created.
1636    :type location: str
1637    :param service_uri: The service URI for the webhook to post notifications.
1638    :type service_uri: str
1639    :param custom_headers: Custom headers that will be added to the webhook notifications.
1640    :type custom_headers: dict[str, str]
1641    :param status: The status of the webhook at the time the operation was called. Possible values
1642     include: "enabled", "disabled".
1643    :type status: str or ~azure.mgmt.containerregistry.v2019_05_01.models.WebhookStatus
1644    :param scope: The scope of repositories where the event can be triggered. For example, 'foo:*'
1645     means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only.
1646     'foo' is equivalent to 'foo:latest'. Empty means all events.
1647    :type scope: str
1648    :param actions: The list of actions that trigger the webhook to post notifications.
1649    :type actions: list[str or ~azure.mgmt.containerregistry.v2019_05_01.models.WebhookAction]
1650    """
1651
1652    _validation = {
1653        'location': {'required': True},
1654    }
1655
1656    _attribute_map = {
1657        'tags': {'key': 'tags', 'type': '{str}'},
1658        'location': {'key': 'location', 'type': 'str'},
1659        'service_uri': {'key': 'properties.serviceUri', 'type': 'str'},
1660        'custom_headers': {'key': 'properties.customHeaders', 'type': '{str}'},
1661        'status': {'key': 'properties.status', 'type': 'str'},
1662        'scope': {'key': 'properties.scope', 'type': 'str'},
1663        'actions': {'key': 'properties.actions', 'type': '[str]'},
1664    }
1665
1666    def __init__(
1667        self,
1668        *,
1669        location: str,
1670        tags: Optional[Dict[str, str]] = None,
1671        service_uri: Optional[str] = None,
1672        custom_headers: Optional[Dict[str, str]] = None,
1673        status: Optional[Union[str, "WebhookStatus"]] = None,
1674        scope: Optional[str] = None,
1675        actions: Optional[List[Union[str, "WebhookAction"]]] = None,
1676        **kwargs
1677    ):
1678        super(WebhookCreateParameters, self).__init__(**kwargs)
1679        self.tags = tags
1680        self.location = location
1681        self.service_uri = service_uri
1682        self.custom_headers = custom_headers
1683        self.status = status
1684        self.scope = scope
1685        self.actions = actions
1686
1687
1688class WebhookListResult(msrest.serialization.Model):
1689    """The result of a request to list webhooks for a container registry.
1690
1691    :param value: The list of webhooks. Since this list may be incomplete, the nextLink field
1692     should be used to request the next list of webhooks.
1693    :type value: list[~azure.mgmt.containerregistry.v2019_05_01.models.Webhook]
1694    :param next_link: The URI that can be used to request the next list of webhooks.
1695    :type next_link: str
1696    """
1697
1698    _attribute_map = {
1699        'value': {'key': 'value', 'type': '[Webhook]'},
1700        'next_link': {'key': 'nextLink', 'type': 'str'},
1701    }
1702
1703    def __init__(
1704        self,
1705        *,
1706        value: Optional[List["Webhook"]] = None,
1707        next_link: Optional[str] = None,
1708        **kwargs
1709    ):
1710        super(WebhookListResult, self).__init__(**kwargs)
1711        self.value = value
1712        self.next_link = next_link
1713
1714
1715class WebhookUpdateParameters(msrest.serialization.Model):
1716    """The parameters for updating a webhook.
1717
1718    :param tags: A set of tags. The tags for the webhook.
1719    :type tags: dict[str, str]
1720    :param service_uri: The service URI for the webhook to post notifications.
1721    :type service_uri: str
1722    :param custom_headers: Custom headers that will be added to the webhook notifications.
1723    :type custom_headers: dict[str, str]
1724    :param status: The status of the webhook at the time the operation was called. Possible values
1725     include: "enabled", "disabled".
1726    :type status: str or ~azure.mgmt.containerregistry.v2019_05_01.models.WebhookStatus
1727    :param scope: The scope of repositories where the event can be triggered. For example, 'foo:*'
1728     means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only.
1729     'foo' is equivalent to 'foo:latest'. Empty means all events.
1730    :type scope: str
1731    :param actions: The list of actions that trigger the webhook to post notifications.
1732    :type actions: list[str or ~azure.mgmt.containerregistry.v2019_05_01.models.WebhookAction]
1733    """
1734
1735    _attribute_map = {
1736        'tags': {'key': 'tags', 'type': '{str}'},
1737        'service_uri': {'key': 'properties.serviceUri', 'type': 'str'},
1738        'custom_headers': {'key': 'properties.customHeaders', 'type': '{str}'},
1739        'status': {'key': 'properties.status', 'type': 'str'},
1740        'scope': {'key': 'properties.scope', 'type': 'str'},
1741        'actions': {'key': 'properties.actions', 'type': '[str]'},
1742    }
1743
1744    def __init__(
1745        self,
1746        *,
1747        tags: Optional[Dict[str, str]] = None,
1748        service_uri: Optional[str] = None,
1749        custom_headers: Optional[Dict[str, str]] = None,
1750        status: Optional[Union[str, "WebhookStatus"]] = None,
1751        scope: Optional[str] = None,
1752        actions: Optional[List[Union[str, "WebhookAction"]]] = None,
1753        **kwargs
1754    ):
1755        super(WebhookUpdateParameters, self).__init__(**kwargs)
1756        self.tags = tags
1757        self.service_uri = service_uri
1758        self.custom_headers = custom_headers
1759        self.status = status
1760        self.scope = scope
1761        self.actions = actions
1762