sift_client.sift_types
¶
Sift Types - Pydantic models for Sift resources.
This module provides strongly-typed Pydantic models for interacting with Sift resources. These models are used throughout the Sift client to provide type safety, validation, and convenient methods for working with Sift objects.
Resource BaseTypes¶
Resource BaseTypes are immutable Pydantic models that represent specific Sift objects retrieved from the API. They provide:
- Type-safe access to all resource properties
- Convenience methods for common operations (update, archive, etc.)
- Related resource access via properties (e.g.,
asset.runs,run.assets) - Rich integration with IDEs for autocomplete and type checking
Available Resource Types¶
Asset- Physical or logical entities (vehicles, machines, devices)Run- Time-bounded operational periods for an assetChannel- Time-series data streams (sensor readings, telemetry)- etc.
Create and Update Types¶
Create and Update types are Pydantic models used to create new resources or modify existing ones. They can be used directly as typed objects or as dictionaries for convenience.
Create Types¶
Create types define the required and optional fields for creating new resources. For example:
RunCreate- Create a new runCalculatedChannelCreate- Create a new calculated channelRuleCreate- Create a new rule- etc.
Update Types¶
Update types define which fields can be modified on existing resources. For example:
AssetUpdate- Update asset propertiesRunUpdate- Update run propertiesCalculatedChannelUpdate- Update calculated channel properties- etc.
Example Usage¶
from sift_client import SiftClient
from sift_client.sift_types import RunCreate, AssetUpdate
client = SiftClient(api_key="...", grpc_url="...", rest_url="...")
# Using Create types - typed approach
run = client.runs.create(
RunCreate(
name="Test Run",
description="A test run",
asset_ids=["asset123"],
start_time=datetime.now(),
)
)
# Using Create types - dict approach (more convenient)
run = client.runs.create({
"name": "Test Run",
"description": "A test run",
"asset_ids": ["asset123"],
"start_time": datetime.now(),
})
# Using Update types - typed approach
asset = client.assets.update(
asset="asset123",
update=AssetUpdate(tags=["production", "v2"])
)
# Using Update types - dict approach (more convenient)
asset = client.assets.update(
asset="asset123",
update={"tags": ["production", "v2"]}
)
# Using convenience methods on resource instances
asset.update({"tags": ["production", "v3"]})
Helper Types¶
Additional types are provided for specific use cases. For example:
ChannelReference- Reference to a channel in expressionsChannelDataType- Enum for channel data typesChannelBitFieldElement- Bit field element definitionRuleActionType- Enum for rule action typesRuleAnnotationType- Enum for annotation typesChannelConfig- Configuration for data ingestion channelsFlow- Data flow configuration for ingestionIngestionConfig- Complete ingestion configuration- etc.
Type Validation¶
All types use Pydantic for validation, ensuring:
- Required fields are present
- Field types are correct
- Datetime fields have timezone information
- Enum values are valid
Validation errors are raised immediately with clear error messages.
Immutability¶
Resource BaseTypes (Asset, Run, etc.) are immutable by default. To update a resource,
use the update() method, which will update the instance in-place by replacing its
internal state with the updated values from the API.
asset = client.assets.get(asset_id="asset123")
# This will raise an error - assets are immutable
# asset.name = "New Name"
# Instead, use the update method
asset.update({"tags": ["new-tag"]}) # Updates the instance in-place
| MODULE | DESCRIPTION |
|---|---|
asset |
|
calculated_channel |
|
channel |
|
file_attachment |
|
ingestion |
|
report |
|
rule |
|
run |
|
tag |
|
test_report |
|
| CLASS | DESCRIPTION |
|---|---|
Asset |
Model of the Sift Asset. |
AssetUpdate |
Model of the Asset Fields that can be updated. |
CalculatedChannel |
Model of the Sift Calculated Channel. |
CalculatedChannelCreate |
Create model for a Calculated Channel. |
CalculatedChannelUpdate |
Update model for a Calculated Channel. |
Channel |
Model representing a Sift Channel. |
ChannelBitFieldElement |
Bit field element model. |
ChannelConfig |
Channel configuration model for ingestion purposes. |
ChannelDataType |
Enum for channel data types (mimics protobuf values, but as int for now). |
ChannelReference |
Channel reference for calculated channel or rule. |
Flow |
Model representing a data flow for ingestion. |
FlowConfig |
Model representing a data flow config for ingestion. |
IngestionConfig |
Model of the Sift Ingestion Config. |
IngestionConfigCreate |
Create model for IngestionConfig. |
Report |
Report model representing a data analysis report. |
ReportRuleStatus |
Report rule status. |
ReportRuleSummary |
ReportRuleSummary model representing a rule summary within a report. |
ReportUpdate |
Model of the Report fields that can be updated. |
Rule |
Model of the Sift Rule. |
RuleAction |
Model of a Rule Action. |
RuleActionType |
Enum for rule action kinds. |
RuleAnnotationType |
Enum for rule annotation types. |
RuleCreate |
Model for creating a new Rule. |
RuleUpdate |
Model of the Rule fields that can be updated. |
RuleVersion |
Model of a Rule Version. |
Run |
Run model representing a data collection run. |
RunCreate |
Create model for Run. |
RunUpdate |
Update model for Run. |
Tag |
Model of the Sift Tag. |
TagCreate |
Create model for Tag. |
TagUpdate |
Update model for Tag. |
TestMeasurement |
TestMeasurement model representing a measurement in a test. |
TestMeasurementCreate |
Create model for TestMeasurement. |
TestMeasurementType |
TestMeasurementType enum. |
TestReport |
TestReport model representing a test report. |
TestReportCreate |
Create model for TestReport. |
TestReportUpdate |
Update model for TestReport. |
TestStatus |
TestStatus enum. |
TestStep |
TestStep model representing a step in a test. |
TestStepCreate |
Create model for TestStep. |
TestStepType |
TestStepType enum. |
Asset
pydantic-model
¶
Bases: BaseType[Asset, 'Asset'], FileAttachmentsMixin
Model of the Sift Asset.
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
name(str) -
organization_id(str) -
created_date(datetime) -
created_by_user_id(str) -
modified_date(datetime) -
modified_by_user_id(str) -
tags(list[str | Tag]) -
metadata(dict[str, str | float | bool]) -
is_archived(bool) -
archived_date(datetime | None)
attachments
property
¶
attachments: list[FileAttachment]
Get all file attachments for this entity.
| RETURNS | DESCRIPTION |
|---|---|
list[FileAttachment]
|
A list of FileAttachments associated with this entity. |
archive
¶
archive(*, archive_runs: bool = False) -> Asset
Archive the asset.
| PARAMETER | DESCRIPTION |
|---|---|
archive_runs
|
If True, archive all Runs associated with the Asset.
TYPE:
|
channels
¶
Get the channels for this asset.
delete_attachment
¶
delete_attachment(
file_attachment: list[FileAttachment | str]
| FileAttachment
| str,
) -> None
Delete one or more file attachments.
| PARAMETER | DESCRIPTION |
|---|---|
file_attachment
|
A single FileAttachment or list of FileAttachments to delete.
TYPE:
|
update
¶
update(update: AssetUpdate | dict) -> Asset
Update the Asset.
| PARAMETER | DESCRIPTION |
|---|---|
update
|
Either an AssetUpdate instance or a dictionary of key-value pairs to update.
TYPE:
|
upload_attachment
¶
upload_attachment(
path: str | Path,
metadata: dict[str, Any] | None = None,
description: str | None = None,
organization_id: str | None = None,
) -> FileAttachment
Upload a file attachment to a remote file.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
The path to the file to upload.
TYPE:
|
metadata
|
Optional metadata for the file (e.g., video/image metadata).
TYPE:
|
description
|
Optional description of the file.
TYPE:
|
organization_id
|
Optional organization ID.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
FileAttachment
|
The uploaded FileAttachment. |
AssetUpdate
pydantic-model
¶
Bases: ModelUpdate[Asset]
Model of the Asset Fields that can be updated.
Fields:
-
_field_helpers_called(set[str]) -
_resource_id(str | None) -
tags(list[str | Tag] | None) -
metadata(dict[str, str | float | bool] | None) -
is_archived(bool | None)
to_proto_with_mask
¶
Convert to proto with field mask.
CalculatedChannel
pydantic-model
¶
Bases: BaseType[CalculatedChannel, 'CalculatedChannel']
Model of the Sift Calculated Channel.
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
name(str) -
description(str) -
expression(str) -
channel_references(list[ChannelReference]) -
is_archived(bool) -
units(str | None) -
asset_ids(list[str] | None) -
tag_ids(list[str] | None) -
all_assets(bool | None) -
organization_id(str | None) -
client_key(str | None) -
archived_date(datetime | None) -
version_id(str | None) -
version(int | None) -
change_message(str | None) -
user_notes(str | None) -
created_date(datetime | None) -
modified_date(datetime | None) -
created_by_user_id(str | None) -
modified_by_user_id(str | None)
update
¶
update(
update: CalculatedChannelUpdate | dict,
user_notes: str | None = None,
) -> CalculatedChannel
Update the Calculated Channel.
| PARAMETER | DESCRIPTION |
|---|---|
update
|
The update to apply to the calculated channel. See CalculatedChannelUpdate for more updatable fields.
TYPE:
|
user_notes
|
The user notes to apply to the calculated channel.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CalculatedChannel
|
The updated calculated channel. |
CalculatedChannelCreate
pydantic-model
¶
Bases: CalculatedChannelBase, ModelCreate[CreateCalculatedChannelRequest]
Create model for a Calculated Channel.
Fields:
-
_field_helpers_called(set[str]) -
description(str | None) -
units(str | None) -
expression(str | None) -
expression_channel_references(list[ChannelReference] | None) -
tag_ids(list[str] | None) -
asset_ids(list[str] | None) -
all_assets(bool | None) -
metadata(dict[str, str | float | bool] | None) -
name(str) -
user_notes(str | None) -
client_key(str | None)
Validators:
-
_validate_asset_configuration -
_validate_expression_and_channel_references
expression_channel_references
pydantic-field
¶
expression_channel_references: (
list[ChannelReference] | None
) = None
CalculatedChannelUpdate
pydantic-model
¶
Bases: CalculatedChannelBase, ModelUpdate[CalculatedChannel]
Update model for a Calculated Channel.
Fields:
-
_field_helpers_called(set[str]) -
_resource_id(str | None) -
description(str | None) -
units(str | None) -
expression(str | None) -
expression_channel_references(list[ChannelReference] | None) -
tag_ids(list[str] | None) -
asset_ids(list[str] | None) -
all_assets(bool | None) -
metadata(dict[str, str | float | bool] | None) -
name(str | None) -
is_archived(bool | None)
Validators:
-
_validate_asset_configuration -
_validate_expression_and_channel_references
expression_channel_references
pydantic-field
¶
expression_channel_references: (
list[ChannelReference] | None
) = None
to_proto_with_mask
¶
Convert to proto with field mask.
Channel
pydantic-model
¶
Bases: BaseType[Channel, 'Channel']
Model representing a Sift Channel.
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
name(str) -
data_type(ChannelDataType) -
description(str) -
unit(str) -
bit_field_elements(list[ChannelBitFieldElement]) -
enum_types(dict[str, int]) -
asset_id(str) -
created_date(datetime) -
modified_date(datetime) -
created_by_user_id(str) -
modified_by_user_id(str)
data
¶
data(
*,
run_id: str | None = None,
start_time: datetime | None = None,
end_time: datetime | None = None,
limit: int | None = None,
as_arrow: bool = False,
)
Retrieve channel data for this channel during the specified run.
| PARAMETER | DESCRIPTION |
|---|---|
run_id
|
The run ID to get data for.
TYPE:
|
start_time
|
The start time to get data for.
TYPE:
|
end_time
|
The end time to get data for.
TYPE:
|
limit
|
The maximum number of data points to return.
TYPE:
|
as_arrow
|
Whether to return the data as an Arrow table.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
|
A dict of channel name to pandas DataFrame or Arrow Table object. |
ChannelBitFieldElement
pydantic-model
¶
ChannelConfig
pydantic-model
¶
Bases: BaseType[ChannelConfig, 'ChannelConfig']
Channel configuration model for ingestion purposes.
This model contains only the fields needed for ingestion configuration, without the full metadata from the Channels API.
Config:
frozen:False
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
name(str) -
data_type(ChannelDataType) -
description(str | None) -
unit(str | None) -
bit_field_elements(list[ChannelBitFieldElement] | None) -
enum_types(dict[str, int] | None)
Validators:
-
_validate_enum_types
bit_field_elements
pydantic-field
¶
bit_field_elements: list[ChannelBitFieldElement] | None = (
None
)
as_channel_value
¶
as_channel_value(value: Any) -> ChannelValue
Create a ChannelValue from a value using this channel's configuration.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The value to wrap in a ChannelValue. The type should match this channel's data_type.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ChannelValue
|
A ChannelValue instance with this channel's name and data type, |
ChannelValue
|
containing the provided value. |
from_channel
classmethod
¶
from_channel(channel: Channel) -> ChannelConfig
Create ChannelConfig from a Channel.
| PARAMETER | DESCRIPTION |
|---|---|
channel
|
The Channel to convert.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ChannelConfig
|
A ChannelConfig with the channel's configuration data. |
ChannelDataType
¶
Bases: Enum
Enum for channel data types (mimics protobuf values, but as int for now).
| METHOD | DESCRIPTION |
|---|---|
__str__ |
|
from_api_format |
Convert API format string to ChannelDataType. |
from_str |
Convert string representation to ChannelDataType. |
hash_str |
Get the hash string for this channel data type. |
proto_data_class |
Return the appropriate protobuf class for the given channel data type. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
BIT_FIELD |
|
BOOL |
|
BYTES |
|
DOUBLE |
|
ENUM |
|
FLOAT |
|
INT_32 |
|
INT_64 |
|
STRING |
|
UINT_32 |
|
UINT_64 |
|
from_api_format
staticmethod
¶
from_api_format(val: str) -> ChannelDataType | None
Convert API format string to ChannelDataType.
| PARAMETER | DESCRIPTION |
|---|---|
val
|
API format string representation of ChannelDataType.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ChannelDataType | None
|
ChannelDataType if conversion is successful, None otherwise. |
from_str
staticmethod
¶
from_str(raw: str) -> ChannelDataType | None
Convert string representation to ChannelDataType.
| PARAMETER | DESCRIPTION |
|---|---|
raw
|
String representation of ChannelDataType.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ChannelDataType | None
|
ChannelDataType if conversion is successful, None otherwise. |
| RAISES | DESCRIPTION |
|---|---|
Exception
|
If the string format is recognized but cannot be converted. |
hash_str
¶
Get the hash string for this channel data type.
proto_data_class
staticmethod
¶
proto_data_class(data_type: ChannelDataType)
Return the appropriate protobuf class for the given channel data type.
| PARAMETER | DESCRIPTION |
|---|---|
data_type
|
The channel data type.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
|
The protobuf class corresponding to the data type. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the data type is not recognized. |
ChannelReference
pydantic-model
¶
Bases: BaseModel
Channel reference for calculated channel or rule.
Fields:
-
channel_reference(str) -
channel_identifier(str)
Flow
pydantic-model
¶
Bases: BaseModel
Model representing a data flow for ingestion.
A Flow represents a collection of channels that are ingested together.
A representation of the IngestWithConfigDataStreamRequest proto
Config:
frozen:False
Fields:
-
ingestion_config_id(str | None) -
flow(str) -
timestamp(datetime) -
channel_values(list[ChannelValue]) -
run_id(str | None) -
end_stream_on_validation_error(bool | None) -
organization_id(str | None)
FlowConfig
pydantic-model
¶
Bases: BaseType[FlowConfig, 'FlowConfig']
Model representing a data flow config for ingestion.
A FlowConfig represents the configuration of a collection of channels that are ingested together.
Config:
frozen:False
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
name(str) -
channels(list[ChannelConfig]) -
ingestion_config_id(str | None) -
run_id(str | None)
add_channel
¶
add_channel(channel: ChannelConfig)
Add a ChannelConfig to this Flow.
| PARAMETER | DESCRIPTION |
|---|---|
channel
|
The ChannelConfig to add.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the flow has already been created with an ingestion config. |
as_flow
¶
as_flow(
*,
timestamp: datetime | None = None,
values: dict[str, Any],
) -> Flow
Create a Flow from this FlowConfig with the provided values.
| PARAMETER | DESCRIPTION |
|---|---|
timestamp
|
The timestamp for the flow. If None, uses the current UTC time.
TYPE:
|
values
|
A dictionary mapping channel names to their values. Only channels present in this dictionary will be included in the resulting Flow.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Flow
|
A Flow object with channel values created from the provided values dictionary. |
IngestionConfig
pydantic-model
¶
Bases: BaseType[IngestionConfig, 'IngestionConfig']
Model of the Sift Ingestion Config.
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
asset_id(str) -
client_key(str)
IngestionConfigCreate
pydantic-model
¶
Bases: ModelCreate[CreateIngestionConfigRequest]
Create model for IngestionConfig.
Fields:
-
_field_helpers_called(set[str]) -
asset_name(str) -
flows(list[FlowConfig] | None) -
organization_id(str | None) -
client_key(str | None)
Report
pydantic-model
¶
Bases: BaseType[Report, 'Report']
Report model representing a data analysis report.
Config:
arbitrary_types_allowed:True
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
report_template_id(str) -
run_id(str) -
organization_id(str) -
name(str) -
description(str) -
created_by_user_id(str) -
modified_by_user_id(str) -
created_date(datetime) -
modified_date(datetime) -
summaries(list[ReportRuleSummary]) -
tags(list[str]) -
rerun_from_report_id(str | None) -
metadata(dict[str, str | float | bool]) -
job_id(str) -
archived_date(datetime | None) -
is_archived(bool)
model_config
class-attribute
instance-attribute
¶
ReportRuleStatus
¶
ReportRuleSummary
pydantic-model
¶
Bases: BaseType[ReportRuleSummary, 'ReportRuleSummary']
ReportRuleSummary model representing a rule summary within a report.
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
rule_id(str) -
rule_client_key(str | None) -
rule_version_id(str) -
rule_version_number(int) -
report_rule_version_id(str) -
num_open(int) -
num_failed(int) -
num_passed(int) -
status(ReportRuleStatus) -
created_date(datetime) -
modified_date(datetime) -
asset_id(str) -
deleted_date(datetime | None)
ReportUpdate
pydantic-model
¶
Bases: ModelUpdate[Report]
Model of the Report fields that can be updated.
Fields:
-
_field_helpers_called(set[str]) -
_resource_id(str | None) -
is_archived(bool | None) -
metadata(dict[str, str | float | bool] | None) -
tags(list[str | Tag] | None)
to_proto_with_mask
¶
Convert to proto with field mask.
Rule
pydantic-model
¶
Bases: BaseType[Rule, 'Rule']
Model of the Sift Rule.
Config:
frozen:True
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
name(str) -
description(str) -
is_enabled(bool) -
created_date(datetime) -
modified_date(datetime) -
created_by_user_id(str) -
modified_by_user_id(str) -
organization_id(str) -
is_archived(bool) -
is_external(bool) -
expression(str | None) -
channel_references(list[ChannelReference] | None) -
action(RuleAction | None) -
asset_ids(list[str] | None) -
asset_tag_ids(list[str] | None) -
contextual_channels(list[str] | None) -
client_key(str | None) -
rule_version(RuleVersion | None) -
archived_date(datetime | None)
update
¶
update(
update: RuleUpdate | dict,
version_notes: str | None = None,
) -> Rule
Update the Rule.
| PARAMETER | DESCRIPTION |
|---|---|
update
|
Either a RuleUpdate instance or a dictionary of key-value pairs to update.
TYPE:
|
version_notes
|
Notes associated with the change.
TYPE:
|
RuleAction
pydantic-model
¶
Bases: BaseType[RuleAction, 'RuleAction']
Model of a Rule Action.
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
action_type(RuleActionType) -
condition_id(str | None) -
created_date(datetime | None) -
modified_date(datetime | None) -
created_by_user_id(str | None) -
modified_by_user_id(str | None) -
version_id(str | None) -
annotation_type(RuleAnnotationType | None) -
tags_ids(list[str] | None) -
default_assignee_user(str | None)
annotation
classmethod
¶
annotation(
annotation_type: RuleAnnotationType,
tags: list[str | Tag],
default_assignee_user: str | None = None,
) -> RuleAction
Create an annotation action.
| PARAMETER | DESCRIPTION |
|---|---|
annotation_type
|
Type of annotation to create.
TYPE:
|
default_assignee_user
|
User ID to assign the annotation to.
TYPE:
|
tags
|
List of tags or tag IDs to add to the annotation.
TYPE:
|
RuleActionType
¶
Bases: Enum
Enum for rule action kinds.
| METHOD | DESCRIPTION |
|---|---|
from_str |
Convert string representation to RuleActionType. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
ANNOTATION |
|
UNSPECIFIED |
|
WEBHOOK |
|
from_str
classmethod
¶
from_str(val: str) -> RuleActionType | None
Convert string representation to RuleActionType.
| PARAMETER | DESCRIPTION |
|---|---|
val
|
String representation of RuleActionType.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RuleActionType | None
|
RuleActionType if conversion is successful, None otherwise. |
RuleAnnotationType
¶
Bases: Enum
Enum for rule annotation types.
| METHOD | DESCRIPTION |
|---|---|
from_str |
Convert string representation to RuleAnnotationType. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
DATA_REVIEW |
|
PHASE |
|
UNSPECIFIED |
|
from_str
classmethod
¶
from_str(val: str) -> RuleAnnotationType | None
Convert string representation to RuleAnnotationType.
| PARAMETER | DESCRIPTION |
|---|---|
val
|
String representation of RuleAnnotationType.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RuleAnnotationType | None
|
RuleAnnotationType if conversion is successful, None otherwise. |
RuleCreate
pydantic-model
¶
Bases: RuleCreateUpdateBase, ModelCreate[CreateRuleRequest]
Model for creating a new Rule.
Note: - asset_ids applies this rule to those assets. - asset_tag_ids applies this rule to assets with those tags.
Fields:
-
_field_helpers_called(set[str]) -
organization_id(str | None) -
client_key(str | None) -
asset_ids(list[str] | None) -
asset_tag_ids(list[str] | None) -
contextual_channels(list[str] | None) -
is_external(bool) -
name(str) -
description(str) -
expression(str) -
channel_references(list[ChannelReference]) -
action(RuleAction)
RuleUpdate
pydantic-model
¶
Bases: RuleCreateUpdateBase, ModelUpdate[Rule]
Model of the Rule fields that can be updated.
Note
- assets applies this rule to those assets.
- asset_tags applies this rule to assets with those tags.
- contextual_channels are shown by UI to give context when viewing an annotation, but are not part of rule evaluation.
Fields:
-
_field_helpers_called(set[str]) -
_resource_id(str | None) -
organization_id(str | None) -
client_key(str | None) -
asset_ids(list[str] | None) -
asset_tag_ids(list[str] | None) -
contextual_channels(list[str] | None) -
is_external(bool) -
name(str | None) -
description(str | None) -
expression(str | None) -
channel_references(list[ChannelReference] | None) -
action(RuleAction | None) -
is_archived(bool | None)
to_proto_with_mask
¶
Convert to proto with field mask.
RuleVersion
pydantic-model
¶
Bases: BaseType[RuleVersion, 'RuleVersion']
Model of a Rule Version.
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
rule_id(str) -
rule_version_id(str) -
version(str) -
created_date(datetime) -
created_by_user_id(str) -
version_notes(str) -
generated_change_message(str) -
archived_date(datetime | None) -
is_archived(bool)
Run
pydantic-model
¶
Bases: BaseType[Run, 'Run'], FileAttachmentsMixin
Run model representing a data collection run.
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
name(str) -
description(str) -
created_date(datetime) -
modified_date(datetime) -
created_by_user_id(str) -
modified_by_user_id(str) -
organization_id(str) -
metadata(dict[str, str | float | bool]) -
tags(list[str]) -
asset_ids(list[str]) -
is_adhoc(bool) -
is_archived(bool) -
start_time(datetime | None) -
stop_time(datetime | None) -
duration(timedelta | None) -
default_report_id(str | None) -
client_key(str | None) -
archived_date(datetime | None)
attachments
property
¶
attachments: list[FileAttachment]
Get all file attachments for this entity.
| RETURNS | DESCRIPTION |
|---|---|
list[FileAttachment]
|
A list of FileAttachments associated with this entity. |
delete_attachment
¶
delete_attachment(
file_attachment: list[FileAttachment | str]
| FileAttachment
| str,
) -> None
Delete one or more file attachments.
| PARAMETER | DESCRIPTION |
|---|---|
file_attachment
|
A single FileAttachment or list of FileAttachments to delete.
TYPE:
|
update
¶
upload_attachment
¶
upload_attachment(
path: str | Path,
metadata: dict[str, Any] | None = None,
description: str | None = None,
organization_id: str | None = None,
) -> FileAttachment
Upload a file attachment to a remote file.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
The path to the file to upload.
TYPE:
|
metadata
|
Optional metadata for the file (e.g., video/image metadata).
TYPE:
|
description
|
Optional description of the file.
TYPE:
|
organization_id
|
Optional organization ID.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
FileAttachment
|
The uploaded FileAttachment. |
RunCreate
pydantic-model
¶
Bases: RunBase, ModelCreate[CreateRunRequest]
Create model for Run.
Fields:
-
_field_helpers_called(set[str]) -
description(str | None) -
start_time(datetime | None) -
stop_time(datetime | None) -
tags(list[str] | list[Tag] | None) -
metadata(dict[str, str | float | bool] | None) -
name(str) -
client_key(str | None) -
organization_id(str | None)
Validators:
-
_validate_time_fields
RunUpdate
pydantic-model
¶
Bases: RunBase, ModelUpdate[Run]
Update model for Run.
Fields:
-
_field_helpers_called(set[str]) -
_resource_id(str | None) -
description(str | None) -
start_time(datetime | None) -
stop_time(datetime | None) -
tags(list[str] | list[Tag] | None) -
metadata(dict[str, str | float | bool] | None) -
name(str | None) -
is_archived(bool | None)
Validators:
-
_validate_time_fields
to_proto_with_mask
¶
Convert to proto with field mask.
Tag
pydantic-model
¶
Bases: BaseType[Tag, 'Tag']
Model of the Sift Tag.
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
name(str) -
created_date(datetime) -
created_by_user_id(str)
TagCreate
pydantic-model
¶
Bases: TagCreateUpdateBase, ModelCreate[CreateTagRequest]
Create model for Tag.
Fields:
-
_field_helpers_called(set[str]) -
name(str)
TagUpdate
pydantic-model
¶
Bases: TagCreateUpdateBase, ModelUpdate[Tag]
Update model for Tag.
Fields:
-
_field_helpers_called(set[str]) -
_resource_id(str | None) -
name(str)
to_proto_with_mask
¶
Convert to proto with field mask.
TestMeasurement
pydantic-model
¶
Bases: BaseType[TestMeasurement, 'TestMeasurement']
TestMeasurement model representing a measurement in a test.
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
measurement_type(TestMeasurementType) -
name(str) -
test_step_id(str) -
test_report_id(str | None) -
numeric_value(float | None) -
string_value(str | None) -
boolean_value(bool | None) -
unit(str | None) -
numeric_bounds(NumericBounds | None) -
string_expected_value(str | None) -
passed(bool) -
timestamp(datetime)
update
¶
update(
update: TestMeasurementUpdate | dict,
update_step: bool = False,
) -> TestMeasurement
Update the TestMeasurement.
| PARAMETER | DESCRIPTION |
|---|---|
update
|
The update to apply to the TestMeasurement.
TYPE:
|
update_step
|
Whether to update the TestStep's status to failed if the TestMeasurement is being updated to failed.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
TestMeasurement
|
The updated TestMeasurement. |
TestMeasurementCreate
pydantic-model
¶
Bases: TestMeasurementBase, ModelCreate[TestMeasurement]
Create model for TestMeasurement.
Fields:
-
_field_helpers_called(set[str]) -
numeric_value(float | None) -
string_value(str | None) -
boolean_value(bool | None) -
unit(str | None) -
numeric_bounds(NumericBounds | None) -
string_expected_value(str | None) -
measurement_type(TestMeasurementType | None) -
name(str) -
test_step_id(str) -
passed(bool) -
timestamp(datetime)
TestMeasurementType
¶
TestReport
pydantic-model
¶
Bases: BaseType[TestReport, 'TestReport'], FileAttachmentsMixin
TestReport model representing a test report.
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
status(TestStatus) -
name(str) -
test_system_name(str) -
test_case(str) -
start_time(datetime) -
end_time(datetime) -
metadata(dict[str, str | float | bool]) -
serial_number(str | None) -
part_number(str | None) -
system_operator(str | None) -
run_id(str | None) -
archived_date(datetime | None) -
is_archived(bool)
attachments
property
¶
attachments: list[FileAttachment]
Get all file attachments for this entity.
| RETURNS | DESCRIPTION |
|---|---|
list[FileAttachment]
|
A list of FileAttachments associated with this entity. |
delete_attachment
¶
delete_attachment(
file_attachment: list[FileAttachment | str]
| FileAttachment
| str,
) -> None
Delete one or more file attachments.
| PARAMETER | DESCRIPTION |
|---|---|
file_attachment
|
A single FileAttachment or list of FileAttachments to delete.
TYPE:
|
upload_attachment
¶
upload_attachment(
path: str | Path,
metadata: dict[str, Any] | None = None,
description: str | None = None,
organization_id: str | None = None,
) -> FileAttachment
Upload a file attachment to a remote file.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
The path to the file to upload.
TYPE:
|
metadata
|
Optional metadata for the file (e.g., video/image metadata).
TYPE:
|
description
|
Optional description of the file.
TYPE:
|
organization_id
|
Optional organization ID.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
FileAttachment
|
The uploaded FileAttachment. |
TestReportCreate
pydantic-model
¶
Bases: TestReportBase, ModelCreate[CreateTestReportRequest]
Create model for TestReport.
Fields:
-
_field_helpers_called(set[str]) -
status(TestStatus | None) -
metadata(dict[str, str | float | bool] | None) -
serial_number(str | None) -
part_number(str | None) -
system_operator(str | None) -
run_id(str | None) -
name(str) -
test_system_name(str) -
test_case(str) -
start_time(datetime) -
end_time(datetime)
TestReportUpdate
pydantic-model
¶
Bases: TestReportBase, ModelUpdate[TestReport]
Update model for TestReport.
Fields:
-
_field_helpers_called(set[str]) -
_resource_id(str | None) -
status(TestStatus | None) -
metadata(dict[str, str | float | bool] | None) -
serial_number(str | None) -
part_number(str | None) -
system_operator(str | None) -
run_id(str | None) -
name(str | None) -
test_system_name(str | None) -
test_case(str | None) -
start_time(datetime | None) -
end_time(datetime | None) -
is_archived(bool | None)
to_proto_with_mask
¶
Convert to proto with field mask.
TestStatus
¶
Bases: Enum
TestStatus enum.
| ATTRIBUTE | DESCRIPTION |
|---|---|
ABORTED |
|
DRAFT |
|
ERROR |
|
FAILED |
|
IN_PROGRESS |
|
PASSED |
|
SKIPPED |
|
UNSPECIFIED |
|
TestStep
pydantic-model
¶
Bases: BaseType[TestStep, 'TestStep']
TestStep model representing a step in a test.
Fields:
-
id_(str | None) -
proto(Any | None) -
_client(SiftClient | None) -
test_report_id(str) -
parent_step_id(str | None) -
name(str) -
description(str | None) -
step_type(TestStepType) -
step_path(str) -
status(TestStatus) -
start_time(datetime) -
end_time(datetime) -
error_info(ErrorInfo | None)
measurements
property
¶
measurements: list[TestMeasurement]
Get the TestMeasurements for the TestStep.
TestStepCreate
pydantic-model
¶
Bases: TestStepBase, ModelCreate[TestStep]
Create model for TestStep.
Fields:
-
_field_helpers_called(set[str]) -
parent_step_id(str | None) -
description(str | None) -
error_info(ErrorInfo | None) -
test_report_id(str) -
name(str) -
step_type(TestStepType) -
step_path(str) -
status(TestStatus) -
start_time(datetime) -
end_time(datetime)