ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.133.1

This commit is contained in:
speakeasybot
2024-01-05 19:51:29 +00:00
parent eccef7b78c
commit 0538f5b367
20 changed files with 272 additions and 52 deletions

View File

@@ -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.Float64 {
return suppressDiff{}
func SuppressDiff(strategy int) planmodifier.Float64 {
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) PlanModifyFloat64(ctx context.Context, req planmodifier.Fl
if utils.IsAllStateUnknown(ctx, req.State) {
return
}
if m.strategy == Standard && utils.IsAnyKnownChange(ctx, req.Plan, req.State) {
return
}
resp.PlanValue = req.StateValue
}