Search documentation of ExStreamClient

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

View Source

Modules for interacting with the `chat/segments` 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

delete_segment(id, opts \\ [])

Delete a segment

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

Delete targets from a segment

get_segment(id, opts \\ [])

Get segment

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

Query segment targets

query_segments(payload, opts \\ [])

Query segments

segment_target_exists(id, target_id, opts \\ [])

Check whether a target exists in a segment. Returns 200 if the target exists, 404 otherwise

# Types

# shared_opts()

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

# Functions

# delete_segment(id, opts \\ [])

    @spec delete_segment(String.t(), shared_opts()) ::
      {:ok, ExStreamClient.Model.Response.t()} | {:error, any()}

Delete a segment

### Required Arguments:

- `id`

### Optional Arguments:

- All options from Shared Options are supported.

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

    @spec delete_segment_targets(
      String.t(),
      ExStreamClient.Model.DeleteSegmentTargetsRequest.t(),
      shared_opts()
    ) :: {:ok, ExStreamClient.Model.Response.t()} | {:error, any()}

Delete targets from a segment

### Required Arguments:

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

### Optional Arguments:

- All options from Shared Options are supported.

# get_segment(id, opts \\ [])

    @spec get_segment(String.t(), shared_opts()) ::
      {:ok, ExStreamClient.Model.GetSegmentResponse.t()} | {:error, any()}

Get segment

### Required Arguments:

- `id`

### Optional Arguments:

- All options from Shared Options are supported.

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

    @spec query_segment_targets(
      String.t(),
      ExStreamClient.Model.QuerySegmentTargetsRequest.t(),
      shared_opts()
    ) ::
      {:ok, ExStreamClient.Model.QuerySegmentTargetsResponse.t()} | {:error, any()}

Query segment targets

### Required Arguments:

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

### Optional Arguments:

- All options from Shared Options are supported.

# query_segments(payload, opts \\ [])

    @spec query_segments(ExStreamClient.Model.QuerySegmentsRequest.t(), shared_opts()) ::
      {:ok, ExStreamClient.Model.QuerySegmentsResponse.t()} | {:error, any()}

Query segments

### Required Arguments:

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

### Optional Arguments:

- All options from Shared Options are supported.

# segment_target_exists(id, target_id, opts \\ [])

    @spec segment_target_exists(String.t(), String.t(), shared_opts()) ::
      {:ok, ExStreamClient.Model.Response.t()} | {:error, any()}

Check whether a target exists in a segment. Returns 200 if the target exists, 404 otherwise

### Required Arguments:

- `id`
- `target_id`

### Optional Arguments:

- All options from Shared Options are supported.