/
Resource_ExternalDNSConfig.generated.go
81 lines (73 loc) · 2.08 KB
/
Resource_ExternalDNSConfig.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
package schemas
import (
"reflect"
. "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 ResourceExternalDNSConfig() *schema.Resource {
res := &schema.Resource{
Schema: map[string]*schema.Schema{
"watch_ingress": OptionalBool(),
"watch_namespace": OptionalString(),
"provider": OptionalString(),
},
}
return res
}
func ExpandResourceExternalDNSConfig(in map[string]interface{}) kops.ExternalDNSConfig {
if in == nil {
panic("expand ExternalDNSConfig failure, in is nil")
}
return kops.ExternalDNSConfig{
WatchIngress: func(in interface{}) *bool {
if in == nil {
return nil
}
if reflect.DeepEqual(in, reflect.Zero(reflect.TypeOf(in)).Interface()) {
return nil
}
return func(in interface{}) *bool {
if in == nil {
return nil
}
if _, ok := in.([]interface{}); ok && len(in.([]interface{})) == 0 {
return nil
}
return func(in bool) *bool {
return &in
}(bool(ExpandBool(in)))
}(in)
}(in["watch_ingress"]),
WatchNamespace: func(in interface{}) string {
return string(ExpandString(in))
}(in["watch_namespace"]),
Provider: func(in interface{}) kops.ExternalDNSProvider {
return kops.ExternalDNSProvider(ExpandString(in))
}(in["provider"]),
}
}
func FlattenResourceExternalDNSConfigInto(in kops.ExternalDNSConfig, out map[string]interface{}) {
out["watch_ingress"] = func(in *bool) interface{} {
return func(in *bool) interface{} {
if in == nil {
return nil
}
return func(in bool) interface{} {
return FlattenBool(bool(in))
}(*in)
}(in)
}(in.WatchIngress)
out["watch_namespace"] = func(in string) interface{} {
return FlattenString(string(in))
}(in.WatchNamespace)
out["provider"] = func(in kops.ExternalDNSProvider) interface{} {
return FlattenString(string(in))
}(in.Provider)
}
func FlattenResourceExternalDNSConfig(in kops.ExternalDNSConfig) map[string]interface{} {
out := map[string]interface{}{}
FlattenResourceExternalDNSConfigInto(in, out)
return out
}