# This file generated by `mix dagger.gen`. Please DO NOT EDIT.
defmodule Dagger.FieldTypeDef do
  @moduledoc "A definition of a field on a custom object defined in a Module.\n\nA field on an object has a static value, as opposed to a function on an object whose value is computed by invoking code (and can accept arguments)."
  use Dagger.QueryBuilder
  @type t() :: %__MODULE__{}
  defstruct [:selection, :client]

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

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

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

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