Search documentation of ExStreamClient

# ExStreamClient.Operations.Chat.Campaigns (ExStreamClient v0.1.10)

View Source

Modules for interacting with the `chat/campaigns` group of Stream APIs

API Reference: https://getstream.github.io/protocol/?urls.primaryName=Chat%20v2

### Shared options

All functions in this module accept the following optional parameters:

- `api_key` - API key to use. If not provided, the default key from config will be used
- `api_key_secret` - API key secret to use. If not provided, the default secret from config will be used
- `endpoint` - endpoint to use. If not provided, the default endpoint from config will be used
- `client` - HTTP client to use. Must implement `ExStreamClient.Http.Behavior`. Defaults to `ExStreamClient.Http`
- `req_opts` - all of these options will be forwarded to req. See `Req.new/1` for available options

# Summary

## Types

shared_opts()

## Functions

get_campaign(id, opts \\ [])

Get campaign by ID.

query_campaigns(payload, opts \\ [])

Query campaigns with filter query

schedule_campaign(id, payload, opts \\ [])

Stops a campaign

start_campaign(id, payload, opts \\ [])

Starts or schedules a campaign

# Types

# shared_opts()

    @type shared_opts() :: [
      api_key: String.t(),
      api_key_secret: String.t(),
      client: module(),
      endpoint: String.t(),
      req_opts: keyword()
    ]

# Functions

# get_campaign(id, opts \\ [])

    @spec get_campaign(
      String.t(),
      [
        ({:limit, integer()} | {:next, String.t()} | {:prev, String.t()})
        | shared_opts()
      ]
    ) :: {:ok, ExStreamClient.Model.GetCampaignResponse.t()} | {:error, any()}

Get campaign by ID.

### Required Arguments:

- `id`

### Optional Arguments:

- `limit`
- `next`
- `prev`
- All options from Shared Options are supported.

# query_campaigns(payload, opts \\ [])

    @spec query_campaigns(ExStreamClient.Model.QueryCampaignsRequest.t(), shared_opts()) ::
      {:ok, ExStreamClient.Model.QueryCampaignsResponse.t()} | {:error, any()}

Query campaigns with filter query

### Required Arguments:

- `payload`: `Elixir.ExStreamClient.Model.QueryCampaignsRequest`

### Optional Arguments:

- All options from Shared Options are supported.

# schedule_campaign(id, payload, opts \\ [])

    @spec schedule_campaign(
      String.t(),
      ExStreamClient.Model.StopCampaignRequest.t(),
      shared_opts()
    ) ::
      {:ok, ExStreamClient.Model.CampaignResponse.t()} | {:error, any()}

Stops a campaign

### Required Arguments:

- `id`
- `payload`: `Elixir.ExStreamClient.Model.StopCampaignRequest`

### Optional Arguments:

- All options from Shared Options are supported.

# start_campaign(id, payload, opts \\ [])

    @spec start_campaign(
      String.t(),
      ExStreamClient.Model.StartCampaignRequest.t(),
      shared_opts()
    ) ::
      {:ok, ExStreamClient.Model.StartCampaignResponse.t()} | {:error, any()}

Starts or schedules a campaign

### Required Arguments:

- `id`
- `payload`: `Elixir.ExStreamClient.Model.StartCampaignRequest`

### Optional Arguments:

- All options from Shared Options are supported.