
                            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g)z4Implements the command to list SBOM file references.    )absolute_import)division)unicode_literals)base)endpoint_util)flags)sbom_printer)	sbom_util)util)resource_printerc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
List   zList SBOM file references.z{description}a            To list SBOM file references:

          $ {command}

          To list SBOM file references related to the image with the tag "us-east1-docker.pkg.dev/project/repo/my-image:1.0":

          $ {command} --resource="us-east1-docker.pkg.dev/project/repo/my-image:1.0"

          To list SBOM file references related to the image with the digest "us-east1-docker.pkg.dev/project/repo/my-image@sha256:88b205d7995332e10e836514fbfd59ecaf8976fc15060cd66e85cdcebe7fb356":

          $ {command} --resource="us-east1-docker.pkg.dev/project/repo/my-image@sha256:88b205d7995332e10e836514fbfd59ecaf8976fc15060cd66e85cdcebe7fb356"

          To list SBOM file references related to the images with the resource path prefix "us-east1-docker.pkg.dev/project/repo":

          $ {command} --resource-prefix="us-east1-docker.pkg.dev/project/repo"

          To list SBOM file references generated when the images were pushed to Artifact Registry and related to the installed package dependency "perl":

          $ {command} --dependency="perl"

          )DESCRIPTIONEXAMPLESc                    [         R                  " [        R                  [        R                  5        U R
                  R                  [        R                  5        [        R                  R                  U S5        [        R                  R                  U 5        [        R                  " 5       R                  U 5        U R                  SS9nUR!                  SSSS9  UR!                  SSS	S9  UR!                  S
SSS9  g)zOSet up arguments for this command.

Args:
  parser: An argparse.ArgumentPaser.
zocc.create_timeT)mutexz--dependencyFzList SBOM file references generated when the images were pushed to Artifact Registry and related to the installed package dependency. See https://cloud.google.com/container-analysis/docs/scanning-types for supported packages.)requiredhelpz
--resourcez<List SBOM file references related to the image resource uri.z--resource-prefixzTList SBOM file references related to the resource uri with the resource path prefix.N)r   RegisterFormatterr	   SBOM_PRINTER_FORMATSbomPrinterdisplay_info	AddFormatr   SORT_BY_FLAG
SetDefaultURI_FLAGRemoveFromParserr   GetOptionalAALocationFlagAddToParser	add_groupadd_argument)parsergroups     "lib/surface/artifacts/sbom/list.pyArgs	List.Args=   s     &&((  " !!,"B"BC  ):;MM""6*	##%11&94(E	'	  
 
K  
 
%	      c                 $   UR                   n[        R                  " U5         Ub;  [        R                  " U5      n[        R
                  " X1R                   5      Ul        [        R                  " U5      sSSS5        $ ! , (       d  f       g= f)zThis is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  A list of SBOM references.
N)	locationr   
WithRegionr   
GetProject	GetParentprojectr
   ListSbomReferences)selfargsr*   r.   s       r%   RunList.Rung   s]     }}H		!	!(	+		//$'~~g}}=))$/	 
,	+	+s   AB
B N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr&   r2   __static_attributes__r4   r(   r%   r   r      s2     # %-4 ' 'R0r(   r   N)r9   
__future__r   r   r   googlecloudsdk.callioper   $googlecloudsdk.command_lib.artifactsr   r   r	   r
   r   googlecloudsdk.core.resourcer   ReleaseTracksReleaseTrackGADefaultUniverseOnlyListCommandr   r4   r(   r%   <module>rF      sq    ; &  ' ( > 6 = : 5 9 D%%(()V04 V0  *V0r(   