/
int64.go
43 lines (34 loc) · 1.31 KB
/
int64.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
34
35
36
37
38
39
40
41
42
43
package validator
import (
"context"
"github.com/hashicorp/terraform-plugin-framework/diag"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
"github.com/hashicorp/terraform-plugin-framework/types"
)
// Int64 is a schema validator for types.Int64 attributes.
type Int64 interface {
Describer
// ValidateInt64 should perform the validation.
ValidateInt64(context.Context, Int64Request, *Int64Response)
}
// Int64Request is a request for types.Int64 schema validation.
type Int64Request struct {
// Path contains the path of the attribute for validation. Use this path
// for any response diagnostics.
Path path.Path
// PathExpression contains the expression matching the exact path
// of the attribute for validation.
PathExpression path.Expression
// Config contains the entire configuration of the data source, provider, or resource.
Config tfsdk.Config
// ConfigValue contains the value of the attribute for validation from the configuration.
ConfigValue types.Int64
}
// Int64Response is a response to a Int64Request.
type Int64Response struct {
// Diagnostics report errors or warnings related to validating the data
// source configuration. An empty slice indicates success, with no warnings
// or errors generated.
Diagnostics diag.Diagnostics
}