# 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.Metadata do
  @moduledoc """
  API calls for all endpoints tagged `Metadata`.
  """

  alias FinFeedAPIStockRESTAPI.Connection
  import FinFeedAPIStockRESTAPI.RequestBuilder

  @doc """
  List of exchanges

  ### Parameters

  - `connection` (FinFeedAPIStockRESTAPI.Connection): Connection to server
  - `opts` (keyword): Optional parameters

  ### Returns

  - `{:ok, [%FinFeedApiExchangeModel{}, ...]}` on success
  - `{:error, Tesla.Env.t}` on failure
  """
  @spec v1_exchanges_get(Tesla.Env.client, keyword()) :: {:ok, [FinFeedAPIStockRESTAPI.Model.FinFeedApiExchangeModel.t]} | {:error, Tesla.Env.t}
  def v1_exchanges_get(connection, _opts \\ []) do
    request =
      %{}
      |> method(:get)
      |> url("/v1/exchanges")
      |> Enum.into([])

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

  @doc """
  List of symbols for the exchange

  ### Parameters

  - `connection` (FinFeedAPIStockRESTAPI.Connection): Connection to server
  - `exchange_id` (String.t): 
  - `opts` (keyword): Optional parameters

  ### Returns

  - `{:ok, [%FinFeedApiSymbolModel{}, ...]}` on success
  - `{:error, Tesla.Env.t}` on failure
  """
  @spec v1_symbols_exchange_id_get(Tesla.Env.client, String.t, keyword()) :: {:ok, [FinFeedAPIStockRESTAPI.Model.FinFeedApiSymbolModel.t]} | {:error, Tesla.Env.t}
  def v1_symbols_exchange_id_get(connection, exchange_id, _opts \\ []) do
    request =
      %{}
      |> method(:get)
      |> url("/v1/symbols/#{exchange_id}")
      |> Enum.into([])

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