ConvergerClient.Model (converger_client v0.1.1)

Copy Markdown View Source

Defines response structs from a field list.

use ConvergerClient.Model,
  fields: [conversation_id: "conversationId", token: "token", from: {"from", ConvergerClient.ChannelAccount}]

Each field maps a struct key to a wire key, optionally with a nested model (applied to a map, or to every element of a list). Unknown wire keys are kept in :extra, so fields the server adds later are not lost.

The models are hand-written today. Once the OpenAPI document of #45 ships at priv/static/openapi.json, they are checked against it (see the README).