utils

package
v3.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindActiveAssociatedType added in v3.4.2

func FindActiveAssociatedType[T any](ctx context.Context, plan tfsdk.Plan, sources []HoistedSource) *T

FindActiveAssociatedType searches through the hoisted sources to find an active associated type and returns a pointer to the field value from the plan. Deprecated: Use FindActiveHoistedValue instead, which prefers state values.

func FindActiveHoistedValue added in v3.4.2

func FindActiveHoistedValue[T any](ctx context.Context, plan tfsdk.Plan, state tfsdk.State, sources []HoistedSource) *T

FindActiveHoistedValue searches through the hoisted sources to find an active associated type and returns a pointer to the field value. It prefers state values over plan values to preserve API-returned values for readonly computed fields. Returns nil if not found.

func IsAllStateUnknown

func IsAllStateUnknown(ctx context.Context, state tfsdk.State) bool

Types

type HoistedSource added in v3.4.2

type HoistedSource struct {
	// AssociatedTypePath is the path to check if the associated type is active (not null)
	AssociatedTypePath path.Path
	// FieldPath is the path to the source field within the associated type
	FieldPath path.Path
}

HoistedSource describes the path to a source field within a oneOf associated type that was hoisted to the parent level.

Jump to

Keyboard shortcuts

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