-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel_character.go
529 lines (450 loc) · 14.9 KB
/
model_character.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
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
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
/*
Neucore API
Client library of Neucore API
API version: 2.4.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package neucoreapi
import (
"encoding/json"
"time"
)
// checks if the Character type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Character{}
// Character struct for Character
type Character struct {
// Shows if character's default refresh token is valid or not. This is null if there is no refresh token (EVE SSOv1 only) or a valid token but without scopes (SSOv2).
ValidToken NullableBool `json:"validToken,omitempty"`
// Date and time when the valid token property of the default token was last changed.
ValidTokenTime NullableTime `json:"validTokenTime,omitempty"`
// Date and time when the default token was last checked.
TokenLastChecked NullableTime `json:"tokenLastChecked,omitempty"`
// EVE character ID.
Id NullableInt64 `json:"id"`
// EVE character name.
Name string `json:"name"`
Main *bool `json:"main,omitempty"`
// ESI tokens of the character (API: not included by default).
EsiTokens []EsiToken `json:"esiTokens,omitempty"`
Created NullableTime `json:"created,omitempty"`
// Last ESI update.
LastUpdate NullableTime `json:"lastUpdate,omitempty"`
Corporation *Corporation `json:"corporation,omitempty"`
// List of previous character names (API: not included by default).
CharacterNameChanges []CharacterNameChange `json:"characterNameChanges,omitempty"`
}
// NewCharacter instantiates a new Character 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 NewCharacter(id NullableInt64, name string) *Character {
this := Character{}
this.Id = id
this.Name = name
return &this
}
// NewCharacterWithDefaults instantiates a new Character 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 NewCharacterWithDefaults() *Character {
this := Character{}
return &this
}
// GetValidToken returns the ValidToken field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Character) GetValidToken() bool {
if o == nil || IsNil(o.ValidToken.Get()) {
var ret bool
return ret
}
return *o.ValidToken.Get()
}
// GetValidTokenOk returns a tuple with the ValidToken field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *Character) GetValidTokenOk() (*bool, bool) {
if o == nil {
return nil, false
}
return o.ValidToken.Get(), o.ValidToken.IsSet()
}
// HasValidToken returns a boolean if a field has been set.
func (o *Character) HasValidToken() bool {
if o != nil && o.ValidToken.IsSet() {
return true
}
return false
}
// SetValidToken gets a reference to the given NullableBool and assigns it to the ValidToken field.
func (o *Character) SetValidToken(v bool) {
o.ValidToken.Set(&v)
}
// SetValidTokenNil sets the value for ValidToken to be an explicit nil
func (o *Character) SetValidTokenNil() {
o.ValidToken.Set(nil)
}
// UnsetValidToken ensures that no value is present for ValidToken, not even an explicit nil
func (o *Character) UnsetValidToken() {
o.ValidToken.Unset()
}
// GetValidTokenTime returns the ValidTokenTime field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Character) GetValidTokenTime() time.Time {
if o == nil || IsNil(o.ValidTokenTime.Get()) {
var ret time.Time
return ret
}
return *o.ValidTokenTime.Get()
}
// GetValidTokenTimeOk returns a tuple with the ValidTokenTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *Character) GetValidTokenTimeOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.ValidTokenTime.Get(), o.ValidTokenTime.IsSet()
}
// HasValidTokenTime returns a boolean if a field has been set.
func (o *Character) HasValidTokenTime() bool {
if o != nil && o.ValidTokenTime.IsSet() {
return true
}
return false
}
// SetValidTokenTime gets a reference to the given NullableTime and assigns it to the ValidTokenTime field.
func (o *Character) SetValidTokenTime(v time.Time) {
o.ValidTokenTime.Set(&v)
}
// SetValidTokenTimeNil sets the value for ValidTokenTime to be an explicit nil
func (o *Character) SetValidTokenTimeNil() {
o.ValidTokenTime.Set(nil)
}
// UnsetValidTokenTime ensures that no value is present for ValidTokenTime, not even an explicit nil
func (o *Character) UnsetValidTokenTime() {
o.ValidTokenTime.Unset()
}
// GetTokenLastChecked returns the TokenLastChecked field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Character) GetTokenLastChecked() time.Time {
if o == nil || IsNil(o.TokenLastChecked.Get()) {
var ret time.Time
return ret
}
return *o.TokenLastChecked.Get()
}
// GetTokenLastCheckedOk returns a tuple with the TokenLastChecked field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *Character) GetTokenLastCheckedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.TokenLastChecked.Get(), o.TokenLastChecked.IsSet()
}
// HasTokenLastChecked returns a boolean if a field has been set.
func (o *Character) HasTokenLastChecked() bool {
if o != nil && o.TokenLastChecked.IsSet() {
return true
}
return false
}
// SetTokenLastChecked gets a reference to the given NullableTime and assigns it to the TokenLastChecked field.
func (o *Character) SetTokenLastChecked(v time.Time) {
o.TokenLastChecked.Set(&v)
}
// SetTokenLastCheckedNil sets the value for TokenLastChecked to be an explicit nil
func (o *Character) SetTokenLastCheckedNil() {
o.TokenLastChecked.Set(nil)
}
// UnsetTokenLastChecked ensures that no value is present for TokenLastChecked, not even an explicit nil
func (o *Character) UnsetTokenLastChecked() {
o.TokenLastChecked.Unset()
}
// GetId returns the Id field value
// If the value is explicit nil, the zero value for int64 will be returned
func (o *Character) GetId() int64 {
if o == nil || o.Id.Get() == nil {
var ret int64
return ret
}
return *o.Id.Get()
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *Character) GetIdOk() (*int64, bool) {
if o == nil {
return nil, false
}
return o.Id.Get(), o.Id.IsSet()
}
// SetId sets field value
func (o *Character) SetId(v int64) {
o.Id.Set(&v)
}
// GetName returns the Name field value
func (o *Character) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *Character) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *Character) SetName(v string) {
o.Name = v
}
// GetMain returns the Main field value if set, zero value otherwise.
func (o *Character) GetMain() bool {
if o == nil || IsNil(o.Main) {
var ret bool
return ret
}
return *o.Main
}
// GetMainOk returns a tuple with the Main field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Character) GetMainOk() (*bool, bool) {
if o == nil || IsNil(o.Main) {
return nil, false
}
return o.Main, true
}
// HasMain returns a boolean if a field has been set.
func (o *Character) HasMain() bool {
if o != nil && !IsNil(o.Main) {
return true
}
return false
}
// SetMain gets a reference to the given bool and assigns it to the Main field.
func (o *Character) SetMain(v bool) {
o.Main = &v
}
// GetEsiTokens returns the EsiTokens field value if set, zero value otherwise.
func (o *Character) GetEsiTokens() []EsiToken {
if o == nil || IsNil(o.EsiTokens) {
var ret []EsiToken
return ret
}
return o.EsiTokens
}
// GetEsiTokensOk returns a tuple with the EsiTokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Character) GetEsiTokensOk() ([]EsiToken, bool) {
if o == nil || IsNil(o.EsiTokens) {
return nil, false
}
return o.EsiTokens, true
}
// HasEsiTokens returns a boolean if a field has been set.
func (o *Character) HasEsiTokens() bool {
if o != nil && !IsNil(o.EsiTokens) {
return true
}
return false
}
// SetEsiTokens gets a reference to the given []EsiToken and assigns it to the EsiTokens field.
func (o *Character) SetEsiTokens(v []EsiToken) {
o.EsiTokens = v
}
// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Character) GetCreated() time.Time {
if o == nil || IsNil(o.Created.Get()) {
var ret time.Time
return ret
}
return *o.Created.Get()
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *Character) GetCreatedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.Created.Get(), o.Created.IsSet()
}
// HasCreated returns a boolean if a field has been set.
func (o *Character) HasCreated() bool {
if o != nil && o.Created.IsSet() {
return true
}
return false
}
// SetCreated gets a reference to the given NullableTime and assigns it to the Created field.
func (o *Character) SetCreated(v time.Time) {
o.Created.Set(&v)
}
// SetCreatedNil sets the value for Created to be an explicit nil
func (o *Character) SetCreatedNil() {
o.Created.Set(nil)
}
// UnsetCreated ensures that no value is present for Created, not even an explicit nil
func (o *Character) UnsetCreated() {
o.Created.Unset()
}
// GetLastUpdate returns the LastUpdate field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Character) GetLastUpdate() time.Time {
if o == nil || IsNil(o.LastUpdate.Get()) {
var ret time.Time
return ret
}
return *o.LastUpdate.Get()
}
// GetLastUpdateOk returns a tuple with the LastUpdate field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *Character) GetLastUpdateOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.LastUpdate.Get(), o.LastUpdate.IsSet()
}
// HasLastUpdate returns a boolean if a field has been set.
func (o *Character) HasLastUpdate() bool {
if o != nil && o.LastUpdate.IsSet() {
return true
}
return false
}
// SetLastUpdate gets a reference to the given NullableTime and assigns it to the LastUpdate field.
func (o *Character) SetLastUpdate(v time.Time) {
o.LastUpdate.Set(&v)
}
// SetLastUpdateNil sets the value for LastUpdate to be an explicit nil
func (o *Character) SetLastUpdateNil() {
o.LastUpdate.Set(nil)
}
// UnsetLastUpdate ensures that no value is present for LastUpdate, not even an explicit nil
func (o *Character) UnsetLastUpdate() {
o.LastUpdate.Unset()
}
// GetCorporation returns the Corporation field value if set, zero value otherwise.
func (o *Character) GetCorporation() Corporation {
if o == nil || IsNil(o.Corporation) {
var ret Corporation
return ret
}
return *o.Corporation
}
// GetCorporationOk returns a tuple with the Corporation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Character) GetCorporationOk() (*Corporation, bool) {
if o == nil || IsNil(o.Corporation) {
return nil, false
}
return o.Corporation, true
}
// HasCorporation returns a boolean if a field has been set.
func (o *Character) HasCorporation() bool {
if o != nil && !IsNil(o.Corporation) {
return true
}
return false
}
// SetCorporation gets a reference to the given Corporation and assigns it to the Corporation field.
func (o *Character) SetCorporation(v Corporation) {
o.Corporation = &v
}
// GetCharacterNameChanges returns the CharacterNameChanges field value if set, zero value otherwise.
func (o *Character) GetCharacterNameChanges() []CharacterNameChange {
if o == nil || IsNil(o.CharacterNameChanges) {
var ret []CharacterNameChange
return ret
}
return o.CharacterNameChanges
}
// GetCharacterNameChangesOk returns a tuple with the CharacterNameChanges field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Character) GetCharacterNameChangesOk() ([]CharacterNameChange, bool) {
if o == nil || IsNil(o.CharacterNameChanges) {
return nil, false
}
return o.CharacterNameChanges, true
}
// HasCharacterNameChanges returns a boolean if a field has been set.
func (o *Character) HasCharacterNameChanges() bool {
if o != nil && !IsNil(o.CharacterNameChanges) {
return true
}
return false
}
// SetCharacterNameChanges gets a reference to the given []CharacterNameChange and assigns it to the CharacterNameChanges field.
func (o *Character) SetCharacterNameChanges(v []CharacterNameChange) {
o.CharacterNameChanges = v
}
func (o Character) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Character) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.ValidToken.IsSet() {
toSerialize["validToken"] = o.ValidToken.Get()
}
if o.ValidTokenTime.IsSet() {
toSerialize["validTokenTime"] = o.ValidTokenTime.Get()
}
if o.TokenLastChecked.IsSet() {
toSerialize["tokenLastChecked"] = o.TokenLastChecked.Get()
}
toSerialize["id"] = o.Id.Get()
toSerialize["name"] = o.Name
if !IsNil(o.Main) {
toSerialize["main"] = o.Main
}
if !IsNil(o.EsiTokens) {
toSerialize["esiTokens"] = o.EsiTokens
}
if o.Created.IsSet() {
toSerialize["created"] = o.Created.Get()
}
if o.LastUpdate.IsSet() {
toSerialize["lastUpdate"] = o.LastUpdate.Get()
}
if !IsNil(o.Corporation) {
toSerialize["corporation"] = o.Corporation
}
if !IsNil(o.CharacterNameChanges) {
toSerialize["characterNameChanges"] = o.CharacterNameChanges
}
return toSerialize, nil
}
type NullableCharacter struct {
value *Character
isSet bool
}
func (v NullableCharacter) Get() *Character {
return v.value
}
func (v *NullableCharacter) Set(val *Character) {
v.value = val
v.isSet = true
}
func (v NullableCharacter) IsSet() bool {
return v.isSet
}
func (v *NullableCharacter) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCharacter(val *Character) *NullableCharacter {
return &NullableCharacter{value: val, isSet: true}
}
func (v NullableCharacter) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCharacter) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}