fca_api.types.pagination#
Pagination types for FCA API responses.
- Types:
NextPageToken: An opaque string cursor passed between calls to page through results. PageTokenSerializer: Protocol for encrypting/decrypting pagination tokens. PaginationInfo: Pagination metadata returned alongside each page of results. MultipageList: A generic value object containing one page of results.
- Internal types (not part of the public API):
_PageState: Encodes the FCA API page number into/from a NextPageToken. PaginatedResultInfo: Parses raw FCA API response pagination metadata.
- class fca_api.types.pagination.PaginatedResultInfo(*, next: HttpUrl | None = None, previous: HttpUrl | None = None, page: int, per_page: int, total_count: int)[source]#
Pagination metadata from FCA API responses.
Represents the
ResultInfosection of raw FCA API responses. Used internally by the async client to determine whether further pages exist.- 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:93917378032496', '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( 0x0000556ad7f4b370, ), serializer: PolymorphismTrampoline( PolymorphismTrampoline { class: Py( 0x0000556ad7f4b370, ), serializer: Model( ModelSerializer { class: Py( 0x0000556ad7f4b370, ), serializer: Fields( GeneralFieldsSerializer { fields: { "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( 0x00007fe7e70e3400, ), ), serializer: Nullable( NullableSerializer { serializer: Function( FunctionPlainSerializer { func: Py( 0x00007fe7e4070f40, ), 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, }, "total_count": SerField { key: "total_count", alias: None, serializer: Some( Int( IntSerializer, ), ), required: true, serialize_by_alias: None, serialization_exclude_if: None, }, "page": SerField { key: "page", alias: None, serializer: Some( Int( IntSerializer, ), ), required: true, serialize_by_alias: None, serialization_exclude_if: None, }, "previous": SerField { key: "previous", alias: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007fe7e70e3400, ), ), serializer: Nullable( NullableSerializer { serializer: Function( FunctionPlainSerializer { func: Py( 0x00007fe7e4070e00, ), 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( 0x00007fe7e70e3400, ), ), 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( 0x00007fe7e3f5ed40, ), config: Py( 0x00007fe7e4a28e80, ), 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( 0x00007fe7e4c7c550, ), }, ), 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( 0x00007fe7e70e3400, ), ), 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( 0x00007fe7e3f5ede0, ), config: Py( 0x00007fe7e4a28e80, ), 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( 0x00007fe7e4c7c550, ), }, ), 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( "per_page", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 3, 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( "page", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 2, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, PathItemString( "next", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 0, 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( 0x0000556ad7f4b370, ), generic_origin: None, post_init: None, frozen: false, custom_init: false, root_model: false, undefined: Py( 0x00007fe7e4c7c550, ), 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#
An opaque string cursor for retrieving the next page of results.
Returned in
PaginationInfo.next_pagewhen more results exist. Pass it back to the same endpoint method (as thenext_pageargument) to fetch the next batch.The internal format is an implementation detail and may change. Always treat this value as opaque.
alias of
Annotated[str, FieldInfo(annotation=NoneType, required=True, description=’Opaque pagination cursor. Pass this value unchanged to the same endpoint to retrieve the next page of results. Treat it as an opaque string — do not construct, parse, or modify it.’)]
- class fca_api.types.pagination.PageTokenSerializer(*args, **kwargs)[source]#
Protocol for encrypting and decrypting pagination tokens.
Implement this interface to protect
next_pagetokens from tampering or inspection when they leave the service boundary (e.g. returned to API callers and submitted back on a subsequent request).Pass an instance to
async_api.Clientat construction time:class HmacSerializer: def serialize(self, token: str) -> str: # sign / encrypt the raw token ... def deserialize(self, token: str) -> str: # verify / decrypt back to the raw token ... client = Client( credentials=("email", "key"), page_token_serializer=HmacSerializer(), )
When a serializer is configured:
Tokens returned by endpoint methods are passed through
serializebefore being placed inPaginationInfo.next_page.Tokens received by endpoint methods are passed through
deserializebefore being decoded internally.
- serialize(token: str) str[source]#
Transform a raw pagination token for external use (e.g. encrypt or sign).
- deserialize(token: str) str[source]#
Recover the raw pagination token from an external value (e.g. decrypt or verify).
- __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 this value unchanged to the same endpoint to retrieve the next page of results. Treat it as an opaque string — do not construct, parse, or modify it.')] | None = None, size: int | None = None)[source]#
Pagination state for a result set returned by the FCA API.
Returned alongside every page of results from the async client. Use
next_pagein a subsequent call to the same endpoint to retrieve the next batch of items.Example:
page = await client.search_frn("Barclays", result_count=25) while page.pagination.has_next: page = await client.search_frn( "Barclays", next_page=page.pagination.next_page, result_count=25, )
- 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:93917378959488', '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 the same endpoint 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 this value unchanged to the same endpoint to retrieve the next page of results. Treat it as an opaque string — 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 this value unchanged to the same endpoint to retrieve the next page of results. Treat it as an opaque string — do not construct, parse, or modify it.')], NoneType], required=False, default=None, description='Cursor to pass to the same endpoint 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( 0x0000556ad802d880, ), serializer: PolymorphismTrampoline( PolymorphismTrampoline { class: Py( 0x0000556ad802d880, ), serializer: Model( ModelSerializer { class: Py( 0x0000556ad802d880, ), serializer: Fields( GeneralFieldsSerializer { fields: { "next_page": SerField { key: "next_page", alias: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007fe7e70e3400, ), ), serializer: Nullable( NullableSerializer { serializer: Str( StrSerializer, ), }, ), }, ), ), required: true, serialize_by_alias: None, serialization_exclude_if: None, }, "size": SerField { key: "size", alias: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007fe7e70e3400, ), ), 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, }, }, 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( 0x00007fe7e70e3400, ), ), 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( 0x00007fe7e4c7c550, ), }, ), 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( 0x00007fe7e70e3400, ), ), 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( 0x00007fe7e4c7c550, ), }, ), 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( "next_page", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 1, 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: {}, }, }, }, validate_by_alias: None, validate_by_name: None, }, ), class: Py( 0x0000556ad802d880, ), generic_origin: None, post_init: None, frozen: false, custom_init: false, root_model: false, undefined: Py( 0x00007fe7e4c7c550, ), 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 this value unchanged to the same endpoint to retrieve the next page of results. Treat it as an opaque string — 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: List[T], pagination: PaginationInfo)[source]#
A page of typed results from a paginated FCA API endpoint.
Contains the fetched data items and the pagination metadata needed to retrieve subsequent pages. Returned by all paginated methods on
async_api.Client.- Type Parameters:
T: The type of items in
data.
Fetching pages:
# First page — default result_count fetches one API page page = await client.search_frn("Barclays") print(f"Got {len(page.data)} of ~{page.pagination.size} total results") # Subsequent pages while page.pagination.has_next: page = await client.search_frn( "Barclays", next_page=page.pagination.next_page, result_count=25, ) # process page.data ...
Fetching a larger batch in one call:
# Request at least 100 items (may trigger multiple underlying API calls) page = await client.search_frn("Barclays", result_count=100) # page.data has >= 100 items (or all available items if fewer exist)
- model_config = {'arbitrary_types_allowed': True, '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:93917379060144', 'root_model': False, 'schema': {'computed_fields': [], 'fields': {'data': {'metadata': {'pydantic_js_updates': {'description': 'The result items for this page.'}}, 'schema': {'items_schema': {'type': 'any'}, 'type': 'list'}, '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:93917378959488', '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 the same endpoint 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 this value unchanged to the same endpoint to retrieve the next page of results. Treat it as an opaque string — 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=List[TypeVar], required=True, description='The result items for this page.'), '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( 0x0000556ad80461b0, ), serializer: PolymorphismTrampoline( PolymorphismTrampoline { class: Py( 0x0000556ad80461b0, ), serializer: Model( ModelSerializer { class: Py( 0x0000556ad80461b0, ), serializer: Fields( GeneralFieldsSerializer { fields: { "data": SerField { key: "data", alias: None, serializer: Some( List( ListSerializer { item_serializer: Any( AnySerializer, ), filter: SchemaFilter { include: None, exclude: None, }, name: "list[any]", }, ), ), required: true, serialize_by_alias: None, serialization_exclude_if: None, }, "pagination": SerField { key: "pagination", alias: None, serializer: Some( PolymorphismTrampoline( PolymorphismTrampoline { class: Py( 0x0000556ad802d880, ), serializer: Prebuilt( PrebuiltSerializer { schema_serializer: Py( 0x00007fe7e4d4c550, ), }, ), enabled_from_config: false, }, ), ), 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: List( ListValidator { strict: false, item_validator: None, min_length: None, max_length: None, name: OnceLock( <uninit>, ), 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( 0x00007fe7e4d4c700, ), }, ), 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( "pagination", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 1, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, PathItemString( "data", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 0, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, }, }, validate_by_alias: None, validate_by_name: None, }, ), class: Py( 0x0000556ad80461b0, ), generic_origin: None, post_init: None, frozen: false, custom_init: false, root_model: false, undefined: Py( 0x00007fe7e4c7c550, ), name: "MultipageList", }, ), definitions=[], cache_strings=True)#
The pydantic-core SchemaValidator used to validate instances of the model.
- __signature__ = <Signature (*, data: List[~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