types

package
v1.36.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ListOfStringType is a custom type used for defining a List of strings.
	ListOfStringType = listTypeOf[basetypes.StringValue]{basetypes.ListType{ElemType: basetypes.StringType{}}}
)

Functions

func AttributeTypes

func AttributeTypes[T any](ctx context.Context) (map[string]attr.Type, error)

AttributeTypes returns a map of attribute types for the specified type T. T must be a struct and reflection is used to find exported fields of T with the `tfsdk` tag.

func AttributeTypesMust

func AttributeTypesMust[T any](ctx context.Context) map[string]attr.Type

func NewListNestedObjectTypeOf

func NewListNestedObjectTypeOf[T any](ctx context.Context) listNestedObjectTypeOf[T]

func NewObjectTypeOf

func NewObjectTypeOf[T any](ctx context.Context) objectTypeOf[T]

Types

type ListNestedObjectValueOf

type ListNestedObjectValueOf[T any] struct {
	basetypes.ListValue
}

ListNestedObjectValueOf represents a Terraform Plugin Framework List value whose elements are of type `ObjectTypeOf[T]`.

func NewListNestedObjectValueOfNull

func NewListNestedObjectValueOfNull[T any](ctx context.Context) ListNestedObjectValueOf[T]

func NewListNestedObjectValueOfPtr

func NewListNestedObjectValueOfPtr[T any](ctx context.Context, t *T) ListNestedObjectValueOf[T]

func NewListNestedObjectValueOfSlice

func NewListNestedObjectValueOfSlice[T any](ctx context.Context, ts []*T) ListNestedObjectValueOf[T]

func NewListNestedObjectValueOfUnknown

func NewListNestedObjectValueOfUnknown[T any](ctx context.Context) ListNestedObjectValueOf[T]

func NewListNestedObjectValueOfValueSlice

func NewListNestedObjectValueOfValueSlice[T any](ctx context.Context, ts []T) ListNestedObjectValueOf[T]

func (ListNestedObjectValueOf[T]) Equal

func (v ListNestedObjectValueOf[T]) Equal(o attr.Value) bool

func (ListNestedObjectValueOf[T]) ToObjectPtr

func (v ListNestedObjectValueOf[T]) ToObjectPtr(ctx context.Context) (any, diag.Diagnostics)

func (ListNestedObjectValueOf[T]) ToObjectSlice

func (v ListNestedObjectValueOf[T]) ToObjectSlice(ctx context.Context) (any, diag.Diagnostics)

func (ListNestedObjectValueOf[T]) ToPtr

func (v ListNestedObjectValueOf[T]) ToPtr(ctx context.Context) (*T, diag.Diagnostics)

ToPtr returns a pointer to the single element of a ListNestedObject.

func (ListNestedObjectValueOf[T]) ToSlice

func (v ListNestedObjectValueOf[T]) ToSlice(ctx context.Context) ([]*T, diag.Diagnostics)

ToSlice returns a slice of pointers to the elements of a ListNestedObject.

func (ListNestedObjectValueOf[T]) Type

type ListValueOf

type ListValueOf[T attr.Value] struct {
	basetypes.ListValue
}

func NewListValueOf

func NewListValueOf[T attr.Value](ctx context.Context, elements []attr.Value) (ListValueOf[T], diag.Diagnostics)

func NewListValueOfMust

func NewListValueOfMust[T attr.Value](ctx context.Context, elements []attr.Value) ListValueOf[T]

func NewListValueOfNull

func NewListValueOfNull[T attr.Value](ctx context.Context) ListValueOf[T]

func NewListValueOfUnknown

func NewListValueOfUnknown[T attr.Value](ctx context.Context) ListValueOf[T]

func (ListValueOf[T]) Equal

func (v ListValueOf[T]) Equal(o attr.Value) bool

func (ListValueOf[T]) Type

func (v ListValueOf[T]) Type(ctx context.Context) attr.Type

type NestedObjectCollectionType

type NestedObjectCollectionType interface {
	NestedObjectType

	// NewObjectSlice returns a new value as an object slice (Go []*struct).
	NewObjectSlice(context.Context, int, int) (any, diag.Diagnostics)

	// ValueFromObjectSlice returns a Value given an object pointer (Go []*struct).
	ValueFromObjectSlice(context.Context, any) (attr.Value, diag.Diagnostics)
}

NestedObjectCollectionType extends the NestedObjectType interface for types that represent collections (Lists or Sets) of nested Objects. It isn't generic on the Go struct type as it's referenced within AutoFlEx.

type NestedObjectCollectionValue

type NestedObjectCollectionValue interface {
	NestedObjectValue

	// ToObjectSlice returns the value as an object slice (Go []*struct).
	ToObjectSlice(context.Context) (any, diag.Diagnostics)
}

NestedObjectCollectionValue extends the NestedObjectValue interface for values that represent collections of nested Objects. It isn't generic on the Go struct type as it's referenced within AutoFlEx.

type NestedObjectType

type NestedObjectType interface {
	attr.Type

	// NewObjectPtr returns a new, empty value as an object pointer (Go *struct).
	NewObjectPtr(context.Context) (any, diag.Diagnostics)

	// NullValue returns a Null Value.
	NullValue(context.Context) (attr.Value, diag.Diagnostics)

	// ValueFromObjectPtr returns a Value given an object pointer (Go *struct).
	ValueFromObjectPtr(context.Context, any) (attr.Value, diag.Diagnostics)
}

NestedObjectType extends the Type interface for types that represent nested Objects. The nested objects are either a single object or a collection of objects (List or Set). It isn't generic on the Go struct type as it's referenced within AutoFlEx.

type NestedObjectValue

type NestedObjectValue interface {
	attr.Value

	// ToObjectPtr returns the value as an object pointer (Go *struct).
	ToObjectPtr(context.Context) (any, diag.Diagnostics)
}

NestedObjectValue extends the Value interface for values that represent nested Objects. The nested objects are either a single object or a collection of objects (List or Set). It isn't generic on the Go struct type as it's referenced within AutoFlEx.

type ObjectValueOf

type ObjectValueOf[T any] struct {
	basetypes.ObjectValue
}

ObjectValueOf represents a Terraform Plugin Framework Object value whose corresponding Go type is the structure T.

func NewObjectValueOf

func NewObjectValueOf[T any](ctx context.Context, t *T) ObjectValueOf[T]

func NewObjectValueOfNull

func NewObjectValueOfNull[T any](ctx context.Context) ObjectValueOf[T]

func NewObjectValueOfUnknown

func NewObjectValueOfUnknown[T any](ctx context.Context) ObjectValueOf[T]

func (ObjectValueOf[T]) Equal

func (v ObjectValueOf[T]) Equal(o attr.Value) bool

func (ObjectValueOf[T]) ToObjectPtr

func (v ObjectValueOf[T]) ToObjectPtr(ctx context.Context) (any, diag.Diagnostics)

func (ObjectValueOf[T]) ToPtr

func (v ObjectValueOf[T]) ToPtr(ctx context.Context) (*T, diag.Diagnostics)

func (ObjectValueOf[T]) Type

func (v ObjectValueOf[T]) Type(ctx context.Context) attr.Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL