
    
                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z
 ddlmZ dd	lmZ  G d
 dej                        Zy)z)Command to show bindings in a membership.    )absolute_import)division)unicode_literals)client)base)
exceptions)util)
propertiesc                   &    e Zd ZdZed        Zd Zy)Lista  List Bindings in a Membership.

  This command can fail for the following reasons:
  * The Membership specified does not exist.
  * The user does not have access to the Membership specified.
  * The caller did not specify the location (--location) if referring to
  location other than global.

  ## EXAMPLES

  The following command lists Bindings in global Membership `MEMBERSHIP_NAME`:

    $ {command} --membership=MEMBERSHIP_NAME

  To list all the bindings associated with regional membership
  `MEMBERSHIP_NAME`, provide the location LOCATION_NAME for the Membership where
  the Binding belongs along with membership name.

  $ {command} --membership=MEMBERSHIP_NAME --location=LOCATION_NAME

  c                     | j                   j                  t        j                         | j	                  dt
        dd       | j	                  dt
        dd       y )	Nz--membershipTz-Name of the Membership to list Bindings from.)typerequiredhelpz
--locationglobalz6Name of the Membership location to list Bindings from.)r   defaultr   )display_info	AddFormatr	   B_LIST_FORMATadd_argumentstr)parsers    8lib/surface/container/fleet/memberships/bindings/list.pyArgsz	List.Args3   s_     !!$"4"45
<	  >
 E	  G    c                 f   t        j                  | j                               }|j                  }|2t        j
                  j                  j                  j                         }|j                  d      r'|j                  ||j                  |j                        S t        j                  dd      )N)release_track
membershipzMembership parent is required.)r   FleetClientReleaseTrackprojectr
   VALUEScoreGetIsKnownAndSpecifiedListMembershipBindingsr   locationcalliope_exceptionsRequiredArgumentException)selfargsfleetclientr!   s       r   RunzList.RunB   s    $$43D3D3FGKllG!!&&..224g-//04? ?

7
768 8r   N)__name__
__module____qualname____doc__staticmethodr   r-    r   r   r   r      s"    , G G	8r   r   N)r1   
__future__r   r   r   &googlecloudsdk.api_lib.container.fleetr   googlecloudsdk.callioper   r   r(   *googlecloudsdk.command_lib.container.fleetr	   googlecloudsdk.corer
   ListCommandr   r3   r   r   <module>r:      s4    0 &  ' 9 ( E ; */84 /8r   