helpers

package
v0.18.3-alpha202402271002 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package helpers provides api errors helpers for the CloudAvenue Terraform Provider.

Package helpers provides auth helpers for the CloudAvenue Terraform Provider.

Package helpers provides configuration helpers for Terraform Provider.

Index

Constants

View Source
const (
	// ForceNewDescription is the description for ForceNew.
	ForceNewDescription = "Changes to this field will force a new resource to be created."
)

Variables

This section is empty.

Functions

func GetAuthContextWithTO

func GetAuthContextWithTO(apiCtx, tfCtx context.Context) (context.Context, error)

GetAuthContextWithTO is a helper function to create the auth context with the token api and the terraform context with timeout.

Types

type APIError

type APIError struct {
	cloudavenue.ApiError
	// contains filtered or unexported fields
}

APIError is an error returned by the CloudAvenue API.

func CheckAPIError

func CheckAPIError(err error, httpR *http.Response) *APIError

CheckAPIError checks the HTTP response for errors and returns an APIError with statusCode and model is the error is a cloudavenue.GenericSwaggerError type or only the error if not.

func (*APIError) Error

func (e *APIError) Error() string

Error returns the error message.

func (*APIError) GetDetail

func (e *APIError) GetDetail() string

GetDetail returns a detailed description of the error.

func (*APIError) GetStatusCode

func (e *APIError) GetStatusCode() int

GetStatusCode returns the HTTP status code.

func (*APIError) GetSummary

func (e *APIError) GetSummary() string

GetSummary returns a summary of the error.

func (*APIError) GetTerraformDiagnostic

func (e *APIError) GetTerraformDiagnostic() diag.Diagnostic

GetTerraformDiagnostic returns a Terraform Diagnostic for the error.

func (*APIError) IsNotFound

func (e *APIError) IsNotFound() bool

IsNotFound returns true if the error is a 404 Not Found error.

func (*APIError) Unwrap

func (e *APIError) Unwrap() error

Unwrap returns the underlying error.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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