internal

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributeTypes

func AttributeTypes[T any](ctx context.Context) (map[string]attr.Type, error)

AttributeTypes returns a map of attribute types for the specified type T. T must be a struct and reflection is used to find exported fields of T with the `tfsdk` tag.

func ExpandFrameworkObject added in v0.3.0

func ExpandFrameworkObject[ObjectT any, ExpandT any](ctx context.Context, object types.Object, f func(ObjectT) *ExpandT) *ExpandT

ExpandFrameworkObject converts a framework Object value to a value of type ExpandT according to the specified map function f.

If the framework value is null or unknown, or if an error occurs when converting the object into a value of type ObjectT, nil is returned.

func ExpandFrameworkSet

func ExpandFrameworkSet[SetT any, ExpandT any](ctx context.Context, set types.Set, f func(SetT) ExpandT) []ExpandT

ExpandFrameworkSet converts a framework Set value to a slice of values according to the specified map function f.

If the framework value is null or unknown, or if an error occurs when first converting the set into a slice of type SetT, an empty slice is returned.

func ExpandFrameworkStringSet

func ExpandFrameworkStringSet(ctx context.Context, tfSet types.Set) []string

ExpandFrameworkStringSet converts a framework Set value to a slice of string values.

If the framework value is null or unknown, or if an error occurs when first converting the set into a slice of element type string, an empty slice is returned.

func FlattenFrameworkSet

func FlattenFrameworkSet[T any](ctx context.Context, elementType attr.Type, list []T, f func(T) attr.Value) types.Set

FlattenFrameworkSet converts an arbitrary slice to a framework Set value of the specified elementType and map function f to do the conversion.

If the slice has 0 elements, then an empty set is returned.

func PrettyOneOf

func PrettyOneOf[T ~string](options []T) string

PrettyOneOf returns "(one of options...)"

func PrettyRFC3339Timestamp

func PrettyRFC3339Timestamp() string

PrettyRFC3339Timestamp returns "formatted as a UTC timestamp string in [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) format"

func ResourceSchemaToDataSourceSchema

func ResourceSchemaToDataSourceSchema(resourceSchema map[string]resource_schema.Attribute, idField *string) map[string]datasource_schema.Attribute

ResourceSchemaToDataSourceSchema converts a resource schema to a data source schema by copying all common fields between the two schemas, and setting required = true for the specified id field

func StringFromFramework

func StringFromFramework(_ context.Context, v types.String) *string

StringFromFramework converts a Framework String value to a string pointer. A null String is converted to a nil string pointer.

Types

This section is empty.

Directories

Path Synopsis
bzdatasource provides abstractions that make it easier to write data sources for the BastionZero API.
bzdatasource provides abstractions that make it easier to write data sources for the BastionZero API.
Package testgen provides property based test (PBT) generators that can be used to test properties of the Terraform provider implementation
Package testgen provides property based test (PBT) generators that can be used to test properties of the Terraform provider implementation
bzgen
Package bzgen provides property based test (PBT) generators for BastionZero API types
Package bzgen provides property based test (PBT) generators for BastionZero API types
bzgen/bzpolicygen
Package bzpolicygen provides property based test (PBT) generators for BastionZero policy API types
Package bzpolicygen provides property based test (PBT) generators for BastionZero policy API types
tfgen
Package tfgen provides property based test (PBT) generators for BastionZero Terraform Provider schema model types
Package tfgen provides property based test (PBT) generators for BastionZero Terraform Provider schema model types
tfgen/tfpolicygen
Package tfpolicygen provides property based test (PBT) generators for BastionZero Terraform Provider policy schema model types
Package tfpolicygen provides property based test (PBT) generators for BastionZero Terraform Provider policy schema model types

Jump to

Keyboard shortcuts

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