flex

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ARNStringFromFramework

func ARNStringFromFramework(ctx context.Context, v fwtypes.ARN) *string

func AttributeTypes

func AttributeTypes[T any](ctx context.Context) (map[string]attr.Type, error)

AttributeTypes returns a map of attribute types for the specified type T. T must be a struct and reflection is used to find exported fields of T with the `tfsdk` tag.

func AttributeTypesMust

func AttributeTypesMust[T any](ctx context.Context) map[string]attr.Type

func BoolFromFramework

func BoolFromFramework(ctx context.Context, v types.Bool) *bool

BoolFromFramework converts a Framework Bool value to a bool pointer. A null Bool is converted to a nil bool pointer.

func BoolToFramework

func BoolToFramework(ctx context.Context, v *bool) types.Bool

BoolToFramework converts a bool pointer to a Framework Bool value. A nil bool pointer is converted to a null Bool.

func BoolToFrameworkLegacy

func BoolToFrameworkLegacy(_ context.Context, v *bool) types.Bool

BoolToFrameworkLegacy converts a bool pointer to a Framework Bool value. A nil bool pointer is converted to a false Bool.

func Expand

func Expand(ctx context.Context, tfObject, apiObject any, optFns ...AutoFlexOptionsFunc) diag.Diagnostics

Expand "expands" a resource's "business logic" data structure, implemented using Terraform Plugin Framework data types, into an AWS SDK for Go v2 API data structure. The resource's data structure is walked and exported fields that have a corresponding field in the API data structure (and a suitable target data type) are copied.

func ExpandFrameworkListNestedBlock

func ExpandFrameworkListNestedBlock[T any, U any](ctx context.Context, tfList types.List, f FrameworkElementExpanderFunc[T, U]) []U

func ExpandFrameworkListNestedBlockPtr

func ExpandFrameworkListNestedBlockPtr[T any, U any](ctx context.Context, tfList types.List, f FrameworkElementExpanderFunc[T, *U]) *U

func ExpandFrameworkStringList

func ExpandFrameworkStringList(ctx context.Context, v types.List) []*string

func ExpandFrameworkStringMap

func ExpandFrameworkStringMap(ctx context.Context, v types.Map) map[string]*string

func ExpandFrameworkStringSet

func ExpandFrameworkStringSet(ctx context.Context, v types.Set) []*string

func ExpandFrameworkStringValueList

func ExpandFrameworkStringValueList(ctx context.Context, v types.List) []string

func ExpandFrameworkStringValueMap

func ExpandFrameworkStringValueMap(ctx context.Context, v types.Map) map[string]string

func Flatten

func Flatten(ctx context.Context, apiObject, tfObject any, optFns ...AutoFlexOptionsFunc) diag.Diagnostics

Flatten "flattens" an AWS SDK for Go v2 API data structure into a resource's "business logic" data structure, implemented using Terraform Plugin Framework data types. The API data structure's fields are walked and exported fields that have a corresponding field in the resource's data structure (and a suitable target data type) are copied.

func FlattenFrameworkListNestedBlock

func FlattenFrameworkListNestedBlock[T any, U any](ctx context.Context, apiObjects []U, f FrameworkElementFlattenerFunc[T, U]) types.List

func FlattenFrameworkStringList

func FlattenFrameworkStringList(ctx context.Context, v []*string) types.List

FlattenFrameworkStringList converts a slice of string pointers to a framework List value.

A nil slice is converted to a null List. An empty slice is converted to a null List.

func FlattenFrameworkStringListLegacy

func FlattenFrameworkStringListLegacy(_ context.Context, vs []*string) types.List

FlattenFrameworkStringListLegacy is the Plugin Framework variant of FlattenStringList. A nil slice is converted to an empty (non-null) List.

func FlattenFrameworkStringMap

func FlattenFrameworkStringMap(ctx context.Context, v map[string]*string) types.Map

FlattenFrameworkStringMap converts a map of string pointers to a framework Map value.

A nil map is converted to a null Map. An empty map is converted to a null Map.

func FlattenFrameworkStringSet

func FlattenFrameworkStringSet(ctx context.Context, v []*string) types.Set

FlattenFrameworkStringSet converts a slice of string pointers to a framework Set value.

A nil slice is converted to a null Set. An empty slice is converted to a null Set.

func FlattenFrameworkStringSetLegacy

func FlattenFrameworkStringSetLegacy(_ context.Context, vs []*string) types.Set

FlattenFrameworkStringSetLegacy converts a slice of string pointers to a framework Set value.

A nil slice is converted to an empty (non-null) Set.

func FlattenFrameworkStringValueList

func FlattenFrameworkStringValueList(ctx context.Context, v []string) types.List

FlattenFrameworkStringValueList converts a slice of string values to a framework List value.

A nil slice is converted to a null List. An empty slice is converted to a null List.

func FlattenFrameworkStringValueListLegacy

func FlattenFrameworkStringValueListLegacy(_ context.Context, vs []string) types.List

FlattenFrameworkStringValueListLegacy is the Plugin Framework variant of FlattenStringValueList. A nil slice is converted to an empty (non-null) List.

func FlattenFrameworkStringValueMap

func FlattenFrameworkStringValueMap(ctx context.Context, v map[string]string) types.Map

FlattenFrameworkStringValueMap converts a map of strings to a framework Map value.

A nil map is converted to a null Map. An empty map is converted to a null Map.

func FlattenFrameworkStringValueMapLegacy

func FlattenFrameworkStringValueMapLegacy(_ context.Context, m map[string]string) types.Map

FlattenFrameworkStringValueMapLegacy has no Plugin SDK equivalent as schema.ResourceData.Set can be passed string value maps directly. A nil map is converted to an empty (non-null) Map.

func FlattenFrameworkStringValueSet

func FlattenFrameworkStringValueSet(ctx context.Context, v []string) types.Set

FlattenFrameworkStringValueSet converts a slice of string values to a framework Set value.

A nil slice is converted to a null Set. An empty slice is converted to a null Set.

func FlattenFrameworkStringValueSetLegacy

func FlattenFrameworkStringValueSetLegacy(_ context.Context, vs []string) types.Set

FlattenFrameworkStringValueSetLegacy is the Plugin Framework variant of FlattenStringValueSet. A nil slice is converted to an empty (non-null) Set.

func Float64ToFramework

func Float64ToFramework(ctx context.Context, v *float64) types.Float64

Float64ToFramework converts a float64 pointer to a Framework Float64 value. A nil float64 pointer is converted to a null Float64.

func Float64ToFrameworkLegacy

func Float64ToFrameworkLegacy(_ context.Context, v *float64) types.Float64

Float64ToFrameworkLegacy converts a float64 pointer to a Framework Float64 value. A nil float64 pointer is converted to a zero float64.

func Int32ToFramework

func Int32ToFramework(ctx context.Context, v *int32) types.Int64

func Int64FromFramework

func Int64FromFramework(ctx context.Context, v types.Int64) *int64

Int64FromFramework converts a Framework Int64 value to an int64 pointer. A null Int64 is converted to a nil int64 pointer.

func Int64FromFrameworkLegacy

func Int64FromFrameworkLegacy(_ context.Context, v types.Int64) *int64

func Int64ToFramework

func Int64ToFramework(ctx context.Context, v *int64) types.Int64

Int64ToFramework converts an int64 pointer to a Framework Int64 value. A nil int64 pointer is converted to a null Int64.

func Int64ToFrameworkLegacy

func Int64ToFrameworkLegacy(_ context.Context, v *int64) types.Int64

Int64ToFrameworkLegacy converts an int64 pointer to a Framework Int64 value. A nil int64 pointer is converted to a zero Int64.

func StringFromFramework

func StringFromFramework(ctx context.Context, v types.String) *string

StringFromFramework converts a Framework String value to a string pointer. A null String is converted to a nil string pointer.

func StringFromFrameworkLegacy

func StringFromFrameworkLegacy(_ context.Context, v types.String) *string

func StringSliceFromFramework

func StringSliceFromFramework(ctx context.Context, v types.String) []*string

StringFromFramework converts a single Framework String value to a string pointer slice. A null String is converted to a nil slice.

func StringToFramework

func StringToFramework(ctx context.Context, v *string) types.String

StringToFramework converts a string pointer to a Framework String value. A nil string pointer is converted to a null String.

func StringToFrameworkARN

func StringToFrameworkARN(ctx context.Context, v *string, diags *diag.Diagnostics) fwtypes.ARN

func StringToFrameworkLegacy

func StringToFrameworkLegacy(_ context.Context, v *string) types.String

StringToFrameworkLegacy converts a string pointer to a Framework String value. A nil string pointer is converted to an empty String.

func StringValueToFramework

func StringValueToFramework[T ~string](ctx context.Context, v T) types.String

StringValueToFramework converts a string value to a Framework String value. An empty string is converted to a null String.

func StringValueToFrameworkLegacy

func StringValueToFrameworkLegacy[T ~string](_ context.Context, v T) types.String

StringValueToFrameworkLegacy converts a string value to a Framework String value. An empty string is left as an empty String.

Types

type AutoFlexOptionsFunc

type AutoFlexOptionsFunc func(autoFlexer)

AutoFlexOptionsFunc is a type alias for an autoFlexer functional option.

type FrameworkElementExpanderFunc

type FrameworkElementExpanderFunc[T any, U any] func(context.Context, T) U

type FrameworkElementFlattenerFunc

type FrameworkElementFlattenerFunc[T any, U any] func(context.Context, U) T

type Set

type Set[T comparable] []T

func ExpandFrameworkStringValueSet

func ExpandFrameworkStringValueSet(ctx context.Context, v types.Set) Set[string]

func (Set[T]) Difference

func (s Set[T]) Difference(ns Set[T]) Set[T]

Difference find the elements in two sets that are not similar.

Jump to

Keyboard shortcuts

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