
    Y                     R    d Z ddlZddlmZ  G d dej                        Z	 	 ddZy)z-General utilities for cloud deploy resources.    N)resource_propertyc                   4    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
Zy)ResourceTypezBIndicates the cloud deploy resource type defined in the API proto.DeliveryPipelineTargetReleaseRollout
AutomationCustomTargetTypeDeployPolicyDeliveryPipelineAttributeTargetAttributeN)__name__
__module____qualname____doc__DELIVERY_PIPELINETARGETRELEASEROLLOUT
AUTOMATIONCUSTOM_TARGET_TYPEDEPLOY_POLICYPIPELINE_ATTRIBUTETARGET_ATTRIBUTE     4lib/googlecloudsdk/command_lib/deploy/deploy_util.pyr   r      s6    J(&''*) -2&r   r   c                    |rrt        | |j                        j                  } |       }|j                         D ]1  \  }}|j                  j                  |j                  ||             3 ||_        |rt        | |j                        j                  }	 |	       }
|j                         D ]D  \  }}|
j                  j                  |	j                  t        j                  |      |             F |
|_        yy)a  Sets the metadata of a cloud deploy resource message.

  Args:
   messages: module containing the definitions of messages for Cloud Deploy.
   message: message in googlecloudsdk.generated_clients.apis.clouddeploy.
   resource_type: ResourceType enum, the type of the resource to be updated,
     which is defined in the API proto.
   annotations: dict[str,str], a dict of annotation (key,value) pairs that allow
     clients to store small amounts of arbitrary data in cloud deploy resources.
   labels: dict[str,str], a dict of label (key,value) pairs that can be used to
     select cloud deploy resources and to find collections of cloud deploy
     resources that satisfy certain conditions.
  )keyvalueN)getattrr!   AnnotationsValueitemsadditionalPropertiesappendAdditionalPropertyannotationsLabelsValuer   ConvertToSnakeCaselabels)messagesmessageresource_typer(   r+   annotations_value_msgannotations_valuer    r!   labels_value_msglabels_values              r   SetMetadatar3   #   s    & #H$1$7$799I9I -/!'')
U,,33

2
2s%
2
HJ * ,Gx)<)<=II#%Llln
U''..

-
- $66s;	 .  % "GN r   )NN)r   enumgooglecloudsdk.core.resourcer   Enumr   r3   r   r   r   <module>r7      s/    4  :
'499 
'  !	("r   