flex

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyToAll

func ApplyToAll[T, U any](s []T, f func(T) U) []U

ApplyToAll returns a new slice containing the results of applying the function `f` to each element of the original slice `s`.

func ApplyToAllMultiSlice

func ApplyToAllMultiSlice[T, U, V any](s []T, u []U, d *diag.Diagnostics, f func(T, U) V) []V

ApplyToAllMultiSlice returns a new slice containing the results of applying the function `f` to each element of the original slice `s` and `u`.

func ExpandBool

func ExpandBool(v types.Bool) bool

func ExpandBoolPointer

func ExpandBoolPointer(v types.Bool) *bool

func ExpandFloat32

func ExpandFloat32(v types.Float64) float32

func ExpandFloat32Pointer

func ExpandFloat32Pointer(v types.Float64) *float32

func ExpandFloat64

func ExpandFloat64(v types.Float64) float64

func ExpandFloat64Pointer

func ExpandFloat64Pointer(v types.Float64) *float64

func ExpandFrameworkListInt32 added in v1.1.0

func ExpandFrameworkListInt32(ctx context.Context, tfList types.List, diags *diag.Diagnostics) []int32

func ExpandFrameworkListInt64 added in v1.1.0

func ExpandFrameworkListInt64(ctx context.Context, tfList types.List, diags *diag.Diagnostics) []int64

func ExpandFrameworkListNestedBlock

func ExpandFrameworkListNestedBlock[T any, U any](ctx context.Context, tfList interface {
	basetypes.ListValuable
	ElementsAs(ctx context.Context, target interface{}, allowUnhandled bool) diag.Diagnostics
}, diags *diag.Diagnostics, f FrameworkElementFlExFunc[T, *U]) []U

func ExpandFrameworkListString

func ExpandFrameworkListString(ctx context.Context, tfList interface {
	basetypes.ListValuable
	ElementsAs(ctx context.Context, target interface{}, allowUnhandled bool) diag.Diagnostics
}, diags *diag.Diagnostics) []string

func ExpandFrameworkMapFilterString

func ExpandFrameworkMapFilterString(ctx context.Context, tfMap types.Map, diags *diag.Diagnostics) string

func ExpandFrameworkMapString

func ExpandFrameworkMapString(ctx context.Context, tfMap types.Map, diags *diag.Diagnostics) map[string]interface{}

func ExpandInt32Pointer added in v1.1.0

func ExpandInt32Pointer(v types.Int64) *int32

func ExpandInt64

func ExpandInt64(v types.Int64) int64

func ExpandInt64Pointer

func ExpandInt64Pointer(v types.Int64) *int64

func ExpandList

func ExpandList[U any](ctx context.Context, tfList types.List, u U, diags *diag.Diagnostics) U

func ExpandString

func ExpandString(v types.String) string

func ExpandStringPointer

func ExpandStringPointer(v types.String) *string

func ExpandTime

func ExpandTime(_ context.Context, dt timetypes.RFC3339, diags *diag.Diagnostics) time.Time

func ExpandTimePointer

func ExpandTimePointer(_ context.Context, dt timetypes.RFC3339, diags *diag.Diagnostics) *time.Time

func FlattenBoolPointerFalseAsNull added in v1.4.0

func FlattenBoolPointerFalseAsNull(b *bool) types.Bool

For most fields, API returns false as expected from the provider, so use types.BoolPointerValue() instead. In cases where the API returns null instead of False, use FlattenBoolPointerFalseAsNull.

func FlattenFloat32Pointer added in v1.4.0

func FlattenFloat32Pointer(f *float32) types.Float64

func FlattenFloat64

func FlattenFloat64(f float64) types.Float64

func FlattenFloat64Pointer

func FlattenFloat64Pointer(f *float64) types.Float64

func FlattenFrameworkListInt32 added in v1.1.0

func FlattenFrameworkListInt32(ctx context.Context, l []int32, diags *diag.Diagnostics) types.List

func FlattenFrameworkListInt32NotNull added in v1.1.0

func FlattenFrameworkListInt32NotNull(ctx context.Context, l []int32, diags *diag.Diagnostics) types.List

func FlattenFrameworkListInt64 added in v1.1.0

func FlattenFrameworkListInt64(ctx context.Context, l []int64, diags *diag.Diagnostics) types.List

func FlattenFrameworkListInt64NotNull added in v1.1.0

func FlattenFrameworkListInt64NotNull(ctx context.Context, l []int64, diags *diag.Diagnostics) types.List

func FlattenFrameworkListNestedBlock

func FlattenFrameworkListNestedBlock[T any, U any](ctx context.Context, data []T, attrTypes map[string]attr.Type, diags *diag.Diagnostics, f FrameworkElementFlExFunc[*T, U]) types.List

func FlattenFrameworkListString

func FlattenFrameworkListString(ctx context.Context, l []string, diags *diag.Diagnostics) types.List

func FlattenFrameworkListStringNotNull added in v1.4.0

func FlattenFrameworkListStringNotNull(ctx context.Context, l []string, diags *diag.Diagnostics) types.List

func FlattenFrameworkListsNestedBlock

func FlattenFrameworkListsNestedBlock[T any, U any, V any](ctx context.Context, data []T, model []U, attrTypes map[string]attr.Type, diags *diag.Diagnostics, f FrameworkElementFlExFuncExt[*T, *U, V]) types.List

func FlattenFrameworkMapString

func FlattenFrameworkMapString(ctx context.Context, m map[string]interface{}, diags *diag.Diagnostics) types.Map

func FlattenFrameworkNestedBlock

func FlattenFrameworkNestedBlock[T any, U any](ctx context.Context, data *T, attrTypes map[string]attr.Type, diags *diag.Diagnostics, f FrameworkElementFlExFunc[*T, U]) types.Object

func FlattenFrameworkUnorderedList added in v1.3.1

func FlattenFrameworkUnorderedList[T any](ctx context.Context, elemType attr.Type, data []T, diags *diag.Diagnostics) internaltypes.UnorderedListValue

func FlattenFrameworkUnorderedListNestedBlock added in v1.3.1

func FlattenFrameworkUnorderedListNestedBlock[T any, U any](ctx context.Context, data []T, attrTypes map[string]attr.Type, diags *diag.Diagnostics, f FrameworkElementFlExFunc[*T, U]) internaltypes.UnorderedListValue

func FlattenFrameworkUnorderedListNotNull added in v1.4.0

func FlattenFrameworkUnorderedListNotNull[T any](ctx context.Context, elemType attr.Type, data []T, diags *diag.Diagnostics) internaltypes.UnorderedListValue

func FlattenInt32Pointer added in v1.1.0

func FlattenInt32Pointer(i *int32) types.Int64

func FlattenInt64

func FlattenInt64(i int64) types.Int64

func FlattenInt64Pointer

func FlattenInt64Pointer(i *int64) types.Int64

func FlattenString

func FlattenString(s string) types.String

func FlattenStringPointer

func FlattenStringPointer(s *string) types.String

func FlattenStringPointerWithNilAsEmpty added in v1.0.0

func FlattenStringPointerWithNilAsEmpty(s *string) types.String

FlattenStringPointerWithNilAsEmpty is a helper function to flatten a string pointer to a string. It returns an empty string if the pointer is nil.

For most fields, API returns empty string instead of null to signify no data, so use FlattenStringPointer instead. In cases where the API returns null, use FlattenStringPointerWithNilAsEmpty.

Types

type FrameworkElementFlExFunc

type FrameworkElementFlExFunc[T any, U any] func(context.Context, T, *diag.Diagnostics) U

type FrameworkElementFlExFuncExt

type FrameworkElementFlExFuncExt[T any, U any, V any] func(context.Context, T, U, *diag.Diagnostics) V

Jump to

Keyboard shortcuts

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