-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_a_b_test_options_2.go
531 lines (445 loc) · 15.9 KB
/
model_a_b_test_options_2.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
528
529
/*
Mailchimp Marketing API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: 3.0.55
Contact: apihelp@mailchimp.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package mailchimpmarketingapi
import (
"encoding/json"
"time"
"bytes"
"fmt"
)
// checks if the ABTestOptions2 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ABTestOptions2{}
// ABTestOptions2 The settings specific to A/B test campaigns.
type ABTestOptions2 struct {
// ID for the winning combination.
WinningCombinationId *string `json:"winning_combination_id,omitempty"`
// ID of the campaign that was sent to the remaining recipients based on the winning combination.
WinningCampaignId *string `json:"winning_campaign_id,omitempty"`
// The combination that performs the best. This may be determined automatically by click rate, open rate, or total revenue -- or you may choose manually based on the reporting data you find the most valuable. For Multivariate Campaigns testing send_time, winner_criteria is ignored. For Multivariate Campaigns with 'manual' as the winner_criteria, the winner must be chosen in the Mailchimp web application.
WinnerCriteria string `json:"winner_criteria"`
// The number of minutes to wait before choosing the winning campaign. The value of wait_time must be greater than 0 and in whole hours, specified in minutes.
WaitTime *int32 `json:"wait_time,omitempty"`
// The percentage of recipients to send the test combinations to, must be a value between 10 and 100.
TestSize *int32 `json:"test_size,omitempty"`
// The possible subject lines to test. If no subject lines are provided, settings.subject_line will be used.
SubjectLines []string `json:"subject_lines,omitempty"`
// The possible send times to test. The times provided should be in the format YYYY-MM-DD HH:MM:SS. If send_times are provided to test, the test_size will be set to 100% and winner_criteria will be ignored.
SendTimes []time.Time `json:"send_times,omitempty"`
// The possible from names. The number of from_names provided must match the number of reply_to_addresses. If no from_names are provided, settings.from_name will be used.
FromNames []string `json:"from_names,omitempty"`
// The possible reply-to addresses. The number of reply_to_addresses provided must match the number of from_names. If no reply_to_addresses are provided, settings.reply_to will be used.
ReplyToAddresses []string `json:"reply_to_addresses,omitempty"`
// Descriptions of possible email contents. To set campaign contents, make a PUT request to /campaigns/{campaign_id}/content with the field 'variate_contents'.
Contents []string `json:"contents,omitempty"`
// Combinations of possible variables used to build emails.
Combinations []CombinationsInner `json:"combinations,omitempty"`
}
type _ABTestOptions2 ABTestOptions2
// NewABTestOptions2 instantiates a new ABTestOptions2 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 NewABTestOptions2(winnerCriteria string) *ABTestOptions2 {
this := ABTestOptions2{}
this.WinnerCriteria = winnerCriteria
return &this
}
// NewABTestOptions2WithDefaults instantiates a new ABTestOptions2 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 NewABTestOptions2WithDefaults() *ABTestOptions2 {
this := ABTestOptions2{}
return &this
}
// GetWinningCombinationId returns the WinningCombinationId field value if set, zero value otherwise.
func (o *ABTestOptions2) GetWinningCombinationId() string {
if o == nil || IsNil(o.WinningCombinationId) {
var ret string
return ret
}
return *o.WinningCombinationId
}
// GetWinningCombinationIdOk returns a tuple with the WinningCombinationId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ABTestOptions2) GetWinningCombinationIdOk() (*string, bool) {
if o == nil || IsNil(o.WinningCombinationId) {
return nil, false
}
return o.WinningCombinationId, true
}
// HasWinningCombinationId returns a boolean if a field has been set.
func (o *ABTestOptions2) HasWinningCombinationId() bool {
if o != nil && !IsNil(o.WinningCombinationId) {
return true
}
return false
}
// SetWinningCombinationId gets a reference to the given string and assigns it to the WinningCombinationId field.
func (o *ABTestOptions2) SetWinningCombinationId(v string) {
o.WinningCombinationId = &v
}
// GetWinningCampaignId returns the WinningCampaignId field value if set, zero value otherwise.
func (o *ABTestOptions2) GetWinningCampaignId() string {
if o == nil || IsNil(o.WinningCampaignId) {
var ret string
return ret
}
return *o.WinningCampaignId
}
// GetWinningCampaignIdOk returns a tuple with the WinningCampaignId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ABTestOptions2) GetWinningCampaignIdOk() (*string, bool) {
if o == nil || IsNil(o.WinningCampaignId) {
return nil, false
}
return o.WinningCampaignId, true
}
// HasWinningCampaignId returns a boolean if a field has been set.
func (o *ABTestOptions2) HasWinningCampaignId() bool {
if o != nil && !IsNil(o.WinningCampaignId) {
return true
}
return false
}
// SetWinningCampaignId gets a reference to the given string and assigns it to the WinningCampaignId field.
func (o *ABTestOptions2) SetWinningCampaignId(v string) {
o.WinningCampaignId = &v
}
// GetWinnerCriteria returns the WinnerCriteria field value
func (o *ABTestOptions2) GetWinnerCriteria() string {
if o == nil {
var ret string
return ret
}
return o.WinnerCriteria
}
// GetWinnerCriteriaOk returns a tuple with the WinnerCriteria field value
// and a boolean to check if the value has been set.
func (o *ABTestOptions2) GetWinnerCriteriaOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.WinnerCriteria, true
}
// SetWinnerCriteria sets field value
func (o *ABTestOptions2) SetWinnerCriteria(v string) {
o.WinnerCriteria = v
}
// GetWaitTime returns the WaitTime field value if set, zero value otherwise.
func (o *ABTestOptions2) GetWaitTime() int32 {
if o == nil || IsNil(o.WaitTime) {
var ret int32
return ret
}
return *o.WaitTime
}
// GetWaitTimeOk returns a tuple with the WaitTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ABTestOptions2) GetWaitTimeOk() (*int32, bool) {
if o == nil || IsNil(o.WaitTime) {
return nil, false
}
return o.WaitTime, true
}
// HasWaitTime returns a boolean if a field has been set.
func (o *ABTestOptions2) HasWaitTime() bool {
if o != nil && !IsNil(o.WaitTime) {
return true
}
return false
}
// SetWaitTime gets a reference to the given int32 and assigns it to the WaitTime field.
func (o *ABTestOptions2) SetWaitTime(v int32) {
o.WaitTime = &v
}
// GetTestSize returns the TestSize field value if set, zero value otherwise.
func (o *ABTestOptions2) GetTestSize() int32 {
if o == nil || IsNil(o.TestSize) {
var ret int32
return ret
}
return *o.TestSize
}
// GetTestSizeOk returns a tuple with the TestSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ABTestOptions2) GetTestSizeOk() (*int32, bool) {
if o == nil || IsNil(o.TestSize) {
return nil, false
}
return o.TestSize, true
}
// HasTestSize returns a boolean if a field has been set.
func (o *ABTestOptions2) HasTestSize() bool {
if o != nil && !IsNil(o.TestSize) {
return true
}
return false
}
// SetTestSize gets a reference to the given int32 and assigns it to the TestSize field.
func (o *ABTestOptions2) SetTestSize(v int32) {
o.TestSize = &v
}
// GetSubjectLines returns the SubjectLines field value if set, zero value otherwise.
func (o *ABTestOptions2) GetSubjectLines() []string {
if o == nil || IsNil(o.SubjectLines) {
var ret []string
return ret
}
return o.SubjectLines
}
// GetSubjectLinesOk returns a tuple with the SubjectLines field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ABTestOptions2) GetSubjectLinesOk() ([]string, bool) {
if o == nil || IsNil(o.SubjectLines) {
return nil, false
}
return o.SubjectLines, true
}
// HasSubjectLines returns a boolean if a field has been set.
func (o *ABTestOptions2) HasSubjectLines() bool {
if o != nil && !IsNil(o.SubjectLines) {
return true
}
return false
}
// SetSubjectLines gets a reference to the given []string and assigns it to the SubjectLines field.
func (o *ABTestOptions2) SetSubjectLines(v []string) {
o.SubjectLines = v
}
// GetSendTimes returns the SendTimes field value if set, zero value otherwise.
func (o *ABTestOptions2) GetSendTimes() []time.Time {
if o == nil || IsNil(o.SendTimes) {
var ret []time.Time
return ret
}
return o.SendTimes
}
// GetSendTimesOk returns a tuple with the SendTimes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ABTestOptions2) GetSendTimesOk() ([]time.Time, bool) {
if o == nil || IsNil(o.SendTimes) {
return nil, false
}
return o.SendTimes, true
}
// HasSendTimes returns a boolean if a field has been set.
func (o *ABTestOptions2) HasSendTimes() bool {
if o != nil && !IsNil(o.SendTimes) {
return true
}
return false
}
// SetSendTimes gets a reference to the given []time.Time and assigns it to the SendTimes field.
func (o *ABTestOptions2) SetSendTimes(v []time.Time) {
o.SendTimes = v
}
// GetFromNames returns the FromNames field value if set, zero value otherwise.
func (o *ABTestOptions2) GetFromNames() []string {
if o == nil || IsNil(o.FromNames) {
var ret []string
return ret
}
return o.FromNames
}
// GetFromNamesOk returns a tuple with the FromNames field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ABTestOptions2) GetFromNamesOk() ([]string, bool) {
if o == nil || IsNil(o.FromNames) {
return nil, false
}
return o.FromNames, true
}
// HasFromNames returns a boolean if a field has been set.
func (o *ABTestOptions2) HasFromNames() bool {
if o != nil && !IsNil(o.FromNames) {
return true
}
return false
}
// SetFromNames gets a reference to the given []string and assigns it to the FromNames field.
func (o *ABTestOptions2) SetFromNames(v []string) {
o.FromNames = v
}
// GetReplyToAddresses returns the ReplyToAddresses field value if set, zero value otherwise.
func (o *ABTestOptions2) GetReplyToAddresses() []string {
if o == nil || IsNil(o.ReplyToAddresses) {
var ret []string
return ret
}
return o.ReplyToAddresses
}
// GetReplyToAddressesOk returns a tuple with the ReplyToAddresses field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ABTestOptions2) GetReplyToAddressesOk() ([]string, bool) {
if o == nil || IsNil(o.ReplyToAddresses) {
return nil, false
}
return o.ReplyToAddresses, true
}
// HasReplyToAddresses returns a boolean if a field has been set.
func (o *ABTestOptions2) HasReplyToAddresses() bool {
if o != nil && !IsNil(o.ReplyToAddresses) {
return true
}
return false
}
// SetReplyToAddresses gets a reference to the given []string and assigns it to the ReplyToAddresses field.
func (o *ABTestOptions2) SetReplyToAddresses(v []string) {
o.ReplyToAddresses = v
}
// GetContents returns the Contents field value if set, zero value otherwise.
func (o *ABTestOptions2) GetContents() []string {
if o == nil || IsNil(o.Contents) {
var ret []string
return ret
}
return o.Contents
}
// GetContentsOk returns a tuple with the Contents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ABTestOptions2) GetContentsOk() ([]string, bool) {
if o == nil || IsNil(o.Contents) {
return nil, false
}
return o.Contents, true
}
// HasContents returns a boolean if a field has been set.
func (o *ABTestOptions2) HasContents() bool {
if o != nil && !IsNil(o.Contents) {
return true
}
return false
}
// SetContents gets a reference to the given []string and assigns it to the Contents field.
func (o *ABTestOptions2) SetContents(v []string) {
o.Contents = v
}
// GetCombinations returns the Combinations field value if set, zero value otherwise.
func (o *ABTestOptions2) GetCombinations() []CombinationsInner {
if o == nil || IsNil(o.Combinations) {
var ret []CombinationsInner
return ret
}
return o.Combinations
}
// GetCombinationsOk returns a tuple with the Combinations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ABTestOptions2) GetCombinationsOk() ([]CombinationsInner, bool) {
if o == nil || IsNil(o.Combinations) {
return nil, false
}
return o.Combinations, true
}
// HasCombinations returns a boolean if a field has been set.
func (o *ABTestOptions2) HasCombinations() bool {
if o != nil && !IsNil(o.Combinations) {
return true
}
return false
}
// SetCombinations gets a reference to the given []CombinationsInner and assigns it to the Combinations field.
func (o *ABTestOptions2) SetCombinations(v []CombinationsInner) {
o.Combinations = v
}
func (o ABTestOptions2) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ABTestOptions2) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.WinningCombinationId) {
toSerialize["winning_combination_id"] = o.WinningCombinationId
}
if !IsNil(o.WinningCampaignId) {
toSerialize["winning_campaign_id"] = o.WinningCampaignId
}
toSerialize["winner_criteria"] = o.WinnerCriteria
if !IsNil(o.WaitTime) {
toSerialize["wait_time"] = o.WaitTime
}
if !IsNil(o.TestSize) {
toSerialize["test_size"] = o.TestSize
}
if !IsNil(o.SubjectLines) {
toSerialize["subject_lines"] = o.SubjectLines
}
if !IsNil(o.SendTimes) {
toSerialize["send_times"] = o.SendTimes
}
if !IsNil(o.FromNames) {
toSerialize["from_names"] = o.FromNames
}
if !IsNil(o.ReplyToAddresses) {
toSerialize["reply_to_addresses"] = o.ReplyToAddresses
}
if !IsNil(o.Contents) {
toSerialize["contents"] = o.Contents
}
if !IsNil(o.Combinations) {
toSerialize["combinations"] = o.Combinations
}
return toSerialize, nil
}
func (o *ABTestOptions2) 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{
"winner_criteria",
}
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)
}
}
varABTestOptions2 := _ABTestOptions2{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varABTestOptions2)
if err != nil {
return err
}
*o = ABTestOptions2(varABTestOptions2)
return err
}
type NullableABTestOptions2 struct {
value *ABTestOptions2
isSet bool
}
func (v NullableABTestOptions2) Get() *ABTestOptions2 {
return v.value
}
func (v *NullableABTestOptions2) Set(val *ABTestOptions2) {
v.value = val
v.isSet = true
}
func (v NullableABTestOptions2) IsSet() bool {
return v.isSet
}
func (v *NullableABTestOptions2) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableABTestOptions2(val *ABTestOptions2) *NullableABTestOptions2 {
return &NullableABTestOptions2{value: val, isSet: true}
}
func (v NullableABTestOptions2) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableABTestOptions2) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}