Documentation
¶
Index ¶
- func GetObjectAttr(obj basetypes.ObjectValue, name string, defaultValue attr.Value) attr.Value
- func ListNullIfEmpty(elementType attr.Type, values []attr.Value) types.List
- func ListValue(elementType attr.Type, elements []attr.Value) types.List
- func ListValueFrom(ctx context.Context, elementType attr.Type, elements any) types.List
- func MapNullIfEmpty(elementType attr.Type, values map[string]attr.Value) types.Map
- func MapValue(elementType attr.Type, elements map[string]attr.Value) types.Map
- func MapValueFrom(ctx context.Context, elementType attr.Type, elements any) types.Map
- func ObjectListElements(list basetypes.ListValue) []map[string]attr.Value
- func ObjectMapElements(m basetypes.MapValue) map[string]map[string]attr.Value
- func ObjectNullIfEmpty(attrTypes map[string]attr.Type, values map[string]attr.Value) types.Object
- func ObjectSetElements(set basetypes.SetValue) []map[string]attr.Value
- func ObjectSetFromSlice(ctx context.Context, attrTypes map[string]attr.Type, ...) types.Set
- func ObjectValue(attrTypes map[string]attr.Type, values map[string]attr.Value) types.Object
- func ObjectValueFrom(ctx context.Context, attrTypes map[string]attr.Type, value any) types.Object
- func SetNullIfEmpty(ctx context.Context, elementType attr.Type, values []attr.Value) types.Set
- func SetValue(elementType attr.Type, elements []attr.Value) types.Set
- func SetValueFrom(ctx context.Context, elementType attr.Type, elements any) types.Set
- func StringListElements(list basetypes.ListValue) []string
- func StringMapElements(m basetypes.MapValue) map[string]string
- func StringSetElements(set basetypes.SetValue) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetObjectAttr ¶
GetObjectAttr safely retrieves an attribute from an object by name. Returns the default value if the object is null, unknown, or the attribute doesn't exist.
func ListNullIfEmpty ¶
ListNullIfEmpty returns ListNull if the slice is empty, otherwise creates a list with the values.
func ListValue ¶
ListValue creates a types.List from attr.Value elements. Panics if creation fails, which should only happen with programming errors.
func ListValueFrom ¶
ListValueFrom creates a types.List from a Go slice. Panics if creation fails, which should only happen with programming errors.
func MapNullIfEmpty ¶
MapNullIfEmpty returns MapNull if the map is empty, otherwise creates a map with the values.
func MapValue ¶
MapValue creates a types.Map from attr.Value elements. Panics if creation fails, which should only happen with programming errors.
func MapValueFrom ¶
MapValueFrom creates a types.Map from a Go map. Panics if creation fails, which should only happen with programming errors.
func ObjectListElements ¶
ObjectListElements converts a basetypes.ListValue containing objects to a slice of maps. Returns nil if the list is null or unknown.
func ObjectMapElements ¶
ObjectMapElements converts a basetypes.MapValue containing objects to a map of maps. Returns nil if the map is null or unknown.
func ObjectNullIfEmpty ¶
ObjectNullIfEmpty returns ObjectNull if the map is empty, otherwise creates an object with the values.
func ObjectSetElements ¶
ObjectSetElements converts a basetypes.SetValue containing objects to a slice of maps. Returns nil if the set is null or unknown.
func ObjectSetFromSlice ¶
func ObjectSetFromSlice(ctx context.Context, attrTypes map[string]attr.Type, valueFunc func(int) map[string]attr.Value, length int) types.Set
ObjectSetFromSlice builds a set of objects from a slice Returns types.SetNull() if the length is zero
func ObjectValue ¶
ObjectValue creates a types.Object with known values from a map. Panics if creation fails, which should only happen with programming errors.
func ObjectValueFrom ¶
ObjectValueFrom creates a types.Object from a Go struct. Panics if creation fails, which should only happen with programming errors.
func SetNullIfEmpty ¶
SetNullIfEmpty returns SetNull if the slice is empty, otherwise creates a set with the values.
func SetValue ¶
SetValue creates a types.Set from attr.Value elements. Panics if creation fails, which should only happen with programming errors.
func SetValueFrom ¶
SetValueFrom creates a types.Set from a Go slice. Panics if creation fails, which should only happen with programming errors.
func StringListElements ¶
StringListElements converts a basetypes.ListValue to a slice of strings. Returns nil if the list is null or unknown.
func StringMapElements ¶
StringMapElements converts a basetypes.MapValue to a map of strings. Returns nil if the map is null or unknown.
func StringSetElements ¶
StringSetElements converts a basetypes.SetValue to a slice of strings. Returns nil if the set is null or unknown.
Types ¶
This section is empty.