-
Notifications
You must be signed in to change notification settings - Fork 91
/
bool_parameter_validator.go
33 lines (25 loc) · 1 KB
/
bool_parameter_validator.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package function
import (
"context"
"github.com/hashicorp/terraform-plugin-framework/types"
)
// BoolParameterValidator is a function validator for types.Bool parameters.
type BoolParameterValidator interface {
// ValidateParameterBool performs the validation.
ValidateParameterBool(context.Context, BoolParameterValidatorRequest, *BoolParameterValidatorResponse)
}
// BoolParameterValidatorRequest is a request for types.Bool schema validation.
type BoolParameterValidatorRequest struct {
// ArgumentPosition contains the position of the argument for validation.
// Use this position for any response diagnostics.
ArgumentPosition int64
// Value contains the value of the argument for validation.
Value types.Bool
}
// BoolParameterValidatorResponse is a response to a BoolParameterValidatorRequest.
type BoolParameterValidatorResponse struct {
// Error is a function error generated during validation of the Value.
Error *FuncError
}