
                             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	  G d de
      Z G d	 d
e
      Z G d de
      Z G d de
      Zy)z3Supporting libraries for the config-helper command.    )absolute_import)division)unicode_literals)config)credsc                       e Zd ZdZd Zy)ConfigHelperResulta$  The result of the gcloud config config-helper command that gets serialzied.

  Attributes:
    credential: Credential, The OAuth2 credential information.
    configuration: Configuration, Local Cloud SDK configuration information.
    sentinels: Sentinels, Paths to various sentinel files.
  c                     t        |      | _        t        ||      | _        t	        t        j                         j                        | _        y N)	
Credential
credentialConfigurationconfiguration	Sentinelsr   Pathsconfig_sentinel_file	sentinels)selfr   active_configuration
propertiess       6lib/googlecloudsdk/command_lib/config/config_helper.py__init__zConfigHelperResult.__init__#   s6     ,DO&';ZHDv||~BBCDN    N__name__
__module____qualname____doc__r    r   r   r	   r	      s    Dr   r	   c                       e Zd ZdZdZd Zy)r   zHolder for credential data.

  Attributes:
    access_token: str, The current OAuth2 access token.
    token_expiry: str, The expiry time in UTC as an RFC3339 formatted string.
    id_token: str, The current OAuth2 identity token, if present.
  z%Y-%m-%dT%H:%M:%SZc                 r   t        j                  |      r|j                  | _        t        |dd       }n|j                  | _        t        |dd       }|r|j                  t        j                        nd | _        t        |dd       }|r|j                  dd       }|| _
        y t        |dd       }|| _
        y )Ntoken_expiryexpirytoken_responseid_tokenid_tokenb64)c_credsIsOauth2ClientCredentialsaccess_tokengetattrtokenstrftimer   _EXPIRY_FORMATr"   getr%   )r   credr#   r$   r%   s        r   r   zCredential.__init__3   s    ((.++dt^T2f**dtXt,f 7=
112$ 	 T#3T:N##J5h DM }d3hDMr   N)r   r   r   r   r-   r   r   r   r   r   r   )   s     (.r   r   c                       e Zd ZdZd Zy)r   zHolder for configuration data.

  Attributes:
    active_configuration: str, The name of the active configuration.
    properties: {str: {str: str}}, A dict of section names to properties and
      values.
  c                      || _         || _        y r   )r   r   )r   r   r   s      r   r   zConfiguration.__init__T   s     4D DOr   Nr   r   r   r   r   r   K   s    !r   r   c                       e Zd ZdZd Zy)r   zHolder for sentinel file locations.

  Attributes:
    config_sentinel: str, The path to the sentinel that indicates changes were
      made to properties or the active configuration.
  c                     || _         y r   )config_sentinel)r   r4   s     r   r   zSentinels.__init__a   s
    *Dr   Nr   r   r   r   r   r   Y   s    +r   r   N)r   
__future__r   r   r   googlecloudsdk.corer   googlecloudsdk.core.credentialsr   r'   objectr	   r   r   r   r   r   r   <module>r9      sL     : &  ' & <D D D!F !	+ 	+r   