View Source Dagger.TypeDef (dagger v0.10.0)

A definition of a parameter or return type in a Module.

Link to this section Summary

Functions

If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.

If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.

If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.

If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.

A unique identifier for this TypeDef.

The kind of type this is (e.g. primitive, list, object).

Whether this type can be set to null. Defaults to false.

Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.

Adds a static field for an Object TypeDef, failing if the type is not an object.

Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.

Returns a TypeDef of kind Interface with the provided name.

Sets the kind of the type.

Returns a TypeDef of kind List with the provided type for its elements.

Returns a TypeDef of kind Object with the provided name.

Sets whether this type can be set to null.

Link to this section Types

@type t() :: %Dagger.TypeDef{client: term(), selection: term()}

Link to this section Functions

@spec as_input(t()) :: {:ok, Dagger.InputTypeDef.t() | nil} | {:error, term()}

If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.

@spec as_interface(t()) :: {:ok, Dagger.InterfaceTypeDef.t() | nil} | {:error, term()}

If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.

@spec as_list(t()) :: {:ok, Dagger.ListTypeDef.t() | nil} | {:error, term()}

If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.

@spec as_object(t()) :: {:ok, Dagger.ObjectTypeDef.t() | nil} | {:error, term()}

If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.

@spec id(t()) :: {:ok, Dagger.TypeDefID.t()} | {:error, term()}

A unique identifier for this TypeDef.

@spec kind(t()) :: {:ok, Dagger.TypeDefKind.t()} | {:error, term()}

The kind of type this is (e.g. primitive, list, object).

@spec optional(t()) :: {:ok, Dagger.Boolean.t()} | {:error, term()}

Whether this type can be set to null. Defaults to false.

Link to this function

with_constructor(type_def, function)

View Source
@spec with_constructor(t(), Dagger.Function.t()) :: t()

Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.

required-arguments

Required Arguments

  • function -
Link to this function

with_field(type_def, name, type_def, optional_args \\ [])

View Source
@spec with_field(t(), Dagger.String.t(), t(), keyword()) :: t()

Adds a static field for an Object TypeDef, failing if the type is not an object.

required-arguments

Required Arguments

  • name - The name of the field in the object
  • type_def - The type of the field

optional-arguments

Optional Arguments

  • description - A doc string for the field, if any
Link to this function

with_function(type_def, function)

View Source
@spec with_function(t(), Dagger.Function.t()) :: t()

Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.

required-arguments

Required Arguments

  • function -
Link to this function

with_interface(type_def, name, optional_args \\ [])

View Source
@spec with_interface(t(), Dagger.String.t(), keyword()) :: t()

Returns a TypeDef of kind Interface with the provided name.

required-arguments

Required Arguments

  • name -

optional-arguments

Optional Arguments

  • description -
Link to this function

with_kind(type_def, kind)

View Source
@spec with_kind(t(), Dagger.TypeDefKind.t()) :: t()

Sets the kind of the type.

required-arguments

Required Arguments

  • kind -
Link to this function

with_list_of(type_def, element_type)

View Source
@spec with_list_of(t(), t()) :: t()

Returns a TypeDef of kind List with the provided type for its elements.

required-arguments

Required Arguments

  • element_type -
Link to this function

with_object(type_def, name, optional_args \\ [])

View Source
@spec with_object(t(), Dagger.String.t(), keyword()) :: t()

Returns a TypeDef of kind Object with the provided name.

Note that an object's fields and functions may be omitted if the intent is only to refer to an object. This is how functions are able to return their own object, or any other circular reference.

required-arguments

Required Arguments

  • name -

optional-arguments

Optional Arguments

  • description -
Link to this function

with_optional(type_def, optional)

View Source
@spec with_optional(t(), Dagger.Boolean.t()) :: t()

Sets whether this type can be set to null.

required-arguments

Required Arguments

  • optional -