/
schema_plan_modification.go
39 lines (31 loc) · 1.25 KB
/
schema_plan_modification.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
package tfsdk
import (
"github.com/hashicorp/terraform-plugin-framework/diag"
"github.com/hashicorp/terraform-plugin-go/tftypes"
)
// ModifySchemaPlanRequest represents a request for a schema to run all
// attribute plan modification functions.
type ModifySchemaPlanRequest struct {
// Config is the configuration the user supplied for the resource.
Config Config
// State is the current state of the resource.
State State
// Plan is the planned new state for the resource.
Plan Plan
// ProviderMeta is metadata from the provider_meta block of the module.
ProviderMeta Config
}
// ModifySchemaPlanResponse represents a response to a ModifySchemaPlanRequest.
type ModifySchemaPlanResponse struct {
// Plan is the planned new state for the resource.
Plan Plan
// RequiresReplace is a list of tftypes.AttributePaths that require the
// resource to be replaced. They should point to the specific field
// that changed that requires the resource to be destroyed and
// recreated.
RequiresReplace []*tftypes.AttributePath
// Diagnostics report errors or warnings related to running all attribute
// plan modifiers. Returning an empty slice indicates a successful
// plan modification with no warnings or errors generated.
Diagnostics diag.Diagnostics
}