Skip to content

sift_py.report_templates.service

CLASS DESCRIPTION
ReportTemplateService

A service for managing report templates. Allows for creating, updating, and retrieving report

ReportTemplateService

ReportTemplateService(channel: SiftChannel)

A service for managing report templates. Allows for creating, updating, and retrieving report templates.

METHOD DESCRIPTION
create_or_update_report_template

Create or update a report template via a ReportTemplateConfig. The config must contain a

get_report_template

Retrieve a report template by client key or id. Only one of client_key or id should be

load_report_templates_from_yaml

Load report templates from YAML definitions. The YAML defined report template must have

create_or_update_report_template

create_or_update_report_template(
    config: ReportTemplateConfig,
    updates: Optional[ReportTemplateUpdate] = None,
)

Create or update a report template via a ReportTemplateConfig. The config must contain a template_client_key, otherwise an exception will be raised. If a report template with the same client key exists, it will be updated. Otherwise, a new report template will be created. See sift_py.report_templates.config.ReportTemplateConfig for more information on available fields to configure.

get_report_template

get_report_template(
    client_key: Optional[str] = None,
    id: Optional[str] = None,
) -> Optional[ReportTemplateConfig]

Retrieve a report template by client key or id. Only one of client_key or id should be provided, otherwise an exception will be raised. If a report template is found, it will be returned as a ReportTemplateConfig object.

load_report_templates_from_yaml

load_report_templates_from_yaml(
    paths: List[Path],
) -> List[ReportTemplateConfig]

Load report templates from YAML definitions. The YAML defined report template must have a client key. If the report template with the given client key exists, it will be updated, otherwise a new report template will be created. See sift_py.yaml.report_templates.load_report_templates for more information on the YAML spec for report templates.