Chatto.Api.V1.AssetService (chatto v0.1.0)

Copy Markdown View Source

Reads room-scoped asset metadata and freshly signed asset URLs.

Summary

Functions

Reads many assets in one room. Authentication and room membership are required. Assets also require message.read or a matching thread relationship with message.read-interactions. Missing, deleted, wrong-room, and inaccessible asset IDs are omitted. Results preserve first-seen request order, and repeated asset IDs are de-duplicated.

Reads one asset. Authentication and room membership are required. Assets also require message.read or a matching thread relationship with message.read-interactions. Returns NOT_FOUND when the asset is missing, deleted, or owned by a different room.

Functions

batch_get_assets(client, request)

@spec batch_get_assets(Req.Request.t(), Chatto.Api.V1.BatchGetAssetsRequest.t()) ::
  {:ok, Chatto.Api.V1.BatchGetAssetsResponse.t()}
  | {:error, Chatto.Connect.Error.t()}

Reads many assets in one room. Authentication and room membership are required. Assets also require message.read or a matching thread relationship with message.read-interactions. Missing, deleted, wrong-room, and inaccessible asset IDs are omitted. Results preserve first-seen request order, and repeated asset IDs are de-duplicated.

get_asset(client, request)

@spec get_asset(Req.Request.t(), Chatto.Api.V1.GetAssetRequest.t()) ::
  {:ok, Chatto.Api.V1.GetAssetResponse.t()} | {:error, Chatto.Connect.Error.t()}

Reads one asset. Authentication and room membership are required. Assets also require message.read or a matching thread relationship with message.read-interactions. Returns NOT_FOUND when the asset is missing, deleted, or owned by a different room.