minos.networks.brokers.dispatchers.requests

Classes

BrokerRequest

Handler Request class.

BrokerResponse

Handler Response class.

Exceptions

BrokerResponseException

Handler Response Exception class.

class BrokerRequest[source]

Bases: Request

Handler Request class.

__init__(raw, *args, **kwargs)[source]
Parameters

raw (BrokerMessage) –

raw
user

Returns the UUID of the user making the Request.

property headers: dict[str, str]

Get the headers of the request.

Returns

A dictionary in which keys are str instances and values are str instances.

property has_content: bool

Check if the request has content.

Returns

True if it has content or False otherwise.

property has_params: bool

Check if the request has params.

Returns

True if it has params or False otherwise.

async content(**kwargs)

Get the request content.

Parameters

kwargs – Additional named arguments.

Returns

The request content.

Return type

Any

async params(**kwargs)

Get the request params.

Parameters

kwargs – Additional named arguments.

Returns

The request params.

Return type

dict[str, Any]

class BrokerResponse[source]

Bases: Response

Handler Response class.

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

  • status (int) –

async content(**kwargs)

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

Bases: ResponseException

Handler Response Exception class.

__init__(*args, status=400)
Parameters

status (int) –

__new__(**kwargs)
args
property status: int

The status code of the response.

Returns

An int value.

with_traceback()

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