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

defmodule EMS-RESTAPI.Model.OrderNewSingleRequest do
  @moduledoc """
  The new order message.
  """

  @derive [Poison.Encoder]
  defstruct [
    :exchange_id,
    :client_order_id,
    :symbol_id_exchange,
    :symbol_id_coinapi,
    :amount_order,
    :price,
    :side,
    :order_type,
    :time_in_force,
    :expire_time,
    :exec_inst
  ]

  @type t :: %__MODULE__{
    :exchange_id => String.t,
    :client_order_id => String.t,
    :symbol_id_exchange => String.t | nil,
    :symbol_id_coinapi => String.t | nil,
    :amount_order => float(),
    :price => float(),
    :side => EMS-RESTAPI.Model.OrdSide.t,
    :order_type => EMS-RESTAPI.Model.OrdType.t,
    :time_in_force => EMS-RESTAPI.Model.TimeInForce.t,
    :expire_time => DateTime | nil,
    :exec_inst => [String.t] | nil
  }
end

defimpl Poison.Decoder, for: EMS-RESTAPI.Model.OrderNewSingleRequest do
  import EMS-RESTAPI.Deserializer
  def decode(value, options) do
    value
    |> deserialize(:side, :struct, EMS-RESTAPI.Model.OrdSide, options)
    |> deserialize(:order_type, :struct, EMS-RESTAPI.Model.OrdType, options)
    |> deserialize(:time_in_force, :struct, EMS-RESTAPI.Model.TimeInForce, options)
    |> deserialize(:expire_time, :struct, EMS-RESTAPI.Model.Date, options)
  end
end

