/
DataSource_OpenstackMonitor.generated.go
127 lines (119 loc) · 2.96 KB
/
DataSource_OpenstackMonitor.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
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 DataSourceOpenstackMonitor() *schema.Resource {
res := &schema.Resource{
Schema: map[string]*schema.Schema{
"delay": ComputedString(),
"timeout": ComputedString(),
"max_retries": ComputedInt(),
},
}
return res
}
func ExpandDataSourceOpenstackMonitor(in map[string]interface{}) kops.OpenstackMonitor {
if in == nil {
panic("expand OpenstackMonitor failure, in is nil")
}
return kops.OpenstackMonitor{
Delay: func(in interface{}) *string {
if in == nil {
return nil
}
if reflect.DeepEqual(in, reflect.Zero(reflect.TypeOf(in)).Interface()) {
return nil
}
return func(in interface{}) *string {
if in == nil {
return nil
}
if _, ok := in.([]interface{}); ok && len(in.([]interface{})) == 0 {
return nil
}
return func(in string) *string {
return &in
}(string(ExpandString(in)))
}(in)
}(in["delay"]),
Timeout: func(in interface{}) *string {
if in == nil {
return nil
}
if reflect.DeepEqual(in, reflect.Zero(reflect.TypeOf(in)).Interface()) {
return nil
}
return func(in interface{}) *string {
if in == nil {
return nil
}
if _, ok := in.([]interface{}); ok && len(in.([]interface{})) == 0 {
return nil
}
return func(in string) *string {
return &in
}(string(ExpandString(in)))
}(in)
}(in["timeout"]),
MaxRetries: func(in interface{}) *int {
if in == nil {
return nil
}
if reflect.DeepEqual(in, reflect.Zero(reflect.TypeOf(in)).Interface()) {
return nil
}
return func(in interface{}) *int {
if in == nil {
return nil
}
if _, ok := in.([]interface{}); ok && len(in.([]interface{})) == 0 {
return nil
}
return func(in int) *int {
return &in
}(int(ExpandInt(in)))
}(in)
}(in["max_retries"]),
}
}
func FlattenDataSourceOpenstackMonitorInto(in kops.OpenstackMonitor, out map[string]interface{}) {
out["delay"] = func(in *string) interface{} {
return func(in *string) interface{} {
if in == nil {
return nil
}
return func(in string) interface{} {
return FlattenString(string(in))
}(*in)
}(in)
}(in.Delay)
out["timeout"] = func(in *string) interface{} {
return func(in *string) interface{} {
if in == nil {
return nil
}
return func(in string) interface{} {
return FlattenString(string(in))
}(*in)
}(in)
}(in.Timeout)
out["max_retries"] = func(in *int) interface{} {
return func(in *int) interface{} {
if in == nil {
return nil
}
return func(in int) interface{} {
return FlattenInt(int(in))
}(*in)
}(in)
}(in.MaxRetries)
}
func FlattenDataSourceOpenstackMonitor(in kops.OpenstackMonitor) map[string]interface{} {
out := map[string]interface{}{}
FlattenDataSourceOpenstackMonitorInto(in, out)
return out
}