
                         V   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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SKJr  SrSrS\ S\ 3rS r\R4                  " \R6                  R8                  5       " S S\
R:                  \R<                  5      5       r\R4                  " \R6                  R@                  5       " S S\5      5       r!\R4                  " \R6                  RD                  5       " S S\!5      5       r#SS0r$\$\l%        \$\!l%        \$\#l%        g)z+Creates or updates a Google Cloud Function.    )absolute_import)division)unicode_literals)base)flags)secrets_config)util)command)labels_util)env_vars_util)logzYou can disable this behavior by explicitly specifying the --no-gen2 flag or by setting the functions/gen2 config property to 'off'.zTo learn more about the differences between 1st gen and 2nd gen functions, visit:
https://cloud.google.com/functions/docs/concepts/version-comparisona  As of Cloud SDK 492.0.0 release, new functions will be deployed as 2nd gen functions by default. This is equivalent to currently deploying new with the --gen2 flag. Existing 1st gen functions will not be impacted and will continue to deploy as 1st gen functions.

c                 n   [         R                  " U S5        [         R                  " U 5        [         R                  " U 5        [         R                  " U 5        [         R
                  " U 5        [         R                  " U 5        [         R                  " U 5        [         R                  " U 5        [         R                  " U 5        [        R                  " U [        R                  [        R                  S9  [         R                  " U 5        [         R                  " U 5        [         R                   " U 5        [         R"                  " U 5        [$        R&                  " U 5        [$        R(                  " U 5        [         R*                  " U 5        [         R,                  " X5        [         R.                  " U 5        [         R0                  " U 5        [2        R4                  " U 5        [         R6                  " U 5        [         R8                  " U 5        [         R:                  " U 5        [         R<                  " U 5        [         R>                  " U 5        [         R@                  " U 5        [         RB                  " U 5        [         RD                  " U 5        [         RF                  " U 5        [         RH                  " U 5        [         RJ                  " U 5        [         RL                  " U 5        [         RN                  " U 5        [         RP                  " U 5        [         RR                  " U 5        g)z%Register base flags for this command.z	to deploy)extra_update_messageextra_remove_messageN)*r   AddFunctionResourceArgAddFunctionMemoryAndCpuFlagsAddAllowUnauthenticatedFlagAddFunctionRetryFlagAddFunctionTimeoutFlagAddMaxInstancesFlagAddMinInstancesFlagAddRuntimeFlagAddServiceAccountFlagargs_labels_utilAddUpdateLabelsFlagsr   &NO_LABELS_STARTING_WITH_DEPLOY_MESSAGEAddSourceFlagAddStageBucketFlagAddEntryPointFlagAddTriggerFlagGroupr   AddUpdateEnvVarsFlagsAddBuildEnvVarsFlagsAddIgnoreFileFlagAddRuntimeUpdatePolicyAddKMSKeyFlagsAddDockerRepositoryFlagsr   ConfigureFlagsAddVPCConnectorMutexGroupAddEgressSettingsFlagAddIngressSettingsFlagAddSecurityLevelFlagAddBuildWorkerPoolMutexGroupAddDockerRegistryFlagsAddRunServiceAccountFlagAddTriggerLocationFlagAddTriggerServiceAccountFlagAddGen2Flag$AddServeAllTrafficLatestRevisionFlagAddConcurrencyFlagAddBuildServiceAccountFlag AddBinaryAuthorizationMutexGroupAddAllDirectVpcFlags)parsertracks     lib/surface/functions/deploy.py_CommonArgsr;   6   s3    v{3 $$V, ##F+V$v&F#F#vf%''&MM&MM f6"&! F# %%f- $$V, &! v- v  ( ' !!&)f%v&V$$$V, v&   (v&$$V,F,,V46" ""6* ((0 V$    c                   4    \ rS rSrSr\S 5       rS rS rSr	g)Deploy   )Create or update a Google Cloud Function.c                 L    [        U [        R                  R                  5        g N)r;   r   ReleaseTrackGAr8   s    r:   ArgsDeploy.Args   s    )),,-r<   c                 F    [         R                  " XR                  5       S9$ )N)r9   )
command_v1RunrC   selfargss     r:   _RunV1Deploy._RunV1   s    >>$&7&7&9::r<   c                     U R                   (       d=  [        R                  " 5       (       d#  [        R                  R                  [        5        [        R                  " XR                  5       5      $ rB   )
_v2_functionr   ShouldUseGen2r   statusPrint_NEW_CHANGE_WARNING
command_v2rJ   rC   rK   s     r:   _RunV2Deploy._RunV2   sD    U%8%8%:%:	jj*+>>$ 1 1 344r<    N)
__name__
__module____qualname____firstlineno____doc__staticmethodrF   rN   rW   __static_attributes__rY   r<   r:   r>   r>      s!    1. .;5r<   r>   c                   (    \ rS rSrSr\S 5       rSrg)
DeployBeta   r@   c                 L    [        U [        R                  R                  5        gz<Register alpha (and implicitly beta) flags for this command.N)r;   r   rC   BETArE   s    r:   rF   DeployBeta.Args   s     ))../r<   rY   NrZ   r[   r\   r]   r^   r_   rF   r`   rY   r<   r:   rb   rb      s    10 0r<   rb   c                   (    \ rS rSrSr\S 5       rSrg)DeployAlpha   r@   c                 x    [        U [        R                  R                  5        [        R
                  " U 5        gre   )r;   r   rC   ALPHAr   AddBuildpackStackFlagrE   s    r:   rF   DeployAlpha.Args   s*     ))//0 
'r<   rY   Nrh   rY   r<   r:   rj   rj      s    1( (r<   rj   EXAMPLESa          To deploy a function that is triggered by write events on the document
        ``/messages/{pushId}'', run:

          $ {command} my_function --runtime=python37 --trigger-event=providers/cloud.firestore/eventTypes/document.write --trigger-resource=projects/project_id/databases/(default)/documents/messages/{pushId}

        See https://cloud.google.com/functions/docs/calling for more details
        of using other types of resource as triggers.
        N)&r^   
__future__r   r   r   googlecloudsdk.callioper   $googlecloudsdk.command_lib.functionsr   r   r	   .googlecloudsdk.command_lib.functions.v1.deployr
   rI   r   .googlecloudsdk.command_lib.functions.v2.deployrV   r   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   _HOW_TO_DISABLE_CHANGE_LEARN_ABOUT_GEN_DIFFSrU   r;   ReleaseTracksrC   rD   FunctionResourceCommandCommandr>   rf   rb   rm   rj   DETAILED_HELPdetailed_helprY   r<   r:   <module>r      s:   2 &  ' ( 6 ? 5 P F P H P #B L ; b  K%\ D%%(()5T))4<< 5 *5" D%%**+0 0 ,0 D%%++,	(* 	( -	(  
 % (
 ) r<   