PaginatedHistory

class gafaelfawr.models.history.PaginatedHistory(entries, next_cursor=None, prev_cursor=None, count=None)

Bases: PaginatedList, Generic[E]

A paginated list of history entries, including total count.

Parameters:

Attributes Summary

count

Total count of entries.

next_cursor

Cursor for the next batch of entries.

prev_cursor

Cursor for the previous batch of entries.

Methods Summary

first_url(current_url)

Construct a URL to the first group of results for this query.

link_header(current_url)

Construct an RFC 8288 Link header for a paginated result.

next_url(current_url)

Construct a URL to the next group of results for this query.

prev_url(current_url)

Construct a URL to the previous group of results for this query.

Attributes Documentation

count: int | None = None

Total count of entries.

next_cursor: Optional[TypeVar(C, bound= PaginationCursor)] = None

Cursor for the next batch of entries.

prev_cursor: Optional[TypeVar(C, bound= PaginationCursor)] = None

Cursor for the previous batch of entries.

Methods Documentation

first_url(current_url)

Construct a URL to the first group of results for this query.

Parameters:

current_url (URL) – The starting URL of the current group of entries.

Returns:

URL to the first group of entries for this query.

Return type:

str

Construct an RFC 8288 Link header for a paginated result.

Parameters:

current_url (URL) – The starting URL of the current group of entries.

Returns:

Contents of an RFC 8288 Link header.

Return type:

str

next_url(current_url)

Construct a URL to the next group of results for this query.

Parameters:

current_url (URL) – The starting URL of the current group of entries.

Returns:

URL to the next group of entries for this query or None if there are no further entries.

Return type:

str or None

prev_url(current_url)

Construct a URL to the previous group of results for this query.

Parameters:

current_url (URL) – The starting URL of the current group of entries.

Returns:

URL to the previous group of entries for this query or None if there are no further entries.

Return type:

str or None