
    ^G              	          S r SSKJr  SSKJr  SSKJr  SSKrSSK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SSSSSSS.r0 rS rS rS rS rS rS rS rS rS rS  r S! r!S" r"S# r#S$ r$S% r%S& r&S' r'S( r(S) r)S* r*S+ r+S, r,S- r-S. r.S/ r/S0 r0S1 r1S2 r2S3 r3S4 r4S5 r5S6 r6S7 r7S8 r8S9 r9S: r:S; r;S< r<S= r=S> r>S? r?S@ r@SA rASB rBSC rCSD rDSE rESF rFSG rGSH rHSI rISJ rJSK rKSL rLSM rMSN rNg)Oz3Common flags for artifacts print-settings commands.    )absolute_import)division)unicode_literalsN)
exceptions)actions)arg_parsers)base)concepts)deps)concept_parsers)
propertieszMaven package.z-Go standard library and third party packages.zNPM package.zPython package.zRust package.zRubyGems package.zPHP Composer package.zNuGet package.)MAVENGONPMPYTHONRUSTRUBYGEMSCOMPOSERNUGETc                      [         R                  " [        R                  R                  R
                  5      /n [        R                  " SSU S9$ )N
repositoryzRepository of the {resource}.name	help_textfallthroughs)r   PropertyFallthroughr   VALUES	artifactsr   r
    ResourceParameterAttributeConfigftss    1lib/googlecloudsdk/command_lib/artifacts/flags.pyRepoAttributeConfigr#   /   sC    		!	!*"3"3"="="H"H	IJ#		2	2/
     c                      [         R                  " [        R                  R                  R
                  5      /n [        R                  " SSU S9$ )NlocationzLocation of the {resource}.r   )r   r   r   r   r   r&   r
   r   r    s    r"   LocationAttributeConfigr'   7   sC    		!	!*"3"3"="="F"F	GH#		2	2-
 r$   c                  ,    [         R                  " SSS9$ )NpackagezPackage of the {resource}.)r   r   )r
   r    r$   r"   PackageAttributeConfigr+   ?   s    		2	2,
. .r$   c                  n    [         R                  " SS[         R                  [        5       [	        5       S9$ )N0artifactregistry.projects.locations.repositoriesr   resource_name
projectsIdlocationsIdrepositoriesIdr
   ResourceSpec DEFAULT_PROJECT_ATTRIBUTE_CONFIGr'   r#   r*   r$   r"   GetRepoResourceSpecr6   E   s0    			8 ::)+(*
, ,r$   c            	      p    [         R                  " SSS[         R                  [        5       [	        5       S9$ )Nr-   r   v1beta1)r/   api_versionr0   r1   r2   r3   r*   r$   r"   GetBetaRepoResourceSpecr:   N   s3    			8 ::)+(*
, ,r$   c                  \    [         R                  " SS[         R                  [        5       S9$ )Nz#artifactregistry.projects.locationsr&   )r/   r0   r1   )r
   r4   r5   r'   r*   r$   r"   GetLocationResourceSpecr<   X   s*    			+::)+	
- -r$   c                  n    [         R                  " SS[         R                  [        5       [	        5       S9$ )Nz6artifactregistry.projects.locations.repositories.filesfiler.   r3   r*   r$   r"   GetFileResourceSpecr?   `   s0    			>::)+(*
, ,r$   c                  n    [         R                  " SS[         R                  [        5       [	        5       S9$ )Nz<artifactregistry.projects.locations.repositories.attachments
attachmentr.   r3   r*   r$   r"   GetAttachmentResourceSpecrB   i   s0    			D ::)+(*
 r$   c                  n    [         R                  " SS[         R                  [        5       [	        5       S9$ )Nz9artifactregistry.projects.locations.repositories.packagesr)   r.   r3   r*   r$   r"   GetPackageResourceSpecrD   s   s0    			A::)+(*
 r$   c            	          [         R                  " SS[         R                  [        5       [	        5       [        5       S9$ )NzBartifactregistry.projects.locations.repositories.packages.versionsversionr/   r0   r1   r2   
packagesIdr
   r4   r5   r'   r#   r+   r*   r$   r"   GetVersionResourceSpecrJ   }   s6    			J::)+(*')
 r$   c            	          [         R                  " SS[         R                  [        5       [	        5       [        5       S9$ )Nz>artifactregistry.projects.locations.repositories.packages.tagstagrG   rI   r*   r$   r"   GetTagResourceSpecrM      s6    			F::)+(*')
 r$   c                  ,    [         R                  " SSS9$ )Nz--scopezThe scope to associate with the Artifact Registry registry. If not specified, Artifact Registry is set as the default registry.helpr	   Argumentr*   r$   r"   GetScopeFlagrS      s    	
 r$   c                  Z    [         R                  " S5      n [        R                  " SU SS9$ )z-Gets IMAGE_PATH optional positional argument.a3    An Artifact Registry repository or a container image.
  If not specified, default config values are used.

  A valid docker repository has the format of
    LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY-ID

  A valid image has the format of
    LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY-ID/IMAGE_PATH

IMAGE_PATH?)rP   nargstextwrapdedentr	   rR   help_txts    r"   GetImagePathOptionalArgr]      s*    __ 	 	( 
|(#	>>r$   c                  X    [         R                  " S5      n [        R                  " SU S9$ )z(Gets IMAGE required positional argument.a[    A container image.

  A valid container image has the format of
    LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY-ID/IMAGE

  A valid container image that can be referenced by tag or digest, has the format of
    LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY-ID/IMAGE:tag
    LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY-ID/IMAGE@sha256:digest
IMAGErO   rX   r[   s    r"   GetImageRequiredArgr`      s(    __ 	 	( 
wX	..r$   c                  X    [         R                  " S5      n [        R                  " SU S9$ )Na    Docker image - The container image that you want to tag.

A valid container image can be referenced by tag or digest, has the format of
  LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY-ID/IMAGE:tag
  LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY-ID/IMAGE@sha256:digest
DOCKER_IMAGErO   rX   r[   s    r"   GetDockerImageRequiredArgrc      s(    __  ( 
~H	55r$   c                  X    [         R                  " S5      n [        R                  " SU S9$ )Nz  Image tag - The container image tag.

A valid Docker tag has the format of
  LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY-ID/IMAGE:tag

DOCKER_TAGrO   rX   r[   s    r"   GetTagRequiredArgrf      s(    __  ( 
|(	33r$   c                  R    [         R                  R                  S[        5       SSS9$ )N--repository]The Artifact Registry repository. If not specified, the current artifacts/repository is used.Frequiredr   ConceptParserForResourcer6   r*   r$   r"   GetRepoFlagro      s1    		&	&	2	23 
3 
 r$   c                  R    [         R                  R                  S[        5       SSS9$ )Nrh   ri   Trj   rl   r*   r$   r"   GetRequiredRepoFlagrq      s1    		&	&	2	23 
3 
 r$   c                  R    [         R                  R                  S[        5       SSS9$ )N
--locationzdThe Artifact Registry repository location. If not specified, the current artifacts/location is used.Trj   r   rm   rn   r<   r*   r$   r"   GetLocationFlagru      s1    		&	&	2	21 
3 
 r$   c                  R    [         R                  R                  S[        5       SSS9$ )Nr>   z The Artifact Registry file name.Trj   )r   rm   rn   r?   r*   r$   r"   GetRequiredFileFlagrw      s/    		&	&	2	2(	 
3 
 r$   c                  R    [         R                  R                  S[        5       SSS9$ )NrA   &The Artifact Registry attachment name.Trj   r   rm   rn   rB   r*   r$   r"   GetRequiredAttachmentFlagr{      s/    		&	&	2	2!.	 
3 
 r$   c                  R    [         R                  R                  S[        5       SSS9$ )NrA   ry   Frj   rz   r*   r$   r"   GetOptionalAttachmentFlagr}      s/    		&	&	2	2!.	 
3 
 r$   c                  R    [         R                  R                  S[        5       SSS9$ )NrF   z#The Artifact Registry version name.Trj   )r   rm   rn   rJ   r*   r$   r"   GetRequiredVersionFlagr     s/    		&	&	2	2+	 
3 
 r$   c                  R    [         R                  R                  S[        5       SSS9$ )NrL   zThe Artifact Registry tag name.Trj   )r   rm   rn   rM   r*   r$   r"   GetRequiredTagFlagr     s/    		&	&	2	2'	 
3 
 r$   c                  0    [         R                  " SSSSS9$ )Nz--allow-overwrite
store_trueFz5If specified, the command overwrites an existing fileactiondefaultrP   rQ   r*   r$   r"   GetAllowOverwriteFlagr     s    	B	
 r$   c                  R    [         R                  R                  S[        5       SSS9$ Nr   ri   Trj   rl   r*   r$   r"   
GetRepoArgr     s1    		&	&	2	23 
3 
 r$   c                  R    [         R                  R                  S[        5       SSS9$ r   )r   rm   rn   r:   r*   r$   r"   GetRepoArgFromBetar   (  s1    		&	&	2	23 
3 
 r$   c                  R    [         R                  R                  S[        5       SSS9$ )Nrs   a  The Artifact Registry repository location. You can also set --location=all to list repositories across all locations. If you omit this flag, the default location is used if you set the artifacts/location property. Otherwise, omitting this flag lists repositories across all locations.Frj   rt   r*   r$   r"   GetOptionalLocationFlagr   1  s3    		&	&	2	22
  
3 
 r$   c                  .    [         R                  " SSSS9$ )Nrs   z]If specified, all requests to Artifact Analysis for occurrences will go to location specifiedF)rP   rk   rQ   r*   r$   r"   GetOptionalAALocationFlagr   =  s    	-	
 r$   c                  0    [         R                  " SSSSS9$ )Nz--include-tagszkIf specified, tags associated with each image digest are displayed up to a maximum of 100 tags per version.r   FrP   r   rk   rQ   r*   r$   r"   GetIncludeTagsFlagr   F  s#    	6 
 r$   c                  0    [         R                  " SSSSS9$ )Nz--delete-tagsz=If specified, all tags associated with the image are deleted.r   Fr   rQ   r*   r$   r"   GetDeleteTagsFlagr   R  s    	J	
 r$   c                  ,    [         R                  " SSS9$ )NDOMAINzZA Container Registry domain. Valid values are: [gcr.io, asia.gcr.io, eu.gcr.io, us.gcr.io]rO   rQ   r*   r$   r"   GetGCRDomainArgr   Z  s    	#
 r$   c                     U S:X  d  U S:X  a  [         R                  " SSS9$ U S;   a  [         R                  " SSS9$ [        R                  " SR	                  U 5      5      e)	z0Gets Json Key Flag text based on specified tool.pypipythonz
--json-keyzPath to service account JSON key. If not specified, output returns either credentials for an active service account or a placeholder for the current user account.rO   )gradlemavennpmzPath to service account JSON key. If not specified, current active service account credentials or a placeholder for gcloud credentials is used.zInvalid tool type: {})r	   rR   ar_exceptionsArtifactRegistryErrorformat)tools    r"   GetJsonKeyFlagr   d  sr    	V^tx'==?A A
 ))==,. . 
-
-&&t,. .r$   c                  .    [         R                  " SSSS9$ )Nz--show-all-metadatar   zInclude all metadata in the output. Metadata will be grouped by Grafeas kind, with an additional section for intoto provenance metadata.r   rP   rQ   r*   r$   r"   GetShowAllMetadataFlagr   w  s    	
 r$   c                  .    [         R                  " SSSS9$ )Nz--show-deploymentr   z*Include deployment metadata in the output.r   rQ   r*   r$   r"   GetShowDeploymentFlagr     s    	7
9 9r$   c                  .    [         R                  " SSSS9$ )Nz--show-image-basisr   z*Include base image metadata in the output.r   rQ   r*   r$   r"   GetShowImageBasisFlagr     s    	7
9 9r$   c                  .    [         R                  " SSSS9$ )Nz--show-package-vulnerabilityr   z-Include vulnerability metadata in the output.r   rQ   r*   r$   r"   GetShowPackageVulnerabilityFlagr     s    	$:
< <r$   c                  .    [         R                  " SSSS9$ )Nz--show-build-detailsr   z%Include build metadata in the output.r   rQ   r*   r$   r"   GetShowBuildDetailsFlagr     s    	2
4 4r$   c                  .    [         R                  " SSSS9$ )Nz--show-sbom-referencesr   z$Include SBOM metadata in the output.r   rQ   r*   r$   r"   GetShowSbomReferencesFlagr     s    	1
3 3r$   c                  ,    [         R                  " SSS9$ )Nz--metadata-filterzJAdditional filter to fetch metadata for a given qualified image reference.rO   rQ   r*   r$   r"   GetMetadataFilterFlagr     s    	)
+ +r$   c                  .    [         R                  " SSSS9$ )Nz--show-occurrencesr   z/Show summaries of the various occurrence types.r   rQ   r*   r$   r"   GetShowOccurrencesFlagr     s    	<
> >r$   c            	      t    [         R                  " S[        R                  " S[        R
                  SS9SSS9$ )Nz--show-occurrences-from   T)	unlimited
   zHThe number of the most recent images for which to summarize occurrences.)typer   rP   )r	   rR   r   
BoundedIntsysmaxsizer*   r$   r"   GetShowOccurrencesFromFlagr     s4    	!!!S[[DA%	
' 'r$   c                  .    [         R                  " SSSS9$ )N--occurrence-filterzIkind="BUILD" OR kind="IMAGE" OR kind="DISCOVERY" OR kind="SBOM_REFERENCE"z6A filter for the occurrences which will be summarized.)r   rP   rQ   r*   r$   r"   GetOccurrenceFilterFlagr     s#    	# D
E Er$   c                  ,    [         R                  " SSS9$ )Nr   zA filter for the occurrences which will be summarized. See link for officially supported filters: https://cloud.google.com/container-analysis/docs/os-scanning-automatically#filteringrO   rQ   r*   r$   r"   &GetVulnerabilitiesOccurrenceFilterFlagr     s    	]
^ ^r$   c                  .    [         R                  " SSSS9$ )Nz--show-provenancer   zInclude intoto provenance metadata in the output, in the provenance_summary section. To see all build metadata in the output, use --show-all-metadata or --show-build-details.r   rQ   r*   r$   r"   GetShowProvenanceFlagr     s    	9
: :r$   c                  ,    [         R                  " SSS9$ )z/Gets RESOURCE_URI required positional argument.RESOURCE_URIzsA container image in a Google Cloud registry (Artifact Registry or Container Registry), or a local container image.rO   rQ   r*   r$   r"   GetResourceURIArgr     s    	B
D Dr$   c                  ,    [         R                  " SSS9$ )z+Gets list uri required positional argument.URIz^An URI identifying a container image or package in Artifact Registry or Google Cloud Registry.rO   rQ   r*   r$   r"   GetListURIArgr     s    	:
< <r$   c                  0    [         R                  " SSSSS9$ )Nz--remoter   FzIWhether the container image is located remotely or on your local machine.r   rQ   r*   r$   r"   GetRemoteFlagr     s!    	%	
' 'r$   c                  8    [         R                  " SSSSS.SSS9$ )	Nrs   zPerform analysis in the USzPerform analysis in EuropezPerform analysis in Asia)useuropeasiar   zThe API location in which to perform package analysis. Consider choosing a location closest to where you are located. Proximity to the container image does not affect response time.)choicesr   rP   rQ   r*   r$   r"   GetOnDemandScanningLocationFlagr     s1    	,0,
 D

F 
Fr$   c                  2    [         R                  " SSSSSS9$ )Nz--fake-extractionr   FTzlWhether to use fake packages/versions instead of performing extraction. This flag is for test purposes only.r   r   hiddenrP   rQ   r*   r$   r"   %GetOnDemandScanningFakeExtractionFlagr     s&    	?
A Ar$   c            	          [         R                  " S[        R                  " SSS9[        R
                  " [        S S9SSS9$ )	Nz--additional-package-typesThis flag is deprecated as scanning for all package types is now the default. To skip scanning for specific package types, use --skip-package-types.warnc                 "    U R                  5       $ Nupperpackage_types    r"   <lambda>/GetAdditionalPackageTypesFlag.<locals>.<lambda>      L,>,>,@r$   r   element_typeADDITIONAL_PACKAGE_TYPESzKA comma-separated list of package types to scan in addition to OS packages.)r   r   metavarrP   )r	   rR   r   DeprecationActionr   ArgList_PACKAGE_TYPE_CHOICESr*   r$   r"   GetAdditionalPackageTypesFlagr     sL    	"&&
&* '@ )!
 r$   c            	          [         R                  " S[        R                  " SSS9[        R
                  " [        S S9SSSS	9$ )
Nz--experimental-package-typesr   r   c                 "    U R                  5       $ r   r   r   s    r"   r   1GetExperimentalPackageTypesFlag.<locals>.<lambda>*  r   r$   r   TEXPERIMENTAL_PACKAGE_TYPESzA comma-separated list of experimental package types to scan in addition to OS packages and officially supported third party packages.)r   r   r   r   rP   )r	   rR   r   r   r   r   "_EXPERIMENTAL_PACKAGE_TYPE_CHOICESr*   r$   r"   GetExperimentalPackageTypesFlagr     sO    	$&&
(* 4@ *#
 r$   c                  `    [         R                  " S[        R                  " [        S S9SSS9$ )Nz--skip-package-typesc                 "    U R                  5       $ r   r   r   s    r"   r   )GetSkipPackageTypesFlag.<locals>.<lambda>;  r   r$   r   SKIP_PACKAGE_TYPESz>A comma-separated list of package types to skip when scanning.)r   r   rP   )r	   rR   r   r   r   r*   r$   r"   GetSkipPackageTypesFlagr   6  s2    	'@ #K
 r$   c                  2    [         R                  " SSSSSS9$ )Nz--verbose-errorsr   FTzLog internal errors.r   rQ   r*   r$   r"   GetVerboseErrorsFlagr   B  s"    	"
% %r$   c                  0    [         R                  " SSSSS9$ )Nz--skip-existingr   FztIf specified, skip uploading files that already exist in the repository, and continue to upload the remaining files.r   rQ   r*   r$   r"   GetSkipExistingFlagr   K  s"    	E
 r$   c                  ,    [         R                  " SSS9$ )Nz--chunk-sizezHIf specified, the chunk size (bytes) to use for downloading the package.rO   rQ   r*   r$   r"   GetChunkSizer   W  s    	
 r$   )O__doc__
__future__r   r   r   r   rY    googlecloudsdk.api_lib.artifactsr   r   googlecloudsdk.callioper   r   r	    googlecloudsdk.calliope.conceptsr
   r   (googlecloudsdk.command_lib.util.conceptsr   googlecloudsdk.corer   r   r   r#   r'   r+   r6   r:   r<   r?   rB   rD   rJ   rM   rS   r]   r`   rc   rf   ro   rq   ru   rw   r{   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r*   r$   r"   <module>r     sx   : &  ' 
  H + / ( 5 1 D * 
9#'	  &( ".,,-,?/64		.&99<43+>'E^:D<'FA.2	%	r$   