
                            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  \	R$                  " \	R&                  R(                  \	R&                  R*                  \	R&                  R,                  5      \	R.                   " S S\	R0                  5      5       5       rS rS rg)z/Command for listing a finding's security marks.    )absolute_import)division)print_function)unicode_literals)securitycenter_client)base)flags)util)timesc                   :    \ rS rSrSrSSSS.r\S 5       rS rSr	g	)
	ListMarks   z List a finding's security marks.a  
        List all security marks for `testFinding` under organization `123456` and
        source `5678`:

          $ {command} `testFinding` --organization=123456 --source=5678

        List all security marks for `testFinding` under project `example-project`
        and source `5678`:

          $ {command} projects/example-project/sources/5678/findings/testFinding

        List all security marks for `testFinding` under folder `456` and source
        `5678`:

          $ {command} folders/456/sources/5678/findings/testFinding

        List all security marks for `testFinding` under organization `123456`,
        source `5678` and `location=eu`:

          $ {command} `testFinding` --organization=123456 --source=5678
            --location=euz
      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                 4   [         R                  R                  U 5        [        R                  R                  U 5        [        R                  R                  U 5        [        R                  R                  U 5        [        R                  R                  U 5        [        R                  R                  U 5        [        R                  R                  U 5        U R                  SS9nUR                  SSS9  UR                  SSS9  UR                  SS	S9  g )
NF)requiredz--organizationz:The organization ID (e.g., 123) that contains the finding.)helpz--folderz4The folder ID (e.g., 456) that contains the finding.z	--projectzAThe project ID (e.g., example-project) that contains the finding.)r   URI_FLAGRemoveFromParserr	   FINDING_FLAGAddToParserSOURCE_FLAG	scc_flagsPAGE_TOKEN_FLAGREAD_TIME_FLAGAPI_VERSION_FLAGLOCATION_FLAGadd_mutually_exclusive_groupadd_argument)parsergroups     &lib/surface/scc/findings/list_marks.pyArgsListMarks.ArgsB   s     	MM""6* 
""6*	!!&)))&1((0**62''////?E	I   
C   
O      c                    [        U5      n[        R                  " U5      nUR                  5       nUR                  Ul        US:X  ab  UR                  S5      (       aL  UR                  Ul        [        R                  " UR                  5      n[        R                  " U5      Ul        [        XU5      n[        R                  " U5      nUR                  R                  U5      n[         R"                  " UR$                  U5      nU$ )Nv1	read_time)_GetApiVersionr   GetMessages5SecuritycenterOrganizationsSourcesFindingsListRequest
page_token	pageTokenIsKnownAndSpecifiedr(   readTimer   ParseDateTimeFormatDateTime_GenerateParent	GetClientorganizations_sources_findingsListr
    ExtractSecurityMarksFromResponselistFindingsResults)	selfargsversionmessagesrequestread_time_dtclientlist_findings_responseresponses	            r"   RunListMarks.Run_   s    T"G$009HLLNG G$433K@@g(()9)9:l--l;gdW5G",,W5F#BBGGP 4422DH Or%    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr#   rA   __static_attributes__rC   r%   r"   r   r      s7    
 ) 8*r/-8  8r%   r   c                     [         R                  " U 5        [         R                  " X5      n[         R                  " X25      Ul        S[         R
                  " U5       S3Ul        U$ )zCGenerates a finding's parent and adds filter based on finding name.zname : "")r
   .ValidateMutexOnFindingAndSourceAndOrganizationGetFullFindingNameGetSourceParentFromFindingNameparentGetFindingIdFromNamefilter)r9   reqr:   finding_names       r"   r2   r2   x   sS    55d;((7,22<I#*444\BC2F#*	*r%   c                 L    SS/n[         R                  " X R                  U5      $ )zADetermine what version to call from --location and --api-version.compare_durationr(   )scc_utilGetVersionFromArgumentsfinding)r9   deprecated_argss     r"   r)   r)      s(    '5/		)	)
LL/
 r%   N)rH   
__future__r   r   r   r   googlecloudsdk.api_lib.sccr   googlecloudsdk.callioper   googlecloudsdk.command_lib.sccr	   r   r
   rX   'googlecloudsdk.command_lib.scc.findingsgooglecloudsdk.core.utilr   ReleaseTracksReleaseTrackGABETAALPHADefaultUniverseOnlyListCommandr   r2   r)   rC   r%   r"   <module>ri      s    6 &  % ' < ( = ; 9 8 * $++00$2C2C2I2I R   R Rjr%   