
    /	                         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S
KJr  \R                    " S S\R"                  5      5       rg)z(The auth command gets tokens via oauth2.    )absolute_import)division)unicode_literals)refresh_token)base)
exceptions)log)
properties)
console_ioc                   .    \ rS rSrSr\S 5       rS rSrg)ActivateRefreshToken   af  Get credentials via an existing refresh token.

Use an oauth2 refresh token to manufacture credentials for Google APIs. This
token must have been acquired via some legitimate means to work. The account
provided is only used locally to help the Cloud SDK keep track of the new
credentials, so you can activate, list, and revoke the credentials in the
future.
c                 F    U R                  SSS9  U R                  SSSS9  g)	z0Set args for gcloud auth activate-refresh-token.accountz0The account to associate with the refresh token.)helptoken?z1OAuth2 refresh token. If blank, prompt for value.)nargsr   N)add_argument)parsers    *lib/surface/auth/activate_refresh_token.pyArgsActivateRefreshToken.Args)   s<     ?  A sA  D    c                    UR                   =(       d    [        R                  " S5      nU(       d  [        R                  " SS5      e[
        R                  " UR                  U5        UR                  nU(       a9  [        R                  " [        R                  R                  R                  U5        [        R                  R                  SR!                  UR                  5      5        g)zRun the authentication command.zRefresh token: r   zNo value provided.z*Activated refresh token credentials: [{0}]N)r   r   PromptResponsec_excInvalidArgumentExceptionr   ActivateCredentialsr   projectr
   PersistPropertyVALUEScorer	   statusPrintformat)selfargsr   r    s       r   RunActivateRefreshToken.Run3   s     JJF*334EFE**74HII%%dllE:llG  !2!2!7!7!?!?IJJAfT\\*,r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r)   __static_attributes__r+   r   r   r   r      s"     D D,r   r   N)r0   
__future__r   r   r   googlecloudsdk.api_lib.authr   googlecloudsdk.callioper   r   r   googlecloudsdk.corer	   r
   googlecloudsdk.core.consoler   HiddenSilentCommandr   r+   r   r   <module>r:      sJ     / &  ' 5 ( 7 # * 2 ",4-- ", ",r   