View Source Dagger.TypeDef (dagger v0.14.0)
A definition of a parameter or return type in a Module.
Summary
Functions
If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
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.
If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, 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.
Returns a TypeDef of kind Enum with the provided name.
Adds a static value for an Enum TypeDef, failing if the type is not an enum.
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.
Returns a TypeDef of kind Scalar with the provided name.
Types
Functions
@spec as_enum(t()) :: Dagger.EnumTypeDef.t() | nil
If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
@spec as_input(t()) :: Dagger.InputTypeDef.t() | nil
If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
@spec as_interface(t()) :: Dagger.InterfaceTypeDef.t() | nil
If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
@spec as_list(t()) :: Dagger.ListTypeDef.t() | nil
If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
@spec as_object(t()) :: Dagger.ObjectTypeDef.t() | nil
If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
@spec as_scalar(t()) :: Dagger.ScalarTypeDef.t() | nil
If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, 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).
Whether this type can be set to null. Defaults to false.
@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.
@spec with_enum(t(), String.t(), description: String.t() | nil, source_map: Dagger.SourceMapID.t() | nil ) :: t()
Returns a TypeDef of kind Enum with the provided name.
Note that an enum's values may be omitted if the intent is only to refer to an enum. This is how functions are able to return their own, or any other circular reference.
@spec with_enum_value(t(), String.t(), description: String.t() | nil, source_map: Dagger.SourceMapID.t() | nil ) :: t()
Adds a static value for an Enum TypeDef, failing if the type is not an enum.
@spec with_field(t(), String.t(), t(), description: String.t() | nil, source_map: Dagger.SourceMapID.t() | nil ) :: t()
Adds a static field for an Object TypeDef, failing if the type is not an object.
@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.
@spec with_interface(t(), String.t(), description: String.t() | nil, source_map: Dagger.SourceMapID.t() | nil ) :: t()
Returns a TypeDef of kind Interface with the provided name.
@spec with_kind(t(), Dagger.TypeDefKind.t()) :: t()
Sets the kind of the type.
Returns a TypeDef of kind List with the provided type for its elements.
@spec with_object(t(), String.t(), description: String.t() | nil, source_map: Dagger.SourceMapID.t() | nil ) :: 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.
Sets whether this type can be set to null.
Returns a TypeDef of kind Scalar with the provided name.