converters

package
v1.53.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoSdkToTfSdkStruct

func GoSdkToTfSdkStruct(ctx context.Context, gosdk interface{}, tfsdk interface{}) diag.Diagnostics

GoSdkToTfSdkStruct converts a gosdk struct into a tfsdk struct, with the folowing rules.

string -> types.String
bool -> types.Bool
int64 -> types.Int64
float64 -> types.Float64
string -> types.String

NOTE:

If field name doesn't show up in ForceSendFields and the field is zero value, we set the null value on the tfsdk.
types.list and types.map are not supported
map keys should always be a string
tfsdk structs use types.String for all enum values
non-json fields will be omitted

func TfSdkToGoSdkStruct

func TfSdkToGoSdkStruct(ctx context.Context, tfsdk interface{}, gosdk interface{}) diag.Diagnostics

TfSdkToGoSdkStruct converts a tfsdk struct into a gosdk struct, with the folowing rules.

types.String -> string
types.Bool -> bool
types.Int64 -> int64
types.Float64 -> float64
types.String -> string

NOTE:

ForceSendFields are populated for string, bool, int64, float64 on non null values
types.list and types.map are not supported
map keys should always be a string
tfsdk structs use types.String for all enum values

Types

This section is empty.

Jump to

Keyboard shortcuts

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