Documentation
¶
Index ¶
- func Any[T comparable](ts []T, value T) bool
- func CheckLastN[T comparable](ts []T, n int, values ...T) bool
- func DataSourceTypeName(req datasource.MetadataRequest, name string) string
- func Deref[T any](a *T) T
- func FirewallRanges(frs *[]string) []types.String
- func FirstNotEmpty(ss ...string) string
- func FirstSetStringValue(ss ...types.String) types.String
- func HandleError(resp *http.Response, ierr error, numTries int) (*http.Response, error)
- func Join[A any](ss []A, separator string) string
- func Map[A, B any](as []A, f func(A) B) []B
- func MaybeBody(resp StatusCoder) string
- func MaybeBool(b types.Bool) *bool
- func MaybeBoolValue(b *bool) types.Bool
- func MaybeFloat32(f types.Float32) *float32
- func MaybeString(s types.String) *string
- func MaybeStringValue(s *string) types.String
- func MaybeUUIDStringValue(id *otypes.UUID) types.String
- func NewHTTPClient() *http.Client
- func NewTimeValidator() validator.String
- func NewUUIDValidator() validator.String
- func PrivateConnectionTypeString(wgs types.String) (management.PrivateConnectionCreateType, error)
- func Ptr[A any](a A) *A
- func ReadNotEmptyFileTrimmed(path string) (string, error)
- func ResourceTypeName(req resource.MetadataRequest, name string) string
- func StringFirewallRanges(frs []types.String) []string
- func StringValueOrNull[T ~string](value *T) types.String
- func TerraformProviderUserAgent(version string) string
- func ToString(s types.String) string
- func UUIDStringValue(id otypes.UUID) types.String
- func WorkspaceAutoScaleSensitivityString(wgs types.String) *management.WorkspaceUpdateAutoScaleSensitivity
- func WorkspaceCreateAutoSuspendSuspendTypeString(wgs types.String) *management.WorkspaceCreateAutoSuspendSuspendType
- func WorkspaceGroupCreateDeploymentTypeString(wgs types.String) *management.WorkspaceGroupCreateDeploymentType
- func WorkspaceGroupStateStringValue(wgs management.WorkspaceGroupState) types.String
- func WorkspaceGroupUpdateDeploymentTypeString(wgs types.String) *management.WorkspaceGroupUpdateDeploymentType
- func WorkspaceStateString(wgs types.String) *management.WorkspaceState
- func WorkspaceStateStringValue(ws management.WorkspaceState) types.String
- func WorkspaceUpdateAutoSuspendSuspendTypeString(wgs types.String) *management.WorkspaceUpdateAutoSuspendSuspendType
- type StatusCoder
- type StatusOKOption
- type SummaryWithDetailError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Any ¶
func Any[T comparable](ts []T, value T) bool
Any returns true if any element of the array is equal to the value.
func CheckLastN ¶
func CheckLastN[T comparable](ts []T, n int, values ...T) bool
CheckLastN returns true if the last n elements of the array are equal to any of the values. If the array does not have the desired count of elements, it returns false.
func DataSourceTypeName ¶
func DataSourceTypeName(req datasource.MetadataRequest, name string) string
DataSourceTypeName constructs the type name for the data source of the provider.
func Deref ¶
func Deref[T any](a *T) T
Deref returns the value under the pointer.
If the pointer is nil, it returns an empty value.
func FirewallRanges ¶
func FirstNotEmpty ¶
FirstNotEmpty returns the first encountered not empty string if present.
func FirstSetStringValue ¶
FirstSetStringValue returns the first set string value. If not found, it returns an unset string.
func HandleError ¶
HandleError overrides the default behavior of the library by exposing the underlying issue because the underlying issue may be useful, e.g., a customer running out of credits and still closing the body.
This function is called if retries are expired, containing the last status from the http library. If not specified, default behavior for the library is to close the body and return an error indicating how many tries were attempted.
The function is called only when server returns 500s.
func Map ¶
func Map[A, B any](as []A, f func(A) B) []B
Map applies the function f to each element of the input list and returns a new list containing the results. The input list is not modified. The function f should take an element of the input list as its argument and return a value of a different type. The output list has the same length as the input list.
func MaybeBody ¶
func MaybeBody(resp StatusCoder) string
func MaybeBoolValue ¶
func MaybeFloat32 ¶
func MaybeString ¶
func MaybeStringValue ¶
func NewHTTPClient ¶
NewHTTPClient creates an HTTP client for the Terraform provider.
func NewTimeValidator ¶
NewTimeValidator returns an AttributeValidator which ensures that any configured attribute value:
- Is a string.
- Matches the string format RFC3339.
- Is UTC.
Null (unconfigured) and unknown (known after apply) values are skipped.
func NewUUIDValidator ¶
NewUUIDValidator returns an AttributeValidator which ensures that any configured attribute value:
- Is a string.
- Matches the UUID format.
Null (unconfigured) and unknown (known after apply) values are skipped.
func PrivateConnectionTypeString ¶
func PrivateConnectionTypeString(wgs types.String) (management.PrivateConnectionCreateType, error)
func ReadNotEmptyFileTrimmed ¶
ReadNotEmptyFileTrimmed reads the file at path and returns the white space trimmed non-empty content.
func ResourceTypeName ¶
func ResourceTypeName(req resource.MetadataRequest, name string) string
ResourceTypeName constructs the type name for the resource of the provider.
func StringFirewallRanges ¶
func StringValueOrNull ¶
func TerraformProviderUserAgent ¶
TerraformProviderUserAgent identifies the provider as a versioned User Agent.
func WorkspaceAutoScaleSensitivityString ¶
func WorkspaceAutoScaleSensitivityString(wgs types.String) *management.WorkspaceUpdateAutoScaleSensitivity
func WorkspaceCreateAutoSuspendSuspendTypeString ¶
func WorkspaceCreateAutoSuspendSuspendTypeString(wgs types.String) *management.WorkspaceCreateAutoSuspendSuspendType
func WorkspaceGroupCreateDeploymentTypeString ¶
func WorkspaceGroupCreateDeploymentTypeString(wgs types.String) *management.WorkspaceGroupCreateDeploymentType
func WorkspaceGroupStateStringValue ¶
func WorkspaceGroupStateStringValue(wgs management.WorkspaceGroupState) types.String
func WorkspaceGroupUpdateDeploymentTypeString ¶
func WorkspaceGroupUpdateDeploymentTypeString(wgs types.String) *management.WorkspaceGroupUpdateDeploymentType
func WorkspaceStateString ¶
func WorkspaceStateString(wgs types.String) *management.WorkspaceState
func WorkspaceStateStringValue ¶
func WorkspaceStateStringValue(ws management.WorkspaceState) types.String
func WorkspaceUpdateAutoSuspendSuspendTypeString ¶
func WorkspaceUpdateAutoSuspendSuspendTypeString(wgs types.String) *management.WorkspaceUpdateAutoSuspendSuspendType
Types ¶
type StatusCoder ¶
type StatusCoder interface {
StatusCode() int
}
type StatusOKOption ¶
type StatusOKOption func(code int) (overrideReturn bool, newResult *SummaryWithDetailError)
type SummaryWithDetailError ¶
func MapWithError ¶
func MapWithError[A, B any](as []A, f func(A) (B, *SummaryWithDetailError)) ([]B, *SummaryWithDetailError)
MapWithError applies the function f to each element of the input list and returns a new list containing the results. The input list is not modified. The function f should take an element of the input list as its argument and return a value of a different type. The output list has the same length as the input list. If the converter returns an error, the first error is returned and no result.
func ReturnNilOnNotFound ¶
func ReturnNilOnNotFound(code int) (bool, *SummaryWithDetailError)
func StatusOK ¶
func StatusOK(resp StatusCoder, ierr error, opts ...StatusOKOption, ) *SummaryWithDetailError
func (SummaryWithDetailError) Error ¶
func (swd SummaryWithDetailError) Error() string