minos.networks.requests.abc

Classes

Request

Request interface.

Response

Response definition.

Exceptions

ResponseException

Response Exception class.

class Request[source]

Bases: ABC

Request interface.

abstract property user: Optional[uuid.UUID]

Returns the UUID of the user making the Request.

async content(**kwargs)[source]

Get the request content.

Parameters

kwargs – Additional named arguments.

Returns

The request content.

Return type

Any

abstract property has_content: bool

Check if the request has content.

Returns

True if it has content or False otherwise.

async params(**kwargs)[source]

Get the request params.

Parameters

kwargs – Additional named arguments.

Returns

The request params.

Return type

dict[str, Any]

abstract property has_params: bool

Check if the request has params.

Returns

True if it has params or False otherwise.

class Response[source]

Bases: object

Response definition.

__init__(data=sentinel, *, status=200)[source]
Parameters
  • data (Any) –

  • status (int) –

async content(**kwargs)[source]

Response content.

Parameters

kwargs – Additional named arguments.

Returns

A list of items.

Return type

Any

property has_content: bool

Check if the request has content.

Returns

True if it has content or False otherwise.

property status: int

The status code of the response.

Returns

An int value.

exception ResponseException[source]

Bases: MinosException

Response Exception class.

__init__(*args, status=400)[source]
Parameters

status (int) –

property status: int

The status code of the response.

Returns

An int value.

__new__(**kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.