Skip to content

Commit 88ce093

Browse files
authored
Add Callout for PreferWriteOnlyAttribute() validators in GoDoc comments (#272)
* Add usage note to `PreferWriteOnlyAttribute` godocs * Remove `setvalidator.PreferWriteOnlyAttribute` entry from changelog * Add godoc note to `stringvalidator`
1 parent 57972e0 commit 88ce093

14 files changed

+36
-2
lines changed

.changes/0.17.0.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ FEATURES:
1313
* numbervalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
1414
* objectvalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
1515
* resourcevalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
16-
* setvalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
1716
* stringvalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
1817

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ FEATURES:
1313
* numbervalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
1414
* objectvalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
1515
* resourcevalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
16-
* setvalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
1716
* stringvalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
1817

1918
## 0.16.0 (December 12, 2024)

boolvalidator/prefer_write_only_attribute.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import (
2121
// This implements the validation logic declaratively within the schema.
2222
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
2323
// for declaring this type of validation outside the schema definition.
24+
//
25+
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
26+
// has a value in the configuration. The validator will also produce warnings for users of shared modules who cannot immediately take action on the warning.
2427
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Bool {
2528
return schemavalidator.PreferWriteOnlyAttribute{
2629
WriteOnlyAttribute: writeOnlyAttribute,

dynamicvalidator/prefer_write_only_attribute.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import (
2121
// This implements the validation logic declaratively within the schema.
2222
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
2323
// for declaring this type of validation outside the schema definition.
24+
//
25+
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
26+
// has a value in the configuration. The validator will also produce warnings for users of shared modules who cannot immediately take action on the warning.
2427
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Dynamic {
2528
return schemavalidator.PreferWriteOnlyAttribute{
2629
WriteOnlyAttribute: writeOnlyAttribute,

float32validator/prefer_write_only_attribute.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import (
2121
// This implements the validation logic declaratively within the schema.
2222
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
2323
// for declaring this type of validation outside the schema definition.
24+
//
25+
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
26+
// has a value in the configuration. The validator will also produce warnings for users of shared modules who cannot immediately take action on the warning.
2427
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Float32 {
2528
return schemavalidator.PreferWriteOnlyAttribute{
2629
WriteOnlyAttribute: writeOnlyAttribute,

float64validator/prefer_write_only_attribute.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import (
2121
// This implements the validation logic declaratively within the schema.
2222
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
2323
// for declaring this type of validation outside the schema definition.
24+
//
25+
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
26+
// has a value in the configuration. The validator will also produce warnings for users of shared modules who cannot immediately take action on the warning.
2427
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Float64 {
2528
return schemavalidator.PreferWriteOnlyAttribute{
2629
WriteOnlyAttribute: writeOnlyAttribute,

int32validator/prefer_write_only_attribute.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import (
2121
// This implements the validation logic declaratively within the schema.
2222
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
2323
// for declaring this type of validation outside the schema definition.
24+
//
25+
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
26+
// has a value in the configuration. The validator will also produce warnings for users of shared modules who cannot immediately take action on the warning.
2427
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Int32 {
2528
return schemavalidator.PreferWriteOnlyAttribute{
2629
WriteOnlyAttribute: writeOnlyAttribute,

int64validator/prefer_write_only_attribute.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import (
2121
// This implements the validation logic declaratively within the schema.
2222
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
2323
// for declaring this type of validation outside the schema definition.
24+
//
25+
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
26+
// has a value in the configuration. The validator will also produce warnings for users of shared modules who cannot immediately take action on the warning.
2427
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Int64 {
2528
return schemavalidator.PreferWriteOnlyAttribute{
2629
WriteOnlyAttribute: writeOnlyAttribute,

listvalidator/prefer_write_only_attribute.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import (
2121
// This implements the validation logic declaratively within the schema.
2222
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
2323
// for declaring this type of validation outside the schema definition.
24+
//
25+
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
26+
// has a value in the configuration. The validator will also produce warnings for users of shared modules who cannot immediately take action on the warning.
2427
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.List {
2528
return schemavalidator.PreferWriteOnlyAttribute{
2629
WriteOnlyAttribute: writeOnlyAttribute,

mapvalidator/prefer_write_only_attribute.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import (
2121
// This implements the validation logic declaratively within the schema.
2222
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
2323
// for declaring this type of validation outside the schema definition.
24+
//
25+
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
26+
// has a value in the configuration. The validator will also produce warnings for users of shared modules who cannot immediately take action on the warning.
2427
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Map {
2528
return schemavalidator.PreferWriteOnlyAttribute{
2629
WriteOnlyAttribute: writeOnlyAttribute,

numbervalidator/prefer_write_only_attribute.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import (
2121
// This implements the validation logic declaratively within the schema.
2222
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
2323
// for declaring this type of validation outside the schema definition.
24+
//
25+
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
26+
// has a value in the configuration. The validator will also produce warnings for users of shared modules who cannot immediately take action on the warning.
2427
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Number {
2528
return schemavalidator.PreferWriteOnlyAttribute{
2629
WriteOnlyAttribute: writeOnlyAttribute,

objectvalidator/prefer_write_only_attribute.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import (
2121
// This implements the validation logic declaratively within the schema.
2222
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
2323
// for declaring this type of validation outside the schema definition.
24+
//
25+
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
26+
// has a value in the configuration. The validator will also produce warnings for users of shared modules who cannot immediately take action on the warning.
2427
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Object {
2528
return schemavalidator.PreferWriteOnlyAttribute{
2629
WriteOnlyAttribute: writeOnlyAttribute,

resourcevalidator/prefer_write_only_attribute.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import (
1414

1515
// PreferWriteOnlyAttribute returns a warning if the Terraform client supports
1616
// write-only attributes, and the old attribute value is not null.
17+
//
18+
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
19+
// has a value in the configuration. The validator will also produce warnings for users of shared modules who cannot immediately take action on the warning.
1720
func PreferWriteOnlyAttribute(oldAttribute path.Expression, writeOnlyAttribute path.Expression) resource.ConfigValidator {
1821
return preferWriteOnlyAttributeValidator{
1922
oldAttribute: oldAttribute,

stringvalidator/prefer_write_only_attribute.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import (
2121
// This implements the validation logic declaratively within the schema.
2222
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
2323
// for declaring this type of validation outside the schema definition.
24+
//
25+
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
26+
// has a value in the configuration. The validator will also produce warnings for users of shared modules who cannot immediately take action on the warning.
2427
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.String {
2528
return schemavalidator.PreferWriteOnlyAttribute{
2629
WriteOnlyAttribute: writeOnlyAttribute,

0 commit comments

Comments
 (0)