-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_base_loyalty_program.go
532 lines (455 loc) · 19.5 KB
/
model_base_loyalty_program.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
530
531
532
/*
* 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"
)
// BaseLoyaltyProgram struct for BaseLoyaltyProgram
type BaseLoyaltyProgram struct {
// The display title for the Loyalty Program.
Title *string `json:"title,omitempty"`
// Description of our Loyalty Program.
Description *string `json:"description,omitempty"`
// A list containing the IDs of all applications that are subscribed to this Loyalty Program.
SubscribedApplications *[]int32 `json:"subscribedApplications,omitempty"`
// The default duration after which new loyalty points should expire. Can be 'unlimited' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month.
DefaultValidity *string `json:"defaultValidity,omitempty"`
// The default duration of the pending time after which points should be valid. Can be 'immediate' or a specific time. The time format is a number followed by one letter indicating the time unit, like '30s', '40m', '1h', '5D', '7W', or 10M'. These rounding suffixes are also supported: - '_D' for rounding down. Can be used as a suffix after 'D', and signifies the start of the day. - '_U' for rounding up. Can be used as a suffix after 'D', 'W', and 'M', and signifies the end of the day, week, and month.
DefaultPending *string `json:"defaultPending,omitempty"`
// Indicates if this program supports subledgers inside the program.
AllowSubledger *bool `json:"allowSubledger,omitempty"`
// The max amount of user profiles with whom a card can be shared. This can be set to 0 for no limit. This property is only used when `cardBased` is `true`.
UsersPerCardLimit *int32 `json:"usersPerCardLimit,omitempty"`
// Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type.
Sandbox *bool `json:"sandbox,omitempty"`
// The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time.
ProgramJoinPolicy *string `json:"programJoinPolicy,omitempty"`
// The policy that defines how tier expiration, used to reevaluate the customer's current tier, is determined. - `tier_start_date`: The tier expiration is relative to when the customer joined the current tier. - `program_join_date`: The tier expiration is relative to when the customer joined the loyalty program. - `customer_attribute`: The tier expiration is determined by a custom customer attribute. - `absolute_expiration`: The tier is reevaluated at the start of each tier cycle. For this policy, it is required to provide a `tierCycleStartDate`.
TiersExpirationPolicy *string `json:"tiersExpirationPolicy,omitempty"`
// Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`.
TierCycleStartDate *time.Time `json:"tierCycleStartDate,omitempty"`
// The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year.
TiersExpireIn *string `json:"tiersExpireIn,omitempty"`
// The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment.
TiersDowngradePolicy *string `json:"tiersDowngradePolicy,omitempty"`
CardCodeSettings *CodeGeneratorSettings `json:"cardCodeSettings,omitempty"`
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *BaseLoyaltyProgram) GetTitle() string {
if o == nil || o.Title == nil {
var ret string
return ret
}
return *o.Title
}
// GetTitleOk returns a tuple with the Title field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseLoyaltyProgram) GetTitleOk() (string, bool) {
if o == nil || o.Title == nil {
var ret string
return ret, false
}
return *o.Title, true
}
// HasTitle returns a boolean if a field has been set.
func (o *BaseLoyaltyProgram) HasTitle() bool {
if o != nil && o.Title != nil {
return true
}
return false
}
// SetTitle gets a reference to the given string and assigns it to the Title field.
func (o *BaseLoyaltyProgram) SetTitle(v string) {
o.Title = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *BaseLoyaltyProgram) 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 *BaseLoyaltyProgram) 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 *BaseLoyaltyProgram) 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 *BaseLoyaltyProgram) SetDescription(v string) {
o.Description = &v
}
// GetSubscribedApplications returns the SubscribedApplications field value if set, zero value otherwise.
func (o *BaseLoyaltyProgram) GetSubscribedApplications() []int32 {
if o == nil || o.SubscribedApplications == nil {
var ret []int32
return ret
}
return *o.SubscribedApplications
}
// GetSubscribedApplicationsOk returns a tuple with the SubscribedApplications field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseLoyaltyProgram) GetSubscribedApplicationsOk() ([]int32, bool) {
if o == nil || o.SubscribedApplications == nil {
var ret []int32
return ret, false
}
return *o.SubscribedApplications, true
}
// HasSubscribedApplications returns a boolean if a field has been set.
func (o *BaseLoyaltyProgram) HasSubscribedApplications() bool {
if o != nil && o.SubscribedApplications != nil {
return true
}
return false
}
// SetSubscribedApplications gets a reference to the given []int32 and assigns it to the SubscribedApplications field.
func (o *BaseLoyaltyProgram) SetSubscribedApplications(v []int32) {
o.SubscribedApplications = &v
}
// GetDefaultValidity returns the DefaultValidity field value if set, zero value otherwise.
func (o *BaseLoyaltyProgram) GetDefaultValidity() string {
if o == nil || o.DefaultValidity == nil {
var ret string
return ret
}
return *o.DefaultValidity
}
// GetDefaultValidityOk returns a tuple with the DefaultValidity field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseLoyaltyProgram) GetDefaultValidityOk() (string, bool) {
if o == nil || o.DefaultValidity == nil {
var ret string
return ret, false
}
return *o.DefaultValidity, true
}
// HasDefaultValidity returns a boolean if a field has been set.
func (o *BaseLoyaltyProgram) HasDefaultValidity() bool {
if o != nil && o.DefaultValidity != nil {
return true
}
return false
}
// SetDefaultValidity gets a reference to the given string and assigns it to the DefaultValidity field.
func (o *BaseLoyaltyProgram) SetDefaultValidity(v string) {
o.DefaultValidity = &v
}
// GetDefaultPending returns the DefaultPending field value if set, zero value otherwise.
func (o *BaseLoyaltyProgram) GetDefaultPending() string {
if o == nil || o.DefaultPending == nil {
var ret string
return ret
}
return *o.DefaultPending
}
// GetDefaultPendingOk returns a tuple with the DefaultPending field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseLoyaltyProgram) GetDefaultPendingOk() (string, bool) {
if o == nil || o.DefaultPending == nil {
var ret string
return ret, false
}
return *o.DefaultPending, true
}
// HasDefaultPending returns a boolean if a field has been set.
func (o *BaseLoyaltyProgram) HasDefaultPending() bool {
if o != nil && o.DefaultPending != nil {
return true
}
return false
}
// SetDefaultPending gets a reference to the given string and assigns it to the DefaultPending field.
func (o *BaseLoyaltyProgram) SetDefaultPending(v string) {
o.DefaultPending = &v
}
// GetAllowSubledger returns the AllowSubledger field value if set, zero value otherwise.
func (o *BaseLoyaltyProgram) GetAllowSubledger() bool {
if o == nil || o.AllowSubledger == nil {
var ret bool
return ret
}
return *o.AllowSubledger
}
// GetAllowSubledgerOk returns a tuple with the AllowSubledger field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseLoyaltyProgram) GetAllowSubledgerOk() (bool, bool) {
if o == nil || o.AllowSubledger == nil {
var ret bool
return ret, false
}
return *o.AllowSubledger, true
}
// HasAllowSubledger returns a boolean if a field has been set.
func (o *BaseLoyaltyProgram) HasAllowSubledger() bool {
if o != nil && o.AllowSubledger != nil {
return true
}
return false
}
// SetAllowSubledger gets a reference to the given bool and assigns it to the AllowSubledger field.
func (o *BaseLoyaltyProgram) SetAllowSubledger(v bool) {
o.AllowSubledger = &v
}
// GetUsersPerCardLimit returns the UsersPerCardLimit field value if set, zero value otherwise.
func (o *BaseLoyaltyProgram) GetUsersPerCardLimit() int32 {
if o == nil || o.UsersPerCardLimit == nil {
var ret int32
return ret
}
return *o.UsersPerCardLimit
}
// GetUsersPerCardLimitOk returns a tuple with the UsersPerCardLimit field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseLoyaltyProgram) GetUsersPerCardLimitOk() (int32, bool) {
if o == nil || o.UsersPerCardLimit == nil {
var ret int32
return ret, false
}
return *o.UsersPerCardLimit, true
}
// HasUsersPerCardLimit returns a boolean if a field has been set.
func (o *BaseLoyaltyProgram) HasUsersPerCardLimit() bool {
if o != nil && o.UsersPerCardLimit != nil {
return true
}
return false
}
// SetUsersPerCardLimit gets a reference to the given int32 and assigns it to the UsersPerCardLimit field.
func (o *BaseLoyaltyProgram) SetUsersPerCardLimit(v int32) {
o.UsersPerCardLimit = &v
}
// GetSandbox returns the Sandbox field value if set, zero value otherwise.
func (o *BaseLoyaltyProgram) GetSandbox() bool {
if o == nil || o.Sandbox == nil {
var ret bool
return ret
}
return *o.Sandbox
}
// GetSandboxOk returns a tuple with the Sandbox field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseLoyaltyProgram) GetSandboxOk() (bool, bool) {
if o == nil || o.Sandbox == nil {
var ret bool
return ret, false
}
return *o.Sandbox, true
}
// HasSandbox returns a boolean if a field has been set.
func (o *BaseLoyaltyProgram) HasSandbox() bool {
if o != nil && o.Sandbox != nil {
return true
}
return false
}
// SetSandbox gets a reference to the given bool and assigns it to the Sandbox field.
func (o *BaseLoyaltyProgram) SetSandbox(v bool) {
o.Sandbox = &v
}
// GetProgramJoinPolicy returns the ProgramJoinPolicy field value if set, zero value otherwise.
func (o *BaseLoyaltyProgram) GetProgramJoinPolicy() string {
if o == nil || o.ProgramJoinPolicy == nil {
var ret string
return ret
}
return *o.ProgramJoinPolicy
}
// GetProgramJoinPolicyOk returns a tuple with the ProgramJoinPolicy field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseLoyaltyProgram) GetProgramJoinPolicyOk() (string, bool) {
if o == nil || o.ProgramJoinPolicy == nil {
var ret string
return ret, false
}
return *o.ProgramJoinPolicy, true
}
// HasProgramJoinPolicy returns a boolean if a field has been set.
func (o *BaseLoyaltyProgram) HasProgramJoinPolicy() bool {
if o != nil && o.ProgramJoinPolicy != nil {
return true
}
return false
}
// SetProgramJoinPolicy gets a reference to the given string and assigns it to the ProgramJoinPolicy field.
func (o *BaseLoyaltyProgram) SetProgramJoinPolicy(v string) {
o.ProgramJoinPolicy = &v
}
// GetTiersExpirationPolicy returns the TiersExpirationPolicy field value if set, zero value otherwise.
func (o *BaseLoyaltyProgram) GetTiersExpirationPolicy() string {
if o == nil || o.TiersExpirationPolicy == nil {
var ret string
return ret
}
return *o.TiersExpirationPolicy
}
// GetTiersExpirationPolicyOk returns a tuple with the TiersExpirationPolicy field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseLoyaltyProgram) GetTiersExpirationPolicyOk() (string, bool) {
if o == nil || o.TiersExpirationPolicy == nil {
var ret string
return ret, false
}
return *o.TiersExpirationPolicy, true
}
// HasTiersExpirationPolicy returns a boolean if a field has been set.
func (o *BaseLoyaltyProgram) HasTiersExpirationPolicy() bool {
if o != nil && o.TiersExpirationPolicy != nil {
return true
}
return false
}
// SetTiersExpirationPolicy gets a reference to the given string and assigns it to the TiersExpirationPolicy field.
func (o *BaseLoyaltyProgram) SetTiersExpirationPolicy(v string) {
o.TiersExpirationPolicy = &v
}
// GetTierCycleStartDate returns the TierCycleStartDate field value if set, zero value otherwise.
func (o *BaseLoyaltyProgram) GetTierCycleStartDate() time.Time {
if o == nil || o.TierCycleStartDate == nil {
var ret time.Time
return ret
}
return *o.TierCycleStartDate
}
// GetTierCycleStartDateOk returns a tuple with the TierCycleStartDate field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseLoyaltyProgram) GetTierCycleStartDateOk() (time.Time, bool) {
if o == nil || o.TierCycleStartDate == nil {
var ret time.Time
return ret, false
}
return *o.TierCycleStartDate, true
}
// HasTierCycleStartDate returns a boolean if a field has been set.
func (o *BaseLoyaltyProgram) HasTierCycleStartDate() bool {
if o != nil && o.TierCycleStartDate != nil {
return true
}
return false
}
// SetTierCycleStartDate gets a reference to the given time.Time and assigns it to the TierCycleStartDate field.
func (o *BaseLoyaltyProgram) SetTierCycleStartDate(v time.Time) {
o.TierCycleStartDate = &v
}
// GetTiersExpireIn returns the TiersExpireIn field value if set, zero value otherwise.
func (o *BaseLoyaltyProgram) GetTiersExpireIn() string {
if o == nil || o.TiersExpireIn == nil {
var ret string
return ret
}
return *o.TiersExpireIn
}
// GetTiersExpireInOk returns a tuple with the TiersExpireIn field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseLoyaltyProgram) GetTiersExpireInOk() (string, bool) {
if o == nil || o.TiersExpireIn == nil {
var ret string
return ret, false
}
return *o.TiersExpireIn, true
}
// HasTiersExpireIn returns a boolean if a field has been set.
func (o *BaseLoyaltyProgram) HasTiersExpireIn() bool {
if o != nil && o.TiersExpireIn != nil {
return true
}
return false
}
// SetTiersExpireIn gets a reference to the given string and assigns it to the TiersExpireIn field.
func (o *BaseLoyaltyProgram) SetTiersExpireIn(v string) {
o.TiersExpireIn = &v
}
// GetTiersDowngradePolicy returns the TiersDowngradePolicy field value if set, zero value otherwise.
func (o *BaseLoyaltyProgram) GetTiersDowngradePolicy() string {
if o == nil || o.TiersDowngradePolicy == nil {
var ret string
return ret
}
return *o.TiersDowngradePolicy
}
// GetTiersDowngradePolicyOk returns a tuple with the TiersDowngradePolicy field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseLoyaltyProgram) GetTiersDowngradePolicyOk() (string, bool) {
if o == nil || o.TiersDowngradePolicy == nil {
var ret string
return ret, false
}
return *o.TiersDowngradePolicy, true
}
// HasTiersDowngradePolicy returns a boolean if a field has been set.
func (o *BaseLoyaltyProgram) HasTiersDowngradePolicy() bool {
if o != nil && o.TiersDowngradePolicy != nil {
return true
}
return false
}
// SetTiersDowngradePolicy gets a reference to the given string and assigns it to the TiersDowngradePolicy field.
func (o *BaseLoyaltyProgram) SetTiersDowngradePolicy(v string) {
o.TiersDowngradePolicy = &v
}
// GetCardCodeSettings returns the CardCodeSettings field value if set, zero value otherwise.
func (o *BaseLoyaltyProgram) GetCardCodeSettings() CodeGeneratorSettings {
if o == nil || o.CardCodeSettings == nil {
var ret CodeGeneratorSettings
return ret
}
return *o.CardCodeSettings
}
// GetCardCodeSettingsOk returns a tuple with the CardCodeSettings field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *BaseLoyaltyProgram) GetCardCodeSettingsOk() (CodeGeneratorSettings, bool) {
if o == nil || o.CardCodeSettings == nil {
var ret CodeGeneratorSettings
return ret, false
}
return *o.CardCodeSettings, true
}
// HasCardCodeSettings returns a boolean if a field has been set.
func (o *BaseLoyaltyProgram) HasCardCodeSettings() bool {
if o != nil && o.CardCodeSettings != nil {
return true
}
return false
}
// SetCardCodeSettings gets a reference to the given CodeGeneratorSettings and assigns it to the CardCodeSettings field.
func (o *BaseLoyaltyProgram) SetCardCodeSettings(v CodeGeneratorSettings) {
o.CardCodeSettings = &v
}
type NullableBaseLoyaltyProgram struct {
Value BaseLoyaltyProgram
ExplicitNull bool
}
func (v NullableBaseLoyaltyProgram) MarshalJSON() ([]byte, error) {
switch {
case v.ExplicitNull:
return []byte("null"), nil
default:
return json.Marshal(v.Value)
}
}
func (v *NullableBaseLoyaltyProgram) UnmarshalJSON(src []byte) error {
if bytes.Equal(src, []byte("null")) {
v.ExplicitNull = true
return nil
}
return json.Unmarshal(src, &v.Value)
}