
    K              	          S 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+S- r,S. r-S/ r.S0 r/S1 r0S2 r1S3 r2S4 r3S5 r4S6 r5S7 r6S8 r7S9 r8S: r9S; r:S< r;S= r<S> r=S? r>S@ r?SA r@SB rASC rBSD rCSE rDSF rESG rFSH rGSI rHSJ rISK rJSL rKSM rLSN rMg)Oz3Common flags for artifacts print-settings commands.    N)
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$   4   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   GetRepoResourceSpecr3   B   s0    			8 ::)+(*
, ,r!   c            	      p    [         R                  " SSS[         R                  [        5       [	        5       S9$ )Nr*   r   v1beta1)r,   api_versionr-   r.   r/   r0   r'   r!   r   GetBetaRepoResourceSpecr7   K   s3    			8 ::)+(*
, ,r!   c                  \    [         R                  " SS[         R                  [        5       S9$ )Nz#artifactregistry.projects.locationsr#   )r,   r-   r.   )r   r1   r2   r$   r'   r!   r   GetLocationResourceSpecr9   U   s*    			+::)+	
- -r!   c                  n    [         R                  " SS[         R                  [        5       [	        5       S9$ )Nz6artifactregistry.projects.locations.repositories.filesfiler+   r0   r'   r!   r   GetFileResourceSpecr<   ]   s0    			>::)+(*
, ,r!   c                  n    [         R                  " SS[         R                  [        5       [	        5       S9$ )Nz<artifactregistry.projects.locations.repositories.attachments
attachmentr+   r0   r'   r!   r   GetAttachmentResourceSpecr?   f   s0    			D ::)+(*
 r!   c                  n    [         R                  " SS[         R                  [        5       [	        5       S9$ )Nz9artifactregistry.projects.locations.repositories.packagesr&   r+   r0   r'   r!   r   GetPackageResourceSpecrA   p   s0    			A::)+(*
 r!   c            	          [         R                  " SS[         R                  [        5       [	        5       [        5       S9$ )NzBartifactregistry.projects.locations.repositories.packages.versionsversionr,   r-   r.   r/   
packagesIdr   r1   r2   r$   r    r(   r'   r!   r   GetVersionResourceSpecrG   z   s6    			J::)+(*')
 r!   c            	          [         R                  " SS[         R                  [        5       [	        5       [        5       S9$ )Nz>artifactregistry.projects.locations.repositories.packages.tagstagrD   rF   r'   r!   r   GetTagResourceSpecrJ      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   GetScopeFlagrP      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?)rM   nargstextwrapdedentr   rO   help_txts    r   GetImagePathOptionalArgrZ      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
IMAGErL   rU   rX   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_IMAGErL   rU   rX   s    r   GetDockerImageRequiredArgr`      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_TAGrL   rU   rX   s    r   GetTagRequiredArgrc      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ForResourcer3   r'   r!   r   GetRepoFlagrl      s1    		&	&	2	23 
3 
 r!   c                  R    [         R                  R                  S[        5       SSS9$ )Nre   rf   Trg   ri   r'   r!   r   GetRequiredRepoFlagrn      s1    		&	&	2	23 
3 
 r!   c                  R    [         R                  R                  S[        5       SSS9$ )N
--locationdThe Artifact Registry repository location. If not specified, the current artifacts/location is used.Trg   r	   rj   rk   r9   r'   r!   r   GetLocationFlagrs      s1    		&	&	2	21 
3 
 r!   c                  R    [         R                  R                  S[        5       SSS9$ )Nr;   z The Artifact Registry file name.Trg   )r	   rj   rk   r<   r'   r!   r   GetRequiredFileFlagru      s/    		&	&	2	2(	 
3 
 r!   c                  R    [         R                  R                  S[        5       SSS9$ )Nr>   &The Artifact Registry attachment name.Trg   r	   rj   rk   r?   r'   r!   r   GetRequiredAttachmentFlagry      s/    		&	&	2	2!.	 
3 
 r!   c                  R    [         R                  R                  S[        5       SSS9$ )Nr>   rw   Frg   rx   r'   r!   r   GetOptionalAttachmentFlagr{      s/    		&	&	2	2!.	 
3 
 r!   c                  R    [         R                  R                  S[        5       SSS9$ )NrC   z#The Artifact Registry version name.Trg   )r	   rj   rk   rG   r'   r!   r   GetRequiredVersionFlagr}     s/    		&	&	2	2+	 
3 
 r!   c                  R    [         R                  R                  S[        5       SSS9$ )NrI   zThe Artifact Registry tag name.Trg   )r	   rj   rk   rJ   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defaultrM   rN   r'   r!   r   GetAllowOverwriteFlagr     s    	B	
 r!   c                  R    [         R                  R                  S[        5       SSS9$ Nr   rf   Trg   ri   r'   r!   r   
GetRepoArgr     s1    		&	&	2	23 
3 
 r!   c                  R    [         R                  R                  S[        5       SSS9$ r   )r	   rj   rk   r7   r'   r!   r   GetRepoArgFromBetar   %  s1    		&	&	2	23 
3 
 r!   c                  R    [         R                  R                  S[        5       SSS9$ )Nrp   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.Frg   rr   r'   r!   r   GetOptionalLocationFlagr   .  s3    		&	&	2	22
  
3 
 r!   c                  .    [         R                  " SSSS9$ )Nrp   z]If specified, all requests to Artifact Analysis for occurrences will go to location specifiedF)rM   rh   rN   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rM   r   rh   rN   r'   r!   r   GetIncludeTagsFlagr   C  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   rN   r'   r!   r   GetDeleteTagsFlagr   O  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]rL   rN   r'   r!   r   GetGCRDomainArgr   W  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.rL   )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   rO   ar_exceptionsArtifactRegistryErrorformat)tools    r   GetJsonKeyFlagr   a  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   rM   rN   r'   r!   r   GetShowAllMetadataFlagr   t  s    	
 r!   c                  .    [         R                  " SSSS9$ )Nz--show-deploymentr   z*Include deployment metadata in the output.r   rN   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   rN   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   rN   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   rN   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   rN   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.rL   rN   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   rN   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   rM   )r   rO   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   rM   rN   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#filteringrL   rN   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   rN   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.rL   rN   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.rL   rN   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   rN   r'   r!   r   GetRemoteFlagr     s!    	%	
' 'r!   c                  8    [         R                  " SSSSS.SSS9$ )	Nrp   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   rM   rN   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   hiddenrM   rN   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   metavarrM   )r   rO   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   rM   )r   rO   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>8  r   r!   r   SKIP_PACKAGE_TYPESz>A comma-separated list of package types to skip when scanning.)r   r   rM   )r   rO   r   r   r   r'   r!   r   GetSkipPackageTypesFlagr   3  s2    	'@ #K
 r!   c                  2    [         R                  " SSSSSS9$ )Nz--verbose-errorsr   FTzLog internal errors.r   rN   r'   r!   r   GetVerboseErrorsFlagr   ?  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   rN   r'   r!   r   GetSkipExistingFlagr   H  s"    	E
 r!   c                  ,    [         R                  " SSS9$ )Nz--chunk-sizezHIf specified, the chunk size (bytes) to use for downloading the package.rL   rN   r'   r!   r   GetChunkSizer   T  s    	
 r!   c                  ,    [         R                  " SSS9$ )z Gets a simple --repository flag.re   rf   rL   rN   r'   r!   r   GetPlainRepoFlagr   ^  s    	+
 r!   c                  ,    [         R                  " SSS9$ )zGets a simple --location flag.rp   rq   rL   rN   r'   r!   r   GetPlainLocationFlagr   i  s    	1
 r!   c                  6    [         R                  " SS SS/SS9$ )z+Gets the --severity flag for platform logs.z
--severityc                 "    U R                  5       $ r   r   )xs    r   r   !GetSeverityFlag.<locals>.<lambda>x  s
    QWWYr!   INFOERRORzThe minimum severity level of logs to generate. This flag is only applicable when using --enable. Values are case-insensitive.If omitted when --enable is true, it defaults to logging all severities.)r   r   rM   rN   r'   r!   r   GetSeverityFlagr  t  s)    	



 r!   )N__doc__r   rV    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(   r3   r7   r9   r<   r?   rA   rG   rJ   rP   rZ   r]   r`   rc   rl   rn   rs   ru   ry   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'   r!   r   <module>r     s   :   H + / ( 5 1 D * 
9#'	  &( ".,,-,?/64		.&99<43+>'E^:D<'FA.2	%	r!   