
    T                         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 ddlmZ  e	j$                  e	j&                  j(                         G d de	j*                               Zy)zDCommand for getting a Cloud Security Command Center BigQuery export.    )absolute_import)division)print_function)unicode_literals)securitycenter_client)base)flags)util)bqexport_utilc                   2    e Zd ZdZddddZed        Zd Zy)	Getz.Get a Security Command Center BigQuery export.a        Get a Security Command Center BigQuery export.

      BigQuery exports that are created with Security Command Center API V2 and
      later include a `location` attribute. If the `location` attribute is
      included in the resource name of a BigQuery export, you must specify it
      when referencing the export. For example, the following BigQuery export
      name has `location=eu`:
      `organizations/123/locations/eu/bigQueryExports/test-bq-export`.
      a        To get a BigQuery export under given organization `123` with id
      `test-bq-export`,
      run:

        $ gcloud scc bqexports get test-bq-export             --organization=123

      To get a BigQuery export under given folder `456` with id `test-bq-export`,
      run:

        $ gcloud scc bqexports get test-bq-export --folder=456

      To get a BigQuery export under given project `789` with id `test-bq-export,`
      run:

        $ gcloud scc bqexports get test-bq-export --project=789

      To get a BigQuery export under given organization `123` with id
      `test-bq-export`, and `location=global` run:

        $ gcloud scc bqexports get test-bq-export             --organization=123             --location=global
      z      This command uses the Security Command Center API. For more information,
      see [Security Command Center API.](https://cloud.google.com/security-command-center/docs/reference/rest)
      )DESCRIPTIONEXAMPLESzAPI REFERENCEc                     t        j                  |        t        j                  |        t        j                  j                  |        t        j                  j                  |        y )N)bqexports_flagsAddBigQueryPositionalArgumentAddParentGroup	scc_flagsAPI_VERSION_FLAGAddToParserLOCATION_FLAG)parsers     lib/surface/scc/bqexports/get.pyArgszGet.ArgsM   sF    11&9""6***62''/    c                    t        j                  ||j                  d      }t        j                  |      }t        j
                  |      }|dk(  rG|j                         }t        j                  |      |_	        |j                  j                  |      }|S |j                         }t        j                  |      |_	        |j                  j                  |      }|S )NT)"version_specific_existing_resourcev1)scc_utilGetVersionFromArgumentsBIG_QUERY_EXPORTr   GetMessages	GetClient4SecuritycenterOrganizationsBigQueryExportsGetRequestr   "ValidateAndGetBigQueryExportV1Namenameorganizations_bigQueryExportsr   =SecuritycenterOrganizationsLocationsBigQueryExportsGetRequest"ValidateAndGetBigQueryExportV2Name'organizations_locations_bigQueryExports)selfargsversionmessagesclientreqbq_export_responses          r   RunzGet.RunU   s    
 ..d##G %009H",,W5F$IIKcAA$Gch!??CCCH  
P
P
R 
 AA$Gch!IIMM
 r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r2    r   r   r   r      s6    6	

2
I(-T 0 0r   r   N)r6   
__future__r   r   r   r   googlecloudsdk.api_lib.sccr   googlecloudsdk.callioper   googlecloudsdk.command_lib.sccr	   r   r
   r   (googlecloudsdk.command_lib.scc.bqexportsr   r   ReleaseTracksReleaseTrackGADescribeCommandr   r9   r   r   <module>rC      sf     K &  % ' < ( = ; B M D%%(()L$

 L *Lr   