-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into bflad/docs-remove-experimental
- Loading branch information
Showing
68 changed files
with
4,561 additions
and
619 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
kind: BREAKING CHANGES | ||
body: 'function: Removed `Definition` type `Parameter()` method' | ||
time: 2024-04-04T18:20:04.534677+01:00 | ||
custom: | ||
Issue: "968" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
kind: FEATURES | ||
body: 'attr/xattr: Added `ValidateableAttribute` interface for custom value type implementations' | ||
time: 2024-04-04T15:43:39.796606+01:00 | ||
custom: | ||
Issue: "968" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: FEATURES | ||
body: 'function: Added `ValidateableParameter` interface for custom value | ||
type implementations' | ||
time: 2024-04-04T15:44:39.289946+01:00 | ||
custom: | ||
Issue: "968" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: NOTES | ||
body: 'attr/xattr: The `TypeWithValidate` interface has been deprecated in preference | ||
of the `ValidateableAttribute` interface. A `ValidatableParameter` interface has | ||
also been added to the `function` package' | ||
time: 2024-04-04T15:56:06.494328+01:00 | ||
custom: | ||
Issue: "968" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package xattr | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/hashicorp/terraform-plugin-framework/diag" | ||
"github.com/hashicorp/terraform-plugin-framework/path" | ||
) | ||
|
||
// ValidateableAttribute defines an interface for validating an attribute value. | ||
// The ValidateAttribute method is called implicitly by the framework when value | ||
// types from Terraform are converted into framework types. | ||
type ValidateableAttribute interface { | ||
// ValidateAttribute returns any warnings or errors generated during validation | ||
// of the attribute. It is generally used to check the data format and ensure | ||
// that it complies with the requirements of the Value. | ||
ValidateAttribute(context.Context, ValidateAttributeRequest, *ValidateAttributeResponse) | ||
} | ||
|
||
// ValidateAttributeRequest represents a request for the Value to call its | ||
// validation logic. An instance of this request struct is supplied as an | ||
// argument to the ValidateAttribute method. | ||
type ValidateAttributeRequest struct { | ||
// Path is the path to the attribute being validated. | ||
Path path.Path | ||
} | ||
|
||
// ValidateAttributeResponse represents a response to a ValidateAttributeRequest. | ||
// An instance of this response struct is supplied as an argument to the | ||
// ValidateAttribute method. | ||
type ValidateAttributeResponse struct { | ||
// Diagnostics is a collection of warnings or errors generated during | ||
// validation of the Value. | ||
Diagnostics diag.Diagnostics | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.