-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_host.go
435 lines (361 loc) · 10.1 KB
/
model_host.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
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
/*
Chaos
Central Management API - publicly exposed set of APIs for managing deployments
API version: 1.0.0
Contact: support@qernal.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi_chaos_client
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the Host type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Host{}
// Host Host response
type Host struct {
// Host id
Id string `json:"id"`
// Hostname, this can be the root of a domain or a subdomain
Host string `json:"host"`
// The secret reference to the certificate
Certificate *string `json:"certificate,omitempty"`
// Project ID this is attached to
ProjectId string `json:"project_id"`
// If the host is read only and cannot be removed, primarily used for *.qrnl.app domains
ReadOnly bool `json:"read_only"`
// If the host is disabled, then this host won't be accessible and so the deployments will not be routable
Disabled bool `json:"disabled"`
// TXT record of host to verify ownership - if this record is removed, it may become unverified as this is checked periodically to continually verify ownership
TxtVerification string `json:"txt_verification"`
// UTC datetime when the host was verified (ISO 8601 date format).
VerifiedAt *string `json:"verified_at,omitempty"`
Date Date `json:"date"`
VerificationStatus HostVerificationStatus `json:"verification_status"`
}
type _Host Host
// NewHost instantiates a new Host 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 NewHost(id string, host string, projectId string, readOnly bool, disabled bool, txtVerification string, date Date, verificationStatus HostVerificationStatus) *Host {
this := Host{}
this.Id = id
this.Host = host
this.ProjectId = projectId
this.ReadOnly = readOnly
this.Disabled = disabled
this.TxtVerification = txtVerification
this.Date = date
this.VerificationStatus = verificationStatus
return &this
}
// NewHostWithDefaults instantiates a new Host 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 NewHostWithDefaults() *Host {
this := Host{}
return &this
}
// GetId returns the Id field value
func (o *Host) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *Host) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *Host) SetId(v string) {
o.Id = v
}
// GetHost returns the Host field value
func (o *Host) GetHost() string {
if o == nil {
var ret string
return ret
}
return o.Host
}
// GetHostOk returns a tuple with the Host field value
// and a boolean to check if the value has been set.
func (o *Host) GetHostOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Host, true
}
// SetHost sets field value
func (o *Host) SetHost(v string) {
o.Host = v
}
// GetCertificate returns the Certificate field value if set, zero value otherwise.
func (o *Host) GetCertificate() string {
if o == nil || IsNil(o.Certificate) {
var ret string
return ret
}
return *o.Certificate
}
// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Host) GetCertificateOk() (*string, bool) {
if o == nil || IsNil(o.Certificate) {
return nil, false
}
return o.Certificate, true
}
// HasCertificate returns a boolean if a field has been set.
func (o *Host) HasCertificate() bool {
if o != nil && !IsNil(o.Certificate) {
return true
}
return false
}
// SetCertificate gets a reference to the given string and assigns it to the Certificate field.
func (o *Host) SetCertificate(v string) {
o.Certificate = &v
}
// GetProjectId returns the ProjectId field value
func (o *Host) GetProjectId() string {
if o == nil {
var ret string
return ret
}
return o.ProjectId
}
// GetProjectIdOk returns a tuple with the ProjectId field value
// and a boolean to check if the value has been set.
func (o *Host) GetProjectIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ProjectId, true
}
// SetProjectId sets field value
func (o *Host) SetProjectId(v string) {
o.ProjectId = v
}
// GetReadOnly returns the ReadOnly field value
func (o *Host) GetReadOnly() bool {
if o == nil {
var ret bool
return ret
}
return o.ReadOnly
}
// GetReadOnlyOk returns a tuple with the ReadOnly field value
// and a boolean to check if the value has been set.
func (o *Host) GetReadOnlyOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.ReadOnly, true
}
// SetReadOnly sets field value
func (o *Host) SetReadOnly(v bool) {
o.ReadOnly = v
}
// GetDisabled returns the Disabled field value
func (o *Host) GetDisabled() bool {
if o == nil {
var ret bool
return ret
}
return o.Disabled
}
// GetDisabledOk returns a tuple with the Disabled field value
// and a boolean to check if the value has been set.
func (o *Host) GetDisabledOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Disabled, true
}
// SetDisabled sets field value
func (o *Host) SetDisabled(v bool) {
o.Disabled = v
}
// GetTxtVerification returns the TxtVerification field value
func (o *Host) GetTxtVerification() string {
if o == nil {
var ret string
return ret
}
return o.TxtVerification
}
// GetTxtVerificationOk returns a tuple with the TxtVerification field value
// and a boolean to check if the value has been set.
func (o *Host) GetTxtVerificationOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.TxtVerification, true
}
// SetTxtVerification sets field value
func (o *Host) SetTxtVerification(v string) {
o.TxtVerification = v
}
// GetVerifiedAt returns the VerifiedAt field value if set, zero value otherwise.
func (o *Host) GetVerifiedAt() string {
if o == nil || IsNil(o.VerifiedAt) {
var ret string
return ret
}
return *o.VerifiedAt
}
// GetVerifiedAtOk returns a tuple with the VerifiedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Host) GetVerifiedAtOk() (*string, bool) {
if o == nil || IsNil(o.VerifiedAt) {
return nil, false
}
return o.VerifiedAt, true
}
// HasVerifiedAt returns a boolean if a field has been set.
func (o *Host) HasVerifiedAt() bool {
if o != nil && !IsNil(o.VerifiedAt) {
return true
}
return false
}
// SetVerifiedAt gets a reference to the given string and assigns it to the VerifiedAt field.
func (o *Host) SetVerifiedAt(v string) {
o.VerifiedAt = &v
}
// GetDate returns the Date field value
func (o *Host) GetDate() Date {
if o == nil {
var ret Date
return ret
}
return o.Date
}
// GetDateOk returns a tuple with the Date field value
// and a boolean to check if the value has been set.
func (o *Host) GetDateOk() (*Date, bool) {
if o == nil {
return nil, false
}
return &o.Date, true
}
// SetDate sets field value
func (o *Host) SetDate(v Date) {
o.Date = v
}
// GetVerificationStatus returns the VerificationStatus field value
func (o *Host) GetVerificationStatus() HostVerificationStatus {
if o == nil {
var ret HostVerificationStatus
return ret
}
return o.VerificationStatus
}
// GetVerificationStatusOk returns a tuple with the VerificationStatus field value
// and a boolean to check if the value has been set.
func (o *Host) GetVerificationStatusOk() (*HostVerificationStatus, bool) {
if o == nil {
return nil, false
}
return &o.VerificationStatus, true
}
// SetVerificationStatus sets field value
func (o *Host) SetVerificationStatus(v HostVerificationStatus) {
o.VerificationStatus = v
}
func (o Host) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Host) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["host"] = o.Host
if !IsNil(o.Certificate) {
toSerialize["certificate"] = o.Certificate
}
toSerialize["project_id"] = o.ProjectId
toSerialize["read_only"] = o.ReadOnly
toSerialize["disabled"] = o.Disabled
toSerialize["txt_verification"] = o.TxtVerification
if !IsNil(o.VerifiedAt) {
toSerialize["verified_at"] = o.VerifiedAt
}
toSerialize["date"] = o.Date
toSerialize["verification_status"] = o.VerificationStatus
return toSerialize, nil
}
func (o *Host) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"host",
"project_id",
"read_only",
"disabled",
"txt_verification",
"date",
"verification_status",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varHost := _Host{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varHost)
if err != nil {
return err
}
*o = Host(varHost)
return err
}
type NullableHost struct {
value *Host
isSet bool
}
func (v NullableHost) Get() *Host {
return v.value
}
func (v *NullableHost) Set(val *Host) {
v.value = val
v.isSet = true
}
func (v NullableHost) IsSet() bool {
return v.isSet
}
func (v *NullableHost) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableHost(val *Host) *NullableHost {
return &NullableHost{value: val, isSet: true}
}
func (v NullableHost) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableHost) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}