
                             S r SSK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S rS rSS jrS rS rg)z>Utilities for flags for `gcloud cloudlocationfinder` commands.    N)arg_parsers)base)concepts)deps)concept_parsers)presentation_specsc                  \    [         R                  " SS[        R                  " S S5      /S9$ )zReturns the attribute config for a Cloud location.

Returns:
  concepts.ResourceParameterAttributeConfig: Attribute config for a Cloud
    location.
locationz&The Cloud location for the {resource}.c                      g)Nglobal r       ;lib/googlecloudsdk/command_lib/cloudlocationfinder/flags.py<lambda>)LocationAttributeConfig.<locals>.<lambda>&   s    8r   zlocation is always global)name	help_textfallthroughs)r    ResourceParameterAttributeConfigr   Fallthroughr   r   r   LocationAttributeConfigr      s4     
	2	28


+-H
I
 r   c                  \    [         R                  " SS[        5       [         R                  S9$ )zwReturns the resource spec for a Cloud location.

Returns:
  concepts.ResourceSpec: Resource spec for a Cloud location.
z&cloudlocationfinder.projects.locationsr
   )resource_collectionresource_namelocationsId
projectsId)r   ResourceSpecr    DEFAULT_PROJECT_ATTRIBUTE_CONFIGr   r   r   GetLocationResourceSpecr   +   s,     
		B)+::	
 r   c                  ,    [         R                  " SSS9$ )zReturns the attribute config for a source Cloud location.

Returns:
  concepts.ResourceParameterAttributeConfig: Attribute config for a source
    Cloud location.
cloud_locationThe source Cloud location.)r   r   )r   r   r   r   r   "SourceCloudLocationAttributeConfigr#   9   s     
	2	2'C
 r   c                  n    [         R                  " SS[        5       [         R                  [	        5       S9$ )zReturns the resource spec for a source Cloud location.

Returns:
  concepts.ResourceSpec: Resource spec for a source Cloud location.
z5cloudlocationfinder.projects.locations.cloudLocationssource_cloud_location)r   r   r   r   cloudLocationsId)r   r   r   r   r#   r   r   r   "GetSourceCloudLocationResourceSpecr'   E   s2     
		
A+)+::9;
 r   c                 r    [         R                  R                  S[        5       SSS9R	                  U 5        g)zWAdds a flag for specifying a location.

Args:
  parser: The parser to add the flag to.

--locationzThe resource location.F)r   resource_spec
group_helprequiredN)r   ConceptParserForResourcer   AddToParserparsers    r   AddLocationFlagr2   V   s8     +++-)	 , 
 Kr   c           
          [         R                  " [        R                  " S[	        5       SSUS9/SS/0S9R                  U 5        g)	zAdds a flag for specifying a source Cloud location.

Args:
  parser: The parser to add the flag to.
  flag_name_overrides: A dictionary of flag name overrides.
z--source-cloud-locationr"   T)r   concept_specr+   r,   flag_name_overridesz --source-cloud-location.locationr)   )command_level_fallthroughsN)r   r-   r   ResourcePresentationSpecr'   r/   )r1   r5   s     r   AddSourceCloudLocationFlagr8   d   sQ     

5
5,=?5"5 -|n" Kr   c                 X    [         R                  R                  U 5        [        U 5        g)zlAdds flags for listing Cloudlocations to the given parser.

Args:
  parser: The parser to add the flags to.
N)r   SORT_BY_FLAGRemoveFromParserr2   r0   s    r   AddListFlagsr<   {   s      $$V,&r   c           	         [        U 5        [        U SS0S9  U R                  SSS9  U R                  S[        R                  " S[
        R                  S	S
9SS9  U R                  S[        R                  " S[
        R                  S	S
9SS9  g)znAdds flags for searching Cloudlocations to the given parser.

Args:
  parser: The parser to add the flags to.
r
    )r5   z--queryz*Query to use for searching Cloudlocations.)helpz--limit   T)	unlimitedz&Maximum number of resources to return.)typer?   z--page-sizez%Maximum number of resources per page.N)r2   r8   add_argumentr   
BoundedIntsysmaxsizer0   s    r   AddSearchFlagsrG      s     &V*b9IJ7   	!!!S[[DA3  
 	!!!S[[DA2  r   )N)__doc__rE   googlecloudsdk.callioper   r    googlecloudsdk.calliope.conceptsr   r   (googlecloudsdk.command_lib.util.conceptsr   r   r   r   r#   r'   r2   r8   r<   rG   r   r   r   <module>rL      sH    E 
 / ( 5 1 D G 	".r   