/
Resource_AuthenticationSpec.generated.go
97 lines (90 loc) · 3.01 KB
/
Resource_AuthenticationSpec.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
93
94
95
96
97
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 ResourceAuthenticationSpec() *schema.Resource {
res := &schema.Resource{
Schema: map[string]*schema.Schema{
"kopeio": OptionalStruct(ResourceKopeioAuthenticationSpec()),
"aws": OptionalStruct(ResourceAWSAuthenticationSpec()),
},
}
return res
}
func ExpandResourceAuthenticationSpec(in map[string]interface{}) kops.AuthenticationSpec {
if in == nil {
panic("expand AuthenticationSpec failure, in is nil")
}
return kops.AuthenticationSpec{
Kopeio: func(in interface{}) *kops.KopeioAuthenticationSpec {
return func(in interface{}) *kops.KopeioAuthenticationSpec {
if in == nil {
return nil
}
if _, ok := in.([]interface{}); ok && len(in.([]interface{})) == 0 {
return nil
}
return func(in kops.KopeioAuthenticationSpec) *kops.KopeioAuthenticationSpec {
return &in
}(func(in interface{}) kops.KopeioAuthenticationSpec {
if in, ok := in.([]interface{}); ok && len(in) == 1 && in[0] != nil {
return ExpandResourceKopeioAuthenticationSpec(in[0].(map[string]interface{}))
}
return kops.KopeioAuthenticationSpec{}
}(in))
}(in)
}(in["kopeio"]),
AWS: func(in interface{}) *kops.AWSAuthenticationSpec {
return func(in interface{}) *kops.AWSAuthenticationSpec {
if in == nil {
return nil
}
if _, ok := in.([]interface{}); ok && len(in.([]interface{})) == 0 {
return nil
}
return func(in kops.AWSAuthenticationSpec) *kops.AWSAuthenticationSpec {
return &in
}(func(in interface{}) kops.AWSAuthenticationSpec {
if in, ok := in.([]interface{}); ok && len(in) == 1 && in[0] != nil {
return ExpandResourceAWSAuthenticationSpec(in[0].(map[string]interface{}))
}
return kops.AWSAuthenticationSpec{}
}(in))
}(in)
}(in["aws"]),
}
}
func FlattenResourceAuthenticationSpecInto(in kops.AuthenticationSpec, out map[string]interface{}) {
out["kopeio"] = func(in *kops.KopeioAuthenticationSpec) interface{} {
return func(in *kops.KopeioAuthenticationSpec) interface{} {
if in == nil {
return nil
}
return func(in kops.KopeioAuthenticationSpec) interface{} {
return func(in kops.KopeioAuthenticationSpec) []interface{} {
return []interface{}{FlattenResourceKopeioAuthenticationSpec(in)}
}(in)
}(*in)
}(in)
}(in.Kopeio)
out["aws"] = func(in *kops.AWSAuthenticationSpec) interface{} {
return func(in *kops.AWSAuthenticationSpec) interface{} {
if in == nil {
return nil
}
return func(in kops.AWSAuthenticationSpec) interface{} {
return func(in kops.AWSAuthenticationSpec) []interface{} {
return []interface{}{FlattenResourceAWSAuthenticationSpec(in)}
}(in)
}(*in)
}(in)
}(in.AWS)
}
func FlattenResourceAuthenticationSpec(in kops.AuthenticationSpec) map[string]interface{} {
out := map[string]interface{}{}
FlattenResourceAuthenticationSpecInto(in, out)
return out
}