Guava.Campaigns (Guava v0.34.0)

Copy Markdown View Source

List, fetch, and manage outbound campaigns and their contacts.

Summary

Types

result(x)

@type result(x) :: {:ok, x} | {:error, Guava.Error.t()}

Functions

delete(client, campaign_id)

@spec delete(Guava.Client.t(), String.t()) :: result(map())

Delete a campaign.

delete!(client, campaign_id)

@spec delete!(Guava.Client.t(), String.t()) :: map()

get_by_code(client, campaign_code)

@spec get_by_code(Guava.Client.t(), String.t()) :: result(Guava.Campaign.t())

Fetch a campaign by its code.

get_by_code!(client, campaign_code)

@spec get_by_code!(Guava.Client.t(), String.t()) :: Guava.Campaign.t()

has_callable_contacts(client, campaign_id)

@spec has_callable_contacts(Guava.Client.t(), String.t()) :: result(boolean())

Whether a campaign has contacts left to call. Returns {:ok, boolean}.

has_callable_contacts!(client, campaign_id)

@spec has_callable_contacts!(Guava.Client.t(), String.t()) :: boolean()

list(client)

@spec list(Guava.Client.t()) :: result([Guava.Campaign.t()])

List all campaigns.

list!(client)

@spec list!(Guava.Client.t()) :: [Guava.Campaign.t()]

status(client, campaign_id)

@spec status(Guava.Client.t(), String.t()) :: result(map())

Get a campaign's status.

status!(client, campaign_id)

@spec status!(Guava.Client.t(), String.t()) :: map()

update(client, campaign_id, attrs)

@spec update(Guava.Client.t(), String.t(), map()) :: result(map())

Update a campaign's attributes (e.g. %{enabled: false}).

update!(client, campaign_id, attrs)

@spec update!(Guava.Client.t(), String.t(), map()) :: map()

upload_contacts(client, campaign_code, contacts, opts \\ [])

@spec upload_contacts(Guava.Client.t(), String.t(), [Guava.Contact.t()], keyword()) ::
  result(map())

Upload contacts to a campaign by code (v2 endpoint).

Options

  • :allow_duplicates (default false)
  • :accepted_terms_of_service (default false)
  • :outreach_modalities — applied to contacts that don't set their own.

upload_contacts!(client, campaign_code, contacts, opts \\ [])

@spec upload_contacts!(Guava.Client.t(), String.t(), [Guava.Contact.t()], keyword()) ::
  map()