View Source Dagger.TypeDef (dagger v0.9.3)
A definition of a parameter or return type in a Module.
Link to this section Summary
Functions
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.
The kind of type this is (e.g. primitive, list, object)
Whether this type can be set to null. Defaults to false.
Adds a static field for an Object TypeDef, failing if the type is not an object.
Adds a function for an Object TypeDef, failing if the type is not an object.
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
Link to this section Functions
@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()}
@spec kind(t()) :: {:ok, Dagger.TypeDefKind.t() | nil} | {: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.
@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 objecttype_def
- The type of the field
optional-arguments
Optional Arguments
description
- A doc string for the field, if any
@spec with_function(t(), Dagger.Function.t()) :: t()
Adds a function for an Object TypeDef, failing if the type is not an object.
required-arguments
Required Arguments
function
-
@spec with_kind(t(), Dagger.TypeDefKind.t()) :: t()
Sets the kind of the type.
required-arguments
Required Arguments
kind
-
Returns a TypeDef of kind List with the provided type for its elements.
required-arguments
Required Arguments
element_type
-
@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
-
@spec with_optional(t(), Dagger.Boolean.t()) :: t()
Sets whether this type can be set to null.
required-arguments
Required Arguments
optional
-