
                            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  \R$                  " \R&                  R(                  5      \R*                   " S S\R,                  5      5       5       r\R$                  " \R&                  R0                  5      \R*                   " S S\R,                  5      5       5       rg)zWCommand for listing all the Cloud Security Command Center postures for an organization.    )absolute_import)division)print_function)unicode_literals)
list_pager)util)base)errors)flagsc                   :    \ rS rSrSrSSSS.r\S 5       rS rS	r	g
)List   ILists all the Cloud Security Command Center postures for an organization.^
          Lists all the Cloud Security Command Center postures for an
          organization.  
          To list all the Cloud Security Command Center postures for an
          organization `123`
          and in the `global` location, run:

            $ {command} organizations/123/locations/global

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

            z
      This command uses the securityposture/v1 API. The full documentation for
    this API can be found at: https://cloud.google.com/security-command-centerDESCRIPTIONEXAMPLESzAPI REFERENCEc                 n    [         R                  R                  U 5        [        R                  " U 5        g Nr	   URI_FLAGRemoveFromParserr   AddParentOrFlagsGroupparsers     lib/surface/scc/postures/list.pyArgs	List.Args8   &     	MM""6* 
'    c           	      2   [         R                  " USS9n[        R                  " [        R
                  R                  5      n[        R                  " [        R
                  R                  5      n[         R                  " X5      nUR                  S5      (       a  UR                  nO[         R                  " U5       SU 3nUR                  U[        USS 5      [        USS 5      S9n[        R                  " UR                   USUR"                  S	S
9$ )NT"version_specific_existing_resourcePARENT/locations/filter	page_sizeparentr'   pageSizer+   posturesbatch_size_attribute
batch_sizefield)scc_utilGetVersionFromArgumentssecurityposture_clientGetMessagesModuler	   ReleaseTrackGAGetClientInstanceValidateAndGetLocationIsKnownAndSpecifiedr%    GetParentFromPositionalArguments8SecuritypostureOrganizationsLocationsPosturesListRequestgetattrr   YieldFromList organizations_locations_posturesr(   selfargsversionmessagesclientlocationr*   requests           r   RunList.Run@   s    ..G &778I8I8L8LMH#55d6G6G6J6JKF..t=H  **{{f;;DAB+hZXf OOtXt,{D1 P G ##//'>> r!    N
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   rG   __static_attributes__rI   r!   r   r   r      s8     R	R-* ( (r!   r   c                   :    \ rS rSrSrSSSS.r\S 5       rS rS	r	g
)	ListAlpha_   r   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                 n    [         R                  R                  U 5        [        R                  " U 5        g r   r   r   s    r   r   ListAlpha.Argsx   r    r!   c           	      h   [         R                  " USS9n[        R                  " [        R
                  R                  5      n[        R                  " [        R
                  R                  5      n[         R                  " X5      nUR                  S5      (       aB  UR                  S5      (       a,  UR                  S5      (       a  [        R                  " S5      eUR                  S5      (       a  UR                  nO^UR                  S5      (       a2  UR                  S5      (       a  [         R                  " U5       SU 3nO[        R                  " S5      eUR                  U[!        US	S 5      [!        US
S 5      S9n["        R$                  " UR&                  USUR(                  SS9$ )NTr#   r%   organizationrE   z^Cannot provide both a positional `PARENT` and argument (`--organization`, `--location`) flags.r&   zXMust provide either positional `PARENT` or both `--organization` and `--location` flags.r'   r(   r)   r+   r,   r-   )r1   r2   r3   r4   r	   r5   ALPHAr7   r8   r9   IsSpecifiedr
   InvalidSCCInputErrorr%   r:   r;   r<   r   r=   r>   r(   r?   s           r   rG   ListAlpha.Run   s}   ..G &778I8I8O8OPH#55d6G6G6M6MNF..t=H  **((T-=-=j-I-I''4 
 	  **{{f


>
*
*t/?/?
/K/K;;DAB+hZXf''$  OOtXt,{D1 P G ##//'>> r!   rI   NrJ   rI   r!   r   rT   rT   _   s7     R	:-( ( ()r!   rT   N)rO   
__future__r   r   r   r   apitools.base.pyr   #googlecloudsdk.api_lib.scc.posturesr   r3   googlecloudsdk.callioper	   googlecloudsdk.command_lib.sccr
   r1   'googlecloudsdk.command_lib.scc.posturesr   ReleaseTracksr5   r6   DefaultUniverseOnlyListCommandr   rZ   rT   rI   r!   r   <module>rg      s    ^ &  % ' ' N ( 1 ; 9 D%%(()<4 <  *<~ D%%++,H   H  -Hr!   