
    q                        d Z ddlmZ ddlmZ ddlmZ ddlm	Z	  ej                  ej                  j                  ej                  j                        ej                   G d dej                                      Zdd	d
e_        y)zCloudLocation search command.    )
list_pager)apis)base)flagsc                   &    e Zd ZdZed        Zd Zy)SearchzSearch cloudLocations.

  ## EXAMPLES

  To search all cloudLocations for `projects/my-project-id`, run:

    $ {command} --project=my-project-id
  c                 .    t        j                  |        y)zArgs is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command. Positional arguments are allowed.
    N)r   AddSearchFlags)parsers    9lib/surface/cloudlocationfinder/cloud_locations/search.pyArgszSearch.Args#   s     
     c                 z   | j                         t        j                   j                  k(  rd}nd}t        j                  d|      }t        j
                  d|      }|j                  }|j                  j                  j                         j                         }|j                  j                  j                         j                         }|j                  ||j                  ||j                        }d|_        d|_        t!        j"                  ||dd|j                  s|j$                  d	
      S dd	
      S )zRun command.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
        with.

    Returns:
      Search CloudLocations.
    v1v1alphacloudlocationfinder)parentpageSizesourceCloudLocationquery r   cloudLocationsNr   )methodfieldlimitbatch_size_attribute)ReleaseTrackr   GA	core_apisGetClientInstanceGetMessagesModule!projects_locations_cloudLocationsCONCEPTSlocationParseRelativeNamesource_cloud_location?CloudlocationfinderProjectsLocationsCloudLocationsSearchRequest	page_sizer   order_byr   YieldFromListr   )	selfargsapi_versionclientmessagescloud_locations_servicer$   r'   requests	            r   Runz
Search.Run-   s    d//222kk(()>LF**+@+NH$FF}}%%++-::<H++113@@B  VV1jj	 W G DJDM## $

djj' 
 15' r   N)__name__
__module____qualname____doc__staticmethodr   r3    r   r   r   r      s      ! !$r   r   z$
        Search Cloudlocations.
    z
    To search CloudLocations, run:

        $ {command} --source-cloud-location=aws-us-east-1 --query=display_name="us-east4"
    )DESCRIPTIONEXAMPLESN)r7   apitools.base.pyr   googlecloudsdk.api_lib.utilr   r   googlecloudsdk.callioper   .googlecloudsdk.command_lib.cloudlocationfinderr   ReleaseTracksr   r   ALPHAUniverseCompatibleCommandr   detailed_helpr9   r   r   <module>rE      s    $ ' 9 ( @ D%%(($*;*;*A*AB8T\\ 8  C8x		 r   