
                             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	 rS
 rS r\R&                  " \R(                  R*                  5       " S S\R,                  5      5       rg)z*Implements command to list guest policies.    )absolute_import)division)unicode_literals)
list_pager)utils)base)
propertiesc                 \    SnU R                  SS5      n[        U5      U:  a  USU S-   $ U$ )z2Returns a length-limited guest policy description.   description Nz..)getlen)resourcemax_lenr   s      4lib/surface/compute/os_config/guest_policies/list.py _TransformGuestPolicyDescriptionr      sG     ']B/+{#g- hw

 ?3>?    c                    ^  U 4S jnU$ )zFReturns a transformation function from a guest policy resource to URI.c                    > U R                   R                  S5      S   nTR                  U R                   SR                  U5      S9nUR	                  5       $ )N/r   zosconfig.{}.guestPolicies)
collection)namesplitParseformatSelfLink)r   parent_typerefregistrys      r   UriFunc _MakeGetUriFunc.<locals>.UriFunc(   sS    --%%c*1-K
...55kB  DC <<>r    )r    r!   s   ` r   _MakeGetUriFuncr$   %   s     
.r   c                     U R                   R                  S5        U R                   R                  S[        05        [        R
                  " U5      nU R                   R                  [        U5      5        g)z.Parses input flags and sets up output formats.z
        table(
          name.basename(),
          description(),
          create_time,
          update_time
        )
      r   N)display_info	AddFormatAddTransformsr   osconfig_api_utilsGetRegistry
AddUriFuncr$   )parserrelease_trackr    s      r   _Argsr.   2   se     	 !
  	##679++M:(  !:;r   c                   .    \ rS rSrSr\S 5       rS rSrg)ListC   z|List guest policies in a project.

## EXAMPLES

  To list guest policies in the current project, run:

        $ {command}

c                 L    [        U [        R                  R                  5        g)See base class.N)r.   r   ReleaseTrackBETA)r,   s    r   Args	List.ArgsO   s     
&$##(()r   c           	         U R                  5       n[        R                  " U5      n[        R                  " U5      n[        R
                  R                  R                  R                  5       nUR                  UR                  [        R                  " U5      S9nUR                  n[        R                  " UUUR                   [        R"                  " U5      SSS9$ )r3   )pageSizeparentguestPoliciesr9   )limit
batch_sizefieldbatch_size_attribute)r4   r)   GetClientInstanceGetClientMessagesr	   VALUEScoreproject	GetOrFail(OsconfigProjectsGuestPoliciesListRequest	page_sizeosconfig_command_utilsGetProjectUriPathprojects_guestPoliciesr   YieldFromListr<   GetListBatchSize)selfargsr-   clientmessagesrD   requestservices           r   RunList.RunT   s    %%'M11-@F!33MBH$$,,668G??%77@ @ G ++G##jj)::4@' r   r#   N)	__name__
__module____qualname____firstlineno____doc__staticmethodr6   rS   __static_attributes__r#   r   r   r0   r0   C   s      * *r   r0   N)rY   
__future__r   r   r   apitools.base.pyr   (googlecloudsdk.api_lib.compute.os_configr   r)   googlecloudsdk.callioper   ,googlecloudsdk.command_lib.compute.os_configrH   googlecloudsdk.corer	   r   r$   r.   ReleaseTracksr4   r5   ListCommandr0   r#   r   r   <module>rd      si    1 &  ' ' P ( X *?
<" D%%**+$4 $ ,$r   