ft3.api.events.obj module¶
Objects module.
- class Error(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ObjectA stimple error message object.
- classmethod from_exception(exception: ExceptionType | type[ExceptionType]) Self¶
Populate error object from an exception.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('error_code', 'error_message')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class Handler(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ObjectA simple request handler.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('api', 'file_paths')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Pattern¶
Bases:
objectCompiled regex patterns.
- PathId = re.compile('({[a-zA-Z0-9]{1,256}})')¶
Matches resource ids within a path uri.
- class Request(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ObjectA simple request object.
- parse_body(operation: Operation, obj_: type[objects.Object] | None = None) Never | None¶
Parse JSON body from url string and optionally an
Object.Automatically handles translation and injection of
idparams forPUTrequests.
- parse_query_params(method: string[snake_case], operation: Operation, obj_: type[objects.Object] | None = None) None¶
Parse query parameters from url string and optionally an
Object.
- parse_path_params(uri: str, operation: Operation) None¶
Parse path parameters from a matched path uri.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('body', 'headers', 'id_', 'method', 'path', 'path_params', 'query_params', 'url')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ('id_',)¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Response(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ObjectA simple response object.
- serialize() bytes | str¶
JSON serialize body if not already a string.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('body', 'headers', 'request_id', 'status_code')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ('request_id',)¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Api(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI OpenAPI Object.
- servers: Field[list[ServerObject] | None]¶
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'components', 'info', 'openapi', 'paths', 'servers', 'tags')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- classmethod register(obj_: type[ObjectType]) type[ObjectType]¶
Register an
Objectto be served from the API.
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Component(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ObjectOpenAPI Component.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_',)¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class Content(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI content for ContentType.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'schema')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class File(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ObjectA file object, useful for serving static files.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('content', 'content_type', 'path')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Header(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Header Object.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'description', 'schema')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- classmethod request(name: str, description: str | None, *methods: str) Callable[[type[ObjectType]], type[ObjectType]]¶
Register a request header for
Object.
- classmethod response(name: str, description: str | None, *methods: str) Callable[[type[ObjectType]], type[ObjectType]]¶
Register a response header for
Object.
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Healthz(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ObjectDefault application heartbeat.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('status',)¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class Info(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Info Object.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'description', 'summary', 'terms_of_service', 'title', 'version')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class Operation(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Operation Object.
- request_body: Field[RequestBody | None]¶
- responses: Field[dict[str, ResponseObject] | None]¶
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'description', 'parameters', 'request_body', 'responses', 'security', 'summary', 'tags')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- property path_uri: str¶
Path URI.
- class Parameter(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Parameter Object.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {'in_': ('path', 'query', 'header', 'cookie')}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'deprecated', 'description', 'in_', 'name', 'required', 'schema')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ('name',)¶
- class Path(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Path Item Object.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', '_resource_', 'delete', 'description', 'get_', 'options', 'patch', 'post', 'put', 'summary')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class RequestBody(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Request Body Object.
- content: Field[dict[Literal['*/*', 'text/html', 'image/x-icon', 'application/json', 'image/png', 'text/plain'], Content]]¶
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'content', 'description')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class ResponseObject(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Request Body Object.
- content: Field[dict[Literal['*/*', 'text/html', 'image/x-icon', 'application/json', 'image/png', 'text/plain'], Content | None]]¶
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'content', 'description', 'headers')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class Schema(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Schema Object.
- type_: Field[list[Literal['array', 'boolean', 'integer', 'null', 'number', 'object', 'string']] | None]¶
- format_: Field[Literal['boolean'] | Literal['byte'] | Literal['date'] | Literal['datetime'] | Literal['double'] | Literal['float'] | Literal['int32'] | Literal['uuid'] | None]¶
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {'format_': ('boolean', 'byte', 'date', 'datetime', 'double', 'float', 'int32', 'uuid', None), 'type_': ('array', 'boolean', 'integer', 'null', 'number', 'object', 'string', None)}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'all_of', 'any_of', 'default', 'description', 'enum', 'exclusive_maximum', 'exclusive_minimum', 'format_', 'items_', 'max_items', 'max_length', 'maximum', 'min_items', 'min_length', 'minimum', 'multiple_of', 'one_of', 'pattern', 'properties', 'read_only', 'required', 'type_', 'unique_items', 'write_only')¶
- classmethod from_obj(obj: type[Object], /, **kwargs: Any) Schema¶
Parse Schema definition from
Object.
- classmethod from_type(*, type_: Any = None, **kwargs: Any) Schema¶
Parse Schema definition from python
type.
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class SecurityScheme(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Security Scheme Object.
- content: Field[dict[Literal['*/*', 'text/html', 'image/x-icon', 'application/json', 'image/png', 'text/plain'], Content]]¶
- classmethod api_key(name: str, description: str | None, *methods: str) Callable[[type[ObjectType]], type[ObjectType]]¶
Register API Key
SecuritySchemeforObject.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {'in_': ('header', 'query', 'cookie', None), 'scheme': ('basic', 'bearer', None), 'type_': ('http', 'apiKey', 'oauth2', 'openIdConnect')}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'content', 'description', 'in_', 'name_', 'scheme', 'type_')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ('name_',)¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class ServerObject(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Server Object.
- variables: Field[dict[str, ServerVariable] | None]¶
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'description', 'url', 'variables')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class ServerVariable(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Server Variable Object.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'default', 'description')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class Tag(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Tag Object.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'description', 'name')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ('name',)¶