Documentation
¶
Index ¶
- Variables
- func CheckEnvironmentExistsOnPermissionsError(ctx context.Context, managementClient *management.APIClient, ...) (any, *http.Response, error)
- func ParseResponse(ctx context.Context, f framework.SDKInterfaceFunc, requestID string, ...) diag.Diagnostics
- func ParseResponseWithCustomTimeout(ctx context.Context, f framework.SDKInterfaceFunc, requestID string, ...) diag.Diagnostics
- type CustomError
- type ResourceType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultCustomError = func(_ *http.Response, _ *model.P1Error) diag.Diagnostics { return nil } CustomErrorResourceNotFoundWarning = func(r *http.Response, p1Error *model.P1Error) diag.Diagnostics { var diags diag.Diagnostics if p1Error != nil && p1Error.GetCode() == "NOT_FOUND" { diags.AddWarning("Requested resource not found", fmt.Sprintf("The requested resource configuration cannot be found in the PingOne service. If the requested resource is managed in Terraform's state, it may have been removed outside of Terraform.\nAPI error: %s", p1Error.GetMessage())) return diags } if r != nil && r.StatusCode == 404 { diags.AddWarning("Requested resource not found", "The requested resource configuration cannot be found in the PingOne service. If the requested resource is managed in Terraform's state, it may have been removed outside of Terraform.") return diags } return nil } CustomErrorInvalidValue = func(_ *http.Response, p1Error *model.P1Error) diag.Diagnostics { var diags diag.Diagnostics if p1Error != nil { if details, ok := p1Error.GetDetailsOk(); ok && details != nil && len(details) > 0 { if target, ok := details[0].GetTargetOk(); ok && details[0].GetCode() == "INVALID_VALUE" && *target == "name" { diags.AddError("Invalid Value", details[0].GetMessage()) return diags } } } return nil } )
Functions ¶
func ParseResponse ¶
func ParseResponse(ctx context.Context, f framework.SDKInterfaceFunc, requestID string, customError CustomError, customRetryConditions sdk.Retryable, targetObject any) diag.Diagnostics
func ParseResponseWithCustomTimeout ¶
func ParseResponseWithCustomTimeout(ctx context.Context, f framework.SDKInterfaceFunc, requestID string, customError CustomError, customRetryConditions sdk.Retryable, targetObject any, timeout time.Duration) diag.Diagnostics
Types ¶
type CustomError ¶
type ResourceType ¶
Click to show internal directories.
Click to hide internal directories.