legacysdk

package
v1.13.0-beta Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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 CheckEnvironmentExistsOnPermissionsError

func CheckEnvironmentExistsOnPermissionsError(ctx context.Context, managementClient *management.APIClient, environmentID string, fO any, fR *http.Response, fErr error) (any, *http.Response, error)

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 CustomError func(*http.Response, *model.P1Error) diag.Diagnostics

type ResourceType

type ResourceType struct {
	Client *pingone.Client
}

Jump to

Keyboard shortcuts

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