lib/spatio/model/list_emails_response.ex

# NOTE: This file is auto generated by OpenAPI Generator 7.22.0 (https://openapi-generator.tech).
# Do not edit this file manually.

defmodule Spatio.Model.ListEmailsResponse do
  @moduledoc """
  List of emails across the selected accounts. `provider` is set on single-account calls; on fan-out it carries the value from the first contributing account (legacy behavior — clients should rely on the per-row `provider` field instead). 
  """

  @derive JSON.Encoder
  defstruct [
    :emails,
    :total,
    :nextPageToken,
    :provider
  ]

  @type t :: %__MODULE__{
    :emails => [Spatio.Model.Email.t] | nil,
    :total => integer(),
    :nextPageToken => String.t | nil,
    :provider => String.t
  }

  alias Spatio.Deserializer

  def decode(value) do
    value
     |> Deserializer.deserialize(:emails, :list, Spatio.Model.Email)
  end
end