
    p                        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dl
mZ ddlmZ d	d
iZ ej                   ej"                  j$                         G d de	j&                               Z ej                   ej"                  j*                         G d de             Z ej                   ej"                  j.                         G d de             Zy).Triggers execution of a Google Cloud Function.    )absolute_import)division)unicode_literals)base)flags)util)commandEXAMPLESa{  
        To call a function, giving it 'Hello World!' in the message field of its event
        argument (depending on your environment you might need to escape
        characters in `--data` flag value differently), run:

            $ {command} helloWorld --data='{"message": "Hello World!"}'

        Note that this method has a limited quota which cannot be increased. It is
        intended for testing and debugging and should not be used in production.

        Calls to HTTP-triggered functions are sent as HTTP POST requests. To use other
        HTTP methods, use a dedicated HTTP request tool such as cURL or wget.

        c                   0    e Zd ZdZeZed        Zd Zd Z	y)Callr   c                     t        j                  | d       | j                         }t        j                  |       t        j                  | d       t        j
                  |       y)z!Registers flags for this command.z
to executeT)hiddenN)r   AddFunctionResourceArgadd_mutually_exclusive_groupAddDataFlagAddGen2FlagAddCloudEventsFlag)parserdata_flag_groups     lib/surface/functions/call.pyArgsz	Call.Args4   sP     
  699;O	o& 
fT*	_-    c                 J    t        j                  || j                               S N)
command_v1RunReleaseTrackselfargss     r   _RunV1zCall._RunV1?       >>$ 1 1 344r   c                 J    t        j                  || j                               S r   )
command_v2r   r   r   s     r   _RunV2zCall._RunV2B   r#   r   N)
__name__
__module____qualname____doc___DETAILED_HELPdetailed_helpstaticmethodr   r"   r&    r   r   r   r   .   s&    6 -. .55r   r   c                        e Zd ZdZed        Zy)CallBetar   c                 X    t         j                  |        t        j                  |        y)z<Register beta (and implicitly alpha) flags for this command.N)r   r   r   AddGcloudHttpTimeoutFlag)r   s    r   r   zCallBeta.ArgsJ   s      	IIf 
""6*r   N)r'   r(   r)   r*   r-   r   r.   r   r   r0   r0   F   s    6+ +r   r0   c                       e Zd ZdZy)	CallAlphar   N)r'   r(   r)   r*   r.   r   r   r4   r4   S   s    6r   r4   N)r*   
__future__r   r   r   googlecloudsdk.callioper   $googlecloudsdk.command_lib.functionsr   r	   ,googlecloudsdk.command_lib.functions.v1.callr
   r   ,googlecloudsdk.command_lib.functions.v2.callr%   r+   ReleaseTracksr   GAFunctionResourceCommandr   BETAr0   ALPHAr4   r.   r   r   <module>r?      s    5 &  ' ( 6 5 N N  $ D%%(()54'' 5 *5. D%%**+	+t 	+ ,	+ D%%++,7 7 -7r   