/
list.go
36 lines (28 loc) · 974 Bytes
/
list.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
34
35
36
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package defaults
import (
"context"
"github.com/hashicorp/terraform-plugin-framework/diag"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/types"
)
// List is a schema default value for types.List attributes.
type List interface {
Describer
// DefaultList should set the default value.
DefaultList(context.Context, ListRequest, *ListResponse)
}
type ListRequest struct {
// Path contains the path of the attribute for setting the
// default value. Use this path for any response diagnostics.
Path path.Path
}
type ListResponse struct {
// Diagnostics report errors or warnings related to setting the
// default value resource configuration. An empty slice
// indicates success, with no warnings or errors generated.
Diagnostics diag.Diagnostics
// PlanValue is the planned new state for the attribute.
PlanValue types.List
}