psnawp_api.utils package

Submodules

psnawp_api.utils.endpoints module

psnawp_api.utils.misc module

create_logger(module_name: str) Logger[source]

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[source]

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

Parameters

response (requests.Response) – Response object

Returns

None

class RequestBuilder(authenticator: Authenticator)[source]

Bases: object

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

__init__(authenticator: Authenticator)[source]

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[source]

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[source]

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[source]

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[source]

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[source]

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