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

defmodule FinFeedAPIStockRESTAPI.Api.NativeIEX do
  @moduledoc """
  API calls for all endpoints tagged `NativeIEX`.
  """

  alias FinFeedAPIStockRESTAPI.Connection
  import FinFeedAPIStockRESTAPI.RequestBuilder

  @doc """
  Get Admin Messages

  ### Parameters

  - `connection` (FinFeedAPIStockRESTAPI.Connection): Connection to server
  - `symbol` (String.t): The symbol identifier
  - `date` (DateTime.t): Optional date in format YYYY-MM-DD (defaults to latest available data)
  - `opts` (keyword): Optional parameters

  ### Returns

  - `{:ok, [%AdminAdminMessageModel{}, ...]}` on success
  - `{:error, Tesla.Env.t}` on failure
  """
  @spec v1_native_iex_admin_messages_symbol_get(Tesla.Env.client, String.t, DateTime.t, keyword()) :: {:ok, [FinFeedAPIStockRESTAPI.Model.AdminAdminMessageModel.t]} | {:error, Tesla.Env.t}
  def v1_native_iex_admin_messages_symbol_get(connection, symbol, date, _opts \\ []) do
    request =
      %{}
      |> method(:get)
      |> url("/v1/native/iex/admin/messages/#{symbol}")
      |> add_param(:query, :date, date)
      |> Enum.into([])

    connection
    |> Connection.request(request)
    |> evaluate_response([
      {200, FinFeedAPIStockRESTAPI.Model.AdminAdminMessageModel}
    ])
  end

  @doc """
  Get System Events

  ### Parameters

  - `connection` (FinFeedAPIStockRESTAPI.Connection): Connection to server
  - `date` (DateTime.t): Date in format YYYY-MM-DD
  - `opts` (keyword): Optional parameters

  ### Returns

  - `{:ok, [%AdminSystemEventModel{}, ...]}` on success
  - `{:error, Tesla.Env.t}` on failure
  """
  @spec v1_native_iex_admin_system_event_get(Tesla.Env.client, DateTime.t, keyword()) :: {:ok, [FinFeedAPIStockRESTAPI.Model.AdminSystemEventModel.t]} | {:error, Tesla.Env.t}
  def v1_native_iex_admin_system_event_get(connection, date, _opts \\ []) do
    request =
      %{}
      |> method(:get)
      |> url("/v1/native/iex/admin/system-event")
      |> add_param(:query, :date, date)
      |> Enum.into([])

    connection
    |> Connection.request(request)
    |> evaluate_response([
      {200, FinFeedAPIStockRESTAPI.Model.AdminSystemEventModel}
    ])
  end

  @doc """
  Get Level-1 Quotes

  ### Parameters

  - `connection` (FinFeedAPIStockRESTAPI.Connection): Connection to server
  - `symbol` (String.t): The symbol identifier
  - `date` (DateTime.t): Optional date in format YYYY-MM-DD (defaults to latest available data)
  - `opts` (keyword): Optional parameters

  ### Returns

  - `{:ok, [%Level1QuoteUpdateModel{}, ...]}` on success
  - `{:error, Tesla.Env.t}` on failure
  """
  @spec v1_native_iex_level1_quote_symbol_get(Tesla.Env.client, String.t, DateTime.t, keyword()) :: {:ok, [FinFeedAPIStockRESTAPI.Model.Level1QuoteUpdateModel.t]} | {:error, Tesla.Env.t}
  def v1_native_iex_level1_quote_symbol_get(connection, symbol, date, _opts \\ []) do
    request =
      %{}
      |> method(:get)
      |> url("/v1/native/iex/level1-quote/#{symbol}")
      |> add_param(:query, :date, date)
      |> Enum.into([])

    connection
    |> Connection.request(request)
    |> evaluate_response([
      {200, FinFeedAPIStockRESTAPI.Model.Level1QuoteUpdateModel}
    ])
  end

  @doc """
  Get Level-2 Price Level Book

  ### Parameters

  - `connection` (FinFeedAPIStockRESTAPI.Connection): Connection to server
  - `symbol` (String.t): The symbol identifier
  - `date` (DateTime.t): Optional date in format YYYY-MM-DD (defaults to latest available data)
  - `opts` (keyword): Optional parameters

  ### Returns

  - `{:ok, [%Level2PriceLevelUpdateModel{}, ...]}` on success
  - `{:error, Tesla.Env.t}` on failure
  """
  @spec v1_native_iex_level2_price_level_update_symbol_get(Tesla.Env.client, String.t, DateTime.t, keyword()) :: {:ok, [FinFeedAPIStockRESTAPI.Model.Level2PriceLevelUpdateModel.t]} | {:error, Tesla.Env.t}
  def v1_native_iex_level2_price_level_update_symbol_get(connection, symbol, date, _opts \\ []) do
    request =
      %{}
      |> method(:get)
      |> url("/v1/native/iex/level2-price-level-update/#{symbol}")
      |> add_param(:query, :date, date)
      |> Enum.into([])

    connection
    |> Connection.request(request)
    |> evaluate_response([
      {200, FinFeedAPIStockRESTAPI.Model.Level2PriceLevelUpdateModel}
    ])
  end

  @doc """
  Get Level-3 Order Book

  ### Parameters

  - `connection` (FinFeedAPIStockRESTAPI.Connection): Connection to server
  - `symbol` (String.t): The symbol identifier
  - `date` (DateTime.t): Optional date in format YYYY-MM-DD (defaults to latest available data)
  - `opts` (keyword): Optional parameters

  ### Returns

  - `{:ok, [%Level3OrderBookModel{}, ...]}` on success
  - `{:error, Tesla.Env.t}` on failure
  """
  @spec v1_native_iex_level3_order_book_symbol_get(Tesla.Env.client, String.t, DateTime.t, keyword()) :: {:ok, [FinFeedAPIStockRESTAPI.Model.Level3OrderBookModel.t]} | {:error, Tesla.Env.t}
  def v1_native_iex_level3_order_book_symbol_get(connection, symbol, date, _opts \\ []) do
    request =
      %{}
      |> method(:get)
      |> url("/v1/native/iex/level3-order-book/#{symbol}")
      |> add_param(:query, :date, date)
      |> Enum.into([])

    connection
    |> Connection.request(request)
    |> evaluate_response([
      {200, FinFeedAPIStockRESTAPI.Model.Level3OrderBookModel}
    ])
  end

  @doc """
  Get Trades

  ### Parameters

  - `connection` (FinFeedAPIStockRESTAPI.Connection): Connection to server
  - `symbol` (String.t): The symbol identifier
  - `date` (DateTime.t): Optional date in format YYYY-MM-DD (defaults to latest available data)
  - `opts` (keyword): Optional parameters

  ### Returns

  - `{:ok, [%TradeTradeModel{}, ...]}` on success
  - `{:error, Tesla.Env.t}` on failure
  """
  @spec v1_native_iex_trade_symbol_get(Tesla.Env.client, String.t, DateTime.t, keyword()) :: {:ok, [FinFeedAPIStockRESTAPI.Model.TradeTradeModel.t]} | {:error, Tesla.Env.t}
  def v1_native_iex_trade_symbol_get(connection, symbol, date, _opts \\ []) do
    request =
      %{}
      |> method(:get)
      |> url("/v1/native/iex/trade/#{symbol}")
      |> add_param(:query, :date, date)
      |> Enum.into([])

    connection
    |> Connection.request(request)
    |> evaluate_response([
      {200, FinFeedAPIStockRESTAPI.Model.TradeTradeModel}
    ])
  end
end
