Documentation
¶
Index ¶
- func Addr[T any](t T) *T
- func GenerateUpdateTimestamp() basetypes.StringValue
- func IsKnown(value attr.Value) bool
- func ListIDsToModify(ctx context.Context, plan, state types.List) (idsToAdd []string, idsToRemove []string, diags diag.Diagnostics)
- func ListTypeAs[T any](ctx context.Context, list types.List, diags *diag.Diagnostics) []T
- func MapTypeAs[T any](ctx context.Context, mapIn types.Map, diags *diag.Diagnostics) map[string]T
- func MarkdownDescription(section string, description string, apiScopes []scopes.Scope) string
- func MissingElements(a, b []string) []string
- func PancicPrettyPrint(v interface{})
- func SetIDsToModify(ctx context.Context, plan, state types.Set) (idsToAdd []string, idsToRemove []string, diags diag.Diagnostics)
- func SliceToListTypeObject[T any](ctx context.Context, elems []T, attrs map[string]attr.Type, ...) types.List
- func SliceToListTypeString(ctx context.Context, elems []string, diags *diag.Diagnostics) types.List
- func ValidateEmptyIDs(ctx context.Context, checkSet types.Set, attrPath string) diag.Diagnostics
- func ValidateEmptyIDsList(ctx context.Context, checkList types.Set, attrPath string) diag.Diagnostics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateUpdateTimestamp ¶ added in v0.0.23
func GenerateUpdateTimestamp() basetypes.StringValue
func ListIDsToModify ¶
func ListIDsToModify( ctx context.Context, plan, state types.List, ) (idsToAdd []string, idsToRemove []string, diags diag.Diagnostics)
ListIDsToModify takes a list of unique IDs from plan and state and returns the IDs to add and remove to get from the state to the plan. idsToAdd is the slice of IDs that are in the plan but not in the state. idsToRemove is the slice of IDs that are in the state but not in the plan. useful for resources with HostGroups, RuleGroups, etc.
func ListTypeAs ¶ added in v0.0.11
ListTypeAs converts a types.List into a known []T.
func MapTypeAs ¶ added in v0.0.29
func MapTypeAs[T any]( ctx context.Context, mapIn types.Map, diags *diag.Diagnostics, ) map[string]T
MapTypeAs converts a types.Map into a known map[string]T.
func MarkdownDescription ¶ added in v0.0.23
MarkdownDescription generates a markdown description that works for generating terraform docs.
func MissingElements ¶ added in v0.0.26
MissingElements checks if any elements in slice `a` are missing from slice `b`. It returns a slice containing the missing elements.
func PancicPrettyPrint ¶ added in v0.0.20
func PancicPrettyPrint(v interface{})
PancicPrettyPrint converts the interface into a json string and panics.
func SetIDsToModify ¶
func SetIDsToModify( ctx context.Context, plan, state types.Set, ) (idsToAdd []string, idsToRemove []string, diags diag.Diagnostics)
SetIDsToModify takes a set of IDs from plan and state and returns the IDs to add and remove to get from the state to the plan. idsToAdd is the slice of IDs that are in the plan but not in the state. idsToRemove is the slice of IDs that are in the state but not in the plan. useful for resources with HostGroups, RuleGroups, etc.
func SliceToListTypeObject ¶ added in v0.0.29
func SliceToListTypeObject[T any]( ctx context.Context, elems []T, attrs map[string]attr.Type, diags *diag.Diagnostics, ) types.List
SliceToListTypeObject converts []T into types.List with an attr.Type of types.Object{}.
func SliceToListTypeString ¶ added in v0.0.29
func SliceToListTypeString( ctx context.Context, elems []string, diags *diag.Diagnostics, ) types.List
SliceToListTypeString converts []string into types.List with an attr.Type of types.String. Empty []string will result in an empty types.List.
func ValidateEmptyIDs ¶ added in v0.0.20
ValidateEmptyIDs checks if a set contains empty IDs. Returns a attribute error at path.
func ValidateEmptyIDsList ¶ added in v0.0.29
func ValidateEmptyIDsList( ctx context.Context, checkList types.Set, attrPath string, ) diag.Diagnostics
ValidateEmptyIDsList checks if a list contains empty IDs. Returns a attribute error at path.
Types ¶
This section is empty.