framework

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCustomError = func(error model.P1Error) diag.Diagnostics { return nil }

	CustomErrorResourceNotFoundWarning = func(error model.P1Error) diag.Diagnostics {
		var diags diag.Diagnostics

		if error.GetCode() == "NOT_FOUND" {
			diags.AddWarning("Resource not found", fmt.Sprintf("The requested resource object cannot be found.  Error returned: %s.", error.GetMessage()))

			return diags
		}

		return nil
	}

	CustomErrorInvalidValue = func(error model.P1Error) diag.Diagnostics {
		var diags diag.Diagnostics

		if details, ok := error.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 Attr_DataFilter

func Attr_DataFilter(description SchemaDescription, acceptableAttributes []string, mutuallyExclusiveAttributes []string) schema.ListNestedBlock

func Attr_DataSourceReturnIDs

func Attr_DataSourceReturnIDs(description SchemaDescription) schema.ListAttribute

func Attr_ID

func Attr_ID() schema.StringAttribute

Common schema attributes

func Attr_LinkID added in v0.10.0

func Attr_LinkID(description SchemaDescription) schema.StringAttribute

func Attr_LinkIDWithValidators added in v0.11.0

func Attr_LinkIDWithValidators(description SchemaDescription, validators []validator.String) schema.StringAttribute

func Attr_SCIMFilter

func Attr_SCIMFilter(description SchemaDescription, acceptableAttributes []string, mutuallyExclusiveAttributes []string) schema.StringAttribute

func BoolOkToTF

func BoolOkToTF(b *bool, ok bool) basetypes.BoolValue

func EnumOkToTF added in v0.14.0

func EnumOkToTF(v interface{}, ok bool) basetypes.StringValue

func Float32OkToTF added in v0.10.0

func Float32OkToTF(i *float32, ok bool) basetypes.Float64Value

func Int32OkToTF

func Int32OkToTF(i *int32, ok bool) basetypes.Int64Value

func Int32ToTF

func Int32ToTF(i int32) basetypes.Int64Value

func ParseResponse

func ParseResponse(ctx context.Context, f sdk.SDKInterfaceFunc, requestID string, customError CustomError, customRetryConditions sdk.Retryable) (interface{}, diag.Diagnostics)

func ParseResponseWithCustomTimeout

func ParseResponseWithCustomTimeout(ctx context.Context, f sdk.SDKInterfaceFunc, requestID string, customError CustomError, customRetryConditions sdk.Retryable, timeout time.Duration) (interface{}, diag.Diagnostics)

func StringOkToTF

func StringOkToTF(v *string, ok bool) basetypes.StringValue

func StringSetOkToTF added in v0.12.0

func StringSetOkToTF(v []string, ok bool) basetypes.SetValue

func StringSliceToTF

func StringSliceToTF(v []string) (basetypes.ListValue, diag.Diagnostics)

func StringToTF

func StringToTF(v string) basetypes.StringValue

func TFListToStringSlice

func TFListToStringSlice(ctx context.Context, v types.List) []*string

func TFSetToStringSlice added in v0.12.0

func TFSetToStringSlice(ctx context.Context, v types.Set) []*string

func TimeOkToTF added in v0.10.0

func TimeOkToTF(v *time.Time, ok bool) basetypes.StringValue

Types

type CustomError

type CustomError func(model.P1Error) diag.Diagnostics

type DataFilterModel

type DataFilterModel struct {
	Name   types.String `tfsdk:"name"`
	Values types.List   `tfsdk:"values"`
}

Common models

type ResourceType

type ResourceType struct {
	Client *pingone.Client
}

type SchemaDescription

type SchemaDescription struct {
	Description         string
	MarkdownDescription string
}

func SchemaDescriptionFromMarkdown added in v0.14.0

func SchemaDescriptionFromMarkdown(description string) SchemaDescription

func (SchemaDescription) AllowedValues added in v0.14.0

func (r SchemaDescription) AllowedValues(allowedValues []string) SchemaDescription

func (SchemaDescription) AllowedValuesComplex added in v0.14.0

func (r SchemaDescription) AllowedValuesComplex(allowedValuesMap map[string]string) SchemaDescription

func (SchemaDescription) AllowedValuesEnum added in v0.14.0

func (r SchemaDescription) AllowedValuesEnum(allowedValuesEnumSlice interface{}) SchemaDescription

func (SchemaDescription) AppendMarkdownString added in v0.14.0

func (r SchemaDescription) AppendMarkdownString(text string) SchemaDescription

func (SchemaDescription) AppendSliceValues added in v0.14.0

func (r SchemaDescription) AppendSliceValues(pretext string, values []string) SchemaDescription

func (SchemaDescription) AppendStringValue added in v0.14.0

func (r SchemaDescription) AppendStringValue(pretext string, value string) SchemaDescription

func (SchemaDescription) Clean

func (r SchemaDescription) Clean(removeTrailingStop bool) SchemaDescription

func (SchemaDescription) ConflictsWith added in v0.14.0

func (r SchemaDescription) ConflictsWith(fieldPaths []string) SchemaDescription

func (SchemaDescription) DefaultValue added in v0.14.0

func (r SchemaDescription) DefaultValue(defaultValue string) SchemaDescription

func (SchemaDescription) ExactlyOneOf added in v0.14.0

func (r SchemaDescription) ExactlyOneOf(fieldPaths []string) SchemaDescription

func (SchemaDescription) RequiresReplace added in v0.14.0

func (r SchemaDescription) RequiresReplace() SchemaDescription

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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