Documentation
¶
Index ¶
- func DebugPrintStruct(ctx context.Context, prefix string, v interface{})
- func ParseEnum[T any](value basetypes.StringValue, parser func(string) (any, error), setter func(T)) error
- func SetArrayProperty(values []types.String, setter func([]string))
- func SetBoolProperty(value basetypes.BoolValue, setter func(*bool))
- func SetInt32Property(value basetypes.Int32Value, setter func(*int32))
- func SetInt64Property(value basetypes.Int64Value, setter func(*int64))
- func SetStringProperty(value basetypes.StringValue, setter func(*string))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugPrintStruct ¶
func ParseEnum ¶
func ParseEnum[T any](value basetypes.StringValue, parser func(string) (any, error), setter func(T)) error
ParseEnum parses an enum value and sets it if the value is not null or unknown. It accepts a basetypes.StringValue (Terraform SDK type) and uses a parser function to translate the string into an enum type. If the value is valid, it casts the parsed value to the expected type T and passes it to the setter function.
func SetArrayProperty ¶
Add this new helper function to your construct package
func SetBoolProperty ¶
SetBoolProperty sets the value of a bool property if the value is not null or unknown. It accepts a basetypes.BoolValue (Terraform SDK type) and translates it into a pointer to a bool for use in the setter function.
func SetInt32Property ¶
func SetInt32Property(value basetypes.Int32Value, setter func(*int32))
SetInt32Property sets the value of an int32 property if the value is not null or unknown. It accepts a basetypes.Int32Value (Terraform SDK type) and passes it to the setter function.
func SetInt64Property ¶
func SetInt64Property(value basetypes.Int64Value, setter func(*int64))
SetInt64Property sets the value of an int64 property if the value is not null or unknown. It accepts a basetypes.Int64Value (Terraform SDK type) and passes it to the setter function.
func SetStringProperty ¶
func SetStringProperty(value basetypes.StringValue, setter func(*string))
SetStringProperty sets the value of a string property if the value is not null or unknown. It accepts a basetypes.StringValue (Terraform SDK type) and translates it into a pointer to a string for use in the setter function.
Types ¶
This section is empty.