ExStreamClient.Model.Poll (ExStreamClient v0.1.7)

View Source

Schema representing a Poll

Summary

Functions

Components could just be enums that are typed - so we need to decode those as enums as they will just be stings

Types

t()

@type t() :: %ExStreamClient.Model.Poll{
  allow_answers: boolean(),
  allow_user_suggested_options: boolean(),
  answers_count: integer(),
  created_at: float(),
  created_by: ExStreamClient.Model.User.t() | nil,
  created_by_id: String.t(),
  custom: %{optional(String.t()) => any()},
  description: String.t(),
  enforce_unique_vote: boolean(),
  id: String.t(),
  is_closed: boolean() | nil,
  latest_answers: [ExStreamClient.Model.PollVote.t()],
  latest_votes_by_option: %{
    optional(String.t()) => [ExStreamClient.Model.PollVote.t()]
  },
  max_votes_allowed: integer() | nil,
  name: String.t(),
  options: [ExStreamClient.Model.PollOption.t()],
  own_votes: [ExStreamClient.Model.PollVote.t()],
  updated_at: float(),
  vote_count: integer(),
  vote_counts_by_option: %{optional(String.t()) => integer()},
  voting_visibility: String.t() | nil
}

Functions

decode(map)

Components could just be enums that are typed - so we need to decode those as enums as they will just be stings

nested_components()