Polymarket.Schemas.Series (Polymarket v0.1.1)

Copy Markdown View Source

A series an Event belongs to, as returned by the Gamma API (e.g. nested in GET /events/keyset).

A series groups recurring events together (e.g. all "NBA" games). The Gamma API delivers its keys in camelCase; from_attrs/1 normalises them to the snake_case fields below. Field coverage follows the Gamma OpenAPI Series schema; the nested relational objects (events, tags, categories, collections, chats) are intentionally omitted as they are not returned when a series is nested inside an event.

Summary

Functions

Builds a Series from the raw (JSON-decoded) Gamma attributes. Keys may be in camelCase (atom or string); they are normalised to the snake_case fields and each value is coerced to its field type.

Types

t()

@type t() :: %Polymarket.Schemas.Series{
  active: boolean() | nil,
  archived: boolean() | nil,
  closed: boolean() | nil,
  comment_count: integer() | nil,
  comments_enabled: boolean() | nil,
  competitive: String.t() | nil,
  created_at: DateTime.t() | nil,
  created_by: String.t() | nil,
  description: String.t() | nil,
  featured: boolean() | nil,
  icon: String.t() | nil,
  id: String.t() | nil,
  image: String.t() | nil,
  layout: String.t() | nil,
  liquidity: float() | nil,
  new: boolean() | nil,
  published_at: DateTime.t() | nil,
  recurrence: String.t() | nil,
  requires_translation: boolean() | nil,
  restricted: boolean() | nil,
  series_type: String.t() | nil,
  slug: String.t() | nil,
  start_date: DateTime.t() | nil,
  ticker: String.t() | nil,
  title: String.t() | nil,
  updated_at: DateTime.t() | nil,
  updated_by: String.t() | nil,
  volume: float() | nil,
  volume24hr: float() | nil
}

Functions

from_attrs(attrs)

@spec from_attrs(map()) :: {:ok, t()}

Builds a Series from the raw (JSON-decoded) Gamma attributes. Keys may be in camelCase (atom or string); they are normalised to the snake_case fields and each value is coerced to its field type.