-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_base_campaign.go
476 lines (404 loc) · 13.8 KB
/
model_base_campaign.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
/*
* Talon.One API
*
* Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`
*
* API version:
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package talon
import (
"bytes"
"encoding/json"
"time"
)
// BaseCampaign struct for BaseCampaign
type BaseCampaign struct {
// A user-facing name for this campaign.
Name string `json:"name"`
// A detailed description of the campaign.
Description *string `json:"description,omitempty"`
// Timestamp when the campaign will become active.
StartTime *time.Time `json:"startTime,omitempty"`
// Timestamp when the campaign will become inactive.
EndTime *time.Time `json:"endTime,omitempty"`
// Arbitrary properties associated with this campaign.
Attributes *map[string]interface{} `json:"attributes,omitempty"`
// A disabled or archived campaign is not evaluated for rules or coupons.
State string `json:"state"`
// [ID of Ruleset](https://docs.talon.one/management-api#operation/getRulesets) this campaign applies on customer session evaluation.
ActiveRulesetId *int32 `json:"activeRulesetId,omitempty"`
// A list of tags for the campaign.
Tags []string `json:"tags"`
// The features enabled in this campaign.
Features []string `json:"features"`
CouponSettings *CodeGeneratorSettings `json:"couponSettings,omitempty"`
ReferralSettings *CodeGeneratorSettings `json:"referralSettings,omitempty"`
// The set of [budget limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets) for this campaign.
Limits []LimitConfig `json:"limits"`
// The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/managing-campaign-groups) this campaign belongs to.
CampaignGroups *[]int32 `json:"campaignGroups,omitempty"`
// The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items.
Type *string `json:"type,omitempty"`
// A list of store IDs that you want to link to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store.
LinkedStoreIds *[]int32 `json:"linkedStoreIds,omitempty"`
}
// GetName returns the Name field value
func (o *BaseCampaign) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// SetName sets field value
func (o *BaseCampaign) SetName(v string) {
o.Name = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *BaseCampaign) GetDescription() string {
if o == nil || o.Description == nil {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseCampaign) GetDescriptionOk() (string, bool) {
if o == nil || o.Description == nil {
var ret string
return ret, false
}
return *o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *BaseCampaign) HasDescription() bool {
if o != nil && o.Description != nil {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *BaseCampaign) SetDescription(v string) {
o.Description = &v
}
// GetStartTime returns the StartTime field value if set, zero value otherwise.
func (o *BaseCampaign) GetStartTime() time.Time {
if o == nil || o.StartTime == nil {
var ret time.Time
return ret
}
return *o.StartTime
}
// GetStartTimeOk returns a tuple with the StartTime field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseCampaign) GetStartTimeOk() (time.Time, bool) {
if o == nil || o.StartTime == nil {
var ret time.Time
return ret, false
}
return *o.StartTime, true
}
// HasStartTime returns a boolean if a field has been set.
func (o *BaseCampaign) HasStartTime() bool {
if o != nil && o.StartTime != nil {
return true
}
return false
}
// SetStartTime gets a reference to the given time.Time and assigns it to the StartTime field.
func (o *BaseCampaign) SetStartTime(v time.Time) {
o.StartTime = &v
}
// GetEndTime returns the EndTime field value if set, zero value otherwise.
func (o *BaseCampaign) GetEndTime() time.Time {
if o == nil || o.EndTime == nil {
var ret time.Time
return ret
}
return *o.EndTime
}
// GetEndTimeOk returns a tuple with the EndTime field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseCampaign) GetEndTimeOk() (time.Time, bool) {
if o == nil || o.EndTime == nil {
var ret time.Time
return ret, false
}
return *o.EndTime, true
}
// HasEndTime returns a boolean if a field has been set.
func (o *BaseCampaign) HasEndTime() bool {
if o != nil && o.EndTime != nil {
return true
}
return false
}
// SetEndTime gets a reference to the given time.Time and assigns it to the EndTime field.
func (o *BaseCampaign) SetEndTime(v time.Time) {
o.EndTime = &v
}
// GetAttributes returns the Attributes field value if set, zero value otherwise.
func (o *BaseCampaign) GetAttributes() map[string]interface{} {
if o == nil || o.Attributes == nil {
var ret map[string]interface{}
return ret
}
return *o.Attributes
}
// GetAttributesOk returns a tuple with the Attributes field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseCampaign) GetAttributesOk() (map[string]interface{}, bool) {
if o == nil || o.Attributes == nil {
var ret map[string]interface{}
return ret, false
}
return *o.Attributes, true
}
// HasAttributes returns a boolean if a field has been set.
func (o *BaseCampaign) HasAttributes() bool {
if o != nil && o.Attributes != nil {
return true
}
return false
}
// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field.
func (o *BaseCampaign) SetAttributes(v map[string]interface{}) {
o.Attributes = &v
}
// GetState returns the State field value
func (o *BaseCampaign) GetState() string {
if o == nil {
var ret string
return ret
}
return o.State
}
// SetState sets field value
func (o *BaseCampaign) SetState(v string) {
o.State = v
}
// GetActiveRulesetId returns the ActiveRulesetId field value if set, zero value otherwise.
func (o *BaseCampaign) GetActiveRulesetId() int32 {
if o == nil || o.ActiveRulesetId == nil {
var ret int32
return ret
}
return *o.ActiveRulesetId
}
// GetActiveRulesetIdOk returns a tuple with the ActiveRulesetId field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseCampaign) GetActiveRulesetIdOk() (int32, bool) {
if o == nil || o.ActiveRulesetId == nil {
var ret int32
return ret, false
}
return *o.ActiveRulesetId, true
}
// HasActiveRulesetId returns a boolean if a field has been set.
func (o *BaseCampaign) HasActiveRulesetId() bool {
if o != nil && o.ActiveRulesetId != nil {
return true
}
return false
}
// SetActiveRulesetId gets a reference to the given int32 and assigns it to the ActiveRulesetId field.
func (o *BaseCampaign) SetActiveRulesetId(v int32) {
o.ActiveRulesetId = &v
}
// GetTags returns the Tags field value
func (o *BaseCampaign) GetTags() []string {
if o == nil {
var ret []string
return ret
}
return o.Tags
}
// SetTags sets field value
func (o *BaseCampaign) SetTags(v []string) {
o.Tags = v
}
// GetFeatures returns the Features field value
func (o *BaseCampaign) GetFeatures() []string {
if o == nil {
var ret []string
return ret
}
return o.Features
}
// SetFeatures sets field value
func (o *BaseCampaign) SetFeatures(v []string) {
o.Features = v
}
// GetCouponSettings returns the CouponSettings field value if set, zero value otherwise.
func (o *BaseCampaign) GetCouponSettings() CodeGeneratorSettings {
if o == nil || o.CouponSettings == nil {
var ret CodeGeneratorSettings
return ret
}
return *o.CouponSettings
}
// GetCouponSettingsOk returns a tuple with the CouponSettings field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseCampaign) GetCouponSettingsOk() (CodeGeneratorSettings, bool) {
if o == nil || o.CouponSettings == nil {
var ret CodeGeneratorSettings
return ret, false
}
return *o.CouponSettings, true
}
// HasCouponSettings returns a boolean if a field has been set.
func (o *BaseCampaign) HasCouponSettings() bool {
if o != nil && o.CouponSettings != nil {
return true
}
return false
}
// SetCouponSettings gets a reference to the given CodeGeneratorSettings and assigns it to the CouponSettings field.
func (o *BaseCampaign) SetCouponSettings(v CodeGeneratorSettings) {
o.CouponSettings = &v
}
// GetReferralSettings returns the ReferralSettings field value if set, zero value otherwise.
func (o *BaseCampaign) GetReferralSettings() CodeGeneratorSettings {
if o == nil || o.ReferralSettings == nil {
var ret CodeGeneratorSettings
return ret
}
return *o.ReferralSettings
}
// GetReferralSettingsOk returns a tuple with the ReferralSettings field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseCampaign) GetReferralSettingsOk() (CodeGeneratorSettings, bool) {
if o == nil || o.ReferralSettings == nil {
var ret CodeGeneratorSettings
return ret, false
}
return *o.ReferralSettings, true
}
// HasReferralSettings returns a boolean if a field has been set.
func (o *BaseCampaign) HasReferralSettings() bool {
if o != nil && o.ReferralSettings != nil {
return true
}
return false
}
// SetReferralSettings gets a reference to the given CodeGeneratorSettings and assigns it to the ReferralSettings field.
func (o *BaseCampaign) SetReferralSettings(v CodeGeneratorSettings) {
o.ReferralSettings = &v
}
// GetLimits returns the Limits field value
func (o *BaseCampaign) GetLimits() []LimitConfig {
if o == nil {
var ret []LimitConfig
return ret
}
return o.Limits
}
// SetLimits sets field value
func (o *BaseCampaign) SetLimits(v []LimitConfig) {
o.Limits = v
}
// GetCampaignGroups returns the CampaignGroups field value if set, zero value otherwise.
func (o *BaseCampaign) GetCampaignGroups() []int32 {
if o == nil || o.CampaignGroups == nil {
var ret []int32
return ret
}
return *o.CampaignGroups
}
// GetCampaignGroupsOk returns a tuple with the CampaignGroups field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseCampaign) GetCampaignGroupsOk() ([]int32, bool) {
if o == nil || o.CampaignGroups == nil {
var ret []int32
return ret, false
}
return *o.CampaignGroups, true
}
// HasCampaignGroups returns a boolean if a field has been set.
func (o *BaseCampaign) HasCampaignGroups() bool {
if o != nil && o.CampaignGroups != nil {
return true
}
return false
}
// SetCampaignGroups gets a reference to the given []int32 and assigns it to the CampaignGroups field.
func (o *BaseCampaign) SetCampaignGroups(v []int32) {
o.CampaignGroups = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *BaseCampaign) GetType() string {
if o == nil || o.Type == nil {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseCampaign) GetTypeOk() (string, bool) {
if o == nil || o.Type == nil {
var ret string
return ret, false
}
return *o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *BaseCampaign) HasType() bool {
if o != nil && o.Type != nil {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *BaseCampaign) SetType(v string) {
o.Type = &v
}
// GetLinkedStoreIds returns the LinkedStoreIds field value if set, zero value otherwise.
func (o *BaseCampaign) GetLinkedStoreIds() []int32 {
if o == nil || o.LinkedStoreIds == nil {
var ret []int32
return ret
}
return *o.LinkedStoreIds
}
// GetLinkedStoreIdsOk returns a tuple with the LinkedStoreIds field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseCampaign) GetLinkedStoreIdsOk() ([]int32, bool) {
if o == nil || o.LinkedStoreIds == nil {
var ret []int32
return ret, false
}
return *o.LinkedStoreIds, true
}
// HasLinkedStoreIds returns a boolean if a field has been set.
func (o *BaseCampaign) HasLinkedStoreIds() bool {
if o != nil && o.LinkedStoreIds != nil {
return true
}
return false
}
// SetLinkedStoreIds gets a reference to the given []int32 and assigns it to the LinkedStoreIds field.
func (o *BaseCampaign) SetLinkedStoreIds(v []int32) {
o.LinkedStoreIds = &v
}
type NullableBaseCampaign struct {
Value BaseCampaign
ExplicitNull bool
}
func (v NullableBaseCampaign) MarshalJSON() ([]byte, error) {
switch {
case v.ExplicitNull:
return []byte("null"), nil
default:
return json.Marshal(v.Value)
}
}
func (v *NullableBaseCampaign) UnmarshalJSON(src []byte) error {
if bytes.Equal(src, []byte("null")) {
v.ExplicitNull = true
return nil
}
return json.Unmarshal(src, &v.Value)
}