Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ async def list_all_calculated_channel_versions(
query_filter: str | None = None,
order_by: str | None = None,
limit: int | None = None,
page_size: int | None = DEFAULT_PAGE_SIZE,
) -> list[CalculatedChannel]:
"""List all versions of a calculated channel."""
return await self._handle_pagination(
Expand All @@ -271,4 +272,5 @@ async def list_all_calculated_channel_versions(
},
order_by=order_by,
max_results=limit,
page_size=page_size,
)
4 changes: 4 additions & 0 deletions python/lib/sift_client/resources/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ async def list_(
filter_query: str | None = None,
order_by: str | None = None,
limit: int | None = None,
page_size: int | None = None,
) -> list[Asset]:
"""List assets with optional filtering.

Expand All @@ -111,6 +112,8 @@ async def list_(
filter_query: Explicit CEL query to filter assets.
order_by: Field and direction to order results by.
limit: Maximum number of assets to return. If None, returns all matches.
page_size: Number of results to fetch per request. Lower this if you hit gRPC
message size limits on responses. If None, uses the server default.

Returns:
A list of Asset objects that match the filter criteria.
Expand Down Expand Up @@ -142,6 +145,7 @@ async def list_(
query_filter=filter_query or None,
order_by=order_by,
max_results=limit,
**({"page_size": page_size} if page_size is not None else {}),
)
return self._apply_client_to_instances(assets)

Expand Down
8 changes: 8 additions & 0 deletions python/lib/sift_client/resources/calculated_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ async def list_(
filter_query: str | None = None,
order_by: str | None = None,
limit: int | None = None,
page_size: int | None = None,
) -> list[CalculatedChannel]:
"""List calculated channels with optional filtering. This will return the latest version. To find all versions, use `list_versions`.

Expand All @@ -127,6 +128,8 @@ async def list_(
filter_query: Explicit CEL query to filter calculated channels.
order_by: How to order the retrieved calculated channels.
limit: How many calculated channels to retrieve. If None, retrieves all matches.
page_size: Number of results to fetch per request. Lower this if you hit gRPC
message size limits on responses. If None, uses the server default.

Returns:
A list of CalculatedChannels that matches the filter.
Expand Down Expand Up @@ -169,6 +172,7 @@ async def list_(
query_filter=query_filter or None,
order_by=order_by,
max_results=limit,
**({"page_size": page_size} if page_size is not None else {}), # type: ignore[arg-type]
)
return self._apply_client_to_instances(calculated_channels)

Expand Down Expand Up @@ -304,6 +308,7 @@ async def list_versions(
filter_query: str | None = None,
order_by: str | None = None,
limit: int | None = None,
page_size: int | None = None,
) -> list[CalculatedChannel]:
"""List versions of a calculated channel.

Expand All @@ -327,6 +332,8 @@ async def list_versions(
filter_query: Explicit CEL query to filter versions.
order_by: How to order the retrieved versions.
limit: Maximum number of versions to return. If None, returns all matches.
page_size: Number of results to fetch per request. Lower this if you hit gRPC
message size limits on responses. If None, uses the server default.

Returns:
A list of CalculatedChannel versions that match the filter criteria.
Expand Down Expand Up @@ -360,6 +367,7 @@ async def list_versions(
query_filter=query_filter or None,
order_by=order_by,
limit=limit,
**({"page_size": page_size} if page_size is not None else {}), # type: ignore[arg-type]
)

return self._apply_client_to_instances(versions)
4 changes: 4 additions & 0 deletions python/lib/sift_client/resources/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ async def list_(
filter_query: str | None = None,
order_by: str | None = None,
limit: int | None = None,
page_size: int | None = None,
) -> list[Channel]:
"""List channels with optional filtering.

Expand All @@ -124,6 +125,8 @@ async def list_(
filter_query: Explicit CEL query to filter channels.
order_by: Field and direction to order results by.
limit: Maximum number of channels to return. If None, returns all matches.
page_size: Number of results to fetch per request. Lower this if you hit gRPC
message size limits on responses. If None, uses the server default.

Returns:
A list of Channels that matches the filter criteria.
Expand Down Expand Up @@ -167,6 +170,7 @@ async def list_(
query_filter=query_filter or None,
order_by=order_by,
max_results=limit,
**({"page_size": page_size} if page_size is not None else {}),
)
return self._apply_client_to_instances(channels)

Expand Down
4 changes: 4 additions & 0 deletions python/lib/sift_client/resources/file_attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ async def list_(
filter_query: str | None = None,
order_by: str | None = None,
limit: int | None = None,
page_size: int | None = None,
) -> list[FileAttachment]:
"""List file attachments with optional filtering.

Expand All @@ -120,6 +121,8 @@ async def list_(
filter_query: Explicit CEL query to filter file attachments.
order_by: Field and direction to order results by. Note: Not supported by the backend, but it is here for API consistency.
limit: Maximum number of file attachments to return. If None, returns all matches.
page_size: Number of results to fetch per request. Lower this if you hit gRPC
message size limits on responses. If None, uses the server default.

Returns:
A list of FileAttachment objects that match the filter criteria.
Expand Down Expand Up @@ -160,6 +163,7 @@ async def list_(
file_attachments = await self._low_level_client.list_all_remote_files(
query_filter=query_filter or None,
max_results=limit,
**({"page_size": page_size} if page_size is not None else {}), # type: ignore[arg-type]
)
return self._apply_client_to_instances(file_attachments)

Expand Down
4 changes: 4 additions & 0 deletions python/lib/sift_client/resources/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ async def list_(
# Ordering and pagination
order_by: str | None = None,
limit: int | None = None,
page_size: int | None = None,
) -> list[Job]:
"""List jobs with optional filtering.

Expand All @@ -97,6 +98,8 @@ async def list_(
filter_query: Explicit CEL query to filter jobs. If provided, other filter arguments are ignored.
order_by: Field and direction to order results by.
limit: Maximum number of jobs to return. If None, returns all matches.
page_size: Number of results to fetch per request. Lower this if you hit gRPC
message size limits on responses. If None, uses the server default.

Returns:
A list of Job objects that match the filter criteria.
Expand Down Expand Up @@ -134,6 +137,7 @@ async def list_(
organization_id=organization_id,
order_by=order_by,
max_results=limit,
**({"page_size": page_size} if page_size is not None else {}),
)
return self._apply_client_to_instances(jobs)

Expand Down
4 changes: 4 additions & 0 deletions python/lib/sift_client/resources/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ async def list_(
modified_by: str | None = None,
order_by: str | None = None,
limit: int | None = None,
page_size: int | None = None,
include_archived: bool = False,
filter_query: str | None = None,
created_after: datetime | None = None,
Expand All @@ -91,6 +92,8 @@ async def list_(
modified_by: The user ID of the last modifier of the reports.
order_by: How to order the retrieved reports.
limit: How many reports to retrieve. If None, retrieves all matches.
page_size: Number of results to fetch per request. Lower this if you hit gRPC
message size limits on responses. If None, uses the server default.
include_archived: Whether to include archived reports.
filter_query: Explicit CEL query to filter reports.
created_after: Filter reports created after this datetime.
Expand Down Expand Up @@ -142,6 +145,7 @@ async def list_(
organization_id=organization_id,
order_by=order_by,
max_results=limit,
**({"page_size": page_size} if page_size is not None else {}),
)
return self._apply_client_to_instances(reports)

Expand Down
10 changes: 8 additions & 2 deletions python/lib/sift_client/resources/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ async def list_(
filter_query: str | None = None,
order_by: str | None = None,
limit: int | None = None,
page_size: int | None = None,
) -> list[Rule]:
"""List rules with optional filtering.

Expand All @@ -108,6 +109,8 @@ async def list_(
filter_query: Explicit CEL query to filter rules.
order_by: Field and direction to order results by.
limit: Maximum number of rules to return. If None, returns all matches.
page_size: Number of results to fetch per request. Lower this if you hit gRPC
message size limits on responses. If None, defaults to `limit`.

Returns:
A list of Rules that matches the filter.
Expand Down Expand Up @@ -146,7 +149,7 @@ async def list_(
filter_query=query_filter,
order_by=order_by,
max_results=limit,
page_size=limit,
page_size=page_size if page_size is not None else limit,
)
return self._apply_client_to_instances(rules)

Expand Down Expand Up @@ -338,6 +341,7 @@ async def list_rule_versions(
rule_version_ids: list[str] | None = None,
filter_query: str | None = None,
limit: int | None = None,
page_size: int | None = None,
) -> list[RuleVersion]:
"""List versions of a rule with optional filtering.

Expand All @@ -348,6 +352,8 @@ async def list_rule_versions(
rule_version_ids: Limit to these rule version IDs.
filter_query: Raw CEL filter (fields: rule_version_id, user_notes, change_message).
limit: Maximum number of versions to return. If None, returns all matches.
page_size: Number of results to fetch per request. Lower this if you hit gRPC
message size limits on responses. If None, defaults to `limit`.

Returns:
A list of RuleVersion objects matching the filters, ordered by newest versions first.
Expand All @@ -372,7 +378,7 @@ async def list_rule_versions(
rule_id=rule_id,
filter_query=query_filter,
max_results=limit,
page_size=limit,
page_size=page_size if page_size is not None else limit,
)

async def get_rule_version(self, rule_version: RuleVersion | str) -> Rule:
Expand Down
4 changes: 4 additions & 0 deletions python/lib/sift_client/resources/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ async def list_(
filter_query: str | None = None,
order_by: str | None = None,
limit: int | None = None,
page_size: int | None = None,
) -> list[Run]:
"""List runs with optional filtering.

Expand Down Expand Up @@ -126,6 +127,8 @@ async def list_(
filter_query: Explicit CEL query to filter runs.
order_by: Field and direction to order results by.
limit: Maximum number of runs to return. If None, returns all matches.
page_size: Number of results to fetch per request. Lower this if you hit gRPC
message size limits on responses. If None, uses the server default.

Returns:
A list of Run objects that match the filter criteria.
Expand Down Expand Up @@ -185,6 +188,7 @@ async def list_(
query_filter=query_filter or None,
order_by=order_by,
max_results=limit,
**({"page_size": page_size} if page_size is not None else {}),
)
return self._apply_client_to_instances(runs)

Expand Down
Loading
Loading