flex

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 9 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 ExpandFrameworkListNestedBlock

func ExpandFrameworkListNestedBlock[T any, U any](ctx context.Context, tfList types.List, diags *diag.Diagnostics, f FrameworkElementFlExFunc[T, *U]) []U

func ExpandFrameworkListString

func ExpandFrameworkListString(ctx context.Context, tfList types.List, 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 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 FlattenFloat64

func FlattenFloat64(f float64) types.Float64

func FlattenFloat64Pointer

func FlattenFloat64Pointer(f *float64) types.Float64

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 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 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