mirror of
https://github.com/LukeHagar/plexterraform.git
synced 2025-12-09 12:37:47 +00:00
ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.133.1
This commit is contained in:
@@ -9,13 +9,24 @@ import (
|
||||
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
|
||||
)
|
||||
|
||||
const (
|
||||
// Standard suppresses "(known after changes)" messages unless there's an explicit change in state [excluding null <=> unknown transitions]
|
||||
Standard = iota
|
||||
// ExplicitSuppress strategy suppresses "(known after changes)" messages unless we're in the initial creation
|
||||
ExplicitSuppress = iota
|
||||
)
|
||||
|
||||
// SuppressDiff returns a plan modifier that propagates a state value into the planned value, when it is Known, and the Plan Value is Unknown
|
||||
func SuppressDiff() planmodifier.String {
|
||||
return suppressDiff{}
|
||||
func SuppressDiff(strategy int) planmodifier.String {
|
||||
return suppressDiff{
|
||||
strategy: strategy,
|
||||
}
|
||||
}
|
||||
|
||||
// suppressDiff implements the plan modifier.
|
||||
type suppressDiff struct{}
|
||||
type suppressDiff struct {
|
||||
strategy int
|
||||
}
|
||||
|
||||
// Description returns a human-readable description of the plan modifier.
|
||||
func (m suppressDiff) Description(_ context.Context) string {
|
||||
@@ -42,6 +53,9 @@ func (m suppressDiff) PlanModifyString(ctx context.Context, req planmodifier.Str
|
||||
if utils.IsAllStateUnknown(ctx, req.State) {
|
||||
return
|
||||
}
|
||||
if m.strategy == Standard && utils.IsAnyKnownChange(ctx, req.Plan, req.State) {
|
||||
return
|
||||
}
|
||||
|
||||
resp.PlanValue = req.StateValue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user