/
nested_attributes.go
62 lines (57 loc) · 2.63 KB
/
nested_attributes.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package tfsdk
import (
"github.com/hashicorp/terraform-plugin-framework/internal/fwschema"
)
// ListNestedAttributes nests `attributes` under another attribute, allowing
// multiple instances of that group of attributes to appear in the
// configuration.
//
// Deprecated: Use datasource/schema.ListNestedAttribute,
// provider/schema.ListNestedAttribute, or resource/schema.ListNestedAttribute
// instead. This can be switched by using the datasource/schema.Schema,
// provider/schema.Schema, or resource/schema.Schema types.
func ListNestedAttributes(attributes map[string]Attribute) fwschema.NestedAttributes {
return fwschema.ListNestedAttributes{
UnderlyingAttributes: schemaAttributes(attributes),
}
}
// MapNestedAttributes nests `attributes` under another attribute, allowing
// multiple instances of that group of attributes to appear in the
// configuration. Each group will need to be associated with a unique string by
// the user.
//
// Deprecated: Use datasource/schema.MapNestedAttribute,
// provider/schema.MapNestedAttribute, or resource/schema.MapNestedAttribute
// instead. This can be switched by using the datasource/schema.Schema,
// provider/schema.Schema, or resource/schema.Schema types.
func MapNestedAttributes(attributes map[string]Attribute) fwschema.NestedAttributes {
return fwschema.MapNestedAttributes{
UnderlyingAttributes: schemaAttributes(attributes),
}
}
// SetNestedAttributes nests `attributes` under another attribute, allowing
// multiple instances of that group of attributes to appear in the
// configuration, while requiring each group of values be unique.
//
// Deprecated: Use datasource/schema.SetNestedAttribute,
// provider/schema.SetNestedAttribute, or resource/schema.SetNestedAttribute
// instead. This can be switched by using the datasource/schema.Schema,
// provider/schema.Schema, or resource/schema.Schema types.
func SetNestedAttributes(attributes map[string]Attribute) fwschema.NestedAttributes {
return fwschema.SetNestedAttributes{
UnderlyingAttributes: schemaAttributes(attributes),
}
}
// SingleNestedAttributes nests `attributes` under another attribute, only
// allowing one instance of that group of attributes to appear in the
// configuration.
//
// Deprecated: Use datasource/schema.SingleNestedAttribute,
// provider/schema.SingleNestedAttribute, or resource/schema.SingleNestedAttribute
// instead. This can be switched by using the datasource/schema.Schema,
// provider/schema.Schema, or resource/schema.Schema types.
func SingleNestedAttributes(attributes map[string]Attribute) fwschema.NestedAttributes {
return fwschema.SingleNestedAttributes{
UnderlyingAttributes: schemaAttributes(attributes),
}
}