lib/open_xchange_client/api/advertisement.ex

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

defmodule OpenXchangeClient.Api.Advertisement do
  @moduledoc """
  API calls for all endpoints tagged `Advertisement`.
  """

  alias OpenXchangeClient.Connection
  import OpenXchangeClient.RequestBuilder

  @doc """
  Retrieves the advertisement configuration

  ## Parameters

  - connection (OpenXchangeClient.Connection): Connection to server
  - session (String.t): A session ID previously obtained from the login module.
  - opts (KeywordList): [optional] Optional parameters
  ## Returns

  {:ok, String.t} on success
  {:error, Tesla.Env.t} on failure
  """
  @spec get_advertisement_config(Tesla.Env.client(), String.t(), keyword()) ::
          {:ok, String.t()} | {:error, Tesla.Env.t()}
  def get_advertisement_config(connection, session, _opts \\ []) do
    %{}
    |> method(:get)
    |> url("/advertisement?action=get")
    |> add_param(:query, :session, session)
    |> Enum.into([])
    |> (&Connection.request(connection, &1)).()
    |> evaluate_response([
      {200, false}
    ])
  end
end