/
validate_config.go
33 lines (29 loc) · 1.25 KB
/
validate_config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package provider
import (
"github.com/hashicorp/terraform-plugin-framework/diag"
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
)
// ValidateConfigRequest represents a request to validate the
// configuration of a provider. An instance of this request struct is
// supplied as an argument to the Provider ValidateConfig receiver method
// or automatically passed through to each ConfigValidator.
type ValidateConfigRequest struct {
// Config is the configuration the user supplied for the provider.
//
// This configuration may contain unknown values if a user uses
// interpolation or other functionality that would prevent Terraform
// from knowing the value at request time.
Config tfsdk.Config
}
// ValidateConfigResponse represents a response to a
// ValidateConfigRequest. An instance of this response struct is
// supplied as an argument to the Provider ValidateConfig receiver method
// or automatically passed through to each ConfigValidator.
type ValidateConfigResponse struct {
// Diagnostics report errors or warnings related to validating the provider
// configuration. An empty slice indicates success, with no warnings or
// errors generated.
Diagnostics diag.Diagnostics
}