Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boolvalidator/null_if_attribute_is_one_of.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// NullIfAttributeIsOneOf checks if the path.Path attribute contains
// one of the exceptedValue attr.Value.
func NullIfAttributeIsOneOf(path path.Expression, exceptedValue []attr.Value) validator.Int64 {
return internal.RequireIfAttributeIsOneOf{
return internal.NullIfAttributeIsOneOf{
PathExpression: path,
ExceptedValues: exceptedValue,
}
Expand Down
2 changes: 1 addition & 1 deletion int64validator/null_if_attribute_is_one_of.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// NullIfAttributeIsOneOf checks if the path.Path attribute contains
// one of the exceptedValue attr.Value.
func NullIfAttributeIsOneOf(path path.Expression, exceptedValue []attr.Value) validator.Int64 {
return internal.RequireIfAttributeIsOneOf{
return internal.NullIfAttributeIsOneOf{
PathExpression: path,
ExceptedValues: exceptedValue,
}
Expand Down
6 changes: 3 additions & 3 deletions internal/null_if_attribute_is_one_of.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ func (av NullIfAttributeIsOneOf) Description(_ context.Context) string {
var expectedValueDescritpion string
for i, expectedValue := range av.ExceptedValues {
if i == len(av.ExceptedValues)-1 {
expectedValueDescritpion += expectedValue.String()
expectedValueDescritpion += fmt.Sprintf("%s, ", expectedValue.String())
break
}
expectedValueDescritpion += expectedValue.String()
}
return fmt.Sprintf("If %s attribute is set and the value is one of %s, this attribute is null", av.PathExpression, expectedValueDescritpion)
return fmt.Sprintf("If %s attribute is set and the value is one of %s, this attribute is NULL", av.PathExpression, expectedValueDescritpion)
}

func (av NullIfAttributeIsOneOf) MarkdownDescription(_ context.Context) string {
Expand All @@ -63,7 +63,7 @@ func (av NullIfAttributeIsOneOf) MarkdownDescription(_ context.Context) string {
}
expectedValueDescritpion += fmt.Sprintf("`%s`, ", expectedValue)
}
return fmt.Sprintf("If %s attribute is set and the value is one of %s, this attribute is null", av.PathExpression, expectedValueDescritpion)
return fmt.Sprintf("If %s attribute is set and the value is one of %s, this attribute is NULL", av.PathExpression, expectedValueDescritpion)
}

func (av NullIfAttributeIsOneOf) Validate(ctx context.Context, req NullIfAttributeIsOneOfRequest, res *NullIfAttributeIsOneOfResponse) {
Expand Down
6 changes: 3 additions & 3 deletions internal/require_if_attribute_is_one_of.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ func (av RequireIfAttributeIsOneOf) Description(_ context.Context) string {
var expectedValueDescritpion string
for i, expectedValue := range av.ExceptedValues {
if i == len(av.ExceptedValues)-1 {
expectedValueDescritpion += expectedValue.String()
expectedValueDescritpion += fmt.Sprintf("%s, ", expectedValue.String())
break
}
expectedValueDescritpion += expectedValue.String()
}
return fmt.Sprintf("If %s attribute is set and the value is one of %s, this attribute is required", av.PathExpression, expectedValueDescritpion)
return fmt.Sprintf("If %s attribute is set and the value is one of %s, this attribute is REQUIRED", av.PathExpression, expectedValueDescritpion)
}

func (av RequireIfAttributeIsOneOf) MarkdownDescription(_ context.Context) string {
Expand All @@ -63,7 +63,7 @@ func (av RequireIfAttributeIsOneOf) MarkdownDescription(_ context.Context) strin
}
expectedValueDescritpion += fmt.Sprintf("`%s`, ", expectedValue)
}
return fmt.Sprintf("If %s attribute is set and the value is one of %s, this attribute is required", av.PathExpression, expectedValueDescritpion)
return fmt.Sprintf("If %s attribute is set and the value is one of %s, this attribute is REQUIRED", av.PathExpression, expectedValueDescritpion)
}

func (av RequireIfAttributeIsOneOf) Validate(ctx context.Context, req RequireIfAttributeIsOneOfRequest, res *RequireIfAttributeIsOneOfResponse) {
Expand Down
2 changes: 1 addition & 1 deletion listvalidator/null_if_attribute_is_one_of.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// NullIfAttributeIsOneOf checks if the path.Path attribute contains
// one of the exceptedValue attr.Value.
func NullIfAttributeIsOneOf(path path.Expression, exceptedValue []attr.Value) validator.List {
return internal.RequireIfAttributeIsOneOf{
return internal.NullIfAttributeIsOneOf{
PathExpression: path,
ExceptedValues: exceptedValue,
}
Expand Down
2 changes: 1 addition & 1 deletion mapvalidator/null_if_attribute_is_one_of.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// NullIfAttributeIsOneOf checks if the path.Path attribute contains
// one of the exceptedValue attr.Value.
func NullIfAttributeIsOneOf(path path.Expression, exceptedValue []attr.Value) validator.Map {
return internal.RequireIfAttributeIsOneOf{
return internal.NullIfAttributeIsOneOf{
PathExpression: path,
ExceptedValues: exceptedValue,
}
Expand Down
2 changes: 1 addition & 1 deletion setvalidator/null_if_attribute_is_one_of.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// NullIfAttributeIsOneOf checks if the path.Path attribute contains
// one of the exceptedValue attr.Value.
func NullIfAttributeIsOneOf(path path.Expression, exceptedValue []attr.Value) validator.Set {
return internal.RequireIfAttributeIsOneOf{
return internal.NullIfAttributeIsOneOf{
PathExpression: path,
ExceptedValues: exceptedValue,
}
Expand Down
2 changes: 1 addition & 1 deletion stringvalidator/null_if_attribute_is_one_of.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// NullIfAttributeIsOneOf checks if the path.Path attribute contains
// one of the exceptedValue attr.Value.
func NullIfAttributeIsOneOf(path path.Expression, exceptedValue []attr.Value) validator.String {
return internal.RequireIfAttributeIsOneOf{
return internal.NullIfAttributeIsOneOf{
PathExpression: path,
ExceptedValues: exceptedValue,
}
Expand Down