-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel_batch.go
425 lines (359 loc) · 11.6 KB
/
model_batch.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
/*
Mailchimp Marketing API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: 3.0.55
Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package mailchimpmarketingapi
import (
"encoding/json"
"time"
)
// checks if the Batch type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Batch{}
// Batch The status of a batch request
type Batch struct {
// A string that uniquely identifies this batch request.
Id *string `json:"id,omitempty"`
// The status of the batch call. [Learn more](https://mailchimp.com/developer/marketing/guides/run-async-requests-batch-endpoint/#check-the-status-of-a-batch-operation) about the batch operation status.
Status *string `json:"status,omitempty"`
// The total number of operations to complete as part of this batch request. For GET requests requiring pagination, each page counts as a separate operation.
TotalOperations *int32 `json:"total_operations,omitempty"`
// The number of completed operations. This includes operations that returned an error.
FinishedOperations *int32 `json:"finished_operations,omitempty"`
// The number of completed operations that returned an error.
ErroredOperations *int32 `json:"errored_operations,omitempty"`
// The date and time when the server received the batch request in ISO 8601 format.
SubmittedAt *time.Time `json:"submitted_at,omitempty"`
// The date and time when all operations in the batch request completed in ISO 8601 format.
CompletedAt *time.Time `json:"completed_at,omitempty"`
// The URL of the gzipped archive of the results of all the operations.
ResponseBodyUrl *string `json:"response_body_url,omitempty"`
// A list of link types and descriptions for the API schema documents.
Links []ResourceLink `json:"_links,omitempty"`
}
// NewBatch instantiates a new Batch 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 NewBatch() *Batch {
this := Batch{}
return &this
}
// NewBatchWithDefaults instantiates a new Batch 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 NewBatchWithDefaults() *Batch {
this := Batch{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *Batch) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Batch) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *Batch) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *Batch) SetId(v string) {
o.Id = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *Batch) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Batch) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *Batch) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *Batch) SetStatus(v string) {
o.Status = &v
}
// GetTotalOperations returns the TotalOperations field value if set, zero value otherwise.
func (o *Batch) GetTotalOperations() int32 {
if o == nil || IsNil(o.TotalOperations) {
var ret int32
return ret
}
return *o.TotalOperations
}
// GetTotalOperationsOk returns a tuple with the TotalOperations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Batch) GetTotalOperationsOk() (*int32, bool) {
if o == nil || IsNil(o.TotalOperations) {
return nil, false
}
return o.TotalOperations, true
}
// HasTotalOperations returns a boolean if a field has been set.
func (o *Batch) HasTotalOperations() bool {
if o != nil && !IsNil(o.TotalOperations) {
return true
}
return false
}
// SetTotalOperations gets a reference to the given int32 and assigns it to the TotalOperations field.
func (o *Batch) SetTotalOperations(v int32) {
o.TotalOperations = &v
}
// GetFinishedOperations returns the FinishedOperations field value if set, zero value otherwise.
func (o *Batch) GetFinishedOperations() int32 {
if o == nil || IsNil(o.FinishedOperations) {
var ret int32
return ret
}
return *o.FinishedOperations
}
// GetFinishedOperationsOk returns a tuple with the FinishedOperations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Batch) GetFinishedOperationsOk() (*int32, bool) {
if o == nil || IsNil(o.FinishedOperations) {
return nil, false
}
return o.FinishedOperations, true
}
// HasFinishedOperations returns a boolean if a field has been set.
func (o *Batch) HasFinishedOperations() bool {
if o != nil && !IsNil(o.FinishedOperations) {
return true
}
return false
}
// SetFinishedOperations gets a reference to the given int32 and assigns it to the FinishedOperations field.
func (o *Batch) SetFinishedOperations(v int32) {
o.FinishedOperations = &v
}
// GetErroredOperations returns the ErroredOperations field value if set, zero value otherwise.
func (o *Batch) GetErroredOperations() int32 {
if o == nil || IsNil(o.ErroredOperations) {
var ret int32
return ret
}
return *o.ErroredOperations
}
// GetErroredOperationsOk returns a tuple with the ErroredOperations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Batch) GetErroredOperationsOk() (*int32, bool) {
if o == nil || IsNil(o.ErroredOperations) {
return nil, false
}
return o.ErroredOperations, true
}
// HasErroredOperations returns a boolean if a field has been set.
func (o *Batch) HasErroredOperations() bool {
if o != nil && !IsNil(o.ErroredOperations) {
return true
}
return false
}
// SetErroredOperations gets a reference to the given int32 and assigns it to the ErroredOperations field.
func (o *Batch) SetErroredOperations(v int32) {
o.ErroredOperations = &v
}
// GetSubmittedAt returns the SubmittedAt field value if set, zero value otherwise.
func (o *Batch) GetSubmittedAt() time.Time {
if o == nil || IsNil(o.SubmittedAt) {
var ret time.Time
return ret
}
return *o.SubmittedAt
}
// GetSubmittedAtOk returns a tuple with the SubmittedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Batch) GetSubmittedAtOk() (*time.Time, bool) {
if o == nil || IsNil(o.SubmittedAt) {
return nil, false
}
return o.SubmittedAt, true
}
// HasSubmittedAt returns a boolean if a field has been set.
func (o *Batch) HasSubmittedAt() bool {
if o != nil && !IsNil(o.SubmittedAt) {
return true
}
return false
}
// SetSubmittedAt gets a reference to the given time.Time and assigns it to the SubmittedAt field.
func (o *Batch) SetSubmittedAt(v time.Time) {
o.SubmittedAt = &v
}
// GetCompletedAt returns the CompletedAt field value if set, zero value otherwise.
func (o *Batch) GetCompletedAt() time.Time {
if o == nil || IsNil(o.CompletedAt) {
var ret time.Time
return ret
}
return *o.CompletedAt
}
// GetCompletedAtOk returns a tuple with the CompletedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Batch) GetCompletedAtOk() (*time.Time, bool) {
if o == nil || IsNil(o.CompletedAt) {
return nil, false
}
return o.CompletedAt, true
}
// HasCompletedAt returns a boolean if a field has been set.
func (o *Batch) HasCompletedAt() bool {
if o != nil && !IsNil(o.CompletedAt) {
return true
}
return false
}
// SetCompletedAt gets a reference to the given time.Time and assigns it to the CompletedAt field.
func (o *Batch) SetCompletedAt(v time.Time) {
o.CompletedAt = &v
}
// GetResponseBodyUrl returns the ResponseBodyUrl field value if set, zero value otherwise.
func (o *Batch) GetResponseBodyUrl() string {
if o == nil || IsNil(o.ResponseBodyUrl) {
var ret string
return ret
}
return *o.ResponseBodyUrl
}
// GetResponseBodyUrlOk returns a tuple with the ResponseBodyUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Batch) GetResponseBodyUrlOk() (*string, bool) {
if o == nil || IsNil(o.ResponseBodyUrl) {
return nil, false
}
return o.ResponseBodyUrl, true
}
// HasResponseBodyUrl returns a boolean if a field has been set.
func (o *Batch) HasResponseBodyUrl() bool {
if o != nil && !IsNil(o.ResponseBodyUrl) {
return true
}
return false
}
// SetResponseBodyUrl gets a reference to the given string and assigns it to the ResponseBodyUrl field.
func (o *Batch) SetResponseBodyUrl(v string) {
o.ResponseBodyUrl = &v
}
// GetLinks returns the Links field value if set, zero value otherwise.
func (o *Batch) GetLinks() []ResourceLink {
if o == nil || IsNil(o.Links) {
var ret []ResourceLink
return ret
}
return o.Links
}
// GetLinksOk returns a tuple with the Links field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Batch) GetLinksOk() ([]ResourceLink, bool) {
if o == nil || IsNil(o.Links) {
return nil, false
}
return o.Links, true
}
// HasLinks returns a boolean if a field has been set.
func (o *Batch) HasLinks() bool {
if o != nil && !IsNil(o.Links) {
return true
}
return false
}
// SetLinks gets a reference to the given []ResourceLink and assigns it to the Links field.
func (o *Batch) SetLinks(v []ResourceLink) {
o.Links = v
}
func (o Batch) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Batch) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.TotalOperations) {
toSerialize["total_operations"] = o.TotalOperations
}
if !IsNil(o.FinishedOperations) {
toSerialize["finished_operations"] = o.FinishedOperations
}
if !IsNil(o.ErroredOperations) {
toSerialize["errored_operations"] = o.ErroredOperations
}
if !IsNil(o.SubmittedAt) {
toSerialize["submitted_at"] = o.SubmittedAt
}
if !IsNil(o.CompletedAt) {
toSerialize["completed_at"] = o.CompletedAt
}
if !IsNil(o.ResponseBodyUrl) {
toSerialize["response_body_url"] = o.ResponseBodyUrl
}
if !IsNil(o.Links) {
toSerialize["_links"] = o.Links
}
return toSerialize, nil
}
type NullableBatch struct {
value *Batch
isSet bool
}
func (v NullableBatch) Get() *Batch {
return v.value
}
func (v *NullableBatch) Set(val *Batch) {
v.value = val
v.isSet = true
}
func (v NullableBatch) IsSet() bool {
return v.isSet
}
func (v *NullableBatch) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBatch(val *Batch) *NullableBatch {
return &NullableBatch{value: val, isSet: true}
}
func (v NullableBatch) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBatch) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}