
    z                         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
Zy	)zEA module to get a credentialed transport object for making API calls.    )absolute_import)division)unicode_literals)base)
properties)requests)httpNc                    t        j                         r|rt        |t        j                        st        d      t        j                  j                  j                  j                         r5t        j                  j                  j                  j                         rd}n|j                  }nd}t        j                  | |||||      }	t        j                  |	||      S t!        j"                  | |||||      S )a  Get an transport client for use with apitools.

  Args:
    timeout: double, The timeout in seconds to pass to httplib2.  This is the
        socket level timeout.  If timeout is None, timeout is infinite.  If
        default argument 'unset' is given, a sensible default is selected.
    enable_resource_quota: bool, By default, we are going to tell APIs to use
        the quota of the project being operated on. For some APIs we want to use
        gcloud's quota, so you can explicitly disable that behavior by passing
        False here.
    response_encoding: str, the encoding to use to decode the response.
    ca_certs: str, absolute filename of a ca_certs file that overrides the
        default
    allow_account_impersonation: bool, True to allow use of impersonated service
        account credentials for calls made with this client. If False, the
        active user credentials will always be used.
    use_google_auth: bool, True if the calling command indicates to use
        google-auth library for authentication. If False, authentication will
        fallback to using the oauth2client library.
    response_handler: requests.ResponseHandler, handler that gets executed
        before any other response handling.
    redact_request_body_reason: str, the reason why the request body must be
        redacted if --log-http is used. If None, the body is not redacted.

  Returns:
    1. A httplib2.Http-like object backed by httplib2 or requests.
  z3response_handler should be of type ResponseHandler.F)timeoutenable_resource_quotaca_certsallow_account_impersonationstreaming_response_bodyredact_request_body_reason)r   r   response_encodingr   r   use_google_auth)r   UseRequests
isinstancecore_requestsResponseHandler
ValueErrorr   VALUEScorelog_httpGetBoollog_http_streaming_body
use_streamr   
GetSessionGetApitoolsRequestsr	   Http)
r   r   r   r   r   r   response_handlerr   r   sessions
             1lib/googlecloudsdk/core/credentials/transports.pyGetApitoolsTransportr$      s    F 
(-*G*GHNOO



 
 
)
)
1
1
3



 
 
8
8
@
@
B
 #("2"="= %!!3$? 7#=?G ,,W6F->@ @ 
7)>%6$/J#2
4 4    )unsetTNNTNNN)__doc__
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.corer   r   r   googlecloudsdk.core.credentialsr	   r$    r%   r#   <module>r-      sE     L '  ' ( * 9 0 4 ")/3+/"&59)-*.48B4r%   