
    z                         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r
\R                   " S	 S
\R                  5      5       rg)z List Artifact Registry versions.    )absolute_import)division)unicode_literals)base)flags)version_utilz    table(
         name.basename().sub("%5E", "^"):label=VERSION,
         description,
         createTime.date(tz=LOCAL),
         updateTime.date(tz=LOCAL),
         metadata.imageSizeBytes:label=SIZE,
         annotations
       )c                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
List$   zList Artifact Registry package versions.

List all Artifact Registry versions in the specified package.

To specify the maximum number of versions to list, use the --limit flag.
z{description}ar  
      The following command lists a maximum of five packages versions:

          $ {command} --limit=5

      To list versions of package `my_pkg` with name as `1.0-SNAPSHOT`:

          $ {command} --package=my_pkg --filter='name="projects/my-project/locations/us/repositories/my-repo/packages/my_pkg/versions/1.0-SNAPSHOT"'

      To list versions of package `my_pkg` with a given partial name, use `*` to match any character in name:

          $ {command} --package=my_pkg --filter='name="projects/my-project/locations/us/repositories/my-repo/packages/my_pkg/versions/1.0*"'

          $ {command} --package=my_pkg --filter='name="projects/my-project/locations/us/repositories/my-repo/packages/my_pkg/versions/*SNAPSHOT"'

      To list versions of package `my_pkg` that have annotations:

          $ {command} --package=my_pkg --filter=annotations:*

      To list versions of package `my_pkg` with annotations pair as [annotation_key: annotation_value]:

          $ {command} --package=my_pkg --filter='annotations.annotation_key:annotation_value'

      To list versions of package `my_pkg` with annotations containing key as `my_key`:

          $ {command} --package=my_pkg --filter=annotations.my_key

          If the key or value contains special characters, such as `my.key` and `my.value`, backtick("`") is required:

          $ {command} --filter='annotations.`my.key`'

          $ {command} --filter='annotations.`my.key`:`my.value`'

      To list versions of package `my_pkg` with given partial annotation key or value, use `*` to match any character:

          $ {command} --filter='annotations.*key:`*.value`'

      To list versions of package `my_pkg` ordered by create_time:

        $ {command} --package=my_pkg --sort-by=create_time

      To list versions of package `my_pkg` ordered by update_time reversely:

        $ {command} --package=my_pkg --sort-by=~update_time
  )DESCRIPTIONEXAMPLESc                     U R                   R                  [        5        [        R                  R                  U 5        [        R                  " 5       R                  U 5        U R                  SSSS9  g )Nz	--packageTzcList all versions in a specified artifact, such as a container
        image or a language package.)requiredhelp)
display_info	AddFormatDEFAULT_LIST_FORMATr   URI_FLAGRemoveFromParserr   GetRepoFlagAddToParseradd_argument)parsers    &lib/surface/artifacts/versions/list.pyArgs	List.Args`   s^    
!!"56MM""6*	##F+
(      c                 D   ^ U4S j[         R                  " T5       5       $ )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 package versions.
c              3   R   >#    U  H  n[         R                  " UT5      v   M     g 7f)N)r   ConvertFingerprint).0vargss     r   	<genexpr>List.Run.<locals>.<genexpr>v   s(      0A 	''4000s   $')r   ListVersions)selfr#   s    `r   RunList.Runl   s     **40 r    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r(   __static_attributes__r*   r   r   r
   r
   $   s2     -	2-h 	 	r   r
   N)r/   
__future__r   r   r   googlecloudsdk.callioper   $googlecloudsdk.command_lib.artifactsr   r   r   DefaultUniverseOnlyListCommandr
   r*   r   r   <module>r8      sN    ' &  ' ( 6 =  T4 T Tr   