/
DataSource_FileAssetSpec.generated.go
92 lines (85 loc) · 2.49 KB
/
DataSource_FileAssetSpec.generated.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package schemas
import (
. "github.com/eddycharly/terraform-provider-kops/pkg/schemas"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"k8s.io/kops/pkg/apis/kops"
)
var _ = Schema
func DataSourceFileAssetSpec() *schema.Resource {
res := &schema.Resource{
Schema: map[string]*schema.Schema{
"name": ComputedString(),
"path": ComputedString(),
"roles": ComputedList(String()),
"content": ComputedString(),
"is_base64": ComputedBool(),
"mode": ComputedString(),
},
}
return res
}
func ExpandDataSourceFileAssetSpec(in map[string]interface{}) kops.FileAssetSpec {
if in == nil {
panic("expand FileAssetSpec failure, in is nil")
}
return kops.FileAssetSpec{
Name: func(in interface{}) string {
return string(ExpandString(in))
}(in["name"]),
Path: func(in interface{}) string {
return string(ExpandString(in))
}(in["path"]),
Roles: func(in interface{}) []kops.InstanceGroupRole {
return func(in interface{}) []kops.InstanceGroupRole {
if in == nil {
return nil
}
var out []kops.InstanceGroupRole
for _, in := range in.([]interface{}) {
out = append(out, kops.InstanceGroupRole(ExpandString(in)))
}
return out
}(in)
}(in["roles"]),
Content: func(in interface{}) string {
return string(ExpandString(in))
}(in["content"]),
IsBase64: func(in interface{}) bool {
return bool(ExpandBool(in))
}(in["is_base64"]),
Mode: func(in interface{}) string {
return string(ExpandString(in))
}(in["mode"]),
}
}
func FlattenDataSourceFileAssetSpecInto(in kops.FileAssetSpec, out map[string]interface{}) {
out["name"] = func(in string) interface{} {
return FlattenString(string(in))
}(in.Name)
out["path"] = func(in string) interface{} {
return FlattenString(string(in))
}(in.Path)
out["roles"] = func(in []kops.InstanceGroupRole) interface{} {
return func(in []kops.InstanceGroupRole) []interface{} {
var out []interface{}
for _, in := range in {
out = append(out, FlattenString(string(in)))
}
return out
}(in)
}(in.Roles)
out["content"] = func(in string) interface{} {
return FlattenString(string(in))
}(in.Content)
out["is_base64"] = func(in bool) interface{} {
return FlattenBool(bool(in))
}(in.IsBase64)
out["mode"] = func(in string) interface{} {
return FlattenString(string(in))
}(in.Mode)
}
func FlattenDataSourceFileAssetSpec(in kops.FileAssetSpec) map[string]interface{} {
out := map[string]interface{}{}
FlattenDataSourceFileAssetSpecInto(in, out)
return out
}