flatteners

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtr

func BoolPtr(in *bool) basetypes.BoolValue

func Float64

func Float64(in float64) basetypes.Float64Value

Int64 accepts a `int64` and returns a `basetypes.Int64Value`. The return type automatically handles `Int64Null` should the integer be 0.

Removes the need for the following code when saving to state.

if response.MyField == "" {
    state.MyField = types.Int64Value(response.MyField)
} else {
    state.MyField = types.Int64Null()
}

Not recommended if you care about returning an empty string for the state.

nolint: contextcheck

func Int32

func Int32(in int) basetypes.Int32Value

func Int32Ptr

func Int32Ptr(in *int) basetypes.Int32Value

func Int64

func Int64(in int64) basetypes.Int64Value

Int64 accepts a `int64` and returns a `basetypes.Int64Value`. The return type automatically handles `Int64Null` should the integer be 0.

Removes the need for the following code when saving to state.

if response.MyField == "" {
    state.MyField = types.Int64Value(response.MyField)
} else {
    state.MyField = types.Int64Null()
}

Not recommended if you care about returning an empty string for the state.

nolint: contextcheck

func Int64Ptr

func Int64Ptr(in *int) basetypes.Int64Value

func ListOfStringToTerraformList

func ListOfStringToTerraformList(l []string) (types.List, diag.Diagnostics)

func String

func String(in string) basetypes.StringValue

String accepts a `string` and returns a `basetypes.StringValue`. The return type automatically handles `StringNull` should the string be empty.

Removes the need for the following code when saving to state.

if response.MyField == "" {
    state.MyField = types.StringValue(response.MyField)
} else {
    state.MyField = types.StringNull()
}

Not recommended if you care about returning an empty string for the state.

nolint: contextcheck

func StringPtr

func StringPtr(in *string) basetypes.StringValue

Types

This section is empty.

Jump to

Keyboard shortcuts

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