util

package
v0.30.5 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, resource string, v ...any)

func Created

func Created(ctx context.Context, resource string, v ...any)

func DatasourceReading

func DatasourceReading(ctx context.Context, resource string, v ...any)

func DatasourceResultCount

func DatasourceResultCount(ctx context.Context, resource string, count int)

func Delete

func Delete(ctx context.Context, resource string, v ...any)

func Deleted

func Deleted(ctx context.Context, resource string, v ...any)

func ExpandStringList

func ExpandStringList(list types.List) []string

func FlattenStringList

func FlattenStringList(list []string) types.List

func GetDataSourceDescription

func GetDataSourceDescription(resourceName string) string

func GetIds

func GetIds(ids types.List) []string

func GetNumber

func GetNumber(val types.Int64) int

func GetProviderName

func GetProviderName() string

func GetResourceSchemaDescription

func GetResourceSchemaDescription(resourceName string) string

func GetStringOrEmpty

func GetStringOrEmpty(tfAttr interface{}) string

func GetTypeName

func GetTypeName(name string) string

func Map

func Map[T, V any](items []T, fn func(T) V) []V

func Read

func Read(ctx context.Context, resource string, v ...any)

func Reading

func Reading(ctx context.Context, resource string, v ...any)

func SetToStringArray

func SetToStringArray(ctx context.Context, set types.Set) ([]string, diag.Diagnostics)

func StringOrNull

func StringOrNull(s string) types.String

func Ternary

func Ternary[T interface{}](condition bool, whenTrue T, whenFalse T) T

func ToValueSlice

func ToValueSlice(slice []string) []attr.Value

func Update

func Update(ctx context.Context, resource string, v ...any)

func Updated

func Updated(ctx context.Context, resource string, v ...any)

Types

type AttributeBuilder

type AttributeBuilder[T any] struct {
	// contains filtered or unexported fields
}

func NewAttributeBuilder

func NewAttributeBuilder[T any]() *AttributeBuilder[T]

func ResourceBool

func ResourceBool() *AttributeBuilder[schema.BoolAttribute]

func ResourceInt64

func ResourceInt64() *AttributeBuilder[schema.Int64Attribute]

func ResourceList

func ResourceList(elementType attr.Type) *AttributeBuilder[schema.ListAttribute]

func ResourceMap

func ResourceMap(elementType attr.Type) *AttributeBuilder[schema.MapAttribute]

func ResourceObject

func ResourceObject(attributeTypes map[string]attr.Type) *AttributeBuilder[schema.ObjectAttribute]

func ResourceSet

func ResourceSet(elementType attr.Type) *AttributeBuilder[schema.SetAttribute]

func (*AttributeBuilder[T]) AttributeTypes

func (b *AttributeBuilder[T]) AttributeTypes(attributeTypes map[string]attr.Type) *AttributeBuilder[T]

func (*AttributeBuilder[T]) Build

func (b *AttributeBuilder[T]) Build() T

func (*AttributeBuilder[T]) Computed

func (b *AttributeBuilder[T]) Computed() *AttributeBuilder[T]

func (*AttributeBuilder[T]) Default

func (b *AttributeBuilder[T]) Default(defaultValue interface{}) *AttributeBuilder[T]

func (*AttributeBuilder[T]) Deprecated

func (b *AttributeBuilder[T]) Deprecated(deprecationMessage string) *AttributeBuilder[T]

func (*AttributeBuilder[T]) Description

func (b *AttributeBuilder[T]) Description(desc string) *AttributeBuilder[T]

func (*AttributeBuilder[T]) ElementType

func (b *AttributeBuilder[T]) ElementType(elementType attr.Type) *AttributeBuilder[T]

func (*AttributeBuilder[T]) Optional

func (b *AttributeBuilder[T]) Optional() *AttributeBuilder[T]

func (*AttributeBuilder[T]) PlanModifiers

func (b *AttributeBuilder[T]) PlanModifiers(modifiers ...any) *AttributeBuilder[T]

func (*AttributeBuilder[T]) Required

func (b *AttributeBuilder[T]) Required() *AttributeBuilder[T]

func (*AttributeBuilder[T]) Sensitive

func (b *AttributeBuilder[T]) Sensitive() *AttributeBuilder[T]

func (*AttributeBuilder[T]) Validators

func (b *AttributeBuilder[T]) Validators(validators ...any) *AttributeBuilder[T]

type DataSourceAttributeBuilder

type DataSourceAttributeBuilder[T any] struct {
	// contains filtered or unexported fields
}

func DataSourceList

func DataSourceList(elementType attr.Type) *DataSourceAttributeBuilder[schema.ListAttribute]

func DataSourceMap

func DataSourceMap(elementType attr.Type) *DataSourceAttributeBuilder[schema.MapAttribute]

func DataSourceSet

func DataSourceSet(elementType attr.Type) *DataSourceAttributeBuilder[schema.SetAttribute]

func NewDataSourceAttributeBuilder

func NewDataSourceAttributeBuilder[T any]() *DataSourceAttributeBuilder[T]

func (*DataSourceAttributeBuilder[T]) Build

func (b *DataSourceAttributeBuilder[T]) Build() T

func (*DataSourceAttributeBuilder[T]) Computed

func (*DataSourceAttributeBuilder[T]) Deprecated

func (b *DataSourceAttributeBuilder[T]) Deprecated(deprecationMessage string) *DataSourceAttributeBuilder[T]

func (*DataSourceAttributeBuilder[T]) Description

func (b *DataSourceAttributeBuilder[T]) Description(desc string) *DataSourceAttributeBuilder[T]

func (*DataSourceAttributeBuilder[T]) ElementType

func (b *DataSourceAttributeBuilder[T]) ElementType(elementType attr.Type) *DataSourceAttributeBuilder[T]

func (*DataSourceAttributeBuilder[T]) Optional

func (*DataSourceAttributeBuilder[T]) Required

func (*DataSourceAttributeBuilder[T]) Sensitive

Jump to

Keyboard shortcuts

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