Search documentation of ExStreamClient

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

View Source

Modules for interacting with the `chat/threads` 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_thread(message_id, opts \\ [])

Return a specific thread

query_threads(payload, opts \\ [])

Returns the list of threads for specific user

update_thread_partial(message_id, payload, opts \\ [])

Updates certain fields of the thread

# 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_thread(message_id, opts \\ [])

    @spec get_thread(
      String.t(),
      [
        ({:member_limit, integer()}
         | {:participant_limit, integer()}
         | {:reply_limit, integer()})
        | shared_opts()
      ]
    ) :: {:ok, ExStreamClient.Model.GetThreadResponse.t()} | {:error, any()}

Return a specific thread

### Required Arguments:

- `message_id`

### Optional Arguments:

- `member_limit`
- `participant_limit`
- `reply_limit`
- All options from Shared Options are supported.

# query_threads(payload, opts \\ [])

    @spec query_threads(ExStreamClient.Model.QueryThreadsRequest.t(), shared_opts()) ::
      {:ok, ExStreamClient.Model.QueryThreadsResponse.t()} | {:error, any()}

Returns the list of threads for specific user

### Required Arguments:

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

### Optional Arguments:

- All options from Shared Options are supported.

# update_thread_partial(message_id, payload, opts \\ [])

    @spec update_thread_partial(
      String.t(),
      ExStreamClient.Model.UpdateThreadPartialRequest.t(),
      shared_opts()
    ) ::
      {:ok, ExStreamClient.Model.UpdateThreadPartialResponse.t()} | {:error, any()}

Updates certain fields of the thread

### Sends events:

- `thread.updated`
- `thread.updated`

### Required Arguments:

- `message_id`
- `payload`: `Elixir.ExStreamClient.Model.UpdateThreadPartialRequest`

### Optional Arguments:

- All options from Shared Options are supported.