
                            S 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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  \	R*                  " \	R,                  R.                  5       " S S\	R0                  5      5       rg)zECommand for updating a Cloud Security Command Center BigQuery export.    )absolute_import)division)print_function)unicode_literals)securitycenter_client)base)flags)util)bqexport_util)log)
propertiesc                   :    \ rS rSrSrSSSS.r\S 5       rS rS	r	g
)Update!   z1Update a Security Command Center BigQuery export.a        Update 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        Update a BigQuery export with id `test-bq-export` under organization `123`
      with a dataset `abc` in project `234` and a filter on category that equals
      to `XSS_SCRIPTING`:

        $ gcloud scc bqexports update test-bq-export           --organization=123           --dataset=projects/234/datasets/abc           --description="This is a test BigQuery export"           --filter="category=\"XSS_SCRIPTING\""

      Update a BigQuery export with id `test-bq-export` under folder `456` with
      a dataset `abc` in project `234` and a filter on category that equals to
      `XSS_SCRIPTING`:

        $ gcloud scc bqexports update test-bq-export --folder=456           --dataset=projects/234/datasets/abc           --description="This is a test BigQuery export"           --filter="category=\"XSS_SCRIPTING\""

      Update a BigQuery export with id `test-bq-export` under project `789` with
      a dataset `abc` in project `234` and a filter on category that equals to
      `XSS_SCRIPTING`:

        $ gcloud scc bqexports update test-bq-export           --project=789 --dataset=projects/234/datasets/abc           --description="This is a test BigQuery export"           --filter="category=\"XSS_SCRIPTING\""

      Update a BigQuery export `test-bq-export` in organization `123` and
      `location=global`. This command updates the target dataset to
      `projects/234/datasets/abc`, the export description to `This is a test
      BigQuery export` and the export filter to `XSS_SCRIPTING`:

        $ gcloud scc bqexports update test-bq-export           --organization=123           --dataset=projects/234/datasets/abc           --description="This is a test BigQuery export"           --filter="category=\"XSS_SCRIPTING\""           --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                 f   [         R                  R                  U 5        [         R                  R                  U 5        [         R                  R                  U 5        [         R
                  R                  U 5        [         R                  " U 5        [         R                  " U 5        U R                  R                  [        R                  R                  R                  R                  5       5        [        R                   R                  U 5        [        R"                  R                  U 5        g )N)bqexport_flagsDATASET_FLAG_OPTIONALAddToParserDESCRIPTION_FLAGFILTER_FLAGUPDATE_MASK_FLAGAddBigQueryPositionalArgumentAddParentGroupdisplay_info	AddFormatr   VALUEScoredefault_formatGet	scc_flagsAPI_VERSION_FLAGLOCATION_FLAG)parsers    #lib/surface/scc/bqexports/update.pyArgsUpdate.Args_   s    ((44V<##//7**62##//7008!!&)
!!*"3"3"8"8"G"G"K"K"MN**62''/    c                    [         R                  " XR                  SS9n[        R                  " U5      n[        R
                  " U5      nUS:X  aN  UR                  5       n[        R                  " U5      Ul	        UR                  5       nXel        UR                  nOMUR                  5       n[        R                  " U5      Ul	        UR                  5       nXel        UR"                  n/ nUR%                  S5      (       a"  UR'                  S5        UR(                  Ul        UR%                  S5      (       a"  UR'                  S5        UR*                  Ul        UR%                  S5      (       a"  UR'                  S5        UR,                  Ul        UR%                  S5      (       a  UR.                  Ul        OSR3                  U5      Ul        S Ul        UR5                  U5      n	[6        R8                  R;                  S	5        U	$ )
NT)"version_specific_existing_resourcev1datasetdescriptionfilterupdate_mask,zUpdated.)scc_utilGetVersionFromArgumentsBIG_QUERY_EXPORTr   GetMessages	GetClient6SecuritycenterOrganizationsBigQueryExportsPatchRequestr   "ValidateAndGetBigQueryExportV1Namename)GoogleCloudSecuritycenterV1BigQueryExport)googleCloudSecuritycenterV1BigQueryExportorganizations_bigQueryExports?SecuritycenterOrganizationsLocationsBigQueryExportsPatchRequest"ValidateAndGetBigQueryExportV2Name)GoogleCloudSecuritycenterV2BigQueryExport)googleCloudSecuritycenterV2BigQueryExport'organizations_locations_bigQueryExportsIsKnownAndSpecifiedappendr-   r.   r/   r0   
updateMaskjoinPatchr   statusPrint)
selfargsversionmessagesclientreqexportendpointcomputed_update_maskbq_export_responses
             r&   Run
Update.Runn   s   
 ..##G %009H",,W5F$KKMcAA$GchAACf6<355h 
R
R
T 
 AA$GchAACf6<3??h	**!!),||fn..!!-0++f))!!(+kkfm ..''cnxx 45cn DK!,JJZ r)    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr'   rS   __static_attributes__rU   r)   r&   r   r   !   s7    9	
(
R
i8-t 0 02r)   r   N)rZ   
__future__r   r   r   r   googlecloudsdk.api_lib.sccr   googlecloudsdk.callioper   googlecloudsdk.command_lib.sccr	   r"   r
   r2   (googlecloudsdk.command_lib.scc.bqexportsr   r   googlecloudsdk.corer   r   ReleaseTracksReleaseTrackGAUpdateCommandr   rU   r)   r&   <module>rh      sj     L &  % ' < ( = ; B L # * D%%(()~T ~ *~r)   