Skip to content

horde_sdk.ai_horde_api.apimodels.operations

Definitions for the admin operations.

__all__ module-attribute

__all__ = [
    "AllIPTimeoutsRequest",
    "BlockIPAddressRequest",
    "BlockIPAddressResponse",
    "BlockWorkerIPAddressRequest",
    "BlockWorkerIPAddressResponse",
    "DeleteIPAddressRequest",
    "DeleteIPAddressResponse",
    "DeleteWorkerIPAddressRequest",
    "DeleteWorkerIPAddressResponse",
    "IPTimeout",
    "IPTimeoutListResponse",
    "SingleIPTimeoutsRequest",
]

IPTimeout

Bases: HordeAPIObjectBaseModel

An IP address that is blocked and the number of seconds left in the timeout.

v2 API Model: IPTimeout

Source code in horde_sdk/ai_horde_api/apimodels/operations.py
class IPTimeout(HordeAPIObjectBaseModel):
    """An IP address that is blocked and the number of seconds left in the timeout.

    v2 API Model: `IPTimeout`
    """

    ipaddr: str
    """The IP address of the user to block."""
    seconds: int
    """How many more seconds this IP block is in timeout."""

    @override
    @classmethod
    def get_api_model_name(cls) -> str:
        return "IPTimeout"

ipaddr instance-attribute

ipaddr: str

The IP address of the user to block.

seconds instance-attribute

seconds: int

How many more seconds this IP block is in timeout.

get_api_model_name classmethod

get_api_model_name() -> str
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_model_name(cls) -> str:
    return "IPTimeout"

IPTimeoutListResponse

Bases: HordeResponseRootModel[list[IPTimeout]]

A list of IP addresses that are blocked.

Represents the data returned from the following endpoints and http status codes
  • /v2/operations/ipaddr | SingleIPTimeoutsRequest [GET] -> 200
  • /v2/operations/ipaddr | AllIPTimeoutsRequest [GET] -> 200

v2 API Model: _ANONYMOUS_MODEL

Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@Unhashable
@Unequatable
class IPTimeoutListResponse(HordeResponseRootModel[list[IPTimeout]]):
    """A list of IP addresses that are blocked.

    Represents the data returned from the following endpoints and http status codes:
        - /v2/operations/ipaddr | SingleIPTimeoutsRequest [GET] -> 200
        - /v2/operations/ipaddr | AllIPTimeoutsRequest [GET] -> 200

    v2 API Model: `_ANONYMOUS_MODEL`
    """

    root: list[IPTimeout]
    """The underlying list of IP addresses that are blocked."""

    @override
    @classmethod
    def get_api_model_name(cls) -> str:
        return _ANONYMOUS_MODEL

root instance-attribute

root: list[IPTimeout]

The underlying list of IP addresses that are blocked.

get_api_model_name classmethod

get_api_model_name() -> str
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_model_name(cls) -> str:
    return _ANONYMOUS_MODEL

AllIPTimeoutsRequest

Bases: BaseAIHordeRequest, APIKeyAllowedInRequestMixin

A request to get all IP addresses that are blocked.

Represents a GET request to the /v2/operations/ipaddr endpoint.

Source code in horde_sdk/ai_horde_api/apimodels/operations.py
class AllIPTimeoutsRequest(
    BaseAIHordeRequest,
    APIKeyAllowedInRequestMixin,
):
    """A request to get all IP addresses that are blocked.

    Represents a GET request to the /v2/operations/ipaddr endpoint.
    """

    @override
    @classmethod
    def get_api_model_name(cls) -> None:
        return None

    @override
    @classmethod
    def get_http_method(cls) -> HTTPMethod:
        return HTTPMethod.GET

    @override
    @classmethod
    def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
        return AI_HORDE_API_ENDPOINT_SUBPATH.v2_operations_ipaddr

    @override
    @classmethod
    def get_default_success_response_type(cls) -> type[IPTimeoutListResponse]:
        return IPTimeoutListResponse

    @override
    @classmethod
    def is_api_key_required(cls) -> bool:
        return True

get_api_model_name classmethod

get_api_model_name() -> None
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_model_name(cls) -> None:
    return None

get_http_method classmethod

get_http_method() -> HTTPMethod
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_http_method(cls) -> HTTPMethod:
    return HTTPMethod.GET

get_api_endpoint_subpath classmethod

get_api_endpoint_subpath() -> AI_HORDE_API_ENDPOINT_SUBPATH
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
    return AI_HORDE_API_ENDPOINT_SUBPATH.v2_operations_ipaddr

get_default_success_response_type classmethod

get_default_success_response_type() -> (
    type[IPTimeoutListResponse]
)
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_default_success_response_type(cls) -> type[IPTimeoutListResponse]:
    return IPTimeoutListResponse

is_api_key_required classmethod

is_api_key_required() -> bool
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def is_api_key_required(cls) -> bool:
    return True

SingleIPTimeoutsRequest

Bases: BaseAIHordeRequest, APIKeyAllowedInRequestMixin

A request to get a single IP address that is blocked.

Represents a GET request to the /v2/operations/ipaddr endpoint.

Source code in horde_sdk/ai_horde_api/apimodels/operations.py
class SingleIPTimeoutsRequest(
    BaseAIHordeRequest,
    APIKeyAllowedInRequestMixin,
):
    """A request to get a single IP address that is blocked.

    Represents a GET request to the /v2/operations/ipaddr endpoint.
    """

    @override
    @classmethod
    def get_api_model_name(cls) -> None:
        return None

    @override
    @classmethod
    def get_http_method(cls) -> HTTPMethod:
        return HTTPMethod.GET

    @override
    @classmethod
    def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
        return AI_HORDE_API_ENDPOINT_SUBPATH.v2_operations_ipaddr

    @override
    @classmethod
    def get_default_success_response_type(cls) -> type[IPTimeoutListResponse]:
        return IPTimeoutListResponse

    @override
    @classmethod
    def is_api_key_required(cls) -> bool:
        return True

get_api_model_name classmethod

get_api_model_name() -> None
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_model_name(cls) -> None:
    return None

get_http_method classmethod

get_http_method() -> HTTPMethod
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_http_method(cls) -> HTTPMethod:
    return HTTPMethod.GET

get_api_endpoint_subpath classmethod

get_api_endpoint_subpath() -> AI_HORDE_API_ENDPOINT_SUBPATH
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
    return AI_HORDE_API_ENDPOINT_SUBPATH.v2_operations_ipaddr

get_default_success_response_type classmethod

get_default_success_response_type() -> (
    type[IPTimeoutListResponse]
)
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_default_success_response_type(cls) -> type[IPTimeoutListResponse]:
    return IPTimeoutListResponse

is_api_key_required classmethod

is_api_key_required() -> bool
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def is_api_key_required(cls) -> bool:
    return True

BlockIPAddressResponse

Bases: HordeResponseBaseModel, ContainsMessageResponseMixin

Indicates that an IP address was successfully blocked.

Represents the data returned from the /v2/operations/ipaddr endpoint with http status code 200.

v2 API Model: SimpleResponse

Source code in horde_sdk/ai_horde_api/apimodels/operations.py
class BlockIPAddressResponse(HordeResponseBaseModel, ContainsMessageResponseMixin):
    """Indicates that an IP address was successfully blocked.

    Represents the data returned from the /v2/operations/ipaddr endpoint with http status code 200.

    v2 API Model: `SimpleResponse`
    """

    @override
    @classmethod
    def get_api_model_name(cls) -> str:
        return "SimpleResponse"

get_api_model_name classmethod

get_api_model_name() -> str
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_model_name(cls) -> str:
    return "SimpleResponse"

BlockIPAddressRequest

Bases: BaseAIHordeRequest, APIKeyAllowedInRequestMixin

Establish a timeout for an IP address for a specified number of hours.

Represents a POST request to the /v2/operations/ipaddr endpoint.

v2 API Model: AddTimeoutIPInput

Source code in horde_sdk/ai_horde_api/apimodels/operations.py
class BlockIPAddressRequest(
    BaseAIHordeRequest,
    APIKeyAllowedInRequestMixin,
):
    """Establish a timeout for an IP address for a specified number of hours.

    Represents a POST request to the /v2/operations/ipaddr endpoint.

    v2 API Model: `AddTimeoutIPInput`
    """

    ipaddr: str
    """The IP address of the user to block."""

    hours: int
    """The number of hours to block the IP address for."""

    @override
    @classmethod
    def get_api_model_name(cls) -> str:
        return "AddTimeoutIPInput"

    @override
    @classmethod
    def get_http_method(cls) -> HTTPMethod:
        return HTTPMethod.POST

    @override
    @classmethod
    def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
        return AI_HORDE_API_ENDPOINT_SUBPATH.v2_operations_ipaddr

    @override
    @classmethod
    def get_default_success_response_type(cls) -> type[BlockIPAddressResponse]:
        return BlockIPAddressResponse

    @override
    @classmethod
    def is_api_key_required(cls) -> bool:
        return True

ipaddr instance-attribute

ipaddr: str

The IP address of the user to block.

hours instance-attribute

hours: int

The number of hours to block the IP address for.

get_api_model_name classmethod

get_api_model_name() -> str
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_model_name(cls) -> str:
    return "AddTimeoutIPInput"

get_http_method classmethod

get_http_method() -> HTTPMethod
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_http_method(cls) -> HTTPMethod:
    return HTTPMethod.POST

get_api_endpoint_subpath classmethod

get_api_endpoint_subpath() -> AI_HORDE_API_ENDPOINT_SUBPATH
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
    return AI_HORDE_API_ENDPOINT_SUBPATH.v2_operations_ipaddr

get_default_success_response_type classmethod

get_default_success_response_type() -> (
    type[BlockIPAddressResponse]
)
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_default_success_response_type(cls) -> type[BlockIPAddressResponse]:
    return BlockIPAddressResponse

is_api_key_required classmethod

is_api_key_required() -> bool
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def is_api_key_required(cls) -> bool:
    return True

DeleteIPAddressResponse

Bases: HordeResponseBaseModel, ContainsMessageResponseMixin

Indicates that an IP address was successfully unblocked.

Represents the data returned from the /v2/operations/ipaddr endpoint with http status code 200.

v2 API Model: SimpleResponse

Source code in horde_sdk/ai_horde_api/apimodels/operations.py
class DeleteIPAddressResponse(
    HordeResponseBaseModel,
    ContainsMessageResponseMixin,
):
    """Indicates that an IP address was successfully unblocked.

    Represents the data returned from the /v2/operations/ipaddr endpoint with http status code 200.

    v2 API Model: `SimpleResponse`
    """

    @override
    @classmethod
    def get_api_model_name(cls) -> str:
        return "SimpleResponse"

get_api_model_name classmethod

get_api_model_name() -> str
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_model_name(cls) -> str:
    return "SimpleResponse"

DeleteIPAddressRequest

Bases: BaseAIHordeRequest, APIKeyAllowedInRequestMixin

Remove a timeout for an IP address.

Represents a DELETE request to the /v2/operations/ipaddr endpoint.

v2 API Model: DeleteTimeoutIPInput

Source code in horde_sdk/ai_horde_api/apimodels/operations.py
class DeleteIPAddressRequest(
    BaseAIHordeRequest,
    APIKeyAllowedInRequestMixin,
):
    """Remove a timeout for an IP address.

    Represents a DELETE request to the /v2/operations/ipaddr endpoint.

    v2 API Model: `DeleteTimeoutIPInput`
    """

    ipaddr: str
    """The IP address of the user to unblock."""

    @override
    @classmethod
    def get_api_model_name(cls) -> str:
        return "DeleteTimeoutIPInput"

    @override
    @classmethod
    def get_http_method(cls) -> HTTPMethod:
        return HTTPMethod.DELETE

    @override
    @classmethod
    def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
        return AI_HORDE_API_ENDPOINT_SUBPATH.v2_operations_ipaddr

    @override
    @classmethod
    def get_default_success_response_type(cls) -> type[DeleteIPAddressResponse]:
        return DeleteIPAddressResponse

    @override
    @classmethod
    def is_api_key_required(cls) -> bool:
        return True

ipaddr instance-attribute

ipaddr: str

The IP address of the user to unblock.

get_api_model_name classmethod

get_api_model_name() -> str
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_model_name(cls) -> str:
    return "DeleteTimeoutIPInput"

get_http_method classmethod

get_http_method() -> HTTPMethod
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_http_method(cls) -> HTTPMethod:
    return HTTPMethod.DELETE

get_api_endpoint_subpath classmethod

get_api_endpoint_subpath() -> AI_HORDE_API_ENDPOINT_SUBPATH
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
    return AI_HORDE_API_ENDPOINT_SUBPATH.v2_operations_ipaddr

get_default_success_response_type classmethod

get_default_success_response_type() -> (
    type[DeleteIPAddressResponse]
)
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_default_success_response_type(cls) -> type[DeleteIPAddressResponse]:
    return DeleteIPAddressResponse

is_api_key_required classmethod

is_api_key_required() -> bool
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def is_api_key_required(cls) -> bool:
    return True

BlockWorkerIPAddressResponse

Bases: HordeResponseBaseModel, ContainsMessageResponseMixin

Indicates that a worker's IP address was successfully blocked.

Represents the data returned from the /v2/operations/block_worker_ipaddr/{worker_id} endpoint with http status code 200.

v2 API Model: SimpleResponse

Source code in horde_sdk/ai_horde_api/apimodels/operations.py
class BlockWorkerIPAddressResponse(
    HordeResponseBaseModel,
    ContainsMessageResponseMixin,
):
    """Indicates that a worker's IP address was successfully blocked.

    Represents the data returned from the /v2/operations/block_worker_ipaddr/{worker_id} endpoint with http status
    code 200.

    v2 API Model: `SimpleResponse`
    """

    @override
    @classmethod
    def get_api_model_name(cls) -> str:
        return "SimpleResponse"

get_api_model_name classmethod

get_api_model_name() -> str
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_model_name(cls) -> str:
    return "SimpleResponse"

BlockWorkerIPAddressRequest

Bases: BaseAIHordeRequest, APIKeyAllowedInRequestMixin

Request to block a worker's IP address for a specified number of days.

Represents a PUT request to the /v2/operations/block_worker_ipaddr/{worker_id} endpoint.

v2 API Model: AddWorkerTimeout

Source code in horde_sdk/ai_horde_api/apimodels/operations.py
class BlockWorkerIPAddressRequest(
    BaseAIHordeRequest,
    APIKeyAllowedInRequestMixin,
):
    """Request to block a worker's IP address for a specified number of days.

    Represents a PUT request to the /v2/operations/block_worker_ipaddr/{worker_id} endpoint.

    v2 API Model: `AddWorkerTimeout`
    """

    worker_id: str
    """The ID of the worker to block."""

    days: int
    """The number of days to block the worker IP address for."""

    @override
    @classmethod
    def get_api_model_name(cls) -> str:
        return "AddWorkerTimeout"

    @override
    @classmethod
    def get_http_method(cls) -> HTTPMethod:
        return HTTPMethod.PUT

    @override
    @classmethod
    def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
        return AI_HORDE_API_ENDPOINT_SUBPATH.v2_operations_block_worker_ipaddr_single

    @override
    @classmethod
    def get_default_success_response_type(cls) -> type[BlockWorkerIPAddressResponse]:
        return BlockWorkerIPAddressResponse

    @override
    @classmethod
    def is_api_key_required(cls) -> bool:
        return True

worker_id instance-attribute

worker_id: str

The ID of the worker to block.

days instance-attribute

days: int

The number of days to block the worker IP address for.

get_api_model_name classmethod

get_api_model_name() -> str
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_model_name(cls) -> str:
    return "AddWorkerTimeout"

get_http_method classmethod

get_http_method() -> HTTPMethod
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_http_method(cls) -> HTTPMethod:
    return HTTPMethod.PUT

get_api_endpoint_subpath classmethod

get_api_endpoint_subpath() -> AI_HORDE_API_ENDPOINT_SUBPATH
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
    return AI_HORDE_API_ENDPOINT_SUBPATH.v2_operations_block_worker_ipaddr_single

get_default_success_response_type classmethod

get_default_success_response_type() -> (
    type[BlockWorkerIPAddressResponse]
)
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_default_success_response_type(cls) -> type[BlockWorkerIPAddressResponse]:
    return BlockWorkerIPAddressResponse

is_api_key_required classmethod

is_api_key_required() -> bool
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def is_api_key_required(cls) -> bool:
    return True

DeleteWorkerIPAddressResponse

Bases: HordeResponseBaseModel, ContainsMessageResponseMixin

Indicates that a worker's IP address was successfully unblocked.

Represents the data returned from the /v2/operations/block_worker_ipaddr/{worker_id} endpoint with http status code 200.

v2 API Model: SimpleResponse

Source code in horde_sdk/ai_horde_api/apimodels/operations.py
class DeleteWorkerIPAddressResponse(
    HordeResponseBaseModel,
    ContainsMessageResponseMixin,
):
    """Indicates that a worker's IP address was successfully unblocked.

    Represents the data returned from the /v2/operations/block_worker_ipaddr/{worker_id} endpoint with http status
    code 200.

    v2 API Model: `SimpleResponse`
    """

    @override
    @classmethod
    def get_api_model_name(cls) -> str:
        return "SimpleResponse"

get_api_model_name classmethod

get_api_model_name() -> str
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_model_name(cls) -> str:
    return "SimpleResponse"

DeleteWorkerIPAddressRequest

Bases: BaseAIHordeRequest, APIKeyAllowedInRequestMixin

Request to unblock a worker's IP address.

Represents a DELETE request to the /v2/operations/block_worker_ipaddr/{worker_id} endpoint.

Source code in horde_sdk/ai_horde_api/apimodels/operations.py
class DeleteWorkerIPAddressRequest(
    BaseAIHordeRequest,
    APIKeyAllowedInRequestMixin,
):
    """Request to unblock a worker's IP address.

    Represents a DELETE request to the /v2/operations/block_worker_ipaddr/{worker_id} endpoint.
    """

    worker_id: str
    """The ID of the worker to unblock."""

    @override
    @classmethod
    def get_api_model_name(cls) -> None:
        return None

    @override
    @classmethod
    def get_http_method(cls) -> HTTPMethod:
        return HTTPMethod.DELETE

    @override
    @classmethod
    def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
        return AI_HORDE_API_ENDPOINT_SUBPATH.v2_operations_block_worker_ipaddr_single

    @override
    @classmethod
    def get_default_success_response_type(cls) -> type[DeleteWorkerIPAddressResponse]:
        return DeleteWorkerIPAddressResponse

    @override
    @classmethod
    def is_api_key_required(cls) -> bool:
        return True

worker_id instance-attribute

worker_id: str

The ID of the worker to unblock.

get_api_model_name classmethod

get_api_model_name() -> None
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_model_name(cls) -> None:
    return None

get_http_method classmethod

get_http_method() -> HTTPMethod
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_http_method(cls) -> HTTPMethod:
    return HTTPMethod.DELETE

get_api_endpoint_subpath classmethod

get_api_endpoint_subpath() -> AI_HORDE_API_ENDPOINT_SUBPATH
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
    return AI_HORDE_API_ENDPOINT_SUBPATH.v2_operations_block_worker_ipaddr_single

get_default_success_response_type classmethod

get_default_success_response_type() -> (
    type[DeleteWorkerIPAddressResponse]
)
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def get_default_success_response_type(cls) -> type[DeleteWorkerIPAddressResponse]:
    return DeleteWorkerIPAddressResponse

is_api_key_required classmethod

is_api_key_required() -> bool
Source code in horde_sdk/ai_horde_api/apimodels/operations.py
@override
@classmethod
def is_api_key_required(cls) -> bool:
    return True