state

package
v0.7.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtrToBool

func BoolPtrToBool(b *bool) bool

BoolPtrToBool converts a bool pointer to a bool. If the input is nil, it returns false.

func BoolPtrToTypeBool

func BoolPtrToTypeBool(b *bool) types.Bool

BoolPtrToTypeBool converts a *bool to a types.Bool. If the input is nil, it returns types.BoolNull().

func ByteToString

func ByteToString(b []byte) string

ByteToString converts a byte slice to a string. It returns the byte slice encoded as a base64 string.

func DateOnlyPtrToString

func DateOnlyPtrToString(date *serialization.DateOnly) types.String

DateOnlyPtrToString converts a DateOnly pointer to a Terraform string.

func DecodeBase64ToString

func DecodeBase64ToString(ctx context.Context, encoded string) types.String

DecodeBase64ToString decodes a base64-encoded string and returns a basetypes.StringValue. If decoding fails, it logs a warning and returns the original string as a basetypes.StringValue.

func EnumListPtrToTypeStringSlice

func EnumListPtrToTypeStringSlice[T fmt.Stringer](input []*T) []types.String

EnumListPtrToTypeStringSlice converts a slice of pointers to enum-like constants to a slice of types.String. It uses the String() method of the enum type to convert each value to a string.

func EnumPtrToTypeString

func EnumPtrToTypeString[T fmt.Stringer](e *T) types.String

EnumPtrToTypeString converts a pointer to an enum-like type to a types.String. It uses the String() method of the enum type to convert the value to a string.

func EnumSliceToTypeStringSlice

func EnumSliceToTypeStringSlice[T fmt.Stringer](input []T) []types.String

EnumSliceToTypeStringSlice converts a slice of enum-like constants to a slice of types.String. It uses the String() method of the enum type to convert each value to a string.

func ISO8601DurationToString

func ISO8601DurationToString(duration *serialization.ISODuration) types.String

ISO8601DurationToString converts an ISODuration to a types.String value.

func Int32PtrToTypeInt32

func Int32PtrToTypeInt32(i *int32) types.Int32

Int32PtrToTypeInt32 converts a pointer to an int32 to a types.Int32. This function is useful for converting nullable int32 values from the SDK to Terraform's types.Int32.

func Int32PtrToTypeInt64

func Int32PtrToTypeInt64(i *int32) types.Int64

Int32PtrToTypeInt64 converts a pointer to an int32 to a types.Int64. This function is useful for converting nullable int32 values from the SDK to Terraform's types.Int64.

func Int64PtrToTypeInt64

func Int64PtrToTypeInt64(i *int64) types.Int64

Int64PtrToTypeInt64 converts a *int64 to a types.Int64. If the input is nil, it returns types.Int64Null().

func SliceToTypeStringSlice

func SliceToTypeStringSlice(input []string) []types.String

SliceToTypeStringSlice converts a slice of strings to a slice of types.String. It handles nil input by returning nil, and empty slices by returning an empty slice of types.String.

func StringListToTypeList

func StringListToTypeList(strings []string) types.List

StringListToTypeList converts a slice of strings to a types.List.

func StringPtrToString

func StringPtrToString(s *string) string

StringPtrToString converts a string pointer to a string.

func TimeToString

func TimeToString(t *time.Time) types.String

TimeToString converts a *time.Time to a types.String. If the input is nil, it returns types.StringNull(). Otherwise, it returns a types.String with the time formatted in RFC3339 format.

Types

This section is empty.

Directories

Path Synopsis
graph_beta

Jump to

Keyboard shortcuts

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