# This file generated by `mix dagger.gen`. Please DO NOT EDIT.
defmodule Dagger.FunctionArg do
  @moduledoc "An argument accepted by a function.\n\nThis is a specification for an argument at function definition time, not an argument passed at function call time."
  use Dagger.QueryBuilder
  @type t() :: %__MODULE__{}
  defstruct [:selection, :client]

  (
    @doc ""
    @spec default_value(t()) :: {:ok, Dagger.JSON.t()} | {:error, term()}
    def default_value(%__MODULE__{} = function_arg) do
      selection = select(function_arg.selection, "defaultValue")
      execute(selection, function_arg.client)
    end
  )

  (
    @doc ""
    @spec description(t()) :: {:ok, Dagger.String.t()} | {:error, term()}
    def description(%__MODULE__{} = function_arg) do
      selection = select(function_arg.selection, "description")
      execute(selection, function_arg.client)
    end
  )

  (
    @doc "A unique identifier for this FunctionArg."
    @spec id(t()) :: {:ok, Dagger.FunctionArgID.t()} | {:error, term()}
    def id(%__MODULE__{} = function_arg) do
      selection = select(function_arg.selection, "id")
      execute(selection, function_arg.client)
    end
  )

  (
    @doc ""
    @spec name(t()) :: {:ok, Dagger.String.t()} | {:error, term()}
    def name(%__MODULE__{} = function_arg) do
      selection = select(function_arg.selection, "name")
      execute(selection, function_arg.client)
    end
  )

  (
    @doc ""
    @spec type_def(t()) :: Dagger.TypeDef.t()
    def type_def(%__MODULE__{} = function_arg) do
      selection = select(function_arg.selection, "typeDef")
      %Dagger.TypeDef{selection: selection, client: function_arg.client}
    end
  )
end
