
                         8   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 dd
lmZ e	j                    e	j"                  e	j$                  j&                  e	j$                  j(                         G d de	j*                                      Zy)z<Command to print access tokens for an Anthos cluster on AWS.    )absolute_import)division)unicode_literals)aws)base)resource_args)endpoint_util)flags)
kubeconfigc                   &    e Zd ZdZed        Zd Zy)PrintAccessTokenz6Generate an access token for an Anthos cluster on AWS.c                 Z    t        j                  | d       t        j                  |        y)z Register flags for this command.z	to accessN)r   AddAwsClusterResourceArgr
   AddExecCredential)parsers    8lib/surface/container/aws/clusters/print_access_token.pyArgszPrintAccessToken.Args"   s"     **6;?	F#    c                    |j                   j                  j                         }t        j                  |j
                        5  t        j                         }|j                  |      }|j                  r4t        j                  |j                  |j                        cddd       S |cddd       S # 1 sw Y   yxY w)zRuns the command.)expiration_timestampaccess_tokenN)CONCEPTSclusterParser	   GkemulticloudEndpointOverridelocationsIdapi_utilClustersClientGenerateAccessTokenexec_credentialr   ExecCredentialexpirationTimeaccessToken)selfargscluster_refcluster_clientresponses        r   RunzPrintAccessToken.Run(   s    --''--/K		4	4[5L5L	M..0n33K@h			((!)!8!8!--
	 
N	M  
N	M	Ms   AB5*B55B>N)__name__
__module____qualname____doc__staticmethodr   r)    r   r   r   r      s     ?$ $
r   r   N)r-   
__future__r   r   r   .googlecloudsdk.api_lib.container.gkemulticloudr   r   googlecloudsdk.callioper   (googlecloudsdk.command_lib.container.awsr   2googlecloudsdk.command_lib.container.gkemulticloudr	   r
   r   HiddenReleaseTracksReleaseTrackALPHAGACommandr   r/   r   r   <module>r;      sy    C &  ' J ( B L D I D%%++T->->-A-ABt||  C r   