-
Notifications
You must be signed in to change notification settings - Fork 63
/
metadata.go
49 lines (40 loc) · 1.02 KB
/
metadata.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
package storage
import (
"github.com/hashicorp/terraform-provider-azurestack/internal/services/storage/validate"
"github.com/hashicorp/terraform-provider-azurestack/internal/tf/pluginsdk"
)
func MetaDataSchema() *pluginsdk.Schema {
return &pluginsdk.Schema{
Type: pluginsdk.TypeMap,
Optional: true,
ValidateFunc: validate.MetaDataKeys,
Elem: &pluginsdk.Schema{
Type: pluginsdk.TypeString,
},
}
}
func MetaDataComputedSchema() *pluginsdk.Schema {
return &pluginsdk.Schema{
Type: pluginsdk.TypeMap,
Optional: true,
Computed: true,
ValidateFunc: validate.MetaDataKeys,
Elem: &pluginsdk.Schema{
Type: pluginsdk.TypeString,
},
}
}
func ExpandMetaData(input map[string]interface{}) map[string]string {
output := make(map[string]string)
for k, v := range input {
output[k] = v.(string)
}
return output
}
func FlattenMetaData(input map[string]string) map[string]interface{} {
output := make(map[string]interface{})
for k, v := range input {
output[k] = v
}
return output
}