
    '
                         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	 ej                   G d d	ej                               Zy
)z.Authenticate clusters using the Anthos client.    )absolute_import)division)unicode_literals)base)anthoscli_backend)flagsc                   &    e Zd ZdZed        Zd Zy)Tokenz#Creates a token for authentication.c                    t        j                         j                  |        t        j                         j                  |        t        j                         j                  |        t        j
                         j                  |        t        j                         j                  |        t        j                         j                  |        t        j                         j                  |        t        j                         j                  |        t        j                         j                  |        t        j                         j                  |        t        j                         j                  |        t        j                         j                  |        t        j                         j                  |        y )N)r   GetTypeFlagAddToParserGetAwsStsRegionFlagGetTokenClusterFlagGetIdTokenFlagGetAccessTokenFlagGetAccessTokenExpiryFlagGetRefreshTokenFlagGetClientIdFlagGetClientSecretFlag"GetIdpCertificateAuthorityDataFlagGetIdpIssuerUrlFlagGetKubeconfigPathFlagGetTokenUserFlag)parsers     lib/surface/anthos/auth/token.pyArgsz
Token.Args   s-   	##F+	++F3	++F3	&&v.	**62	""$008	++F3	''/	++F3	,,.::6B	++F3	!--f5	((0    c                    t        j                         } |d|j                  |j                  |j                  |j
                  |j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                  t        j                               }| j!                  |      S )Ntoken)command
token_typeclusteraws_sts_regionid_tokenaccess_tokenaccess_token_expiryrefresh_token	client_idclient_secretidp_certificate_authority_dataidp_issuer_urlkubeconfig_pathuserenv)r   AnthosAuthWrappertyper"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   GetEnvArgsForCommand _DefaultOperationResponseHandler)selfargscommand_executorresponses       r   Runz	Token.Run-   s    (::<  99**&& 44((..(('+'J'J**,,YY2246H  00::r   N)__name__
__module____qualname____doc__staticmethodr   r7    r   r   r
   r
      s    +1 1;r   r
   N)r;   
__future__r   r   r   googlecloudsdk.callioper   !googlecloudsdk.command_lib.anthosr   r   HiddenBinaryBackedCommandr
   r=   r   r   <module>rC      sA    5 &  ' ( ? 3 ';D$$ '; ';r   