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.134.0
This commit is contained in:
@@ -4,16 +4,16 @@ management:
|
||||
docChecksum: 34d22936f2456c2c461abdfc773e3fc4
|
||||
docVersion: 0.0.3
|
||||
speakeasyVersion: internal
|
||||
generationVersion: 2.228.1
|
||||
releaseVersion: 0.2.0
|
||||
configChecksum: aa46c3314b27098c848b44960a4abd53
|
||||
generationVersion: 2.230.1
|
||||
releaseVersion: 0.2.1
|
||||
configChecksum: c37646e1dc61322a4f6640ddd3e168c0
|
||||
repoURL: https://github.com/LukeHagar/plexterraform.git
|
||||
repoSubDirectory: .
|
||||
published: true
|
||||
features:
|
||||
terraform:
|
||||
constsAndDefaults: 0.1.2
|
||||
core: 3.8.0
|
||||
core: 3.8.1
|
||||
globalSecurity: 2.81.2
|
||||
globalServerURLs: 2.82.1
|
||||
nameOverrides: 2.81.1
|
||||
@@ -80,6 +80,15 @@ generatedFiles:
|
||||
- internal/validators/ExactlyOneChild.go
|
||||
- internal/validators/JSONParseValidator.go
|
||||
- internal/validators/RFC3339Validator.go
|
||||
- internal/validators/boolvalidators/not_null.go
|
||||
- internal/validators/float64validators/not_null.go
|
||||
- internal/validators/int64validators/not_null.go
|
||||
- internal/validators/listvalidators/not_null.go
|
||||
- internal/validators/mapvalidators/not_null.go
|
||||
- internal/validators/numbervalidators/not_null.go
|
||||
- internal/validators/objectvalidators/not_null.go
|
||||
- internal/validators/setvalidators/not_null.go
|
||||
- internal/validators/stringvalidators/not_null.go
|
||||
- main.go
|
||||
- terraform-registry-manifest.json
|
||||
- tools/tools.go
|
||||
|
||||
@@ -61,7 +61,7 @@ terraform {
|
||||
required_providers {
|
||||
PlexAPI = {
|
||||
source = "LukeHagar/PlexAPI"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,3 +23,11 @@ Based on:
|
||||
- Speakeasy CLI 1.133.1 (2.228.1) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [terraform v0.2.0] .
|
||||
|
||||
## 2024-01-09 01:09:28
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc 0.0.3
|
||||
- Speakeasy CLI 1.134.0 (2.230.1) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [terraform v0.2.1] .
|
||||
@@ -17,7 +17,7 @@ terraform {
|
||||
required_providers {
|
||||
PlexAPI = {
|
||||
source = "LukeHagar/PlexAPI"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ terraform {
|
||||
required_providers {
|
||||
PlexAPI = {
|
||||
source = "LukeHagar/PlexAPI"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
gen.yaml
2
gen.yaml
@@ -8,7 +8,7 @@ generation:
|
||||
fixes:
|
||||
nameResolutionDec2023: false
|
||||
terraform:
|
||||
version: 0.2.0
|
||||
version: 0.2.1
|
||||
author: LukeHagar
|
||||
imports:
|
||||
option: openapi
|
||||
|
||||
@@ -10,8 +10,6 @@ import (
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
@@ -53,9 +51,6 @@ func (m suppressDiff) PlanModifyBool(ctx context.Context, req planmodifier.BoolR
|
||||
if utils.IsAllStateUnknown(ctx, req.State) {
|
||||
return
|
||||
}
|
||||
if m.strategy == Standard && utils.IsAnyKnownChange(ctx, req.Plan, req.State) {
|
||||
return
|
||||
}
|
||||
|
||||
resp.PlanValue = req.StateValue
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import (
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
@@ -53,9 +51,6 @@ 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
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import (
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
@@ -53,9 +51,6 @@ func (m suppressDiff) PlanModifyInt64(ctx context.Context, req planmodifier.Int6
|
||||
if utils.IsAllStateUnknown(ctx, req.State) {
|
||||
return
|
||||
}
|
||||
if m.strategy == Standard && utils.IsAnyKnownChange(ctx, req.Plan, req.State) {
|
||||
return
|
||||
}
|
||||
|
||||
resp.PlanValue = req.StateValue
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import (
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
@@ -53,9 +51,6 @@ func (m suppressDiff) PlanModifyList(ctx context.Context, req planmodifier.ListR
|
||||
if utils.IsAllStateUnknown(ctx, req.State) {
|
||||
return
|
||||
}
|
||||
if m.strategy == Standard && utils.IsAnyKnownChange(ctx, req.Plan, req.State) {
|
||||
return
|
||||
}
|
||||
|
||||
resp.PlanValue = req.StateValue
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import (
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
@@ -53,9 +51,6 @@ func (m suppressDiff) PlanModifyMap(ctx context.Context, req planmodifier.MapReq
|
||||
if utils.IsAllStateUnknown(ctx, req.State) {
|
||||
return
|
||||
}
|
||||
if m.strategy == Standard && utils.IsAnyKnownChange(ctx, req.Plan, req.State) {
|
||||
return
|
||||
}
|
||||
|
||||
resp.PlanValue = req.StateValue
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import (
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
@@ -53,9 +51,6 @@ func (m suppressDiff) PlanModifyNumber(ctx context.Context, req planmodifier.Num
|
||||
if utils.IsAllStateUnknown(ctx, req.State) {
|
||||
return
|
||||
}
|
||||
if m.strategy == Standard && utils.IsAnyKnownChange(ctx, req.Plan, req.State) {
|
||||
return
|
||||
}
|
||||
|
||||
resp.PlanValue = req.StateValue
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import (
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
@@ -53,9 +51,6 @@ func (m suppressDiff) PlanModifyObject(ctx context.Context, req planmodifier.Obj
|
||||
if utils.IsAllStateUnknown(ctx, req.State) {
|
||||
return
|
||||
}
|
||||
if m.strategy == Standard && utils.IsAnyKnownChange(ctx, req.Plan, req.State) {
|
||||
return
|
||||
}
|
||||
|
||||
resp.PlanValue = req.StateValue
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import (
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
@@ -53,9 +51,6 @@ func (m suppressDiff) PlanModifySet(ctx context.Context, req planmodifier.SetReq
|
||||
if utils.IsAllStateUnknown(ctx, req.State) {
|
||||
return
|
||||
}
|
||||
if m.strategy == Standard && utils.IsAnyKnownChange(ctx, req.Plan, req.State) {
|
||||
return
|
||||
}
|
||||
|
||||
resp.PlanValue = req.StateValue
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import (
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
@@ -53,9 +51,6 @@ 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
|
||||
}
|
||||
|
||||
@@ -23,91 +23,3 @@ func IsAllStateUnknown(ctx context.Context, state tfsdk.State) bool {
|
||||
|
||||
return !anyFound
|
||||
}
|
||||
|
||||
func IsAnyKnownChange(ctx context.Context, plan tfsdk.Plan, state tfsdk.State) bool {
|
||||
attrs := state.Schema.GetAttributes()
|
||||
anyFound := false
|
||||
for k, _ := range attrs {
|
||||
stateValue := new(attr.Value)
|
||||
planValue := new(attr.Value)
|
||||
state.GetAttribute(ctx, path.Root(k), stateValue)
|
||||
plan.GetAttribute(ctx, path.Root(k), planValue)
|
||||
anyFound = !isKnownEqual(ctx, stateValue, planValue)
|
||||
if anyFound {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return anyFound
|
||||
}
|
||||
|
||||
type HasElements interface {
|
||||
Elements() []attr.Value
|
||||
IsUnknown() bool
|
||||
IsNull() bool
|
||||
}
|
||||
type HasAttributes interface {
|
||||
Attributes() map[string]attr.Value
|
||||
IsUnknown() bool
|
||||
IsNull() bool
|
||||
}
|
||||
|
||||
func isKnownEqual(ctx context.Context, a *attr.Value, b *attr.Value) bool {
|
||||
if (*a).IsUnknown() || (*b).IsUnknown() {
|
||||
return true
|
||||
}
|
||||
aType := (*a).Type(ctx)
|
||||
bType := (*b).Type(ctx)
|
||||
if !aType.Equal(bType) {
|
||||
return false
|
||||
}
|
||||
attributeTypes, ok := aType.(attr.TypeWithAttributeTypes)
|
||||
if ok {
|
||||
check := true
|
||||
for k, _ := range attributeTypes.AttributeTypes() {
|
||||
objValA, isObjA := (*a).(HasAttributes)
|
||||
objValB, isObjB := (*b).(HasAttributes)
|
||||
if isObjA && isObjB {
|
||||
if objValA.IsUnknown() || objValB.IsUnknown() {
|
||||
continue
|
||||
}
|
||||
attrA, foundA := objValA.Attributes()[k]
|
||||
attrB, foundB := objValB.Attributes()[k]
|
||||
if foundA != foundB {
|
||||
return false
|
||||
}
|
||||
if foundA {
|
||||
check = isKnownEqual(ctx, &attrA, &attrB)
|
||||
}
|
||||
}
|
||||
if !check {
|
||||
break
|
||||
}
|
||||
}
|
||||
return check
|
||||
}
|
||||
_, ok = aType.(attr.TypeWithElementType)
|
||||
if ok {
|
||||
aVal, aValList := (*a).(HasElements)
|
||||
bVal, bValList := (*b).(HasElements)
|
||||
if aValList && bValList {
|
||||
if ((aVal).IsUnknown() || (aVal).IsNull()) && ((bVal).IsUnknown() || (bVal).IsNull()) {
|
||||
return true
|
||||
}
|
||||
if len(aVal.Elements()) != len(bVal.Elements()) {
|
||||
return false
|
||||
} else {
|
||||
for i, _ := range aVal.Elements() {
|
||||
if !isKnownEqual(ctx, &aVal.Elements()[i], &bVal.Elements()[i]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
isEqual := (*a).Equal(*b)
|
||||
return isEqual
|
||||
}
|
||||
|
||||
@@ -259,9 +259,9 @@ func New(opts ...SDKOption) *PlexAPI {
|
||||
sdkConfiguration: sdkConfiguration{
|
||||
Language: "go",
|
||||
OpenAPIDocVersion: "0.0.3",
|
||||
SDKVersion: "0.2.0",
|
||||
GenVersion: "2.228.1",
|
||||
UserAgent: "speakeasy-sdk/go 0.2.0 2.228.1 0.0.3 PlexAPI",
|
||||
SDKVersion: "0.2.1",
|
||||
GenVersion: "2.230.1",
|
||||
UserAgent: "speakeasy-sdk/go 0.2.1 2.230.1 0.0.3 PlexAPI",
|
||||
ServerDefaults: []map[string]string{
|
||||
{
|
||||
"protocol": "http",
|
||||
|
||||
49
internal/validators/boolvalidators/not_null.go
Normal file
49
internal/validators/boolvalidators/not_null.go
Normal file
@@ -0,0 +1,49 @@
|
||||
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
|
||||
package boolvalidators
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
|
||||
)
|
||||
|
||||
var _ validator.Bool = BoolNotNullValidator{}
|
||||
|
||||
// BoolNotNullValidator validates that an attribute is not null. Most
|
||||
// attributes should set Required: true instead, however in certain scenarios,
|
||||
// such as a computed nested attribute, all underlying attributes must also be
|
||||
// computed for planning to not show unexpected differences.
|
||||
type BoolNotNullValidator struct{}
|
||||
|
||||
// Description describes the validation in plain text formatting.
|
||||
func (v BoolNotNullValidator) Description(_ context.Context) string {
|
||||
return "value must be configured"
|
||||
}
|
||||
|
||||
// MarkdownDescription describes the validation in Markdown formatting.
|
||||
func (v BoolNotNullValidator) MarkdownDescription(ctx context.Context) string {
|
||||
return v.Description(ctx)
|
||||
}
|
||||
|
||||
// Validate performs the validation.
|
||||
func (v BoolNotNullValidator) ValidateBool(ctx context.Context, req validator.BoolRequest, resp *validator.BoolResponse) {
|
||||
if !req.ConfigValue.IsNull() {
|
||||
return
|
||||
}
|
||||
|
||||
resp.Diagnostics.AddAttributeError(
|
||||
req.Path,
|
||||
"Missing Attribute Value",
|
||||
req.Path.String()+": "+v.Description(ctx),
|
||||
)
|
||||
}
|
||||
|
||||
// NotNull returns an validator which ensures that the attribute is
|
||||
// configured. Most attributes should set Required: true instead, however in
|
||||
// certain scenarios, such as a computed nested attribute, all underlying
|
||||
// attributes must also be computed for planning to not show unexpected
|
||||
// differences.
|
||||
func NotNull() validator.Bool {
|
||||
return BoolNotNullValidator{}
|
||||
}
|
||||
49
internal/validators/float64validators/not_null.go
Normal file
49
internal/validators/float64validators/not_null.go
Normal file
@@ -0,0 +1,49 @@
|
||||
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
|
||||
package float64validators
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
|
||||
)
|
||||
|
||||
var _ validator.Float64 = Float64NotNullValidator{}
|
||||
|
||||
// Float64NotNullValidator validates that an attribute is not null. Most
|
||||
// attributes should set Required: true instead, however in certain scenarios,
|
||||
// such as a computed nested attribute, all underlying attributes must also be
|
||||
// computed for planning to not show unexpected differences.
|
||||
type Float64NotNullValidator struct{}
|
||||
|
||||
// Description describes the validation in plain text formatting.
|
||||
func (v Float64NotNullValidator) Description(_ context.Context) string {
|
||||
return "value must be configured"
|
||||
}
|
||||
|
||||
// MarkdownDescription describes the validation in Markdown formatting.
|
||||
func (v Float64NotNullValidator) MarkdownDescription(ctx context.Context) string {
|
||||
return v.Description(ctx)
|
||||
}
|
||||
|
||||
// Validate performs the validation.
|
||||
func (v Float64NotNullValidator) ValidateFloat64(ctx context.Context, req validator.Float64Request, resp *validator.Float64Response) {
|
||||
if !req.ConfigValue.IsNull() {
|
||||
return
|
||||
}
|
||||
|
||||
resp.Diagnostics.AddAttributeError(
|
||||
req.Path,
|
||||
"Missing Attribute Value",
|
||||
req.Path.String()+": "+v.Description(ctx),
|
||||
)
|
||||
}
|
||||
|
||||
// NotNull returns an validator which ensures that the attribute is
|
||||
// configured. Most attributes should set Required: true instead, however in
|
||||
// certain scenarios, such as a computed nested attribute, all underlying
|
||||
// attributes must also be computed for planning to not show unexpected
|
||||
// differences.
|
||||
func NotNull() validator.Float64 {
|
||||
return Float64NotNullValidator{}
|
||||
}
|
||||
49
internal/validators/int64validators/not_null.go
Normal file
49
internal/validators/int64validators/not_null.go
Normal file
@@ -0,0 +1,49 @@
|
||||
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
|
||||
package int64validators
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
|
||||
)
|
||||
|
||||
var _ validator.Int64 = Int64NotNullValidator{}
|
||||
|
||||
// Int64NotNullValidator validates that an attribute is not null. Most
|
||||
// attributes should set Required: true instead, however in certain scenarios,
|
||||
// such as a computed nested attribute, all underlying attributes must also be
|
||||
// computed for planning to not show unexpected differences.
|
||||
type Int64NotNullValidator struct{}
|
||||
|
||||
// Description describes the validation in plain text formatting.
|
||||
func (v Int64NotNullValidator) Description(_ context.Context) string {
|
||||
return "value must be configured"
|
||||
}
|
||||
|
||||
// MarkdownDescription describes the validation in Markdown formatting.
|
||||
func (v Int64NotNullValidator) MarkdownDescription(ctx context.Context) string {
|
||||
return v.Description(ctx)
|
||||
}
|
||||
|
||||
// Validate performs the validation.
|
||||
func (v Int64NotNullValidator) ValidateInt64(ctx context.Context, req validator.Int64Request, resp *validator.Int64Response) {
|
||||
if !req.ConfigValue.IsNull() {
|
||||
return
|
||||
}
|
||||
|
||||
resp.Diagnostics.AddAttributeError(
|
||||
req.Path,
|
||||
"Missing Attribute Value",
|
||||
req.Path.String()+": "+v.Description(ctx),
|
||||
)
|
||||
}
|
||||
|
||||
// NotNull returns an validator which ensures that the attribute is
|
||||
// configured. Most attributes should set Required: true instead, however in
|
||||
// certain scenarios, such as a computed nested attribute, all underlying
|
||||
// attributes must also be computed for planning to not show unexpected
|
||||
// differences.
|
||||
func NotNull() validator.Int64 {
|
||||
return Int64NotNullValidator{}
|
||||
}
|
||||
49
internal/validators/listvalidators/not_null.go
Normal file
49
internal/validators/listvalidators/not_null.go
Normal file
@@ -0,0 +1,49 @@
|
||||
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
|
||||
package listvalidators
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
|
||||
)
|
||||
|
||||
var _ validator.List = ListNotNullValidator{}
|
||||
|
||||
// ListNotNullValidator validates that an attribute is not null. Most
|
||||
// attributes should set Required: true instead, however in certain scenarios,
|
||||
// such as a computed nested attribute, all underlying attributes must also be
|
||||
// computed for planning to not show unexpected differences.
|
||||
type ListNotNullValidator struct{}
|
||||
|
||||
// Description describes the validation in plain text formatting.
|
||||
func (v ListNotNullValidator) Description(_ context.Context) string {
|
||||
return "value must be configured"
|
||||
}
|
||||
|
||||
// MarkdownDescription describes the validation in Markdown formatting.
|
||||
func (v ListNotNullValidator) MarkdownDescription(ctx context.Context) string {
|
||||
return v.Description(ctx)
|
||||
}
|
||||
|
||||
// Validate performs the validation.
|
||||
func (v ListNotNullValidator) ValidateList(ctx context.Context, req validator.ListRequest, resp *validator.ListResponse) {
|
||||
if !req.ConfigValue.IsNull() {
|
||||
return
|
||||
}
|
||||
|
||||
resp.Diagnostics.AddAttributeError(
|
||||
req.Path,
|
||||
"Missing Attribute Value",
|
||||
req.Path.String()+": "+v.Description(ctx),
|
||||
)
|
||||
}
|
||||
|
||||
// NotNull returns an validator which ensures that the attribute is
|
||||
// configured. Most attributes should set Required: true instead, however in
|
||||
// certain scenarios, such as a computed nested attribute, all underlying
|
||||
// attributes must also be computed for planning to not show unexpected
|
||||
// differences.
|
||||
func NotNull() validator.List {
|
||||
return ListNotNullValidator{}
|
||||
}
|
||||
49
internal/validators/mapvalidators/not_null.go
Normal file
49
internal/validators/mapvalidators/not_null.go
Normal file
@@ -0,0 +1,49 @@
|
||||
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
|
||||
package mapvalidators
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
|
||||
)
|
||||
|
||||
var _ validator.Map = MapNotNullValidator{}
|
||||
|
||||
// MapNotNullValidator validates that an attribute is not null. Most
|
||||
// attributes should set Required: true instead, however in certain scenarios,
|
||||
// such as a computed nested attribute, all underlying attributes must also be
|
||||
// computed for planning to not show unexpected differences.
|
||||
type MapNotNullValidator struct{}
|
||||
|
||||
// Description describes the validation in plain text formatting.
|
||||
func (v MapNotNullValidator) Description(_ context.Context) string {
|
||||
return "value must be configured"
|
||||
}
|
||||
|
||||
// MarkdownDescription describes the validation in Markdown formatting.
|
||||
func (v MapNotNullValidator) MarkdownDescription(ctx context.Context) string {
|
||||
return v.Description(ctx)
|
||||
}
|
||||
|
||||
// Validate performs the validation.
|
||||
func (v MapNotNullValidator) ValidateMap(ctx context.Context, req validator.MapRequest, resp *validator.MapResponse) {
|
||||
if !req.ConfigValue.IsNull() {
|
||||
return
|
||||
}
|
||||
|
||||
resp.Diagnostics.AddAttributeError(
|
||||
req.Path,
|
||||
"Missing Attribute Value",
|
||||
req.Path.String()+": "+v.Description(ctx),
|
||||
)
|
||||
}
|
||||
|
||||
// NotNull returns an validator which ensures that the attribute is
|
||||
// configured. Most attributes should set Required: true instead, however in
|
||||
// certain scenarios, such as a computed nested attribute, all underlying
|
||||
// attributes must also be computed for planning to not show unexpected
|
||||
// differences.
|
||||
func NotNull() validator.Map {
|
||||
return MapNotNullValidator{}
|
||||
}
|
||||
49
internal/validators/numbervalidators/not_null.go
Normal file
49
internal/validators/numbervalidators/not_null.go
Normal file
@@ -0,0 +1,49 @@
|
||||
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
|
||||
package numbervalidators
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
|
||||
)
|
||||
|
||||
var _ validator.Number = NumberNotNullValidator{}
|
||||
|
||||
// NumberNotNullValidator validates that an attribute is not null. Most
|
||||
// attributes should set Required: true instead, however in certain scenarios,
|
||||
// such as a computed nested attribute, all underlying attributes must also be
|
||||
// computed for planning to not show unexpected differences.
|
||||
type NumberNotNullValidator struct{}
|
||||
|
||||
// Description describes the validation in plain text formatting.
|
||||
func (v NumberNotNullValidator) Description(_ context.Context) string {
|
||||
return "value must be configured"
|
||||
}
|
||||
|
||||
// MarkdownDescription describes the validation in Markdown formatting.
|
||||
func (v NumberNotNullValidator) MarkdownDescription(ctx context.Context) string {
|
||||
return v.Description(ctx)
|
||||
}
|
||||
|
||||
// Validate performs the validation.
|
||||
func (v NumberNotNullValidator) ValidateNumber(ctx context.Context, req validator.NumberRequest, resp *validator.NumberResponse) {
|
||||
if !req.ConfigValue.IsNull() {
|
||||
return
|
||||
}
|
||||
|
||||
resp.Diagnostics.AddAttributeError(
|
||||
req.Path,
|
||||
"Missing Attribute Value",
|
||||
req.Path.String()+": "+v.Description(ctx),
|
||||
)
|
||||
}
|
||||
|
||||
// NotNull returns an validator which ensures that the attribute is
|
||||
// configured. Most attributes should set Required: true instead, however in
|
||||
// certain scenarios, such as a computed nested attribute, all underlying
|
||||
// attributes must also be computed for planning to not show unexpected
|
||||
// differences.
|
||||
func NotNull() validator.Number {
|
||||
return NumberNotNullValidator{}
|
||||
}
|
||||
49
internal/validators/objectvalidators/not_null.go
Normal file
49
internal/validators/objectvalidators/not_null.go
Normal file
@@ -0,0 +1,49 @@
|
||||
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
|
||||
package objectvalidators
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
|
||||
)
|
||||
|
||||
var _ validator.Object = ObjectNotNullValidator{}
|
||||
|
||||
// ObjectNotNullValidator validates that an attribute is not null. Most
|
||||
// attributes should set Required: true instead, however in certain scenarios,
|
||||
// such as a computed nested attribute, all underlying attributes must also be
|
||||
// computed for planning to not show unexpected differences.
|
||||
type ObjectNotNullValidator struct{}
|
||||
|
||||
// Description describes the validation in plain text formatting.
|
||||
func (v ObjectNotNullValidator) Description(_ context.Context) string {
|
||||
return "value must be configured"
|
||||
}
|
||||
|
||||
// MarkdownDescription describes the validation in Markdown formatting.
|
||||
func (v ObjectNotNullValidator) MarkdownDescription(ctx context.Context) string {
|
||||
return v.Description(ctx)
|
||||
}
|
||||
|
||||
// Validate performs the validation.
|
||||
func (v ObjectNotNullValidator) ValidateObject(ctx context.Context, req validator.ObjectRequest, resp *validator.ObjectResponse) {
|
||||
if !req.ConfigValue.IsNull() {
|
||||
return
|
||||
}
|
||||
|
||||
resp.Diagnostics.AddAttributeError(
|
||||
req.Path,
|
||||
"Missing Attribute Value",
|
||||
req.Path.String()+": "+v.Description(ctx),
|
||||
)
|
||||
}
|
||||
|
||||
// NotNull returns an validator which ensures that the attribute is
|
||||
// configured. Most attributes should set Required: true instead, however in
|
||||
// certain scenarios, such as a computed nested attribute, all underlying
|
||||
// attributes must also be computed for planning to not show unexpected
|
||||
// differences.
|
||||
func NotNull() validator.Object {
|
||||
return ObjectNotNullValidator{}
|
||||
}
|
||||
49
internal/validators/setvalidators/not_null.go
Normal file
49
internal/validators/setvalidators/not_null.go
Normal file
@@ -0,0 +1,49 @@
|
||||
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
|
||||
package setvalidators
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
|
||||
)
|
||||
|
||||
var _ validator.Set = SetNotNullValidator{}
|
||||
|
||||
// SetNotNullValidator validates that an attribute is not null. Most
|
||||
// attributes should set Required: true instead, however in certain scenarios,
|
||||
// such as a computed nested attribute, all underlying attributes must also be
|
||||
// computed for planning to not show unexpected differences.
|
||||
type SetNotNullValidator struct{}
|
||||
|
||||
// Description describes the validation in plain text formatting.
|
||||
func (v SetNotNullValidator) Description(_ context.Context) string {
|
||||
return "value must be configured"
|
||||
}
|
||||
|
||||
// MarkdownDescription describes the validation in Markdown formatting.
|
||||
func (v SetNotNullValidator) MarkdownDescription(ctx context.Context) string {
|
||||
return v.Description(ctx)
|
||||
}
|
||||
|
||||
// Validate performs the validation.
|
||||
func (v SetNotNullValidator) ValidateSet(ctx context.Context, req validator.SetRequest, resp *validator.SetResponse) {
|
||||
if !req.ConfigValue.IsNull() {
|
||||
return
|
||||
}
|
||||
|
||||
resp.Diagnostics.AddAttributeError(
|
||||
req.Path,
|
||||
"Missing Attribute Value",
|
||||
req.Path.String()+": "+v.Description(ctx),
|
||||
)
|
||||
}
|
||||
|
||||
// NotNull returns an validator which ensures that the attribute is
|
||||
// configured. Most attributes should set Required: true instead, however in
|
||||
// certain scenarios, such as a computed nested attribute, all underlying
|
||||
// attributes must also be computed for planning to not show unexpected
|
||||
// differences.
|
||||
func NotNull() validator.Set {
|
||||
return SetNotNullValidator{}
|
||||
}
|
||||
49
internal/validators/stringvalidators/not_null.go
Normal file
49
internal/validators/stringvalidators/not_null.go
Normal file
@@ -0,0 +1,49 @@
|
||||
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
|
||||
package stringvalidators
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
|
||||
)
|
||||
|
||||
var _ validator.String = StringNotNullValidator{}
|
||||
|
||||
// StringNotNullValidator validates that an attribute is not null. Most
|
||||
// attributes should set Required: true instead, however in certain scenarios,
|
||||
// such as a computed nested attribute, all underlying attributes must also be
|
||||
// computed for planning to not show unexpected differences.
|
||||
type StringNotNullValidator struct{}
|
||||
|
||||
// Description describes the validation in plain text formatting.
|
||||
func (v StringNotNullValidator) Description(_ context.Context) string {
|
||||
return "value must be configured"
|
||||
}
|
||||
|
||||
// MarkdownDescription describes the validation in Markdown formatting.
|
||||
func (v StringNotNullValidator) MarkdownDescription(ctx context.Context) string {
|
||||
return v.Description(ctx)
|
||||
}
|
||||
|
||||
// Validate performs the validation.
|
||||
func (v StringNotNullValidator) ValidateString(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
if !req.ConfigValue.IsNull() {
|
||||
return
|
||||
}
|
||||
|
||||
resp.Diagnostics.AddAttributeError(
|
||||
req.Path,
|
||||
"Missing Attribute Value",
|
||||
req.Path.String()+": "+v.Description(ctx),
|
||||
)
|
||||
}
|
||||
|
||||
// NotNull returns an validator which ensures that the attribute is
|
||||
// configured. Most attributes should set Required: true instead, however in
|
||||
// certain scenarios, such as a computed nested attribute, all underlying
|
||||
// attributes must also be computed for planning to not show unexpected
|
||||
// differences.
|
||||
func NotNull() validator.String {
|
||||
return StringNotNullValidator{}
|
||||
}
|
||||
Reference in New Issue
Block a user