Documentation
¶
Index ¶
- func AddMissingRequiredProviderConfigurationValue(diagnostics *diag.Diagnostics, ...)
- func AddUnexpectedDataSourceConfigurationTypeError(diagnostics *diag.Diagnostics, expectedType, receivedType any)
- func AddUnexpectedEphemeralResourceConfigurationTypeError(diagnostics *diag.Diagnostics, expectedType, receivedType any)
- func AddUnexpectedResourceConfigurationTypeError(diagnostics *diag.Diagnostics, expectedType, receivedType any)
- func AttributeMapFromObject(m ModelWithAttributes) (map[string]attr.Type, error)
- func ConvertBaseStringArrayToPrimitiveStringArray(v []types.String) []string
- func ConvertPrimitiveInterfaceArrayToStringList(ctx context.Context, diagnostics *diag.Diagnostics, v []any) (types.List, string)
- func FindElement[T any](slice []T, criteria any) (T, bool)
- func GetEnvironmentVariable(name string, reciever any) error
- func Int32PointerIsNilOrNegative(value *int32) bool
- func ListToStringSlice(ctx context.Context, l *basetypes.ListValue, response *[]string) diag.Diagnostics
- func ObjectListToTypedArray[objTyp any](ctx context.Context, diagnostics *diag.Diagnostics, v types.List) []objTyp
- func ObjectSetToTypedArray[objTyp any](ctx context.Context, diagnostics *diag.Diagnostics, v types.Set) []objTyp
- func ObjectValueToTypedObject[objTyp any](ctx context.Context, diagnostics *diag.Diagnostics, v types.Object) objTyp
- func PanicHandler(diagnostics *diag.Diagnostics)
- func SliceSharesOneOrMoreElements(s1 []string, s2 []string) bool
- func StringArrayToStringList(ctx context.Context, diagnostics *diag.Diagnostics, v []string) types.List
- func StringArrayToStringSet(ctx context.Context, diagnostics *diag.Diagnostics, v []string) types.Set
- func StringListToStringArray(ctx context.Context, diagnostics *diag.Diagnostics, v types.List) []string
- func StringPointerIsNilOrEmpty(value *string) bool
- func StringSetToStringArray(ctx context.Context, diagnostics *diag.Diagnostics, v types.Set) []string
- func StringToInt(str string) (int, error)
- func StringToTypeBool(from string) types.Bool
- func TypeBoolToString(from types.Bool) string
- func TypedArrayToObjectList[objTyp ModelWithAttributes](ctx context.Context, diagnostics *diag.Diagnostics, v []objTyp) types.List
- func TypedArrayToObjectSet[objTyp ModelWithAttributes](ctx context.Context, diagnostics *diag.Diagnostics, v []objTyp) types.Set
- func TypedObjectToObjectValue(ctx context.Context, diagnostics *diag.Diagnostics, v ModelWithAttributes) types.Object
- type ModelWithAttributes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMissingRequiredProviderConfigurationValue ¶
func AddMissingRequiredProviderConfigurationValue(diagnostics *diag.Diagnostics, attributeName, attributeNamePretty, attributeEnvVar string)
func AddUnexpectedDataSourceConfigurationTypeError ¶
func AddUnexpectedDataSourceConfigurationTypeError(diagnostics *diag.Diagnostics, expectedType, receivedType any)
func AddUnexpectedEphemeralResourceConfigurationTypeError ¶
func AddUnexpectedEphemeralResourceConfigurationTypeError(diagnostics *diag.Diagnostics, expectedType, receivedType any)
func AddUnexpectedResourceConfigurationTypeError ¶
func AddUnexpectedResourceConfigurationTypeError(diagnostics *diag.Diagnostics, expectedType, receivedType any)
func AttributeMapFromObject ¶
func AttributeMapFromObject(m ModelWithAttributes) (map[string]attr.Type, error)
<summary> Helper function to convert a model to a map of attribute types. Used when converting back to a types.Object </summary> <param name="m">Model to convert, must implement the ModelWithSchema interface</param> <returns>Map of attribute types</returns>
func ConvertBaseStringArrayToPrimitiveStringArray ¶
<summary> Helper function to convert array of terraform strings to array of golang primitive strings Deprecated: Remove after we fully move to types.List </summary> <param name="v">Array of terraform stringsArray of golang primitive strings</param> <returns>Array of golang primitive strings</returns>
func ConvertPrimitiveInterfaceArrayToStringList ¶
func ConvertPrimitiveInterfaceArrayToStringList(ctx context.Context, diagnostics *diag.Diagnostics, v []any) (types.List, string)
<summary> Helper function to convert array of golang primitive interface to native terraform list of strings </summary> <param name="v">Array of golang primitive interface</param> <returns>Terraform list of strings</returns>
func FindElement ¶
FindElement searches for an element in a slice and returns it if found, along with a boolean indicating if it was found. The criteria argument can be either a value to compare directly with elements in the slice, or a map[string]any of key-value pairs to match against the fields of a struct element.
func GetEnvironmentVariable ¶
GetEnvironmentVariable retrieves the string value of the specified environment variable, converts it to the type of the reciever argument, and assigns address of the converted value to reciever.
If the environment variable is not set, is set to an empty value, or is unable to be converted into the reciever type, the function will exit without modifying reciever and return an error.
func ListToStringSlice ¶
func ListToStringSlice(ctx context.Context, l *basetypes.ListValue, response *[]string) diag.Diagnostics
Converts basetypes.ListValue to string slice and populates it in response
func ObjectListToTypedArray ¶
func ObjectListToTypedArray[objTyp any](ctx context.Context, diagnostics *diag.Diagnostics, v types.List) []objTyp
<summary> Helper function to convert a native terraform list of objects to a golang slice of the specified type Use TypedArrayToObjectList to go the other way. </summary> <param name="ctx">context</param> <param name="diagnostics">Any issues will be appended to these diagnostics</param> <param name="v">List of object in the native terraform types.List wrapper</param> <returns>Array of the specified type</returns>
func ObjectSetToTypedArray ¶
func ObjectSetToTypedArray[objTyp any](ctx context.Context, diagnostics *diag.Diagnostics, v types.Set) []objTyp
<summary> Helper function to convert a native terraform list of objects to a golang slice of the specified type Use TypedArrayToObjectSet to go the other way. </summary> <param name="ctx">context</param> <param name="diagnostics">Any issues will be appended to these diagnostics</param> <param name="v">Set of object in the native terraform types.Set wrapper</param> <returns>Array of the specified type</returns>
func ObjectValueToTypedObject ¶
func ObjectValueToTypedObject[objTyp any](ctx context.Context, diagnostics *diag.Diagnostics, v types.Object) objTyp
<summary> Helper function to convert a native terraform object to a golang object of the specified type. Use TypedObjectToObjectValue to go the other way. </summary> <param name="ctx">context</param> <param name="diagnostics">Any issues will be appended to these diagnostics</param> <param name="v">Object in the native terraform types.Object wrapper</param> <returns>Object of the specified type</returns>
func PanicHandler ¶
func PanicHandler(diagnostics *diag.Diagnostics)
PanicHandler is a global panic handler to catch all unexpected errors to prevent the provider from crashing.
The crash stack is written into a local text file.
func SliceSharesOneOrMoreElements ¶
Returns true if s1 shares any elements with s2
func StringArrayToStringList ¶
func StringArrayToStringList(ctx context.Context, diagnostics *diag.Diagnostics, v []string) types.List
<summary> Helper function to convert a golang slice of string to a native terraform list of strings. Use StringListToStringArray to go the other way. </summary> <param name="diagnostics">Any issues will be appended to these diagnostics</param> <param name="v">Slice of strings</param> <returns>types.List</returns>
func StringArrayToStringSet ¶
func StringArrayToStringSet(ctx context.Context, diagnostics *diag.Diagnostics, v []string) types.Set
<summary> Helper function to convert a golang slice of string to a native terraform set of strings. Use StringSetToStringArray to go the other way. </summary> <param name="diagnostics">Any issues will be appended to these diagnostics</param> <param name="v">Slice of strings</param> <returns>types.Set</returns>
func StringListToStringArray ¶
func StringListToStringArray(ctx context.Context, diagnostics *diag.Diagnostics, v types.List) []string
<summary> Helper function to convert a terraform list of terraform strings to array of golang primitive strings. Use StringArrayToStringList to go the other way. </summary> <param name="v">List of terraform strings</param> <returns>Array of golang primitive strings</returns>
func StringSetToStringArray ¶
func StringSetToStringArray(ctx context.Context, diagnostics *diag.Diagnostics, v types.Set) []string
<summary> Helper function to convert a terraform set of terraform strings to array of golang primitive strings. Use StringArrayToStringSet to go the other way. </summary> <param name="v">Set of terraform strings</param> <returns>Array of golang primitive strings</returns>
func StringToInt ¶
func StringToTypeBool ¶
<summary> Helper function to convert string to terraform boolean value </summary> <param name="from">Boolean value in string</param> <returns>Boolean value in terraform types.Bool</returns>
func TypeBoolToString ¶
<summary> Helper function to convert terraform bool value to string </summary> <param name="from">Boolean value in terraform bool</param> <returns>Boolean value in string</returns>
func TypedArrayToObjectList ¶
func TypedArrayToObjectList[objTyp ModelWithAttributes](ctx context.Context, diagnostics *diag.Diagnostics, v []objTyp) types.List
<summary> Helper function to convert a golang slice to a native terraform list of objects. Use ObjectListToTypedArray to go the other way. </summary> <param name="diagnostics">Any issues will be appended to these diagnostics</param> <param name="v">Slice of objects</param> <returns>types.List</returns>
func TypedArrayToObjectSet ¶
func TypedArrayToObjectSet[objTyp ModelWithAttributes](ctx context.Context, diagnostics *diag.Diagnostics, v []objTyp) types.Set
<summary> Helper function to convert a golang slice to a native terraform list of objects. Use ObjectSetToTypedArray to go the other way. </summary> <param name="diagnostics">Any issues will be appended to these diagnostics</param> <param name="v">Slice of objects</param> <returns>types.Set</returns>
func TypedObjectToObjectValue ¶
func TypedObjectToObjectValue(ctx context.Context, diagnostics *diag.Diagnostics, v ModelWithAttributes) types.Object
<summary> Helper function to convert a golang object to a native terraform object. Use ObjectValueToTypedObject to go the other way. </summary> <param name="ctx">"context</param> <param name="diagnostics">Any issues will be appended to these diagnostics</param> <param name="v">Object of the specified type</param> <param name="s">Schema map of the object</param> <returns>Object in the native terraform types.Object wrapper</returns>