
                             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)zCCommand for listing Cloud Security Command Center BigQuery exports.    )absolute_import)division)print_function)unicode_literals)
list_pager)securitycenter_client)base)flags)utilc                   2    e Zd ZdZddddZed        Zd Zy)	Listz.List Security Command Center BigQuery exports.a  List Security Command Center BigQuery exports.

      BigQuery exports that are created with Security Command Center API V2 and
      later include a `location` attribute. Include the `--location` flag to
      list BigQuery exports with `location` attribute other than `global`.
      a        List BigQuery exports under organization `123`:

          $ gcloud scc bqexports list --organization=123

      List BigQuery exports under folder `456`:

          $ gcloud scc bqexports list --folder=456

      List BigQuery exports under project `789`:

          $ gcloud scc bqexports list --project=789

      List BigQuery exports under organization `123` and location `global`:

          $ gcloud scc bqexports list --organization=123               --location=global

      List BigQuery exports under organization `123` and `location=eu`:

          $ gcloud scc bqexports list --organization=123               --location=eu
      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                  j                  |        t        j                  | d       t
        j                  j                  |        t
        j                  j                  |        y )NT)required)	r	   URI_FLAGRemoveFromParserbqexports_flagsAddParentGroup	scc_flagsAPI_VERSION_FLAGAddToParserLOCATION_FLAG)parsers    !lib/surface/scc/bqexports/list.pyArgsz	List.ArgsG   sN     	MM""6*""6D9**62''/    c                    t        j                  |d      }t        j                  |      }t        j                  |      }|dk(  r7|j                         }t        j                  |      |_        |j                  }nS|j                         }t        j                  |      }t        j                  |d      }| d| |_        |j                  }|j                  |_        t        j                  ||d|j                  d      S )	NT)"version_specific_existing_resourcev1v2z/locations/pageSizebigQueryExports)batch_size_attribute
batch_sizefield)scc_utilGetVersionFromArgumentsr   GetMessages	GetClient5SecuritycenterOrganizationsBigQueryExportsListRequestGetParentFromNamedArgumentsparentorganizations_bigQueryExports>SecuritycenterOrganizationsLocationsBigQueryExportsListRequestValidateAndGetLocation'organizations_locations_bigQueryExports	page_sizer"   r   YieldFromList)	selfargsversionmessagesclientrequestendpointr-   locations	            r   RunzList.RunQ   s    ..G %009H",,W5F$NNPg;;DAgn55h 
Q
Q
S  33D9f00t<h XJ7gn??h~~G ##'>> r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r<    r   r   r   r      s5    6

.="-H 0 0r   r   N)r@   
__future__r   r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.sccr   googlecloudsdk.callioper	   googlecloudsdk.command_lib.sccr
   r   r   r'   (googlecloudsdk.command_lib.scc.bqexportsr   ReleaseTracksReleaseTrackGAListCommandr   rC   r   r   <module>rN      sf     J &  % ' ' < ( = ; M D%%(()P4 P *Pr   