
                            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(                        ej*                   G d dej,                                      Z ej$                  ej&                  j0                        ej*                   G d dej,                                      Zy)z;Command for listing an organization IaC validation reports.    )absolute_import)division)print_function)unicode_literals)
list_pager)util)base)errors)flagsc                   2    e Zd ZdZddddZed        Zd Zy)	List]Lists all the Cloud Security Command Center (SCC) IaC validation reports for an organization.r
          Lists all the Cloud Security Command Center (SCC) IaC validation
          reports for an organization.(  
          To list Cloud Security Command Center IaC validation reports for organization `123` in the `global` location, run:

            $ {command} organizations/123/locations/global/reports

          Or using flags:

            $ {command} --organization=123 --location=global

            z
      This command uses the securityposture/v1 API. For more information,
      see Security Command Center API. (https://cloud.google.com/security-command-center)DESCRIPTIONEXAMPLESzAPI REFERENCEc                 l    t         j                  j                  |        t        j                  |        y Nr	   URI_FLAGRemoveFromParserr   AddParentOrFlagsGroupparsers    .lib/surface/scc/iac_validation_reports/list.pyArgsz	List.Args:   &     	MM""6* 
'    c           	         t        j                  |d      }t        j                  t        j
                  j                        }t        j                  t        j
                  j                        }t        j                  ||      }|j                  r-|j                  r!|j                  rt        j                  d      |j                  d      r|j                  }nR|j                  d      r,|j                  d      rt        j                   |       d| }nt        j                  d      |j#                  |t%        |d	d       t%        |d
d             }t'        j(                  |j*                  |d|j,                  d      S NT)"version_specific_existing_resourcez^Cannot provide both a positional `PARENT` and argument (`--organization`, `--location`) flags.PARENTorganizationlocationz/locations/zXMust provide either positional `PARENT` or both `--organization` and `--location` flags.filter	page_size)parentr&   pageSizer)   reports)batch_size_attribute
batch_sizefield)scc_utilGetVersionFromArgumentssecurityposture_clientGetMessagesModuler	   ReleaseTrackGAGetClientInstanceValidateAndGetLocationr#   r$   r%   r
   InvalidSCCInputErrorIsKnownAndSpecifiedIsSpecified GetParentFromPositionalArguments7SecuritypostureOrganizationsLocationsReportsListRequestgetattrr   YieldFromListorganizations_locations_reportsr'   selfargsversionmessagesclientr%   r(   requests           r   RunzList.RunB   sY   ..G &778I8I8L8LMH#55d6G6G6J6JKF..tW=H$++''4 
 	  *{{f


>
*t/?/?
/K;;DAB+hZXf''$  NNtXt,{D1 O G ##..'>> r   N__name__
__module____qualname____doc__detailed_helpstaticmethodr   rE    r   r   r   r      s8    
 f*	]!-* ( ('r   r   c                   2    e Zd ZdZddddZed        Zd Zy)		ListAlphar   r   r   z
      This command uses the securityposture/v1alpha API. The full documentation for this API can be found at:
      https://cloud.google.com/security-command-centerr   c                 l    t         j                  j                  |        t        j                  |        y r   r   r   s    r   r   zListAlpha.Args   r   r   c           	         t        j                  |d      }t        j                  t        j
                  j                        }t        j                  t        j
                  j                        }t        j                  ||      }|j                  r-|j                  r!|j                  rt        j                  d      |j                  d      r|j                  }nR|j                  d      r,|j                  d      rt        j                   |       d| }nt        j                  d      |j#                  |t%        |d	d       t%        |d
d             }t'        j(                  |j*                  |d|j,                  d      S r!   )r.   r/   r0   r1   r	   r2   ALPHAr4   r5   r#   r$   r%   r
   r6   r7   r8   r9   r:   r;   r   r<   r=   r'   r>   s           r   rE   zListAlpha.Run   sY   ..G &778I8I8O8OPH#55d6G6G6M6MNF..tW=H$++''4 
 	  *{{f


>
*t/?/?
/K;;DAB+hZXf''$  NNtXt,{D1 O G ##..'>> r   NrF   rM   r   r   rO   rO   l   s7    
 f*	:!-* ( ('r   rO   N)rJ   
__future__r   r   r   r   apitools.base.pyr   #googlecloudsdk.api_lib.scc.posturesr   r0   googlecloudsdk.callioper	   googlecloudsdk.command_lib.sccr
   r.   5googlecloudsdk.command_lib.scc.iac_validation_reportsr   ReleaseTracksr2   r3   DefaultUniverseOnlyListCommandr   rR   rO   rM   r   r   <module>r\      s    B &  % ' ' N ( 1 ; G  G4 G GT  G   G Gr   