Skip to content

Add Callout for PreferWriteOnlyAttribute() validators in GoDoc comments #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 3, 2025
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
1 change: 0 additions & 1 deletion .changes/0.17.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ FEATURES:
* numbervalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
* objectvalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
* resourcevalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
* setvalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
* stringvalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))

1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ FEATURES:
* numbervalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
* objectvalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
* resourcevalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
* setvalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))
* stringvalidator: Added `PreferWriteOnlyAttribute` validator ([#263](https://github.com/hashicorp/terraform-plugin-framework-validators/issues/263))

## 0.16.0 (December 12, 2024)
Expand Down
3 changes: 3 additions & 0 deletions boolvalidator/prefer_write_only_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
// This implements the validation logic declaratively within the schema.
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
// for declaring this type of validation outside the schema definition.
//
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
// 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.
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Bool {
return schemavalidator.PreferWriteOnlyAttribute{
WriteOnlyAttribute: writeOnlyAttribute,
Expand Down
3 changes: 3 additions & 0 deletions dynamicvalidator/prefer_write_only_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
// This implements the validation logic declaratively within the schema.
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
// for declaring this type of validation outside the schema definition.
//
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
// 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.
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Dynamic {
return schemavalidator.PreferWriteOnlyAttribute{
WriteOnlyAttribute: writeOnlyAttribute,
Expand Down
3 changes: 3 additions & 0 deletions float32validator/prefer_write_only_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
// This implements the validation logic declaratively within the schema.
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
// for declaring this type of validation outside the schema definition.
//
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
// 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.
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Float32 {
return schemavalidator.PreferWriteOnlyAttribute{
WriteOnlyAttribute: writeOnlyAttribute,
Expand Down
3 changes: 3 additions & 0 deletions float64validator/prefer_write_only_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
// This implements the validation logic declaratively within the schema.
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
// for declaring this type of validation outside the schema definition.
//
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
// 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.
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Float64 {
return schemavalidator.PreferWriteOnlyAttribute{
WriteOnlyAttribute: writeOnlyAttribute,
Expand Down
3 changes: 3 additions & 0 deletions int32validator/prefer_write_only_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
// This implements the validation logic declaratively within the schema.
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
// for declaring this type of validation outside the schema definition.
//
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
// 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.
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Int32 {
return schemavalidator.PreferWriteOnlyAttribute{
WriteOnlyAttribute: writeOnlyAttribute,
Expand Down
3 changes: 3 additions & 0 deletions int64validator/prefer_write_only_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
// This implements the validation logic declaratively within the schema.
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
// for declaring this type of validation outside the schema definition.
//
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
// 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.
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Int64 {
return schemavalidator.PreferWriteOnlyAttribute{
WriteOnlyAttribute: writeOnlyAttribute,
Expand Down
3 changes: 3 additions & 0 deletions listvalidator/prefer_write_only_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
// This implements the validation logic declaratively within the schema.
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
// for declaring this type of validation outside the schema definition.
//
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
// 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.
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.List {
return schemavalidator.PreferWriteOnlyAttribute{
WriteOnlyAttribute: writeOnlyAttribute,
Expand Down
3 changes: 3 additions & 0 deletions mapvalidator/prefer_write_only_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
// This implements the validation logic declaratively within the schema.
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
// for declaring this type of validation outside the schema definition.
//
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
// 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.
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Map {
return schemavalidator.PreferWriteOnlyAttribute{
WriteOnlyAttribute: writeOnlyAttribute,
Expand Down
3 changes: 3 additions & 0 deletions numbervalidator/prefer_write_only_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
// This implements the validation logic declaratively within the schema.
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
// for declaring this type of validation outside the schema definition.
//
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
// 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.
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Number {
return schemavalidator.PreferWriteOnlyAttribute{
WriteOnlyAttribute: writeOnlyAttribute,
Expand Down
3 changes: 3 additions & 0 deletions objectvalidator/prefer_write_only_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
// This implements the validation logic declaratively within the schema.
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
// for declaring this type of validation outside the schema definition.
//
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
// 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.
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.Object {
return schemavalidator.PreferWriteOnlyAttribute{
WriteOnlyAttribute: writeOnlyAttribute,
Expand Down
3 changes: 3 additions & 0 deletions resourcevalidator/prefer_write_only_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import (

// PreferWriteOnlyAttribute returns a warning if the Terraform client supports
// write-only attributes, and the old attribute value is not null.
//
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
// 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.
func PreferWriteOnlyAttribute(oldAttribute path.Expression, writeOnlyAttribute path.Expression) resource.ConfigValidator {
return preferWriteOnlyAttributeValidator{
oldAttribute: oldAttribute,
Expand Down
3 changes: 3 additions & 0 deletions stringvalidator/prefer_write_only_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
// This implements the validation logic declaratively within the schema.
// Refer to [resourcevalidator.PreferWriteOnlyAttribute]
// for declaring this type of validation outside the schema definition.
//
// NOTE: This validator will produce persistent warnings for practitioners on every Terraform run as long as the specified non-write-only attribute
// 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.
func PreferWriteOnlyAttribute(writeOnlyAttribute path.Expression) validator.String {
return schemavalidator.PreferWriteOnlyAttribute{
WriteOnlyAttribute: writeOnlyAttribute,
Expand Down
Loading