utils

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindActiveAssociatedType

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

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

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