utils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package utils provides utility functions for the provider and resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHTTPStatusCode

func AddHTTPStatusCode(props map[string]any, httpResponse *http.Response) map[string]any

If httpResponse is not nil, add the status code to the properties map.

func Float32PtrToIntString

func Float32PtrToIntString(f *float32) string

Some of the ids are returned as numbers, and our SDK client represents them as float32, but we need them as strings.

func GetStringListValue

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

Converts a TF list of strings into Go list of strings.

func IsEmptyList

func IsEmptyList(value types.List) bool

Returns true if the list value is null, unknown, or empty.

func IsEmptyMap

func IsEmptyMap(value types.Map) bool

Returns true if the map value is null, unknown, or empty.

func IsEmptyObject

func IsEmptyObject(value types.Object) bool

Returns true if the object value is null or unknown.

Types

type ProviderData

type ProviderData struct {
	Client            *api.APIClient
	RootFolderIDCache *map[string]string
}

providerData is the data structure that is passed to the DataSource and Resource.

Jump to

Keyboard shortcuts

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