
                         D   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
lmZ  ej                   ej"                  j$                  ej"                  j&                  ej"                  j(                         G d dej*                               Zy)zCommand QueryAsset API.    )absolute_import)division)unicode_literals)client_util)base)asset_query_printer)flags)utils)common_argsc                   0    e Zd ZdZdddZed        Zd Zy)QueryzQuery the Cloud assets.zp      Issue an analytical query on Cloud assets using a BigQuery Standard SQL
      compatible statement.
      a_        To count the number of compute instances, run:

        $ {command} --project='test-project' --statement='SELECT * FROM compute_googleapis_com_Instance'

      To see the query result of the previous job, pass the job-reference from the previous response:

        $ {command} --project='test-project' --job-reference=<job-reference-from>
      )DESCRIPTIONEXAMPLESc                 V   | j                  d      }t        j                  |d       t        j                  d      j                  |       t        j                  |d       t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        | j                  j                  t        j                          t        j"                  j%                  |        y )NT)requiredz3The ID of the organization which is the root asset.z$The project which is the root asset.)help_text_to_prependz-The ID of the folder which is the root asset.)add_mutually_exclusive_groupr	   AddOrganizationArgsr   ProjectArgumentAddToParserAddFolderArgsAddQueryArgsAddPageSizeAddPageToken
AddTimeoutAddTimeArgsAddQuerySystemBigQueryArgsdisplay_info	AddFormatr   ASSET_QUERY_PRINTER_FORMATAssetQueryPrinterRegister)parserparent_groups     lib/surface/asset/query.pyArgsz
Query.Args6   s    666EL	KMCk,	GI	v	f	v	V	f	$$V,
!!668 ))226:    c                     t        j                  |j                  |j                  |j                        }t        j                  |      }|j                  |      }|S )N)asset_utilsGetParentNameForExportorganizationprojectfolderr   AssetQueryClientr   )selfargsparentclientresps        r%   Runz	Query.RunL   sJ    //0A0A4<<04=F))&1F<<DKr'   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr&   r4    r'   r%   r   r      s1      



-& ; ;*r'   r   N)r8   
__future__r   r   r   googlecloudsdk.api_lib.assetr   googlecloudsdk.callioper    googlecloudsdk.command_lib.assetr   r	   r
   r)   $googlecloudsdk.command_lib.util.argsr   ReleaseTracksReleaseTrackALPHABETAGACommandr   r;   r'   r%   <module>rG      s|     &  ' 4 ( @ 2 A < D%%++T->->-C-C%%((*3DLL 3*3r'   