
    (                         S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSK	J
r
  SSK	Jr   " S	 S
\
R                  5      rg)z=Fetch Hub-registered cluster credentials for Connect Gateway.    )absolute_import)division)unicode_literalsN)util)gateway)	resourcesc                   .    \ rS rSrSr\S 5       rS rSrg)GetCredentials   a  Fetch credentials for a membership with a particular namespace.

## EXAMPLES

  Get the Connect Gateway kubeconfig for global membership `MEMBERSHIP`,
  using namespace `NAMESPACE` in the config:

    $ {command} NAMESPACE --membership=MEMBERSHIP --membership-location=global
      --set-namespace-in-config=true

  Get the Connect Gateway kubeconfig for global membership `MEMBERSHIP`:

    $ {command} NAMESPACE --membership=MEMBERSHIP --membership-location=global
c           	      r   UR                  S[        SS9  UR                  S[        [        R                  " S5      S9  UR                  S[        [        R                  " S5      S9  UR                  S[        [        R                  " S	5      S9  UR                  S
SSS[        R                  " S5      S9  g )N	NAMESPACEz=Name of the namespace for which to get access to memberships.)typehelpz--membershipz          Membership ID to get credentials from. If not provided, a
          prompt will offer a list of memberships in the fleet.z--membership-locationz            The location of the membership resource, e.g. `us-central1`.
            If not specified, defaults to `global`.
          z--set-namespace-in-configat              If true, the default namespace for the context in the generated
            kubeconfig will be set to the Fleet namespace
            (i.e. the name given as the positional argument in this command).

            Otherwise, no default namespace will be set, functioning the same as
            `gcloud container fleet memberships get-credentials`.
            z--use-client-side-generation
store_trueFTzi          Generate the kubeconfig locally rather than generating it using an API
          call.
        )actionrequiredhiddenr   )add_argumentstrtextwrapdedentbool)clsparsers     @lib/surface/container/fleet/scopes/namespaces/get_credentials.pyArgsGetCredentials.Args,   s    
L  N __ C D	   __     #__     &__    	    c                    UR                   (       a  UR                  nOS nUR                  (       a"  UR                  nUR                  =(       d    SnOA[        R
                  " 5       n[        R                  " U5      n[        R                  " U5      nUR                  (       a  U R                  X4U5        g U R                  UUUS9  g )Nglobal)arg_namespace)set_namespace_in_configr   
membershipmembership_locationr   PromptForMembership
fleet_utilMembershipShortnameMembershipLocationuse_client_side_generationRunGetCredentialsRunServerSide)selfargscontext_namespacemembership_idlocationr#   s         r   RunGetCredentials.RunZ   s    ##..oom))5Xh002j 44Z@m..z:h&&
]6GH


)  r    N)	__name__
__module____qualname____firstlineno____doc__classmethodr   r1   __static_attributes__r3   r   r   r
   r
      s!     + +Zr   r
   )r8   
__future__r   r   r   r   &googlecloudsdk.api_lib.container.fleetr   r&   *googlecloudsdk.command_lib.container.fleetr   r   GetCredentialsCommandr
   r3   r   r   <module>r?      s4    D &  '  E > @SW22 Sr   