Documentation ¶
Index ¶
- func CustomHttpRequestRetry[T any](ctx context.Context, maxRetries int, initialRetryDelay time.Duration, ...) (T, *http.Response, error)
- func CustomHttpRequestRetryStronglyTyped[T any](ctx context.Context, maxRetries int, retryDelay time.Duration, ...) (T, *http.Response, error, diag.Diagnostics)
- func Decrypt(key, cryptoText string) (string, error)
- func Encrypt(key, text string) (string, error)
- func ExtractBoolAttr(hashMap map[string]interface{}, key string) (types.Bool, diag.Diagnostics)
- func ExtractFloat32Attr(hashMap map[string]interface{}, key string) (types.Float64, diag.Diagnostics)
- func ExtractFloat64Attr(hashMap map[string]interface{}, key string) (types.Float64, diag.Diagnostics)
- func ExtractInt32Attr(hashMap map[string]interface{}, key string) (types.Int64, diag.Diagnostics)
- func ExtractInt64Attr(hashMap map[string]interface{}, key string) (types.Int64, diag.Diagnostics)
- func ExtractInt64FromFloat(hashMap map[string]interface{}, key string) (types.Int64, diag.Diagnostics)
- func ExtractListAttr(hashMap map[string]interface{}, key string, elemType attr.Type) (types.List, diag.Diagnostics)
- func ExtractListStringAttr(hashMap map[string]interface{}, key string) (types.List, diag.Diagnostics)
- func ExtractObjectAttr(hashMap map[string]interface{}, key string, attrTypes map[string]attr.Type) (types.Object, diag.Diagnostics)
- func ExtractResponseToMap(resp *http.Response) (map[string]interface{}, error)
- func ExtractStringAttr(hashMap map[string]interface{}, key string) (types.String, diag.Diagnostics)
- func ExtractStringsFromList(array types.List) ([]string, diag.Diagnostics)
- func Float32Pointer(input float64) (*float32, diag.Diagnostics)
- func Float64Pointer(input float32) (*float64, diag.Diagnostics)
- func HttpDiagnostics(httpResp *http.Response) string
- func Int32Pointer(input int64) (*int32, diag.Diagnostics)
- func ListInt64TypeToInt32Array(data types.List) ([]int32, diag.Diagnostics)
- func LogCurrentState(t *testing.T) resource.TestCheckFunc
- func NewBoolDefault(defaultValue bool) defaults.Bool
- func NewFloat64Default(defaultValue float64) defaults.Float64
- func NewHttpDiagnostics(httpResp *http.Response, bodyContent string) string
- func NewInt64Default(defaultValue int64) defaults.Int64
- func NewSensitivePlanModifier(encryptionKey string) planmodifier.String
- func NewStringDefault(defaultValue string) defaults.String
- func ReadAndCloseBody(httpResp *http.Response) (string, error)
- type RequiresReplaceIfSensitive
- type SensitivePlanModifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomHttpRequestRetry ¶
func CustomHttpRequestRetry[T any](ctx context.Context, maxRetries int, initialRetryDelay time.Duration, apiCall func() (T, *http.Response, error)) (T, *http.Response, error)
CustomHttpRequestRetry Helper function for retrying API calls. This is to recover from backend congestion errors which manifest as 4XX response codes
func CustomHttpRequestRetryStronglyTyped ¶
func CustomHttpRequestRetryStronglyTyped[T any](ctx context.Context, maxRetries int, retryDelay time.Duration, apiCall func() (T, *http.Response, error, diag.Diagnostics)) (T, *http.Response, error, diag.Diagnostics)
CustomHttpRequestRetryStronglyTyped is a generic function that leverages CustomHttpRequestRetry
func ExtractBoolAttr ¶
ExtractBoolAttr Extracts a bool attribute from a hashmap
func ExtractFloat32Attr ¶
func ExtractFloat32Attr(hashMap map[string]interface{}, key string) (types.Float64, diag.Diagnostics)
ExtractFloat32Attr Extracts a float attribute from a hashmap
func ExtractFloat64Attr ¶
func ExtractFloat64Attr(hashMap map[string]interface{}, key string) (types.Float64, diag.Diagnostics)
ExtractFloat64Attr Extracts a float attribute from a hashmap
func ExtractInt32Attr ¶
ExtractInt32Attr Extracts an int64 attribute from a hashmap
func ExtractInt64Attr ¶
ExtractInt64Attr Extracts an int64 attribute from a hashmap
func ExtractInt64FromFloat ¶ added in v0.12.0
func ExtractListAttr ¶
func ExtractListAttr(hashMap map[string]interface{}, key string, elemType attr.Type) (types.List, diag.Diagnostics)
ExtractListAttr extracts a list attribute from a hashmap
func ExtractListStringAttr ¶
func ExtractListStringAttr(hashMap map[string]interface{}, key string) (types.List, diag.Diagnostics)
ExtractListStringAttr extracts a slice of string attributes from a hashmap
func ExtractObjectAttr ¶
func ExtractObjectAttr(hashMap map[string]interface{}, key string, attrTypes map[string]attr.Type) (types.Object, diag.Diagnostics)
ExtractObjectAttr extracts an object attribute from a hashmap
func ExtractResponseToMap ¶
ExtractResponseToMap reads an HTTP response body and unmarshals the JSON content into a map[string]interface{}. It returns the map along with any error that occurs during the read or unmarshal process.
func ExtractStringAttr ¶
ExtractStringAttr Extracts a string attribute from a hashmap
func ExtractStringsFromList ¶
func ExtractStringsFromList(array types.List) ([]string, diag.Diagnostics)
func Float32Pointer ¶
func Float32Pointer(input float64) (*float32, diag.Diagnostics)
Float32Pointer Convert float64 to *float32 with error handling
func Float64Pointer ¶
func Float64Pointer(input float32) (*float64, diag.Diagnostics)
Float64Pointer Convert float32 to *float64 with error handling
func HttpDiagnostics ¶
HttpDiagnostics - responsible for gathering and logging HTTP driven events
func Int32Pointer ¶
func Int32Pointer(input int64) (*int32, diag.Diagnostics)
Int32Pointer Convert int64 to *int32 with error handling
func ListInt64TypeToInt32Array ¶
func ListInt64TypeToInt32Array(data types.List) ([]int32, diag.Diagnostics)
func LogCurrentState ¶
func LogCurrentState(t *testing.T) resource.TestCheckFunc
LogCurrentState LogCurrentStat Custom test check function to log the current state
func NewBoolDefault ¶
NewBoolDefault returns a struct that implements the defaults.Bool interface for a resource Schema
func NewFloat64Default ¶
NewFloat64Default returns a struct that implements the defaults.Float64 interface for a resource Schema
func NewHttpDiagnostics ¶
NewHttpDiagnostics - responsible for gathering and logging HTTP driven events
func NewInt64Default ¶
NewInt64Default returns a struct that implements the defaults.Int64 interface for a resource Schema
func NewSensitivePlanModifier ¶
func NewSensitivePlanModifier(encryptionKey string) planmodifier.String
func NewStringDefault ¶
NewStringDefault returns a struct that implements the defaults.String interface for a resource Schema
Types ¶
type RequiresReplaceIfSensitive ¶
type RequiresReplaceIfSensitive struct{}
RequiresReplaceIfSensitive Custom plan modifier to require replacement if the sensitive attribute changes
func (RequiresReplaceIfSensitive) Description ¶
func (r RequiresReplaceIfSensitive) Description(context.Context) string
func (RequiresReplaceIfSensitive) MarkdownDescription ¶
func (r RequiresReplaceIfSensitive) MarkdownDescription(context.Context) string
func (RequiresReplaceIfSensitive) PlanModifyString ¶
func (r RequiresReplaceIfSensitive) PlanModifyString(ctx context.Context, req planmodifier.StringRequest, resp *planmodifier.StringResponse)
type SensitivePlanModifier ¶
type SensitivePlanModifier struct {
// contains filtered or unexported fields
}
func (SensitivePlanModifier) Description ¶
func (m SensitivePlanModifier) Description(ctx context.Context) string
func (SensitivePlanModifier) MarkdownDescription ¶
func (m SensitivePlanModifier) MarkdownDescription(ctx context.Context) string
func (SensitivePlanModifier) PlanModifyString ¶
func (m SensitivePlanModifier) PlanModifyString(ctx context.Context, req planmodifier.StringRequest, resp *planmodifier.StringResponse)