Packages

Reference spec for interacting with Foyer API services

Current section

Files

Jump to
foyer_api_sdk lib foyer_api model trial.ex
Raw

lib/foyer_api/model/trial.ex

# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# https://openapi-generator.tech
# Do not edit the class manually.
defmodule FoyerAPI.Model.Trial do
@moduledoc """
"""
@derive [Poison.Encoder]
defstruct [
:id,
:userId,
:mediaId,
:result,
:updatedAt,
:createdAt,
:User,
:Media
]
@type t :: %__MODULE__{
:id => integer() | nil,
:userId => integer() | nil,
:mediaId => integer() | nil,
:result => String.t | nil,
:updatedAt => Date.t | nil,
:createdAt => Date.t | nil,
:User => FoyerAPI.Model.User.t | nil,
:Media => FoyerAPI.Model.Media.t | nil
}
end
defimpl Poison.Decoder, for: FoyerAPI.Model.Trial do
import FoyerAPI.Deserializer
def decode(value, options) do
value
|> deserialize(:updatedAt, :date, nil, options)
|> deserialize(:createdAt, :date, nil, options)
|> deserialize(:User, :struct, FoyerAPI.Model.User, options)
|> deserialize(:Media, :struct, FoyerAPI.Model.Media, options)
end
end