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.
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.
Click to show internal directories.
Click to hide internal directories.