Ë
    €ÏÖ
  ã                   ó`   — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z
 ddlmZ dZd	„ Zd
„ Zy)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                 ón   — |sy|D ]-  }|j                  d«      sŒt        j                  | t        «      ‚ y)a  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                 ó  — |xs i }d|d<   t        j                  |||¬«      }t        j                  «       }|j	                  |j
                  j                  | j                  «      }|j                  r|j                  | _        yy)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   