fca_api.types.pagination#

Pagination types for FCA API responses.

Public:

NextPageToken — opaque cursor passed to Client.fetch_next_page. PageTokenSerializer — optional hook for signing/encrypting tokens. PaginationInfo — pagination metadata returned with each page. MultipageList — one page of typed results.

Internal:

_PageState — JSON-encoded cursor (endpoint + arguments + page number). PaginatedResultInfo — parses the ResultInfo block from raw responses.

class fca_api.types.pagination.PaginatedResultInfo(*, next: HttpUrl | None = None, previous: HttpUrl | None = None, page: int, per_page: int, total_count: int)[source]#

Parsed ResultInfo block from a raw FCA API response.

property total_pages: int#

Total pages required to hold all items.

classmethod model_validate(data: dict) PaginatedResultInfo[source]#

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • extra – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

__pydantic_fields_set__#

The names of fields explicitly set during instantiation.

__pydantic_extra__#

A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.

__pydantic_private__#

Values of private attributes set on the model instance.

__class_vars__ = {}#

The names of the class variables defined on the model.

__private_attributes__ = {}#

Metadata about the private attributes of the model.

__pydantic_complete__ = True#

Whether model building is completed, or if there are still undefined fields.

__pydantic_computed_fields__ = {}#

A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

__pydantic_core_schema__ = {'cls': <class 'fca_api.types.pagination.PaginatedResultInfo'>, 'config': {'title': 'PaginatedResultInfo'}, 'custom_init': False, 'metadata': {'pydantic_js_functions': [<bound method BaseModel.__get_pydantic_json_schema__ of <class 'fca_api.types.pagination.PaginatedResultInfo'>>]}, 'ref': 'fca_api.types.pagination.PaginatedResultInfo:94486100886032', 'root_model': False, 'schema': {'computed_fields': [], 'fields': {'next': {'metadata': {}, 'schema': {'default': None, 'schema': {'schema': {'function': {'function': <function _BaseUrl.__get_pydantic_core_schema__.<locals>.wrap_val>, 'type': 'no-info'}, 'metadata': {'pydantic_js_functions': [<bound method _BaseUrl.__get_pydantic_json_schema__ of <class 'pydantic.networks.HttpUrl'>>]}, 'schema': {'allowed_schemes': ['http', 'https'], 'max_length': 2083, 'type': 'url'}, 'serialization': {'function': <bound method _BaseUrl.serialize_url of <class 'pydantic.networks.HttpUrl'>>, 'info_arg': True, 'type': 'function-plain'}, 'type': 'function-wrap'}, 'type': 'nullable'}, 'type': 'default'}, 'type': 'model-field'}, 'page': {'metadata': {}, 'schema': {'type': 'int'}, 'type': 'model-field'}, 'per_page': {'metadata': {}, 'schema': {'type': 'int'}, 'type': 'model-field'}, 'previous': {'metadata': {}, 'schema': {'default': None, 'schema': {'schema': {'function': {'function': <function _BaseUrl.__get_pydantic_core_schema__.<locals>.wrap_val>, 'type': 'no-info'}, 'metadata': {'pydantic_js_functions': [<bound method _BaseUrl.__get_pydantic_json_schema__ of <class 'pydantic.networks.HttpUrl'>>]}, 'schema': {'allowed_schemes': ['http', 'https'], 'max_length': 2083, 'type': 'url'}, 'serialization': {'function': <bound method _BaseUrl.serialize_url of <class 'pydantic.networks.HttpUrl'>>, 'info_arg': True, 'type': 'function-plain'}, 'type': 'function-wrap'}, 'type': 'nullable'}, 'type': 'default'}, 'type': 'model-field'}, 'total_count': {'metadata': {}, 'schema': {'type': 'int'}, 'type': 'model-field'}}, 'model_name': 'PaginatedResultInfo', 'type': 'model-fields'}, 'type': 'model'}#

The core schema of the model.

__pydantic_custom_init__ = False#

Whether the model has a custom __init__ method.

__pydantic_decorators__ = DecoratorInfos(validators={}, field_validators={}, root_validators={}, field_serializers={}, model_serializers={}, model_validators={}, computed_fields={})#

Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

__pydantic_extra_info__ = None#

A wrapper around the __pydantic_extra__ annotation, if explicitly annotated on a model.

This is a private attribute, not meant to be used outside Pydantic.

__pydantic_fields__ = {'next': FieldInfo(annotation=Union[HttpUrl, NoneType], required=False, default=None), 'page': FieldInfo(annotation=int, required=True), 'per_page': FieldInfo(annotation=int, required=True), 'previous': FieldInfo(annotation=Union[HttpUrl, NoneType], required=False, default=None), 'total_count': FieldInfo(annotation=int, required=True)}#

A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects. This replaces Model.__fields__ from Pydantic V1.

__pydantic_generic_metadata__ = {'args': (), 'origin': None, 'parameters': ()}#

A dictionary containing metadata about generic Pydantic models.

The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.

__pydantic_parent_namespace__ = None#

Parent namespace of the model, used for automatic rebuilding of models.

__pydantic_post_init__ = None#

The name of the post-init method for the model, if defined.

__pydantic_serializer__ = SchemaSerializer(serializer=PolymorphismTrampoline(     PolymorphismTrampoline {         class: Py(             0x000055ef427ac210,         ),         serializer: PolymorphismTrampoline(             PolymorphismTrampoline {                 class: Py(                     0x000055ef427ac210,                 ),                 serializer: Model(                     ModelSerializer {                         class: Py(                             0x000055ef427ac210,                         ),                         serializer: Fields(                             GeneralFieldsSerializer {                                 fields: {                                     "page": SerField {                                         key: "page",                                         alias: None,                                         serializer: Some(                                             Int(                                                 IntSerializer,                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                     "total_count": SerField {                                         key: "total_count",                                         alias: None,                                         serializer: Some(                                             Int(                                                 IntSerializer,                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                     "per_page": SerField {                                         key: "per_page",                                         alias: None,                                         serializer: Some(                                             Int(                                                 IntSerializer,                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                     "next": SerField {                                         key: "next",                                         alias: None,                                         serializer: Some(                                             WithDefault(                                                 WithDefaultSerializer {                                                     default: Default(                                                         Py(                                                             0x00007efebd4e2400,                                                         ),                                                     ),                                                     serializer: Nullable(                                                         NullableSerializer {                                                             serializer: Function(                                                                 FunctionPlainSerializer {                                                                     func: Py(                                                                         0x00007efebad42940,                                                                     ),                                                                     name: "plain_function[serialize_url]",                                                                     function_name: "serialize_url",                                                                     return_serializer: Any(                                                                         AnySerializer,                                                                     ),                                                                     fallback_serializer: None,                                                                     when_used: Always,                                                                     is_field_serializer: false,                                                                     info_arg: true,                                                                 },                                                             ),                                                         },                                                     ),                                                 },                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                     "previous": SerField {                                         key: "previous",                                         alias: None,                                         serializer: Some(                                             WithDefault(                                                 WithDefaultSerializer {                                                     default: Default(                                                         Py(                                                             0x00007efebd4e2400,                                                         ),                                                     ),                                                     serializer: Nullable(                                                         NullableSerializer {                                                             serializer: Function(                                                                 FunctionPlainSerializer {                                                                     func: Py(                                                                         0x00007efeba2a9840,                                                                     ),                                                                     name: "plain_function[serialize_url]",                                                                     function_name: "serialize_url",                                                                     return_serializer: Any(                                                                         AnySerializer,                                                                     ),                                                                     fallback_serializer: None,                                                                     when_used: Always,                                                                     is_field_serializer: false,                                                                     info_arg: true,                                                                 },                                                             ),                                                         },                                                     ),                                                 },                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                 },                                 computed_fields: Some(                                     ComputedFields(                                         [],                                     ),                                 ),                                 mode: SimpleDict,                                 extra_serializer: None,                                 filter: SchemaFilter {                                     include: None,                                     exclude: None,                                 },                                 required_fields: 5,                             },                         ),                         has_extra: false,                         root_model: false,                         name: "PaginatedResultInfo",                     },                 ),                 enabled_from_config: false,             },         ),         enabled_from_config: false,     }, ), definitions=[])#

The pydantic-core SchemaSerializer used to dump instances of the model.

__pydantic_setattr_handlers__ = {}#

__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__

__pydantic_validator__ = SchemaValidator(title="PaginatedResultInfo", validator=Model(     ModelValidator {         revalidate: Never,         validator: ModelFields(             ModelFieldsValidator {                 fields: [                     Field {                         name: "next",                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "next",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: WithDefault(                             WithDefaultValidator {                                 default: Default(                                     Py(                                         0x00007efebd4e2400,                                     ),                                 ),                                 on_error: Raise,                                 validator: Nullable(                                     NullableValidator {                                         validator: FunctionWrap(                                             FunctionWrapValidator {                                                 validator: Url(                                                     UrlValidator {                                                         strict: false,                                                         max_length: Some(                                                             2083,                                                         ),                                                         allowed_schemes: Some(                                                             (                                                                 {                                                                     "http",                                                                     "https",                                                                 },                                                                 "'http' or 'https'",                                                             ),                                                         ),                                                         host_required: false,                                                         default_host: None,                                                         default_port: None,                                                         default_path: None,                                                         name: "url['http','https']",                                                         preserve_empty_path: false,                                                     },                                                 ),                                                 func: Py(                                                     0x00007efeba35ade0,                                                 ),                                                 config: Py(                                                     0x00007efeba405c40,                                                 ),                                                 name: "function-wrap[wrap_val()]",                                                 field_name: None,                                                 info_arg: false,                                                 hide_input_in_errors: false,                                                 validation_error_cause: false,                                             },                                         ),                                         name: "nullable[function-wrap[wrap_val()]]",                                     },                                 ),                                 validate_default: false,                                 copy_default: false,                                 name: "default[nullable[function-wrap[wrap_val()]]]",                                 undefined: Py(                                     0x00007efebb06c550,                                 ),                             },                         ),                         frozen: false,                     },                     Field {                         name: "previous",                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "previous",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: WithDefault(                             WithDefaultValidator {                                 default: Default(                                     Py(                                         0x00007efebd4e2400,                                     ),                                 ),                                 on_error: Raise,                                 validator: Nullable(                                     NullableValidator {                                         validator: FunctionWrap(                                             FunctionWrapValidator {                                                 validator: Url(                                                     UrlValidator {                                                         strict: false,                                                         max_length: Some(                                                             2083,                                                         ),                                                         allowed_schemes: Some(                                                             (                                                                 {                                                                     "https",                                                                     "http",                                                                 },                                                                 "'http' or 'https'",                                                             ),                                                         ),                                                         host_required: false,                                                         default_host: None,                                                         default_port: None,                                                         default_path: None,                                                         name: "url['http','https']",                                                         preserve_empty_path: false,                                                     },                                                 ),                                                 func: Py(                                                     0x00007efeba35ae80,                                                 ),                                                 config: Py(                                                     0x00007efeba405c40,                                                 ),                                                 name: "function-wrap[wrap_val()]",                                                 field_name: None,                                                 info_arg: false,                                                 hide_input_in_errors: false,                                                 validation_error_cause: false,                                             },                                         ),                                         name: "nullable[function-wrap[wrap_val()]]",                                     },                                 ),                                 validate_default: false,                                 copy_default: false,                                 name: "default[nullable[function-wrap[wrap_val()]]]",                                 undefined: Py(                                     0x00007efebb06c550,                                 ),                             },                         ),                         frozen: false,                     },                     Field {                         name: "page",                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "page",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: Int(                             IntValidator {                                 strict: false,                             },                         ),                         frozen: false,                     },                     Field {                         name: "per_page",                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "per_page",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: Int(                             IntValidator {                                 strict: false,                             },                         ),                         frozen: false,                     },                     Field {                         name: "total_count",                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "total_count",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: Int(                             IntValidator {                                 strict: false,                             },                         ),                         frozen: false,                     },                 ],                 model_name: "PaginatedResultInfo",                 extra_behavior: Ignore,                 extras_validator: None,                 extras_keys_validator: None,                 strict: false,                 from_attributes: false,                 loc_by_alias: true,                 lookup: LookupTree {                     inner: {                         PathItemString(                             "next",                         ): LookupTreeNode {                             fields: [                                 LookupFieldInfo {                                     field_index: 0,                                     lookup_priority: LookupFieldPriority {                                         lookup_type: Both,                                         alias_index: 0,                                     },                                 },                             ],                             map: {},                             list: {},                         },                         PathItemString(                             "total_count",                         ): LookupTreeNode {                             fields: [                                 LookupFieldInfo {                                     field_index: 4,                                     lookup_priority: LookupFieldPriority {                                         lookup_type: Both,                                         alias_index: 0,                                     },                                 },                             ],                             map: {},                             list: {},                         },                         PathItemString(                             "per_page",                         ): LookupTreeNode {                             fields: [                                 LookupFieldInfo {                                     field_index: 3,                                     lookup_priority: LookupFieldPriority {                                         lookup_type: Both,                                         alias_index: 0,                                     },                                 },                             ],                             map: {},                             list: {},                         },                         PathItemString(                             "page",                         ): LookupTreeNode {                             fields: [                                 LookupFieldInfo {                                     field_index: 2,                                     lookup_priority: LookupFieldPriority {                                         lookup_type: Both,                                         alias_index: 0,                                     },                                 },                             ],                             map: {},                             list: {},                         },                         PathItemString(                             "previous",                         ): LookupTreeNode {                             fields: [                                 LookupFieldInfo {                                     field_index: 1,                                     lookup_priority: LookupFieldPriority {                                         lookup_type: Both,                                         alias_index: 0,                                     },                                 },                             ],                             map: {},                             list: {},                         },                     },                 },                 validate_by_alias: None,                 validate_by_name: None,             },         ),         class: Py(             0x000055ef427ac210,         ),         generic_origin: None,         post_init: None,         frozen: false,         custom_init: false,         root_model: false,         undefined: Py(             0x00007efebb06c550,         ),         name: "PaginatedResultInfo",     }, ), definitions=[], cache_strings=True)#

The pydantic-core SchemaValidator used to validate instances of the model.

__signature__ = <Signature (*, next: Optional[pydantic.networks.HttpUrl] = None, previous: Optional[pydantic.networks.HttpUrl] = None, page: int, per_page: int, total_count: int) -> None>#

The synthesized __init__ [Signature][inspect.Signature] of the model.

__weakref__#

list of weak references to the object

model_config = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

fca_api.types.pagination.NextPageToken#

Opaque cursor for the next page. Format is internal and may change.

alias of Annotated[str, FieldInfo(annotation=NoneType, required=True, description=’Opaque pagination cursor. Pass unchanged to Client.fetch_next_page to retrieve the next page; do not construct, parse, or modify it.’)]

class fca_api.types.pagination.PageTokenSerializer(*args, **kwargs)[source]#

Optional hook for signing or encrypting next_page tokens.

Implement to protect tokens crossing a trust boundary (e.g. returned to an external caller and resubmitted later). When a serializer is configured on the Client, outgoing tokens pass through :meth:`serialize` and incoming tokens through :meth:`deserialize`.

Example:

class HmacSerializer:
    def serialize(self, token: str) -> str: ...
    def deserialize(self, token: str) -> str: ...

client = Client(credentials=("email", "key"), page_token_serializer=HmacSerializer())
serialize(token: str) str[source]#

Transform a raw token for external use (e.g. sign or encrypt).

deserialize(token: str) str[source]#

Recover the raw token from its external form (e.g. verify or decrypt).

__init__(*args, **kwargs)#
classmethod __subclasshook__(other)#

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__#

list of weak references to the object

class fca_api.types.pagination.PaginationInfo(*, has_next: bool, next_page: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Opaque pagination cursor. Pass unchanged to ``Client.fetch_next_page`` to retrieve the next page; do not construct, parse, or modify it.')] | None = None, size: int | None = None)[source]#

Pagination state attached to every paginated result.

Pass next_page to :meth:`Client.fetch_next_page` to advance:

while page.pagination.has_next:
    page = await client.fetch_next_page(page.pagination.next_page)
model_config = {'frozen': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

__pydantic_fields_set__#

The names of fields explicitly set during instantiation.

__pydantic_extra__#

A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.

__pydantic_private__#

Values of private attributes set on the model instance.

__class_vars__ = {}#

The names of the class variables defined on the model.

__hash__() int#

Return hash(self).

__private_attributes__ = {}#

Metadata about the private attributes of the model.

__pydantic_complete__ = True#

Whether model building is completed, or if there are still undefined fields.

__pydantic_computed_fields__ = {}#

A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

__pydantic_core_schema__ = {'cls': <class 'fca_api.types.pagination.PaginationInfo'>, 'config': {'title': 'PaginationInfo'}, 'custom_init': False, 'metadata': {'pydantic_js_functions': [<bound method BaseModel.__get_pydantic_json_schema__ of <class 'fca_api.types.pagination.PaginationInfo'>>]}, 'ref': 'fca_api.types.pagination.PaginationInfo:94486099519328', 'root_model': False, 'schema': {'computed_fields': [], 'fields': {'has_next': {'metadata': {'pydantic_js_updates': {'description': 'True if more results are available beyond this page.'}}, 'schema': {'type': 'bool'}, 'type': 'model-field'}, 'next_page': {'metadata': {'pydantic_js_updates': {'description': 'Cursor to pass to Client.fetch_next_page to fetch the next page. None when has_next is False.'}}, 'schema': {'default': None, 'schema': {'schema': {'metadata': {'pydantic_js_updates': {'description': 'Opaque pagination cursor. Pass unchanged to ``Client.fetch_next_page`` to retrieve the next page; do not construct, parse, or modify it.'}}, 'type': 'str'}, 'type': 'nullable'}, 'type': 'default'}, 'type': 'model-field'}, 'size': {'metadata': {'pydantic_js_updates': {'description': 'Estimated total number of items in the collection as reported by the FCA API. May be approximate.'}}, 'schema': {'default': None, 'schema': {'schema': {'type': 'int'}, 'type': 'nullable'}, 'type': 'default'}, 'type': 'model-field'}}, 'model_name': 'PaginationInfo', 'type': 'model-fields'}, 'type': 'model'}#

The core schema of the model.

__pydantic_custom_init__ = False#

Whether the model has a custom __init__ method.

__pydantic_decorators__ = DecoratorInfos(validators={}, field_validators={}, root_validators={}, field_serializers={}, model_serializers={}, model_validators={}, computed_fields={})#

Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

__pydantic_extra_info__ = None#

A wrapper around the __pydantic_extra__ annotation, if explicitly annotated on a model.

This is a private attribute, not meant to be used outside Pydantic.

__pydantic_fields__ = {'has_next': FieldInfo(annotation=bool, required=True, description='True if more results are available beyond this page.'), 'next_page': FieldInfo(annotation=Union[Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Opaque pagination cursor. Pass unchanged to ``Client.fetch_next_page`` to retrieve the next page; do not construct, parse, or modify it.')], NoneType], required=False, default=None, description='Cursor to pass to Client.fetch_next_page to fetch the next page. None when has_next is False.'), 'size': FieldInfo(annotation=Union[int, NoneType], required=False, default=None, description='Estimated total number of items in the collection as reported by the FCA API. May be approximate.')}#

A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects. This replaces Model.__fields__ from Pydantic V1.

__pydantic_generic_metadata__ = {'args': (), 'origin': None, 'parameters': ()}#

A dictionary containing metadata about generic Pydantic models.

The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.

__pydantic_parent_namespace__ = None#

Parent namespace of the model, used for automatic rebuilding of models.

__pydantic_post_init__ = None#

The name of the post-init method for the model, if defined.

__pydantic_serializer__ = SchemaSerializer(serializer=PolymorphismTrampoline(     PolymorphismTrampoline {         class: Py(             0x000055ef4265e760,         ),         serializer: PolymorphismTrampoline(             PolymorphismTrampoline {                 class: Py(                     0x000055ef4265e760,                 ),                 serializer: Model(                     ModelSerializer {                         class: Py(                             0x000055ef4265e760,                         ),                         serializer: Fields(                             GeneralFieldsSerializer {                                 fields: {                                     "size": SerField {                                         key: "size",                                         alias: None,                                         serializer: Some(                                             WithDefault(                                                 WithDefaultSerializer {                                                     default: Default(                                                         Py(                                                             0x00007efebd4e2400,                                                         ),                                                     ),                                                     serializer: Nullable(                                                         NullableSerializer {                                                             serializer: Int(                                                                 IntSerializer,                                                             ),                                                         },                                                     ),                                                 },                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                     "has_next": SerField {                                         key: "has_next",                                         alias: None,                                         serializer: Some(                                             Bool(                                                 BoolSerializer,                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                     "next_page": SerField {                                         key: "next_page",                                         alias: None,                                         serializer: Some(                                             WithDefault(                                                 WithDefaultSerializer {                                                     default: Default(                                                         Py(                                                             0x00007efebd4e2400,                                                         ),                                                     ),                                                     serializer: Nullable(                                                         NullableSerializer {                                                             serializer: Str(                                                                 StrSerializer,                                                             ),                                                         },                                                     ),                                                 },                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                 },                                 computed_fields: Some(                                     ComputedFields(                                         [],                                     ),                                 ),                                 mode: SimpleDict,                                 extra_serializer: None,                                 filter: SchemaFilter {                                     include: None,                                     exclude: None,                                 },                                 required_fields: 3,                             },                         ),                         has_extra: false,                         root_model: false,                         name: "PaginationInfo",                     },                 ),                 enabled_from_config: false,             },         ),         enabled_from_config: false,     }, ), definitions=[])#

The pydantic-core SchemaSerializer used to dump instances of the model.

__pydantic_setattr_handlers__ = {}#

__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__

__pydantic_validator__ = SchemaValidator(title="PaginationInfo", validator=Model(     ModelValidator {         revalidate: Never,         validator: ModelFields(             ModelFieldsValidator {                 fields: [                     Field {                         name: "has_next",                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "has_next",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: Bool(                             BoolValidator {                                 strict: false,                             },                         ),                         frozen: false,                     },                     Field {                         name: "next_page",                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "next_page",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: WithDefault(                             WithDefaultValidator {                                 default: Default(                                     Py(                                         0x00007efebd4e2400,                                     ),                                 ),                                 on_error: Raise,                                 validator: Nullable(                                     NullableValidator {                                         validator: Str(                                             StrValidator {                                                 strict: false,                                                 coerce_numbers_to_str: false,                                             },                                         ),                                         name: "nullable[str]",                                     },                                 ),                                 validate_default: false,                                 copy_default: false,                                 name: "default[nullable[str]]",                                 undefined: Py(                                     0x00007efebb06c550,                                 ),                             },                         ),                         frozen: false,                     },                     Field {                         name: "size",                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "size",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: WithDefault(                             WithDefaultValidator {                                 default: Default(                                     Py(                                         0x00007efebd4e2400,                                     ),                                 ),                                 on_error: Raise,                                 validator: Nullable(                                     NullableValidator {                                         validator: Int(                                             IntValidator {                                                 strict: false,                                             },                                         ),                                         name: "nullable[int]",                                     },                                 ),                                 validate_default: false,                                 copy_default: false,                                 name: "default[nullable[int]]",                                 undefined: Py(                                     0x00007efebb06c550,                                 ),                             },                         ),                         frozen: false,                     },                 ],                 model_name: "PaginationInfo",                 extra_behavior: Ignore,                 extras_validator: None,                 extras_keys_validator: None,                 strict: false,                 from_attributes: false,                 loc_by_alias: true,                 lookup: LookupTree {                     inner: {                         PathItemString(                             "has_next",                         ): LookupTreeNode {                             fields: [                                 LookupFieldInfo {                                     field_index: 0,                                     lookup_priority: LookupFieldPriority {                                         lookup_type: Both,                                         alias_index: 0,                                     },                                 },                             ],                             map: {},                             list: {},                         },                         PathItemString(                             "size",                         ): LookupTreeNode {                             fields: [                                 LookupFieldInfo {                                     field_index: 2,                                     lookup_priority: LookupFieldPriority {                                         lookup_type: Both,                                         alias_index: 0,                                     },                                 },                             ],                             map: {},                             list: {},                         },                         PathItemString(                             "next_page",                         ): LookupTreeNode {                             fields: [                                 LookupFieldInfo {                                     field_index: 1,                                     lookup_priority: LookupFieldPriority {                                         lookup_type: Both,                                         alias_index: 0,                                     },                                 },                             ],                             map: {},                             list: {},                         },                     },                 },                 validate_by_alias: None,                 validate_by_name: None,             },         ),         class: Py(             0x000055ef4265e760,         ),         generic_origin: None,         post_init: None,         frozen: false,         custom_init: false,         root_model: false,         undefined: Py(             0x00007efebb06c550,         ),         name: "PaginationInfo",     }, ), definitions=[], cache_strings=True)#

The pydantic-core SchemaValidator used to validate instances of the model.

__signature__ = <Signature (*, has_next: bool, next_page: Optional[Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Opaque pagination cursor. Pass unchanged to ``Client.fetch_next_page`` to retrieve the next page; do not construct, parse, or modify it.')]] = None, size: Optional[int] = None) -> None>#

The synthesized __init__ [Signature][inspect.Signature] of the model.

__weakref__#

list of weak references to the object

class fca_api.types.pagination.MultipageList(*, data: Tuple[T, ...], pagination: PaginationInfo)[source]#

One page of typed results plus pagination state.

Type Parameters:

T: Type of items in data.

Walk the full result set:

page = await client.search_frn("Barclays")
while True:
    for firm in page.data:
        ...
    if not page.pagination.has_next:
        break
    page = await client.fetch_next_page(page.pagination.next_page)

Collect at least N items in one call (may issue several requests):

page = await client.search_frn("Barclays", result_count=100)
model_config = {'frozen': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

__pydantic_fields_set__#

The names of fields explicitly set during instantiation.

__pydantic_extra__#

A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.

__pydantic_private__#

Values of private attributes set on the model instance.

__class_vars__ = {}#

The names of the class variables defined on the model.

__hash__() int#

Return hash(self).

__private_attributes__ = {}#

Metadata about the private attributes of the model.

__pydantic_complete__ = True#

Whether model building is completed, or if there are still undefined fields.

__pydantic_computed_fields__ = {}#

A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

__pydantic_core_schema__ = {'cls': <class 'fca_api.types.pagination.MultipageList'>, 'config': {'title': 'MultipageList'}, 'custom_init': False, 'metadata': {'pydantic_js_functions': [<bound method BaseModel.__get_pydantic_json_schema__ of <class 'fca_api.types.pagination.MultipageList'>>]}, 'ref': 'fca_api.types.pagination.MultipageList:94486098210800', 'root_model': False, 'schema': {'computed_fields': [], 'fields': {'data': {'metadata': {'pydantic_js_updates': {'description': 'The result items for this page. Immutable.'}}, 'schema': {'items_schema': [{'type': 'any'}], 'type': 'tuple', 'variadic_item_index': 0}, 'type': 'model-field'}, 'pagination': {'metadata': {'pydantic_js_updates': {'description': 'Pagination state, including whether more results exist and how to fetch them.'}}, 'schema': {'cls': <class 'fca_api.types.pagination.PaginationInfo'>, 'config': {'title': 'PaginationInfo'}, 'custom_init': False, 'metadata': {'pydantic_js_functions': [<bound method BaseModel.__get_pydantic_json_schema__ of <class 'fca_api.types.pagination.PaginationInfo'>>]}, 'ref': 'fca_api.types.pagination.PaginationInfo:94486099519328', 'root_model': False, 'schema': {'computed_fields': [], 'fields': {'has_next': {'metadata': {'pydantic_js_updates': {'description': 'True if more results are available beyond this page.'}}, 'schema': {'type': 'bool'}, 'type': 'model-field'}, 'next_page': {'metadata': {'pydantic_js_updates': {'description': 'Cursor to pass to Client.fetch_next_page to fetch the next page. None when has_next is False.'}}, 'schema': {'default': None, 'schema': {'schema': {'metadata': {'pydantic_js_updates': {'description': 'Opaque pagination cursor. Pass unchanged to ``Client.fetch_next_page`` to retrieve the next page; do not construct, parse, or modify it.'}}, 'type': 'str'}, 'type': 'nullable'}, 'type': 'default'}, 'type': 'model-field'}, 'size': {'metadata': {'pydantic_js_updates': {'description': 'Estimated total number of items in the collection as reported by the FCA API. May be approximate.'}}, 'schema': {'default': None, 'schema': {'schema': {'type': 'int'}, 'type': 'nullable'}, 'type': 'default'}, 'type': 'model-field'}}, 'model_name': 'PaginationInfo', 'type': 'model-fields'}, 'type': 'model'}, 'type': 'model-field'}}, 'model_name': 'MultipageList', 'type': 'model-fields'}, 'type': 'model'}#

The core schema of the model.

__pydantic_custom_init__ = False#

Whether the model has a custom __init__ method.

__pydantic_decorators__ = DecoratorInfos(validators={}, field_validators={}, root_validators={}, field_serializers={}, model_serializers={}, model_validators={}, computed_fields={})#

Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

__pydantic_extra_info__ = None#

A wrapper around the __pydantic_extra__ annotation, if explicitly annotated on a model.

This is a private attribute, not meant to be used outside Pydantic.

__pydantic_fields__ = {'data': FieldInfo(annotation=Tuple[TypeVar, ...], required=True, description='The result items for this page. Immutable.'), 'pagination': FieldInfo(annotation=PaginationInfo, required=True, description='Pagination state, including whether more results exist and how to fetch them.')}#

A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects. This replaces Model.__fields__ from Pydantic V1.

__pydantic_generic_metadata__ = {'args': (), 'origin': None, 'parameters': (~T,)}#

A dictionary containing metadata about generic Pydantic models.

The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.

__pydantic_parent_namespace__ = None#

Parent namespace of the model, used for automatic rebuilding of models.

__pydantic_post_init__ = None#

The name of the post-init method for the model, if defined.

__pydantic_serializer__ = SchemaSerializer(serializer=PolymorphismTrampoline(     PolymorphismTrampoline {         class: Py(             0x000055ef4251eff0,         ),         serializer: PolymorphismTrampoline(             PolymorphismTrampoline {                 class: Py(                     0x000055ef4251eff0,                 ),                 serializer: Model(                     ModelSerializer {                         class: Py(                             0x000055ef4251eff0,                         ),                         serializer: Fields(                             GeneralFieldsSerializer {                                 fields: {                                     "pagination": SerField {                                         key: "pagination",                                         alias: None,                                         serializer: Some(                                             PolymorphismTrampoline(                                                 PolymorphismTrampoline {                                                     class: Py(                                                         0x000055ef4265e760,                                                     ),                                                     serializer: Prebuilt(                                                         PrebuiltSerializer {                                                             schema_serializer: Py(                                                                 0x00007efebadc2950,                                                             ),                                                         },                                                     ),                                                     enabled_from_config: false,                                                 },                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                     "data": SerField {                                         key: "data",                                         alias: None,                                         serializer: Some(                                             Tuple(                                                 TupleSerializer {                                                     serializers: [                                                         Any(                                                             AnySerializer,                                                         ),                                                     ],                                                     variadic_item_index: Some(                                                         0,                                                     ),                                                     filter: SchemaFilter {                                                         include: None,                                                         exclude: None,                                                     },                                                     name: "tuple[any, ...]",                                                 },                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                 },                                 computed_fields: Some(                                     ComputedFields(                                         [],                                     ),                                 ),                                 mode: SimpleDict,                                 extra_serializer: None,                                 filter: SchemaFilter {                                     include: None,                                     exclude: None,                                 },                                 required_fields: 2,                             },                         ),                         has_extra: false,                         root_model: false,                         name: "MultipageList",                     },                 ),                 enabled_from_config: false,             },         ),         enabled_from_config: false,     }, ), definitions=[])#

The pydantic-core SchemaSerializer used to dump instances of the model.

__pydantic_setattr_handlers__ = {}#

__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__

__pydantic_validator__ = SchemaValidator(title="MultipageList", validator=Model(     ModelValidator {         revalidate: Never,         validator: ModelFields(             ModelFieldsValidator {                 fields: [                     Field {                         name: "data",                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "data",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: Tuple(                             TupleValidator {                                 strict: false,                                 validators: [                                     Any(                                         AnyValidator,                                     ),                                 ],                                 variadic_item_index: Some(                                     0,                                 ),                                 min_length: None,                                 max_length: None,                                 name: "tuple[any, ...]",                                 fail_fast: false,                             },                         ),                         frozen: false,                     },                     Field {                         name: "pagination",                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "pagination",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: Prebuilt(                             PrebuiltValidator {                                 schema_validator: Py(                                     0x00007efebadc1240,                                 ),                             },                         ),                         frozen: false,                     },                 ],                 model_name: "MultipageList",                 extra_behavior: Ignore,                 extras_validator: None,                 extras_keys_validator: None,                 strict: false,                 from_attributes: false,                 loc_by_alias: true,                 lookup: LookupTree {                     inner: {                         PathItemString(                             "data",                         ): LookupTreeNode {                             fields: [                                 LookupFieldInfo {                                     field_index: 0,                                     lookup_priority: LookupFieldPriority {                                         lookup_type: Both,                                         alias_index: 0,                                     },                                 },                             ],                             map: {},                             list: {},                         },                         PathItemString(                             "pagination",                         ): LookupTreeNode {                             fields: [                                 LookupFieldInfo {                                     field_index: 1,                                     lookup_priority: LookupFieldPriority {                                         lookup_type: Both,                                         alias_index: 0,                                     },                                 },                             ],                             map: {},                             list: {},                         },                     },                 },                 validate_by_alias: None,                 validate_by_name: None,             },         ),         class: Py(             0x000055ef4251eff0,         ),         generic_origin: None,         post_init: None,         frozen: false,         custom_init: false,         root_model: false,         undefined: Py(             0x00007efebb06c550,         ),         name: "MultipageList",     }, ), definitions=[], cache_strings=True)#

The pydantic-core SchemaValidator used to validate instances of the model.

__signature__ = <Signature (*, data: Tuple[~T, ...], pagination: fca_api.types.pagination.PaginationInfo) -> None>#

The synthesized __init__ [Signature][inspect.Signature] of the model.

__weakref__#

list of weak references to the object