-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_fly_machine_service_check.go
More file actions
496 lines (420 loc) · 13.8 KB
/
model_fly_machine_service_check.go
File metadata and controls
496 lines (420 loc) · 13.8 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
493
494
/*
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 FlyMachineServiceCheck type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FlyMachineServiceCheck{}
// FlyMachineServiceCheck struct for FlyMachineServiceCheck
type FlyMachineServiceCheck struct {
// The time to wait after a VM starts before checking its health
GracePeriod *FlyDuration `json:"grace_period,omitempty"`
Headers []FlyMachineHTTPHeader `json:"headers,omitempty"`
// The time between connectivity checks
Interval *FlyDuration `json:"interval,omitempty"`
// For http checks, the HTTP method to use to when making the request
Method *string `json:"method,omitempty"`
// For http checks, the path to send the request to
Path *string `json:"path,omitempty"`
// The port to connect to, often the same as internal_port
Port *int64 `json:"port,omitempty"`
// For http checks, whether to use http or https
Protocol *string `json:"protocol,omitempty"`
// The maximum time a connection can take before being reported as failing its health check
Timeout *FlyDuration `json:"timeout,omitempty"`
// If the protocol is https, the hostname to use for TLS certificate validation
TlsServerName *string `json:"tls_server_name,omitempty"`
// For http checks with https protocol, whether or not to verify the TLS certificate
TlsSkipVerify *bool `json:"tls_skip_verify,omitempty"`
// tcp or http
Type *string `json:"type,omitempty"`
}
// NewFlyMachineServiceCheck instantiates a new FlyMachineServiceCheck 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 NewFlyMachineServiceCheck() *FlyMachineServiceCheck {
this := FlyMachineServiceCheck{}
return &this
}
// NewFlyMachineServiceCheckWithDefaults instantiates a new FlyMachineServiceCheck 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 NewFlyMachineServiceCheckWithDefaults() *FlyMachineServiceCheck {
this := FlyMachineServiceCheck{}
return &this
}
// GetGracePeriod returns the GracePeriod field value if set, zero value otherwise.
func (o *FlyMachineServiceCheck) GetGracePeriod() FlyDuration {
if o == nil || IsNil(o.GracePeriod) {
var ret FlyDuration
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 *FlyMachineServiceCheck) GetGracePeriodOk() (*FlyDuration, 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 *FlyMachineServiceCheck) HasGracePeriod() bool {
if o != nil && !IsNil(o.GracePeriod) {
return true
}
return false
}
// SetGracePeriod gets a reference to the given FlyDuration and assigns it to the GracePeriod field.
func (o *FlyMachineServiceCheck) SetGracePeriod(v FlyDuration) {
o.GracePeriod = &v
}
// GetHeaders returns the Headers field value if set, zero value otherwise.
func (o *FlyMachineServiceCheck) GetHeaders() []FlyMachineHTTPHeader {
if o == nil || IsNil(o.Headers) {
var ret []FlyMachineHTTPHeader
return ret
}
return o.Headers
}
// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyMachineServiceCheck) GetHeadersOk() ([]FlyMachineHTTPHeader, bool) {
if o == nil || IsNil(o.Headers) {
return nil, false
}
return o.Headers, true
}
// HasHeaders returns a boolean if a field has been set.
func (o *FlyMachineServiceCheck) HasHeaders() bool {
if o != nil && !IsNil(o.Headers) {
return true
}
return false
}
// SetHeaders gets a reference to the given []FlyMachineHTTPHeader and assigns it to the Headers field.
func (o *FlyMachineServiceCheck) SetHeaders(v []FlyMachineHTTPHeader) {
o.Headers = v
}
// GetInterval returns the Interval field value if set, zero value otherwise.
func (o *FlyMachineServiceCheck) GetInterval() FlyDuration {
if o == nil || IsNil(o.Interval) {
var ret FlyDuration
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 *FlyMachineServiceCheck) GetIntervalOk() (*FlyDuration, 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 *FlyMachineServiceCheck) HasInterval() bool {
if o != nil && !IsNil(o.Interval) {
return true
}
return false
}
// SetInterval gets a reference to the given FlyDuration and assigns it to the Interval field.
func (o *FlyMachineServiceCheck) SetInterval(v FlyDuration) {
o.Interval = &v
}
// GetMethod returns the Method field value if set, zero value otherwise.
func (o *FlyMachineServiceCheck) GetMethod() string {
if o == nil || IsNil(o.Method) {
var ret string
return ret
}
return *o.Method
}
// GetMethodOk returns a tuple with the Method field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyMachineServiceCheck) GetMethodOk() (*string, bool) {
if o == nil || IsNil(o.Method) {
return nil, false
}
return o.Method, true
}
// HasMethod returns a boolean if a field has been set.
func (o *FlyMachineServiceCheck) HasMethod() bool {
if o != nil && !IsNil(o.Method) {
return true
}
return false
}
// SetMethod gets a reference to the given string and assigns it to the Method field.
func (o *FlyMachineServiceCheck) SetMethod(v string) {
o.Method = &v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *FlyMachineServiceCheck) GetPath() string {
if o == nil || IsNil(o.Path) {
var ret string
return ret
}
return *o.Path
}
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyMachineServiceCheck) GetPathOk() (*string, bool) {
if o == nil || IsNil(o.Path) {
return nil, false
}
return o.Path, true
}
// HasPath returns a boolean if a field has been set.
func (o *FlyMachineServiceCheck) HasPath() bool {
if o != nil && !IsNil(o.Path) {
return true
}
return false
}
// SetPath gets a reference to the given string and assigns it to the Path field.
func (o *FlyMachineServiceCheck) SetPath(v string) {
o.Path = &v
}
// GetPort returns the Port field value if set, zero value otherwise.
func (o *FlyMachineServiceCheck) GetPort() int64 {
if o == nil || IsNil(o.Port) {
var ret int64
return ret
}
return *o.Port
}
// GetPortOk returns a tuple with the Port field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyMachineServiceCheck) GetPortOk() (*int64, bool) {
if o == nil || IsNil(o.Port) {
return nil, false
}
return o.Port, true
}
// HasPort returns a boolean if a field has been set.
func (o *FlyMachineServiceCheck) HasPort() bool {
if o != nil && !IsNil(o.Port) {
return true
}
return false
}
// SetPort gets a reference to the given int64 and assigns it to the Port field.
func (o *FlyMachineServiceCheck) SetPort(v int64) {
o.Port = &v
}
// GetProtocol returns the Protocol field value if set, zero value otherwise.
func (o *FlyMachineServiceCheck) GetProtocol() string {
if o == nil || IsNil(o.Protocol) {
var ret string
return ret
}
return *o.Protocol
}
// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyMachineServiceCheck) GetProtocolOk() (*string, bool) {
if o == nil || IsNil(o.Protocol) {
return nil, false
}
return o.Protocol, true
}
// HasProtocol returns a boolean if a field has been set.
func (o *FlyMachineServiceCheck) HasProtocol() bool {
if o != nil && !IsNil(o.Protocol) {
return true
}
return false
}
// SetProtocol gets a reference to the given string and assigns it to the Protocol field.
func (o *FlyMachineServiceCheck) SetProtocol(v string) {
o.Protocol = &v
}
// GetTimeout returns the Timeout field value if set, zero value otherwise.
func (o *FlyMachineServiceCheck) GetTimeout() FlyDuration {
if o == nil || IsNil(o.Timeout) {
var ret FlyDuration
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 *FlyMachineServiceCheck) GetTimeoutOk() (*FlyDuration, 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 *FlyMachineServiceCheck) HasTimeout() bool {
if o != nil && !IsNil(o.Timeout) {
return true
}
return false
}
// SetTimeout gets a reference to the given FlyDuration and assigns it to the Timeout field.
func (o *FlyMachineServiceCheck) SetTimeout(v FlyDuration) {
o.Timeout = &v
}
// GetTlsServerName returns the TlsServerName field value if set, zero value otherwise.
func (o *FlyMachineServiceCheck) GetTlsServerName() string {
if o == nil || IsNil(o.TlsServerName) {
var ret string
return ret
}
return *o.TlsServerName
}
// GetTlsServerNameOk returns a tuple with the TlsServerName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyMachineServiceCheck) GetTlsServerNameOk() (*string, bool) {
if o == nil || IsNil(o.TlsServerName) {
return nil, false
}
return o.TlsServerName, true
}
// HasTlsServerName returns a boolean if a field has been set.
func (o *FlyMachineServiceCheck) HasTlsServerName() bool {
if o != nil && !IsNil(o.TlsServerName) {
return true
}
return false
}
// SetTlsServerName gets a reference to the given string and assigns it to the TlsServerName field.
func (o *FlyMachineServiceCheck) SetTlsServerName(v string) {
o.TlsServerName = &v
}
// GetTlsSkipVerify returns the TlsSkipVerify field value if set, zero value otherwise.
func (o *FlyMachineServiceCheck) GetTlsSkipVerify() bool {
if o == nil || IsNil(o.TlsSkipVerify) {
var ret bool
return ret
}
return *o.TlsSkipVerify
}
// GetTlsSkipVerifyOk returns a tuple with the TlsSkipVerify field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyMachineServiceCheck) GetTlsSkipVerifyOk() (*bool, bool) {
if o == nil || IsNil(o.TlsSkipVerify) {
return nil, false
}
return o.TlsSkipVerify, true
}
// HasTlsSkipVerify returns a boolean if a field has been set.
func (o *FlyMachineServiceCheck) HasTlsSkipVerify() bool {
if o != nil && !IsNil(o.TlsSkipVerify) {
return true
}
return false
}
// SetTlsSkipVerify gets a reference to the given bool and assigns it to the TlsSkipVerify field.
func (o *FlyMachineServiceCheck) SetTlsSkipVerify(v bool) {
o.TlsSkipVerify = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *FlyMachineServiceCheck) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlyMachineServiceCheck) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *FlyMachineServiceCheck) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *FlyMachineServiceCheck) SetType(v string) {
o.Type = &v
}
func (o FlyMachineServiceCheck) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FlyMachineServiceCheck) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.GracePeriod) {
toSerialize["grace_period"] = o.GracePeriod
}
if !IsNil(o.Headers) {
toSerialize["headers"] = o.Headers
}
if !IsNil(o.Interval) {
toSerialize["interval"] = o.Interval
}
if !IsNil(o.Method) {
toSerialize["method"] = o.Method
}
if !IsNil(o.Path) {
toSerialize["path"] = o.Path
}
if !IsNil(o.Port) {
toSerialize["port"] = o.Port
}
if !IsNil(o.Protocol) {
toSerialize["protocol"] = o.Protocol
}
if !IsNil(o.Timeout) {
toSerialize["timeout"] = o.Timeout
}
if !IsNil(o.TlsServerName) {
toSerialize["tls_server_name"] = o.TlsServerName
}
if !IsNil(o.TlsSkipVerify) {
toSerialize["tls_skip_verify"] = o.TlsSkipVerify
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
return toSerialize, nil
}
type NullableFlyMachineServiceCheck struct {
value *FlyMachineServiceCheck
isSet bool
}
func (v NullableFlyMachineServiceCheck) Get() *FlyMachineServiceCheck {
return v.value
}
func (v *NullableFlyMachineServiceCheck) Set(val *FlyMachineServiceCheck) {
v.value = val
v.isSet = true
}
func (v NullableFlyMachineServiceCheck) IsSet() bool {
return v.isSet
}
func (v *NullableFlyMachineServiceCheck) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFlyMachineServiceCheck(val *FlyMachineServiceCheck) *NullableFlyMachineServiceCheck {
return &NullableFlyMachineServiceCheck{value: val, isSet: true}
}
func (v NullableFlyMachineServiceCheck) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFlyMachineServiceCheck) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}