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

defmodule Nuon.Api.RunnerRunners do
  @moduledoc """
  API calls for all endpoints tagged `RunnerRunners`.
  """

  alias Nuon.Connection
  import Nuon.RequestBuilder

  @doc """
  get a runner
  Return a runner. 

  ### Parameters

  - `connection` (Nuon.Connection): Connection to server
  - `runner_id` (String.t): runner ID
  - `opts` (keyword): Optional parameters

  ### Returns

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

    connection
    |> Connection.request(request)
    |> evaluate_response([
      {200, Nuon.Model.AppRunner},
      {400, Nuon.Model.StderrErrResponse},
      {401, Nuon.Model.StderrErrResponse},
      {403, Nuon.Model.StderrErrResponse},
      {404, Nuon.Model.StderrErrResponse},
      {500, Nuon.Model.StderrErrResponse}
    ])
  end
end
