lib/spatio/model/ambiguous_account_error.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.AmbiguousAccountError do
  @moduledoc """
  Returned when the caller's request matches more than one connected account and no `accountId` query param disambiguates which one to target. The `accounts` array enumerates the candidates so the client can prompt the user to pick. 
  """

  @derive JSON.Encoder
  defstruct [
    :error,
    :code,
    :accounts
  ]

  @type t :: %__MODULE__{
    :error => String.t,
    :code => String.t | nil,
    :accounts => [Spatio.Model.AccountChoice.t] | nil
  }

  alias Spatio.Deserializer

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