-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_fly_container_healthcheck.go
More file actions
494 lines (418 loc) · 14.1 KB
/
Copy pathmodel_fly_container_healthcheck.go
File metadata and controls
494 lines (418 loc) · 14.1 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
/*
Machines API
This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/) for how to get started, more information about each endpoint, parameter descriptions, and examples.
API version: 1.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package machines
import (
"encoding/json"
)
// checks if the FlyContainerHealthcheck type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FlyContainerHealthcheck{}
// FlyContainerHealthcheck struct for FlyContainerHealthcheck
type FlyContainerHealthcheck struct {
Exec *FlyExecHealthcheck `json:"exec,omitempty"`
// The number of times the check must fail before considering the container unhealthy.
FailureThreshold *int64 `json:"failure_threshold,omitempty"`
// The time in seconds to wait after a container starts before checking its health.
GracePeriod *int64 `json:"grace_period,omitempty"`
Http *FlyHTTPHealthcheck `json:"http,omitempty"`
// The time in seconds between executing the defined check.
Interval *int64 `json:"interval,omitempty"`
// Kind of healthcheck (readiness, liveness)
Kind *FlyContainerHealthcheckKind `json:"kind,omitempty"`
// The name of the check. Must be unique within the container.
Name *string `json:"name,omitempty"`
// The number of times the check must succeeed before considering the container healthy.
SuccessThreshold *int64 `json:"success_threshold,omitempty"`
Tcp *FlyTCPHealthcheck `json:"tcp,omitempty"`
// The time in seconds to wait for the check to complete.
Timeout *int64 `json:"timeout,omitempty"`
// Unhealthy policy that determines what action to take if a container is deemed unhealthy
Unhealthy *FlyUnhealthyPolicy `json:"unhealthy,omitempty"`
}
// NewFlyContainerHealthcheck instantiates a new FlyContainerHealthcheck object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewFlyContainerHealthcheck() *FlyContainerHealthcheck {
this := FlyContainerHealthcheck{}
return &this
}
// NewFlyContainerHealthcheckWithDefaults instantiates a new FlyContainerHealthcheck object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewFlyContainerHealthcheckWithDefaults() *FlyContainerHealthcheck {
this := FlyContainerHealthcheck{}
return &this
}
// GetExec returns the Exec field value if set, zero value otherwise.
func (o *FlyContainerHealthcheck) GetExec() FlyExecHealthcheck {
if o == nil || IsNil(o.Exec) {
var ret FlyExecHealthcheck
return ret
}
return *o.Exec
}
// GetExecOk returns a tuple with the Exec field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyContainerHealthcheck) GetExecOk() (*FlyExecHealthcheck, bool) {
if o == nil || IsNil(o.Exec) {
return nil, false
}
return o.Exec, true
}
// HasExec returns a boolean if a field has been set.
func (o *FlyContainerHealthcheck) HasExec() bool {
if o != nil && !IsNil(o.Exec) {
return true
}
return false
}
// SetExec gets a reference to the given FlyExecHealthcheck and assigns it to the Exec field.
func (o *FlyContainerHealthcheck) SetExec(v FlyExecHealthcheck) {
o.Exec = &v
}
// GetFailureThreshold returns the FailureThreshold field value if set, zero value otherwise.
func (o *FlyContainerHealthcheck) GetFailureThreshold() int64 {
if o == nil || IsNil(o.FailureThreshold) {
var ret int64
return ret
}
return *o.FailureThreshold
}
// GetFailureThresholdOk returns a tuple with the FailureThreshold field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyContainerHealthcheck) GetFailureThresholdOk() (*int64, bool) {
if o == nil || IsNil(o.FailureThreshold) {
return nil, false
}
return o.FailureThreshold, true
}
// HasFailureThreshold returns a boolean if a field has been set.
func (o *FlyContainerHealthcheck) HasFailureThreshold() bool {
if o != nil && !IsNil(o.FailureThreshold) {
return true
}
return false
}
// SetFailureThreshold gets a reference to the given int64 and assigns it to the FailureThreshold field.
func (o *FlyContainerHealthcheck) SetFailureThreshold(v int64) {
o.FailureThreshold = &v
}
// GetGracePeriod returns the GracePeriod field value if set, zero value otherwise.
func (o *FlyContainerHealthcheck) GetGracePeriod() int64 {
if o == nil || IsNil(o.GracePeriod) {
var ret int64
return ret
}
return *o.GracePeriod
}
// GetGracePeriodOk returns a tuple with the GracePeriod field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyContainerHealthcheck) GetGracePeriodOk() (*int64, bool) {
if o == nil || IsNil(o.GracePeriod) {
return nil, false
}
return o.GracePeriod, true
}
// HasGracePeriod returns a boolean if a field has been set.
func (o *FlyContainerHealthcheck) HasGracePeriod() bool {
if o != nil && !IsNil(o.GracePeriod) {
return true
}
return false
}
// SetGracePeriod gets a reference to the given int64 and assigns it to the GracePeriod field.
func (o *FlyContainerHealthcheck) SetGracePeriod(v int64) {
o.GracePeriod = &v
}
// GetHttp returns the Http field value if set, zero value otherwise.
func (o *FlyContainerHealthcheck) GetHttp() FlyHTTPHealthcheck {
if o == nil || IsNil(o.Http) {
var ret FlyHTTPHealthcheck
return ret
}
return *o.Http
}
// GetHttpOk returns a tuple with the Http field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyContainerHealthcheck) GetHttpOk() (*FlyHTTPHealthcheck, bool) {
if o == nil || IsNil(o.Http) {
return nil, false
}
return o.Http, true
}
// HasHttp returns a boolean if a field has been set.
func (o *FlyContainerHealthcheck) HasHttp() bool {
if o != nil && !IsNil(o.Http) {
return true
}
return false
}
// SetHttp gets a reference to the given FlyHTTPHealthcheck and assigns it to the Http field.
func (o *FlyContainerHealthcheck) SetHttp(v FlyHTTPHealthcheck) {
o.Http = &v
}
// GetInterval returns the Interval field value if set, zero value otherwise.
func (o *FlyContainerHealthcheck) GetInterval() int64 {
if o == nil || IsNil(o.Interval) {
var ret int64
return ret
}
return *o.Interval
}
// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyContainerHealthcheck) GetIntervalOk() (*int64, bool) {
if o == nil || IsNil(o.Interval) {
return nil, false
}
return o.Interval, true
}
// HasInterval returns a boolean if a field has been set.
func (o *FlyContainerHealthcheck) HasInterval() bool {
if o != nil && !IsNil(o.Interval) {
return true
}
return false
}
// SetInterval gets a reference to the given int64 and assigns it to the Interval field.
func (o *FlyContainerHealthcheck) SetInterval(v int64) {
o.Interval = &v
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *FlyContainerHealthcheck) GetKind() FlyContainerHealthcheckKind {
if o == nil || IsNil(o.Kind) {
var ret FlyContainerHealthcheckKind
return ret
}
return *o.Kind
}
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyContainerHealthcheck) GetKindOk() (*FlyContainerHealthcheckKind, bool) {
if o == nil || IsNil(o.Kind) {
return nil, false
}
return o.Kind, true
}
// HasKind returns a boolean if a field has been set.
func (o *FlyContainerHealthcheck) HasKind() bool {
if o != nil && !IsNil(o.Kind) {
return true
}
return false
}
// SetKind gets a reference to the given FlyContainerHealthcheckKind and assigns it to the Kind field.
func (o *FlyContainerHealthcheck) SetKind(v FlyContainerHealthcheckKind) {
o.Kind = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *FlyContainerHealthcheck) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyContainerHealthcheck) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *FlyContainerHealthcheck) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *FlyContainerHealthcheck) SetName(v string) {
o.Name = &v
}
// GetSuccessThreshold returns the SuccessThreshold field value if set, zero value otherwise.
func (o *FlyContainerHealthcheck) GetSuccessThreshold() int64 {
if o == nil || IsNil(o.SuccessThreshold) {
var ret int64
return ret
}
return *o.SuccessThreshold
}
// GetSuccessThresholdOk returns a tuple with the SuccessThreshold field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyContainerHealthcheck) GetSuccessThresholdOk() (*int64, bool) {
if o == nil || IsNil(o.SuccessThreshold) {
return nil, false
}
return o.SuccessThreshold, true
}
// HasSuccessThreshold returns a boolean if a field has been set.
func (o *FlyContainerHealthcheck) HasSuccessThreshold() bool {
if o != nil && !IsNil(o.SuccessThreshold) {
return true
}
return false
}
// SetSuccessThreshold gets a reference to the given int64 and assigns it to the SuccessThreshold field.
func (o *FlyContainerHealthcheck) SetSuccessThreshold(v int64) {
o.SuccessThreshold = &v
}
// GetTcp returns the Tcp field value if set, zero value otherwise.
func (o *FlyContainerHealthcheck) GetTcp() FlyTCPHealthcheck {
if o == nil || IsNil(o.Tcp) {
var ret FlyTCPHealthcheck
return ret
}
return *o.Tcp
}
// GetTcpOk returns a tuple with the Tcp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyContainerHealthcheck) GetTcpOk() (*FlyTCPHealthcheck, bool) {
if o == nil || IsNil(o.Tcp) {
return nil, false
}
return o.Tcp, true
}
// HasTcp returns a boolean if a field has been set.
func (o *FlyContainerHealthcheck) HasTcp() bool {
if o != nil && !IsNil(o.Tcp) {
return true
}
return false
}
// SetTcp gets a reference to the given FlyTCPHealthcheck and assigns it to the Tcp field.
func (o *FlyContainerHealthcheck) SetTcp(v FlyTCPHealthcheck) {
o.Tcp = &v
}
// GetTimeout returns the Timeout field value if set, zero value otherwise.
func (o *FlyContainerHealthcheck) GetTimeout() int64 {
if o == nil || IsNil(o.Timeout) {
var ret int64
return ret
}
return *o.Timeout
}
// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyContainerHealthcheck) GetTimeoutOk() (*int64, bool) {
if o == nil || IsNil(o.Timeout) {
return nil, false
}
return o.Timeout, true
}
// HasTimeout returns a boolean if a field has been set.
func (o *FlyContainerHealthcheck) HasTimeout() bool {
if o != nil && !IsNil(o.Timeout) {
return true
}
return false
}
// SetTimeout gets a reference to the given int64 and assigns it to the Timeout field.
func (o *FlyContainerHealthcheck) SetTimeout(v int64) {
o.Timeout = &v
}
// GetUnhealthy returns the Unhealthy field value if set, zero value otherwise.
func (o *FlyContainerHealthcheck) GetUnhealthy() FlyUnhealthyPolicy {
if o == nil || IsNil(o.Unhealthy) {
var ret FlyUnhealthyPolicy
return ret
}
return *o.Unhealthy
}
// GetUnhealthyOk returns a tuple with the Unhealthy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyContainerHealthcheck) GetUnhealthyOk() (*FlyUnhealthyPolicy, bool) {
if o == nil || IsNil(o.Unhealthy) {
return nil, false
}
return o.Unhealthy, true
}
// HasUnhealthy returns a boolean if a field has been set.
func (o *FlyContainerHealthcheck) HasUnhealthy() bool {
if o != nil && !IsNil(o.Unhealthy) {
return true
}
return false
}
// SetUnhealthy gets a reference to the given FlyUnhealthyPolicy and assigns it to the Unhealthy field.
func (o *FlyContainerHealthcheck) SetUnhealthy(v FlyUnhealthyPolicy) {
o.Unhealthy = &v
}
func (o FlyContainerHealthcheck) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FlyContainerHealthcheck) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Exec) {
toSerialize["exec"] = o.Exec
}
if !IsNil(o.FailureThreshold) {
toSerialize["failure_threshold"] = o.FailureThreshold
}
if !IsNil(o.GracePeriod) {
toSerialize["grace_period"] = o.GracePeriod
}
if !IsNil(o.Http) {
toSerialize["http"] = o.Http
}
if !IsNil(o.Interval) {
toSerialize["interval"] = o.Interval
}
if !IsNil(o.Kind) {
toSerialize["kind"] = o.Kind
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.SuccessThreshold) {
toSerialize["success_threshold"] = o.SuccessThreshold
}
if !IsNil(o.Tcp) {
toSerialize["tcp"] = o.Tcp
}
if !IsNil(o.Timeout) {
toSerialize["timeout"] = o.Timeout
}
if !IsNil(o.Unhealthy) {
toSerialize["unhealthy"] = o.Unhealthy
}
return toSerialize, nil
}
type NullableFlyContainerHealthcheck struct {
value *FlyContainerHealthcheck
isSet bool
}
func (v NullableFlyContainerHealthcheck) Get() *FlyContainerHealthcheck {
return v.value
}
func (v *NullableFlyContainerHealthcheck) Set(val *FlyContainerHealthcheck) {
v.value = val
v.isSet = true
}
func (v NullableFlyContainerHealthcheck) IsSet() bool {
return v.isSet
}
func (v *NullableFlyContainerHealthcheck) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFlyContainerHealthcheck(val *FlyContainerHealthcheck) *NullableFlyContainerHealthcheck {
return &NullableFlyContainerHealthcheck{value: val, isSet: true}
}
func (v NullableFlyContainerHealthcheck) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFlyContainerHealthcheck) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}