ó
    €ÏÖ
  ã                   ó`   • S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r
  SSKJr  SrS	 rS
 rg)z('functions deploy' utilities for labels.é    )Úabsolute_import)Údivision)Úunicode_literals)Úutil)Ú
exceptions)Úlabels_utilzpLabel keys starting with `deployment` are reserved for use by deployment tools and cannot be specified manually.c                 óˆ   • U(       d  gU H4  nUR                  S5      (       d  M  [        R                  " U [        5      e   g)z÷Check for labels that start with `deployment`, which is not allowed.

Args:
  flag_name: The name of the flag to include in case of an exception
  label_names: A list of label names to check

Raises:
  calliope_exceptions.InvalidArgumentException
NÚ
deployment)Ú
startswithÚcalliope_exceptionsÚInvalidArgumentExceptionÚ&NO_LABELS_STARTING_WITH_DEPLOY_MESSAGE)Ú	flag_nameÚlabel_namesÚ
label_names      ÚAlib/googlecloudsdk/command_lib/functions/v1/deploy/labels_util.pyÚCheckNoDeploymentLabelsr       s>   € ö 
Ø
Û€jØ×Ñ˜\×*Ó*Ü×8Ò8Ø
Ô;óð ò  ó    c                 ó  • U=(       d    0 nSUS'   [         R                  " XBUS9n[        R                  " 5       nUR	                  UR
                  R                  U R                  5      nUR                  (       a  UR                  U l        gg)aÔ  Set the labels on a function based on args.

Args:
  function: the function to set the labels on
  update_labels: a dict of <label-name>-<label-value> pairs for the labels to
    be updated, from --update-labels
  remove_labels: a list of the labels to be removed, from --remove-labels
  clear_labels: a bool representing whether or not to clear all labels, from
    --clear-labels

Returns:
  A bool indicating whether or not any labels were updated on the function.
z
cli-gcloudzdeployment-tool)Ú	additionsÚsubtractionsÚclearTF)	Úargs_labels_utilÚDiffÚapi_utilÚGetApiMessagesModuleÚApplyÚCloudFunctionÚLabelsValueÚlabelsÚneeds_update)ÚfunctionÚupdate_labelsÚremove_labelsÚclear_labelsÚlabels_to_updateÚlabels_diffÚmessagesÚlabels_updates           r   ÚSetFunctionLabelsr*   3   sƒ   € ð #×( bÐØ(4ÐÐ$Ñ%Ü ×%Ò%Ø ÀLñ€+ô ×*Ò*Ó,€(Ø×#Ñ#Ø×Ñ×(Ñ(¨(¯/©/ó€-ð ××Ø#×*Ñ*€H„OØØ	r   N)Ú__doc__Ú
__future__r   r   r   Ú#googlecloudsdk.api_lib.functions.v1r   r   Úgooglecloudsdk.callioper   r   Ú$googlecloudsdk.command_lib.util.argsr   r   r   r   r*   © r   r   Ú<module>r1      s0   ðñ /å &Ý Ý 'å @Ý EÝ Pð.ð 'òó&r   