
                              S r SSKJr  SSKJr  SSKJr  SSKJr  SS jrSS jrSS	 jr	SS
 jr
SS jrSS jrSS jrSS jrSS jrSS jrSS jr  SS jr  SS jr  S S jrSS jrS rg)!z3Shared resource args for Cloud API Gateway surface.    )concepts)deps)concept_parsers)presentation_specsNc                    ^  T nT S:X  a  Sn/ nT (       a9  UR                  [        R                  " U 4S jSR                  U5      5      5        [        R
                  " SUSS9$ )z"Creates location attribute config.-z
a wildcardc                     > T $ N defaults   ;lib/googlecloudsdk/command_lib/api_gateway/resource_args.py<lambda>)LocationAttributeConfig.<locals>.<lambda>#   s    G    z0Location for API and API Configs. Defaults to {}locationzCloud location for {resource}.namefallthroughs	help_text)appendr   Fallthroughformatr    ResourceParameterAttributeConfig)r   default_keywordr   s   `  r   LocationAttributeConfigr      sj    /^"O,>EE!	"# 
	2	20
2 2r   c                 ,    [         R                  " U SS9$ )NzName for API Gatewayr   r   r   r   r   s    r   GatewayAttributeConfigr!   -   s    		2	2&
( (r   c                     / nU(       a'  UR                  [        R                  " S S5      5        [        R                  " U USS9$ )Nc                      g)Nr   r   r   r   r   r   $ApiAttributeConfig.<locals>.<lambda>8   s    Cr   z!Defaults to wildcard for all APIszAPI ID.r   )r   r   r   r   r   )r   wildcardr   s      r   ApiAttributeConfigr&   3   sJ    ,/	12
 
	2	2
 r   c                 ,    [         R                  " U SS9$ )NzAPI Config ID.r   r   r    s    r   ApiConfigAttributeConfigr(   A   s    		2	2 
" "r   c                 ,    [         R                  " U SS9$ )Nz&The name for the API Gateway operationr   r   r    s    r   OperationAttributeConfigr*   G   s    		2	28
: :r   c                 Z    [         R                  " SU [        US9[         R                  S9$ )Nzapigateway.projects.locationsr   )resource_namelocationsId
projectsId)r   ResourceSpecr    DEFAULT_PROJECT_ATTRIBUTE_CONFIG)r,   r   s     r   GetLocationResourceSpecr1   M   s,    			%!)':::	
< <r   c                 n    [         R                  " SU [        5       [        5       [         R                  S9$ )Nz&apigateway.projects.locations.gateways)r,   
gatewaysIdr-   r.   )r   r/   r!   r   r0   r,   s    r   GetGatewayResourceSpecr5   U   s0    			.!'))+::
< <r   c           	      j    [         R                  " SU [        US9[        SS9[         R                  S9$ )Nz"apigateway.projects.locations.apisr%   globalr   )r,   apisIdr-   r.   )r   r/   r&   r   r0   )r,   r%   s     r   GetApiResourceSpecr:   ^   s4    			*!2)(;::
< <r   c           
      ~    [         R                  " SU [        5       [        5       [	        SS9[         R
                  S9$ )Nz*apigateway.projects.locations.apis.configsr8   r   )r,   	configsIdr9   r-   r.   )r   r/   r(   r&   r   r0   r4   s    r   GetApiConfigResourceSpecr=   g   s8    			2!(*!)(;::
< <r   c                 n    [         R                  " SU [        5       [        5       [         R                  S9$ )Nz(apigateway.projects.locations.operations)r,   operationsIdr-   r.   )r   r/   r*   r   r0   r4   s    r   GetOperationResourceSpecr@   q   s0    			0!+-)+::
< <r   c                     U(       a  SnOSn[         R                  R                  U[        5       SR	                  U5      US9R                  U 5        g)a  Adds Gateway resource argument to parser.

Args:
  parser: parser to add arg to
  verb: action being taken with the Gateway
  positional: Boolean indicating if argument is positional, default False
  required: Boolean for if this is required, default is True

Returns: None
gatewayz	--gateway"Name for gateway which will be {}.requiredN)r   ConceptParserForResourcer5   r   AddToParserparserverb
positionalrE   r   s        r   AddGatewayResourceArgrM   z   sP     DD++
*11$7	 ,  %V,r   c                     [         R                  " [        R                  " S[	        5       SR                  U5      US9[        R                  " S[        5       SSS0US9/5      R                  U 5        g	)
a1  Adds Gateway and API Config resource arguments to parser.

Args:
  parser: parser to add arg to
  verb: action being taken with the Gateway
  gateway_required: Boolean for if Gateway is required, default is True
  api_config_required: Boolean for if API Config is required, default is True

Returns: None
rB   rC   rD   --api-configz2Resource name for API config the gateway will use.r    flag_name_overridesrE   N)r   rF   r   ResourcePresentationSpecr5   r   r=   rH   )rJ   rK   gateway_requiredapi_config_requireds       r   AddGatewayApiConfigResourceArgsrV      sr     

5
5$&299$?'	)
 
5
5&(B#-r"2*,	 
V	r   c                     U(       a  SnOSnSnUS:X  a  SS0n[         R                  R                  U[        US9SR	                  U5      UUS9R                  U 5        g)	a=  Adds location resource argument to parser.

Args:
  parser: parser to add arg to
  verb: action being taken with the location
  positional: Optional boolean indiicating if argument is positional
  default: Optional default value for the arg
  required: Boolean for if this is required, default is True

Returns: None
r   z
--locationNr8   rP   r   zParent location which {}.rQ   )r   rF   rG   r1   r   rH   )rJ   rK   rL   r   rE   r   overrides          r   AddLocationResourceArgrY      sl     DD(BH++
g.!((." , 
 %V,r   c                     U(       a  SnOSn[         R                  R                  U[        US9SR	                  U5      SS0US9R                  U 5        g)	aK  Adds API resource argument to parser.

Args:
  parser: parser to add arg to
  verb: action being taken with the API
  positional: Optional boolean indiicating if argument is positional
  required: Boolean for if this is required, default is True
  wildcard: Boolean. Does arg have a default wildcard? default: False

Returns: None
apiz--apir7   zName for API which {}.r   rP   rQ   N)r   rF   rG   r:   r   rH   )rJ   rK   rL   rE   r%   r   s         r   AddApiResourceArgr\      sZ     DD++
(+%%d+%r* , 
 %V,r   c                     U(       a  SnOSn[         R                  R                  U[        5       SR	                  U5      SS0US9R                  U 5        g)a  Adds API Config resource argument to parser.

Args:
  parser: parser to add arg to
  verb: action being taken with the API Config
  positional: Boolean indicating if argument is positional, default False
  required: Boolean for if this is required, default is True

Returns: None

api_configrO   z%Name for API Config which will be {}.r   rP   rQ   N)r   rF   rG   r=   r   rH   rI   s        r   AddApiConfigResourceArgr_      sX     DD++
 -44T:%r* , 
 %V,r   c                     [         R                  R                  S[        5       SR	                  U5      SS9R                  U 5        g )N	operationz The name of the operation to {}.TrD   )r   rF   rG   r@   r   rH   )rJ   rK   s     r   AddOperationResourceArgsrb      sA    ++ (//5	 ,  ![(r   r
   )rB   )r[   F)z
api-config)ra   )r   N)FT)TT)FNT)FTF)__doc__ googlecloudsdk.calliope.conceptsr   r   (googlecloudsdk.command_lib.util.conceptsr   r   r   r!   r&   r(   r*   r1   r5   r:   r=   r@   rM   rV   rY   r\   r_   rb   r   r   r   <module>rf      s     : 6 1 D G2((":<<<<<-. DH8<: DH$(-> @D$-4-0)r   