pub struct LoopsClient { /* private fields */ }Expand description
High-level client for the Loops API.
Wraps every Loops endpoint with typed arguments, maps failures to
LoopsError, and enforces safe mode. Cloning is cheap: clones share the
underlying connection pool.
use loops_so::{ContactFields, ContactId, LoopsClient};
let client = LoopsClient::builder().api_key("your_api_key").build()?;
client
.upsert_contact(
ContactId::email("user@example.com"),
ContactFields::new().first_name("John"),
)
.await?;Implementations§
Source§impl LoopsClient
impl LoopsClient
Sourcepub async fn list_campaigns(&self, page: Page) -> Result<ListCampaignsResponse>
pub async fn list_campaigns(&self, page: Page) -> Result<ListCampaignsResponse>
List campaigns.
Sourcepub async fn get_campaign(&self, campaign_id: &str) -> Result<CampaignResponse>
pub async fn get_campaign(&self, campaign_id: &str) -> Result<CampaignResponse>
Get a campaign.
Sourcepub async fn create_campaign(
&self,
name: &str,
) -> Result<CreateCampaignResponse>
pub async fn create_campaign( &self, name: &str, ) -> Result<CreateCampaignResponse>
Create a draft campaign, together with its email message.
Sourcepub async fn update_campaign(
&self,
campaign_id: &str,
name: &str,
) -> Result<CampaignResponse>
pub async fn update_campaign( &self, campaign_id: &str, name: &str, ) -> Result<CampaignResponse>
Rename a campaign.
Sourcepub async fn get_campaign_metrics(
&self,
campaign_id: &str,
) -> Result<EmailMetricsResponse>
pub async fn get_campaign_metrics( &self, campaign_id: &str, ) -> Result<EmailMetricsResponse>
All-time engagement metrics of a sent campaign. Opens and clicks count sends, not events: a send opened five times counts once.
§Errors
LoopsError::Api with status 400 when the
campaign has not been sent or has no email message.
Source§impl LoopsClient
impl LoopsClient
Sourcepub async fn create_contact(
&self,
email: &str,
user_id: Option<&str>,
fields: ContactFields,
) -> Result<ContactSuccessResponse>
pub async fn create_contact( &self, email: &str, user_id: Option<&str>, fields: ContactFields, ) -> Result<ContactSuccessResponse>
Create a contact.
Fails with LoopsError::ContactExists when a contact with this email
or user ID already exists; use upsert_contact
to create or update.
Sourcepub async fn upsert_contact(
&self,
contact: ContactId,
fields: ContactFields,
) -> Result<ContactSuccessResponse>
pub async fn upsert_contact( &self, contact: ContactId, fields: ContactFields, ) -> Result<ContactSuccessResponse>
Create a contact, or update the one matching contact.
To change a contact’s email address the contact needs a user ID: pass
ContactId::Both and Loops matches on either value.
Sourcepub async fn find_contact(
&self,
contact: ContactId,
) -> Result<Option<Vec<Contact>>>
pub async fn find_contact( &self, contact: ContactId, ) -> Result<Option<Vec<Contact>>>
Find a contact by email or user ID.
Returns None when Loops answers the lookup with a failure (400 or
404) rather than raising, and Some with the matches otherwise. An
unknown contact is usually Some(vec![]). The contacts carry their
custom properties in Contact::properties.
§Errors
LoopsError::InvalidInput for ContactId::Both: Loops looks up
by exactly one identifier.
Sourcepub async fn delete_contact(&self, contact: ContactId) -> Result<bool>
pub async fn delete_contact(&self, contact: ContactId) -> Result<bool>
Delete a contact by email or user ID.
Returns true once deleted and false when Loops answers with a
failure (400 or 404), e.g. because no such contact exists.
§Errors
LoopsError::InvalidInput for ContactId::Both: Loops deletes by
exactly one identifier.
Sourcepub async fn create_contact_property(
&self,
name: &str,
property_type: ContactPropertyCreateRequestType,
) -> Result<Value>
pub async fn create_contact_property( &self, name: &str, property_type: ContactPropertyCreateRequestType, ) -> Result<Value>
Create a custom contact property.
Returns the response body as JSON, since Loops answers with more fields than the spec documents.
Sourcepub async fn list_contact_properties(&self) -> Result<Vec<ContactProperty>>
pub async fn list_contact_properties(&self) -> Result<Vec<ContactProperty>>
List every contact property, default and custom.
Sourcepub async fn list_mailing_lists(&self) -> Result<Vec<MailingList>>
pub async fn list_mailing_lists(&self) -> Result<Vec<MailingList>>
List the team’s mailing lists.
Sourcepub async fn list_sending_ips(&self) -> Result<Vec<String>>
pub async fn list_sending_ips(&self) -> Result<Vec<String>>
List Loops’ dedicated sending IP addresses.
Sourcepub async fn get_contact_suppression(
&self,
contact: ContactId,
) -> Result<ContactSuppressionStatusResponse>
pub async fn get_contact_suppression( &self, contact: ContactId, ) -> Result<ContactSuppressionStatusResponse>
Get a contact’s suppression status and the remaining removal quota.
§Errors
Sourcepub async fn remove_contact_suppression(
&self,
contact: ContactId,
) -> Result<ContactSuppressionRemoveResponse>
pub async fn remove_contact_suppression( &self, contact: ContactId, ) -> Result<ContactSuppressionRemoveResponse>
Source§impl LoopsClient
impl LoopsClient
Sourcepub async fn get_email_message(
&self,
email_message_id: &str,
) -> Result<EmailMessageResponse>
pub async fn get_email_message( &self, email_message_id: &str, ) -> Result<EmailMessageResponse>
Get an email message.
Sourcepub async fn update_email_message(
&self,
email_message_id: &str,
update: EmailMessageUpdate,
) -> Result<EmailMessageResponse>
pub async fn update_email_message( &self, email_message_id: &str, update: EmailMessageUpdate, ) -> Result<EmailMessageResponse>
Update an email message. Only the fields set on update change.
§Errors
LoopsError::UnsafeEmail when safe mode is on and the CC or BCC
address is outside the allowed domains: those addresses receive every
email sent from the message. LoopsError::Api with status 409 when
expected_revision_id is stale.
Sourcepub async fn get_email_message_guardian(
&self,
email_message_id: &str,
) -> Result<EmailMessageGuardianResponse>
pub async fn get_email_message_guardian( &self, email_message_id: &str, ) -> Result<EmailMessageGuardianResponse>
Run Guardian content checks against a saved email message: missing or invalid links, unsupported properties, malformed buttons, missing required data variables and the like. MJML messages are not supported.
Sourcepub async fn preview_email_message(
&self,
email_message_id: &str,
emails: &[&str],
options: PreviewOptions,
) -> Result<EmailMessagePreviewResponse>
pub async fn preview_email_message( &self, email_message_id: &str, emails: &[&str], options: PreviewOptions, ) -> Result<EmailMessagePreviewResponse>
Send a preview of an email message to one or more addresses, each checked against safe mode.
Sourcepub async fn create_upload(
&self,
content_type: &str,
content_length: u64,
) -> Result<CreateUploadResponse>
pub async fn create_upload( &self, content_type: &str, content_length: u64, ) -> Result<CreateUploadResponse>
Start an asset upload. Upload the file to the returned presigned URL,
then call complete_upload.
Sourcepub async fn complete_upload(
&self,
upload_id: &str,
) -> Result<CompleteUploadResponse>
pub async fn complete_upload( &self, upload_id: &str, ) -> Result<CompleteUploadResponse>
Mark an upload as complete.
Loops reports an exceeded upload limit as HTTP 429, which surfaces as
LoopsError::RateLimit.
Source§impl LoopsClient
impl LoopsClient
Sourcepub async fn send_event(
&self,
event_name: &str,
contact: ContactId,
options: EventOptions,
) -> Result<EventSuccessResponse>
pub async fn send_event( &self, event_name: &str, contact: ContactId, options: EventOptions, ) -> Result<EventSuccessResponse>
Send an event to trigger workflows and emails for a contact.
An idempotency key is generated when options does not carry one.
Source§impl LoopsClient
impl LoopsClient
Sourcepub async fn list_campaign_groups(
&self,
page: Page,
) -> Result<ListGroupsResponse>
pub async fn list_campaign_groups( &self, page: Page, ) -> Result<ListGroupsResponse>
List campaign groups.
Sourcepub async fn get_campaign_group(
&self,
campaign_group_id: &str,
) -> Result<GroupResponse>
pub async fn get_campaign_group( &self, campaign_group_id: &str, ) -> Result<GroupResponse>
Get a campaign group.
Sourcepub async fn create_campaign_group(
&self,
name: &str,
description: Option<&str>,
) -> Result<GroupResponse>
pub async fn create_campaign_group( &self, name: &str, description: Option<&str>, ) -> Result<GroupResponse>
Create a campaign group.
Sourcepub async fn update_campaign_group(
&self,
campaign_group_id: &str,
name: Option<&str>,
description: Option<&str>,
) -> Result<GroupResponse>
pub async fn update_campaign_group( &self, campaign_group_id: &str, name: Option<&str>, description: Option<&str>, ) -> Result<GroupResponse>
Rename a campaign group and/or change its description.
Sourcepub async fn list_transactional_groups(
&self,
page: Page,
) -> Result<ListGroupsResponse>
pub async fn list_transactional_groups( &self, page: Page, ) -> Result<ListGroupsResponse>
List transactional groups.
Sourcepub async fn get_transactional_group(
&self,
transactional_group_id: &str,
) -> Result<GroupResponse>
pub async fn get_transactional_group( &self, transactional_group_id: &str, ) -> Result<GroupResponse>
Get a transactional group.
Sourcepub async fn create_transactional_group(
&self,
name: &str,
description: Option<&str>,
) -> Result<GroupResponse>
pub async fn create_transactional_group( &self, name: &str, description: Option<&str>, ) -> Result<GroupResponse>
Create a transactional group.
Sourcepub async fn update_transactional_group(
&self,
transactional_group_id: &str,
name: Option<&str>,
description: Option<&str>,
) -> Result<GroupResponse>
pub async fn update_transactional_group( &self, transactional_group_id: &str, name: Option<&str>, description: Option<&str>, ) -> Result<GroupResponse>
Rename a transactional group and/or change its description.
Sourcepub async fn list_workflow_groups(
&self,
page: Page,
) -> Result<ListGroupsResponse>
pub async fn list_workflow_groups( &self, page: Page, ) -> Result<ListGroupsResponse>
List workflow groups, most recently created first.
Sourcepub async fn get_workflow_group(
&self,
workflow_group_id: &str,
) -> Result<GroupResponse>
pub async fn get_workflow_group( &self, workflow_group_id: &str, ) -> Result<GroupResponse>
Get a workflow group.
Sourcepub async fn create_workflow_group(
&self,
name: &str,
description: Option<&str>,
) -> Result<GroupResponse>
pub async fn create_workflow_group( &self, name: &str, description: Option<&str>, ) -> Result<GroupResponse>
Create a workflow group.
Sourcepub async fn update_workflow_group(
&self,
workflow_group_id: &str,
name: Option<&str>,
description: Option<&str>,
) -> Result<GroupResponse>
pub async fn update_workflow_group( &self, workflow_group_id: &str, name: Option<&str>, description: Option<&str>, ) -> Result<GroupResponse>
Rename a workflow group and/or change its description.
The reserved “Unsorted” group cannot be edited.
Source§impl LoopsClient
impl LoopsClient
Sourcepub async fn list_audience_segments(
&self,
page: Page,
) -> Result<ListAudienceSegmentsResponse>
pub async fn list_audience_segments( &self, page: Page, ) -> Result<ListAudienceSegmentsResponse>
List audience segments, most recently created first.
Sourcepub async fn get_audience_segment(
&self,
audience_segment_id: &str,
) -> Result<AudienceSegmentResponse>
pub async fn get_audience_segment( &self, audience_segment_id: &str, ) -> Result<AudienceSegmentResponse>
Get an audience segment.
Sourcepub async fn create_audience_segment(
&self,
name: &str,
filter: Value,
description: Option<&str>,
) -> Result<AudienceSegmentResponse>
pub async fn create_audience_segment( &self, name: &str, filter: Value, description: Option<&str>, ) -> Result<AudienceSegmentResponse>
Create an audience segment.
filter is the segment’s condition tree, e.g.
{"match": "all", "conditions": [{"type": "property", "key": "plan", "operator": "equals", "value": "pro"}]}. match is "all" or
"any"; each condition is a property, optIn or activity
condition (see the Loops docs for the grammar).
Sourcepub async fn list_event_patterns(
&self,
page: Page,
) -> Result<ListEventPatternsResponse>
pub async fn list_event_patterns( &self, page: Page, ) -> Result<ListEventPatternsResponse>
List event patterns: the event types workflow triggers can listen for, custom or from integrated webhook platforms.
Sourcepub async fn get_event_pattern(
&self,
event_pattern_id: &str,
) -> Result<EventPattern>
pub async fn get_event_pattern( &self, event_pattern_id: &str, ) -> Result<EventPattern>
Get an event pattern by ID.
Sourcepub async fn get_event_pattern_by_name(
&self,
event_name: &str,
) -> Result<EventPattern>
pub async fn get_event_pattern_by_name( &self, event_name: &str, ) -> Result<EventPattern>
Get an event pattern by its case-sensitive event name.
Source§impl LoopsClient
impl LoopsClient
Sourcepub async fn list_components(
&self,
page: Page,
) -> Result<ListComponentsResponse>
pub async fn list_components( &self, page: Page, ) -> Result<ListComponentsResponse>
List components.
Sourcepub async fn get_component(
&self,
component_id: &str,
) -> Result<ComponentResponse>
pub async fn get_component( &self, component_id: &str, ) -> Result<ComponentResponse>
Get a component.
Sourcepub async fn create_component(
&self,
name: &str,
lmx: &str,
) -> Result<ComponentResponse>
pub async fn create_component( &self, name: &str, lmx: &str, ) -> Result<ComponentResponse>
Create a component from an LMX body.
Sourcepub async fn update_component(
&self,
component_id: &str,
name: Option<&str>,
lmx: Option<&str>,
) -> Result<UpdateComponentResponse>
pub async fn update_component( &self, component_id: &str, name: Option<&str>, lmx: Option<&str>, ) -> Result<UpdateComponentResponse>
Rename a component and/or replace its LMX body. Changing the body
updates every email using the component; the response counts them in
affected_email_count.
Sourcepub async fn list_themes(&self, page: Page) -> Result<ListThemesResponse>
pub async fn list_themes(&self, page: Page) -> Result<ListThemesResponse>
List themes.
Sourcepub async fn get_theme(&self, theme_id: &str) -> Result<ThemeResponse>
pub async fn get_theme(&self, theme_id: &str) -> Result<ThemeResponse>
Get a theme.
Sourcepub async fn create_theme(
&self,
name: &str,
styles: Option<ThemeStyles>,
) -> Result<ThemeResponse>
pub async fn create_theme( &self, name: &str, styles: Option<ThemeStyles>, ) -> Result<ThemeResponse>
Create a theme. styles mirrors the attributes of the LMX <Style />
tag; unset fields keep the Loops defaults.
Sourcepub async fn update_theme(
&self,
theme_id: &str,
name: Option<&str>,
styles: Option<ThemeStyles>,
) -> Result<UpdateThemeResponse>
pub async fn update_theme( &self, theme_id: &str, name: Option<&str>, styles: Option<ThemeStyles>, ) -> Result<UpdateThemeResponse>
Rename a theme and/or change its styles. Changing styles updates every
email using the theme; the response counts them in
affected_email_count.
Source§impl LoopsClient
impl LoopsClient
Sourcepub async fn send_transactional_email(
&self,
transactional_id: &str,
email: &str,
options: TransactionalOptions,
) -> Result<TransactionalSuccessResponse>
pub async fn send_transactional_email( &self, transactional_id: &str, email: &str, options: TransactionalOptions, ) -> Result<TransactionalSuccessResponse>
Send a transactional email.
An idempotency key is generated when options does not carry one.
§Errors
LoopsError::Api with status 404 when the transactional email does
not exist, 409 when the idempotency key was already used, and 400 for
other rejections such as an unpublished template.
Sourcepub async fn list_transactional_emails(
&self,
page: Page,
) -> Result<TransactionalEmailsResponse>
pub async fn list_transactional_emails( &self, page: Page, ) -> Result<TransactionalEmailsResponse>
List published transactional emails.
Sourcepub async fn list_transactional_templates(
&self,
page: Page,
) -> Result<ListTransactionalsResourceResponse>
pub async fn list_transactional_templates( &self, page: Page, ) -> Result<ListTransactionalsResourceResponse>
List transactional email templates, drafts included.
Sourcepub async fn get_transactional_template(
&self,
transactional_id: &str,
) -> Result<TransactionalResource>
pub async fn get_transactional_template( &self, transactional_id: &str, ) -> Result<TransactionalResource>
Get a transactional email template.
Sourcepub async fn get_transactional_variables(
&self,
transactional_id: &str,
) -> Result<Vec<String>>
pub async fn get_transactional_variables( &self, transactional_id: &str, ) -> Result<Vec<String>>
The names of the data variables a transactional email template
expects, for building the data_variables of
send_transactional_email. Empty for
unpublished templates.
Sourcepub async fn get_transactional_template_metrics(
&self,
transactional_id: &str,
) -> Result<TransactionalMetricsResponse>
pub async fn get_transactional_template_metrics( &self, transactional_id: &str, ) -> Result<TransactionalMetricsResponse>
All-time delivery metrics of a transactional email template, totalled across its published versions.
Sourcepub async fn create_transactional_template(
&self,
name: &str,
transactional_group_id: Option<&str>,
) -> Result<TransactionalDraftResponse>
pub async fn create_transactional_template( &self, name: &str, transactional_group_id: Option<&str>, ) -> Result<TransactionalDraftResponse>
Create a draft transactional email template.
Sourcepub async fn update_transactional_template(
&self,
transactional_id: &str,
name: Option<&str>,
transactional_group_id: Option<&str>,
) -> Result<TransactionalResource>
pub async fn update_transactional_template( &self, transactional_id: &str, name: Option<&str>, transactional_group_id: Option<&str>, ) -> Result<TransactionalResource>
Rename a transactional email template or move it to another group.
Sourcepub async fn draft_transactional_template(
&self,
transactional_id: &str,
) -> Result<TransactionalDraftResponse>
pub async fn draft_transactional_template( &self, transactional_id: &str, ) -> Result<TransactionalDraftResponse>
Create the draft of a transactional email template, or return the existing one.
Sourcepub async fn publish_transactional_template(
&self,
transactional_id: &str,
) -> Result<TransactionalResource>
pub async fn publish_transactional_template( &self, transactional_id: &str, ) -> Result<TransactionalResource>
Publish the draft of a transactional email template.
Source§impl LoopsClient
impl LoopsClient
Sourcepub async fn get_workflow_node(
&self,
workflow_id: &str,
node_id: &str,
) -> Result<Value>
pub async fn get_workflow_node( &self, workflow_id: &str, node_id: &str, ) -> Result<Value>
Get a workflow node as JSON; its shape depends on typeName.
Sourcepub async fn get_workflow_node_metrics(
&self,
workflow_id: &str,
node_id: &str,
) -> Result<EmailMetricsResponse>
pub async fn get_workflow_node_metrics( &self, workflow_id: &str, node_id: &str, ) -> Result<EmailMetricsResponse>
All-time engagement metrics of a SendEmailAction node. Any other
node type fails with 400; a node that has not sent yet reports zeros.
Sourcepub async fn create_workflow_node(
&self,
workflow_id: &str,
node_type: CreateWorkflowNodeTypeName,
expected_revision_id: Option<&str>,
placement: NodePlacement,
) -> Result<Value>
pub async fn create_workflow_node( &self, workflow_id: &str, node_type: CreateWorkflowNodeTypeName, expected_revision_id: Option<&str>, placement: NodePlacement, ) -> Result<Value>
Add a node to a workflow at placement. The node is created with
default settings; configure it with
update_workflow_node.
Returns the response as JSON: the created node and the updated
workflow.
Sourcepub async fn update_workflow_node(
&self,
workflow_id: &str,
node_id: &str,
expected_revision_id: Option<&str>,
payload: Value,
) -> Result<Value>
pub async fn update_workflow_node( &self, workflow_id: &str, node_id: &str, expected_revision_id: Option<&str>, payload: Value, ) -> Result<Value>
Update a node’s settings. payload holds the node-type-specific
fields, e.g. {"amount": 2, "unit": "d"} for a TimerAction.
Returns the response as JSON: the updated node’s fields plus the
latest workflow.
Sourcepub async fn add_workflow_branch(
&self,
workflow_id: &str,
node_id: &str,
expected_revision_id: Option<&str>,
) -> Result<AddWorkflowBranchResponse>
pub async fn add_workflow_branch( &self, workflow_id: &str, node_id: &str, expected_revision_id: Option<&str>, ) -> Result<AddWorkflowBranchResponse>
Add an unconfigured branch to a BranchNode or ExperimentBranchNode.
Sourcepub async fn reroute_workflow_node_connection(
&self,
workflow_id: &str,
node_id: &str,
expected_revision_id: Option<&str>,
new_target_node_id: &str,
) -> Result<Value>
pub async fn reroute_workflow_node_connection( &self, workflow_id: &str, node_id: &str, expected_revision_id: Option<&str>, new_target_node_id: &str, ) -> Result<Value>
Move the single outgoing connection of node_id to
new_target_node_id. Branch nodes have several outputs and cannot be
rerouted this way; the old target must keep another incoming
connection.
Returns the response as JSON: the updated source node plus the latest
workflow.
Sourcepub async fn delete_workflow_node(
&self,
workflow_id: &str,
node_id: &str,
expected_revision_id: Option<&str>,
options: DeleteNodeOptions,
) -> Result<DeleteWorkflowNodeResponse>
pub async fn delete_workflow_node( &self, workflow_id: &str, node_id: &str, expected_revision_id: Option<&str>, options: DeleteNodeOptions, ) -> Result<DeleteWorkflowNodeResponse>
Delete a node, or with DeleteNodeOptions::recursive the node and
everything downstream of it.
With dry_run, or when contacts are queued at the node, Loops answers
with a preview instead of deleting.
Source§impl LoopsClient
impl LoopsClient
Sourcepub async fn list_workflows(&self, page: Page) -> Result<ListWorkflowsResponse>
pub async fn list_workflows(&self, page: Page) -> Result<ListWorkflowsResponse>
List workflows.
Sourcepub async fn get_workflow(
&self,
workflow_id: &str,
) -> Result<SimplifiedWorkflow>
pub async fn get_workflow( &self, workflow_id: &str, ) -> Result<SimplifiedWorkflow>
Get a workflow with its node graph.
Sourcepub async fn create_workflow(
&self,
name: &str,
description: Option<&str>,
mailing_list_id: Option<&str>,
workflow_group_id: Option<&str>,
) -> Result<SimplifiedWorkflow>
pub async fn create_workflow( &self, name: &str, description: Option<&str>, mailing_list_id: Option<&str>, workflow_group_id: Option<&str>, ) -> Result<SimplifiedWorkflow>
Create a draft workflow with a blank trigger and an exit node. Build out its graph with the workflow node methods.
Without workflow_group_id, Loops files the workflow in the team’s
Unsorted group.
Sourcepub async fn update_workflow(
&self,
workflow_id: &str,
expected_revision_id: Option<&str>,
name: Option<&str>,
description: Option<&str>,
workflow_group_id: Option<&str>,
) -> Result<SimplifiedWorkflow>
pub async fn update_workflow( &self, workflow_id: &str, expected_revision_id: Option<&str>, name: Option<&str>, description: Option<&str>, workflow_group_id: Option<&str>, ) -> Result<SimplifiedWorkflow>
Rename a workflow, change its description, and/or move it to another
workflow group. At least one of the three must be Some, or the call
fails with LoopsError::InvalidInput before any request is sent.
expected_revision_id is the optimistic concurrency token: pass the
latest workflow_revision_id, or None for a workflow that has none
yet. A stale value fails with 409.
Sourcepub async fn change_workflow_mailing_list(
&self,
workflow_id: &str,
expected_revision_id: Option<&str>,
mailing_list_id: Option<&str>,
dry_run: Option<bool>,
queued_contact_policy: Option<WorkflowQueuedContactPolicy>,
) -> Result<ChangeWorkflowMailingListResponse>
pub async fn change_workflow_mailing_list( &self, workflow_id: &str, expected_revision_id: Option<&str>, mailing_list_id: Option<&str>, dry_run: Option<bool>, queued_contact_policy: Option<WorkflowQueuedContactPolicy>, ) -> Result<ChangeWorkflowMailingListResponse>
Set (Some) or clear (None) the mailing list of a workflow.
With dry_run, or when contacts queued in the workflow would be
excluded by the new list, Loops answers with a preview instead of
applying the change; retry with
WorkflowQueuedContactPolicy::Discard to apply it and discard them.
Sourcepub async fn delete_workflow(
&self,
workflow_id: &str,
expected_revision_id: Option<&str>,
confirm_delete: Option<bool>,
) -> Result<bool>
pub async fn delete_workflow( &self, workflow_id: &str, expected_revision_id: Option<&str>, confirm_delete: Option<bool>, ) -> Result<bool>
Delete a workflow. Returns true once deleted.
A workflow that is sending or still has queued contacts is not deleted
on the first attempt: Loops answers 409 saying what stands in the way.
Retry with confirm_delete: Some(true) to delete it, stop sending and
cancel the queued contacts.
Source§impl LoopsClient
impl LoopsClient
Sourcepub fn builder() -> LoopsClientBuilder
pub fn builder() -> LoopsClientBuilder
Start building a client.
Sourcepub fn low_level(&self) -> Result<LoopsOpenApiSpecClient>
pub fn low_level(&self) -> Result<LoopsOpenApiSpecClient>
A low-level generated client that shares this client’s base URL and API key. Use it for endpoints or options the high-level methods do not expose. Each call builds a new connection pool, so keep the result rather than calling this per request.
§Errors
LoopsError::Http when the underlying reqwest client cannot be built.