psnawp_api.utils package — PSNAWP 1.1.0 documentation

# psnawp_api.utils package

## Submodules

## psnawp_api.utils.endpoints module

## psnawp_api.utils.misc module

create_logger(module_name: str) → Logger

  Creates logger and returns an instance of logging object.

  Parameters

    module_name (str) – Logger name that will appear in text.

  Returns

    Logging Object.

  Return type

    logging.Logger

## psnawp_api.utils.request_builder module

response_checker(response: Response) → None

  Checks the HTTP(S) response and re-raises them as PSNAWP Exceptions

  Parameters

    response (requests.Response) – `Response` object

  Returns

    None

class RequestBuilder(authenticator: Authenticator)

  Bases: `object`

  Handles all the HTTP Requests and provides a gateway to interacting with PSN API.

  __init__(authenticator: Authenticator)

    Initialized Request Handler and saves the instance of authenticator for future use.

    Parameters

      authenticator – The instance of :class: Authenticator. Represents single authentication to PSN API.

  get(**kwargs: Any) → Response

    Handles the GET requests and returns the requests.Response object.

    Parameters

      kwargs – The query parameters to add to the request.

    Returns

      The Request Response Object.

    Return type

      requests.Response

  patch(**kwargs: Any) → Response

    Handles the POST requests and returns the requests.Response object.

    Parameters

      kwargs – The query parameters to add to the request.

    Returns

      The Request Response Object.

    Return type

      requests.Response

  post(**kwargs: Any) → Response

    Handles the POST requests and returns the requests.Response object.

    Parameters

      kwargs – The query parameters to add to the request.

    Returns

      The Request Response Object.

    Return type

      requests.Response

  multipart_post(**kwargs: Any) → Response

    Handles the Multipart POST requests and returns the requests.Response object.

    Parameters

      kwargs – The query parameters to add to the request.

    Returns

      The Request Response Object.

    Return type

      requests.Response

  delete(**kwargs: Any) → Response

    Handles the DELETE requests and returns the requests.Response object.

    Parameters

      kwargs – The query parameters to add to the request.

    Returns

      The Request Response Object.

    Return type

      requests.Response

## Module contents