-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel_get_account_200_response_active_promotions_inner.go
387 lines (326 loc) · 12.8 KB
/
model_get_account_200_response_active_promotions_inner.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
/*
Linode API
[Read the API documentation](https://techdocs.akamai.com/linode-api/reference/api).
API version: 4.189.2
Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the GetAccount200ResponseActivePromotionsInner type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GetAccount200ResponseActivePromotionsInner{}
// GetAccount200ResponseActivePromotionsInner Promotions generally offer a set amount of credit that can be used toward your Linode services, and the promotion expires after a specified date. As well, a monthly cap on the promotional offer is set. Simply put, a promotion offers a certain amount of credit month, until either the expiration date is passed, or until the total promotional credit is used, whichever comes first.
type GetAccount200ResponseActivePromotionsInner struct {
// The amount available to spend per month.
CreditMonthlyCap *string `json:"credit_monthly_cap,omitempty"`
// The total amount of credit left for this promotion.
CreditRemaining *string `json:"credit_remaining,omitempty"`
// A detailed description of this promotion.
Description *string `json:"description,omitempty"`
// When this promotion's credits expire.
ExpireDt *string `json:"expire_dt,omitempty"`
// The location of an image for this promotion.
ImageUrl *string `json:"image_url,omitempty"`
// The service to which this promotion applies.
ServiceType *string `json:"service_type,omitempty"`
// Short details of this promotion.
Summary *string `json:"summary,omitempty"`
// The amount of credit left for this month for this promotion.
ThisMonthCreditRemaining *string `json:"this_month_credit_remaining,omitempty"`
}
// NewGetAccount200ResponseActivePromotionsInner instantiates a new GetAccount200ResponseActivePromotionsInner 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 NewGetAccount200ResponseActivePromotionsInner() *GetAccount200ResponseActivePromotionsInner {
this := GetAccount200ResponseActivePromotionsInner{}
return &this
}
// NewGetAccount200ResponseActivePromotionsInnerWithDefaults instantiates a new GetAccount200ResponseActivePromotionsInner 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 NewGetAccount200ResponseActivePromotionsInnerWithDefaults() *GetAccount200ResponseActivePromotionsInner {
this := GetAccount200ResponseActivePromotionsInner{}
return &this
}
// GetCreditMonthlyCap returns the CreditMonthlyCap field value if set, zero value otherwise.
func (o *GetAccount200ResponseActivePromotionsInner) GetCreditMonthlyCap() string {
if o == nil || IsNil(o.CreditMonthlyCap) {
var ret string
return ret
}
return *o.CreditMonthlyCap
}
// GetCreditMonthlyCapOk returns a tuple with the CreditMonthlyCap field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GetAccount200ResponseActivePromotionsInner) GetCreditMonthlyCapOk() (*string, bool) {
if o == nil || IsNil(o.CreditMonthlyCap) {
return nil, false
}
return o.CreditMonthlyCap, true
}
// HasCreditMonthlyCap returns a boolean if a field has been set.
func (o *GetAccount200ResponseActivePromotionsInner) HasCreditMonthlyCap() bool {
if o != nil && !IsNil(o.CreditMonthlyCap) {
return true
}
return false
}
// SetCreditMonthlyCap gets a reference to the given string and assigns it to the CreditMonthlyCap field.
func (o *GetAccount200ResponseActivePromotionsInner) SetCreditMonthlyCap(v string) {
o.CreditMonthlyCap = &v
}
// GetCreditRemaining returns the CreditRemaining field value if set, zero value otherwise.
func (o *GetAccount200ResponseActivePromotionsInner) GetCreditRemaining() string {
if o == nil || IsNil(o.CreditRemaining) {
var ret string
return ret
}
return *o.CreditRemaining
}
// GetCreditRemainingOk returns a tuple with the CreditRemaining field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GetAccount200ResponseActivePromotionsInner) GetCreditRemainingOk() (*string, bool) {
if o == nil || IsNil(o.CreditRemaining) {
return nil, false
}
return o.CreditRemaining, true
}
// HasCreditRemaining returns a boolean if a field has been set.
func (o *GetAccount200ResponseActivePromotionsInner) HasCreditRemaining() bool {
if o != nil && !IsNil(o.CreditRemaining) {
return true
}
return false
}
// SetCreditRemaining gets a reference to the given string and assigns it to the CreditRemaining field.
func (o *GetAccount200ResponseActivePromotionsInner) SetCreditRemaining(v string) {
o.CreditRemaining = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *GetAccount200ResponseActivePromotionsInner) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GetAccount200ResponseActivePromotionsInner) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *GetAccount200ResponseActivePromotionsInner) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *GetAccount200ResponseActivePromotionsInner) SetDescription(v string) {
o.Description = &v
}
// GetExpireDt returns the ExpireDt field value if set, zero value otherwise.
func (o *GetAccount200ResponseActivePromotionsInner) GetExpireDt() string {
if o == nil || IsNil(o.ExpireDt) {
var ret string
return ret
}
return *o.ExpireDt
}
// GetExpireDtOk returns a tuple with the ExpireDt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GetAccount200ResponseActivePromotionsInner) GetExpireDtOk() (*string, bool) {
if o == nil || IsNil(o.ExpireDt) {
return nil, false
}
return o.ExpireDt, true
}
// HasExpireDt returns a boolean if a field has been set.
func (o *GetAccount200ResponseActivePromotionsInner) HasExpireDt() bool {
if o != nil && !IsNil(o.ExpireDt) {
return true
}
return false
}
// SetExpireDt gets a reference to the given string and assigns it to the ExpireDt field.
func (o *GetAccount200ResponseActivePromotionsInner) SetExpireDt(v string) {
o.ExpireDt = &v
}
// GetImageUrl returns the ImageUrl field value if set, zero value otherwise.
func (o *GetAccount200ResponseActivePromotionsInner) GetImageUrl() string {
if o == nil || IsNil(o.ImageUrl) {
var ret string
return ret
}
return *o.ImageUrl
}
// GetImageUrlOk returns a tuple with the ImageUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GetAccount200ResponseActivePromotionsInner) GetImageUrlOk() (*string, bool) {
if o == nil || IsNil(o.ImageUrl) {
return nil, false
}
return o.ImageUrl, true
}
// HasImageUrl returns a boolean if a field has been set.
func (o *GetAccount200ResponseActivePromotionsInner) HasImageUrl() bool {
if o != nil && !IsNil(o.ImageUrl) {
return true
}
return false
}
// SetImageUrl gets a reference to the given string and assigns it to the ImageUrl field.
func (o *GetAccount200ResponseActivePromotionsInner) SetImageUrl(v string) {
o.ImageUrl = &v
}
// GetServiceType returns the ServiceType field value if set, zero value otherwise.
func (o *GetAccount200ResponseActivePromotionsInner) GetServiceType() string {
if o == nil || IsNil(o.ServiceType) {
var ret string
return ret
}
return *o.ServiceType
}
// GetServiceTypeOk returns a tuple with the ServiceType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GetAccount200ResponseActivePromotionsInner) GetServiceTypeOk() (*string, bool) {
if o == nil || IsNil(o.ServiceType) {
return nil, false
}
return o.ServiceType, true
}
// HasServiceType returns a boolean if a field has been set.
func (o *GetAccount200ResponseActivePromotionsInner) HasServiceType() bool {
if o != nil && !IsNil(o.ServiceType) {
return true
}
return false
}
// SetServiceType gets a reference to the given string and assigns it to the ServiceType field.
func (o *GetAccount200ResponseActivePromotionsInner) SetServiceType(v string) {
o.ServiceType = &v
}
// GetSummary returns the Summary field value if set, zero value otherwise.
func (o *GetAccount200ResponseActivePromotionsInner) GetSummary() string {
if o == nil || IsNil(o.Summary) {
var ret string
return ret
}
return *o.Summary
}
// GetSummaryOk returns a tuple with the Summary field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GetAccount200ResponseActivePromotionsInner) GetSummaryOk() (*string, bool) {
if o == nil || IsNil(o.Summary) {
return nil, false
}
return o.Summary, true
}
// HasSummary returns a boolean if a field has been set.
func (o *GetAccount200ResponseActivePromotionsInner) HasSummary() bool {
if o != nil && !IsNil(o.Summary) {
return true
}
return false
}
// SetSummary gets a reference to the given string and assigns it to the Summary field.
func (o *GetAccount200ResponseActivePromotionsInner) SetSummary(v string) {
o.Summary = &v
}
// GetThisMonthCreditRemaining returns the ThisMonthCreditRemaining field value if set, zero value otherwise.
func (o *GetAccount200ResponseActivePromotionsInner) GetThisMonthCreditRemaining() string {
if o == nil || IsNil(o.ThisMonthCreditRemaining) {
var ret string
return ret
}
return *o.ThisMonthCreditRemaining
}
// GetThisMonthCreditRemainingOk returns a tuple with the ThisMonthCreditRemaining field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GetAccount200ResponseActivePromotionsInner) GetThisMonthCreditRemainingOk() (*string, bool) {
if o == nil || IsNil(o.ThisMonthCreditRemaining) {
return nil, false
}
return o.ThisMonthCreditRemaining, true
}
// HasThisMonthCreditRemaining returns a boolean if a field has been set.
func (o *GetAccount200ResponseActivePromotionsInner) HasThisMonthCreditRemaining() bool {
if o != nil && !IsNil(o.ThisMonthCreditRemaining) {
return true
}
return false
}
// SetThisMonthCreditRemaining gets a reference to the given string and assigns it to the ThisMonthCreditRemaining field.
func (o *GetAccount200ResponseActivePromotionsInner) SetThisMonthCreditRemaining(v string) {
o.ThisMonthCreditRemaining = &v
}
func (o GetAccount200ResponseActivePromotionsInner) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GetAccount200ResponseActivePromotionsInner) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreditMonthlyCap) {
toSerialize["credit_monthly_cap"] = o.CreditMonthlyCap
}
if !IsNil(o.CreditRemaining) {
toSerialize["credit_remaining"] = o.CreditRemaining
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.ExpireDt) {
toSerialize["expire_dt"] = o.ExpireDt
}
if !IsNil(o.ImageUrl) {
toSerialize["image_url"] = o.ImageUrl
}
if !IsNil(o.ServiceType) {
toSerialize["service_type"] = o.ServiceType
}
if !IsNil(o.Summary) {
toSerialize["summary"] = o.Summary
}
if !IsNil(o.ThisMonthCreditRemaining) {
toSerialize["this_month_credit_remaining"] = o.ThisMonthCreditRemaining
}
return toSerialize, nil
}
type NullableGetAccount200ResponseActivePromotionsInner struct {
value *GetAccount200ResponseActivePromotionsInner
isSet bool
}
func (v NullableGetAccount200ResponseActivePromotionsInner) Get() *GetAccount200ResponseActivePromotionsInner {
return v.value
}
func (v *NullableGetAccount200ResponseActivePromotionsInner) Set(val *GetAccount200ResponseActivePromotionsInner) {
v.value = val
v.isSet = true
}
func (v NullableGetAccount200ResponseActivePromotionsInner) IsSet() bool {
return v.isSet
}
func (v *NullableGetAccount200ResponseActivePromotionsInner) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGetAccount200ResponseActivePromotionsInner(val *GetAccount200ResponseActivePromotionsInner) *NullableGetAccount200ResponseActivePromotionsInner {
return &NullableGetAccount200ResponseActivePromotionsInner{value: val, isSet: true}
}
func (v NullableGetAccount200ResponseActivePromotionsInner) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGetAccount200ResponseActivePromotionsInner) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}