3 f÷ÔYr ã@shdZddlZddlZddlmZejfZdZejej ƒGdd„de ƒƒZ ejej ƒGdd„de ƒƒZ dS) aTransport - HTTP client library support. :mod:`google.auth` is designed to work with various HTTP client libraries such as urllib3 and requests. In order to work across these libraries with different interfaces some abstraction is needed. This module provides two interfaces that are implemented by transport adapters to support HTTP libraries. :class:`Request` defines the interface expected by :mod:`google.auth` to make requests. :class:`Response` defines the interface for the return value of :class:`Request`. éN)Ú http_clientéc@s:eZdZdZejdd„ƒZejdd„ƒZejdd„ƒZdS) ÚResponsezHTTP Response data.cCs tdƒ‚dS)zint: The HTTP status code.zstatus must be implemented.N)ÚNotImplementedError)Úself©rúO/Users/olari/OneDrive/sandbox/awsBlog2/lambda/google/auth/transport/__init__.pyÚstatus-szResponse.statuscCs tdƒ‚dS)z-Mapping[str, str]: The HTTP response headers.zheaders must be implemented.N)r)rrrrÚheaders2szResponse.headerscCs tdƒ‚dS)zbytes: The response body.zdata must be implemented.N)r)rrrrÚdata7sz Response.dataN) Ú__name__Ú __module__Ú __qualname__Ú__doc__ÚabcÚabstractpropertyr r r rrrrr)src@s eZdZdZejddd„ƒZdS)ÚRequestzÝInterface for a callable that makes HTTP requests. Specific transport implementations should provide an implementation of this that adapts their specific request / response API. .. automethod:: __call__ ÚGETNcKs tdƒ‚dS)aMake an HTTP request. Args: url (str): The URI to be requested. method (str): The HTTP method to use for the request. Defaults to 'GET'. body (bytes): The payload / body in HTTP request. headers (Mapping[str, str]): Request headers. timeout (Optional[int]): The number of seconds to wait for a response from the server. If not specified or if None, the transport-specific default timeout will be used. kwargs: Additionally arguments passed on to the transport's request method. Returns: Response: The HTTP response. Raises: google.auth.exceptions.TransportError: If any exception occurred. z__call__ must be implemented.N)r)rÚurlÚmethodÚbodyr ÚtimeoutÚkwargsrrrÚ__call__GszRequest.__call__)rNNN)r r rrrÚabstractmethodrrrrrr=sr) rrÚsixÚ six.movesrÚ UNAUTHORIZEDZDEFAULT_REFRESH_STATUS_CODESZDEFAULT_MAX_REFRESH_ATTEMPTSÚ add_metaclassÚABCMetaÚobjectrrrrrrÚs