/
model_price_and_availability_response_inner_discounts_inner_quantity_discounts_inner.go
275 lines (229 loc) · 10.2 KB
/
model_price_and_availability_response_inner_discounts_inner_quantity_discounts_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
/*
XI Sdk Resellers
For Resellers. Who are looking to Innovate with Ingram Micro's API SolutionsAutomate your eCommerce with our offering of APIs and Webhooks to create a seamless experience for your customers.
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package xi_sdk_resellers
import (
"encoding/json"
)
// checks if the PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner{}
// PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner struct for PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner
type PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner struct {
// Indicates when the discount is applied after ordering the product.
ConditionType *string `json:"conditionType,omitempty"`
// The country-specific three digit ISO 4217 currency code for the order.
CurrencyCode *string `json:"currencyCode,omitempty"`
// Type of currency.
CurrencyType *string `json:"currencyType,omitempty"`
// The total discounted quantity of the product.
Quantity *int32 `json:"quantity,omitempty"`
// The total price of all the discounts applied.
Amount *float32 `json:"amount,omitempty"`
}
// NewPriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner instantiates a new PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner 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 NewPriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner() *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner {
this := PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner{}
return &this
}
// NewPriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInnerWithDefaults instantiates a new PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner 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 NewPriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInnerWithDefaults() *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner {
this := PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner{}
return &this
}
// GetConditionType returns the ConditionType field value if set, zero value otherwise.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) GetConditionType() string {
if o == nil || IsNil(o.ConditionType) {
var ret string
return ret
}
return *o.ConditionType
}
// GetConditionTypeOk returns a tuple with the ConditionType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) GetConditionTypeOk() (*string, bool) {
if o == nil || IsNil(o.ConditionType) {
return nil, false
}
return o.ConditionType, true
}
// HasConditionType returns a boolean if a field has been set.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) HasConditionType() bool {
if o != nil && !IsNil(o.ConditionType) {
return true
}
return false
}
// SetConditionType gets a reference to the given string and assigns it to the ConditionType field.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) SetConditionType(v string) {
o.ConditionType = &v
}
// GetCurrencyCode returns the CurrencyCode field value if set, zero value otherwise.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) GetCurrencyCode() string {
if o == nil || IsNil(o.CurrencyCode) {
var ret string
return ret
}
return *o.CurrencyCode
}
// GetCurrencyCodeOk returns a tuple with the CurrencyCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) GetCurrencyCodeOk() (*string, bool) {
if o == nil || IsNil(o.CurrencyCode) {
return nil, false
}
return o.CurrencyCode, true
}
// HasCurrencyCode returns a boolean if a field has been set.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) HasCurrencyCode() bool {
if o != nil && !IsNil(o.CurrencyCode) {
return true
}
return false
}
// SetCurrencyCode gets a reference to the given string and assigns it to the CurrencyCode field.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) SetCurrencyCode(v string) {
o.CurrencyCode = &v
}
// GetCurrencyType returns the CurrencyType field value if set, zero value otherwise.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) GetCurrencyType() string {
if o == nil || IsNil(o.CurrencyType) {
var ret string
return ret
}
return *o.CurrencyType
}
// GetCurrencyTypeOk returns a tuple with the CurrencyType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) GetCurrencyTypeOk() (*string, bool) {
if o == nil || IsNil(o.CurrencyType) {
return nil, false
}
return o.CurrencyType, true
}
// HasCurrencyType returns a boolean if a field has been set.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) HasCurrencyType() bool {
if o != nil && !IsNil(o.CurrencyType) {
return true
}
return false
}
// SetCurrencyType gets a reference to the given string and assigns it to the CurrencyType field.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) SetCurrencyType(v string) {
o.CurrencyType = &v
}
// GetQuantity returns the Quantity field value if set, zero value otherwise.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) GetQuantity() int32 {
if o == nil || IsNil(o.Quantity) {
var ret int32
return ret
}
return *o.Quantity
}
// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) GetQuantityOk() (*int32, bool) {
if o == nil || IsNil(o.Quantity) {
return nil, false
}
return o.Quantity, true
}
// HasQuantity returns a boolean if a field has been set.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) HasQuantity() bool {
if o != nil && !IsNil(o.Quantity) {
return true
}
return false
}
// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) SetQuantity(v int32) {
o.Quantity = &v
}
// GetAmount returns the Amount field value if set, zero value otherwise.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) GetAmount() float32 {
if o == nil || IsNil(o.Amount) {
var ret float32
return ret
}
return *o.Amount
}
// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) GetAmountOk() (*float32, bool) {
if o == nil || IsNil(o.Amount) {
return nil, false
}
return o.Amount, true
}
// HasAmount returns a boolean if a field has been set.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) HasAmount() bool {
if o != nil && !IsNil(o.Amount) {
return true
}
return false
}
// SetAmount gets a reference to the given float32 and assigns it to the Amount field.
func (o *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) SetAmount(v float32) {
o.Amount = &v
}
func (o PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ConditionType) {
toSerialize["conditionType"] = o.ConditionType
}
if !IsNil(o.CurrencyCode) {
toSerialize["currencyCode"] = o.CurrencyCode
}
if !IsNil(o.CurrencyType) {
toSerialize["currencyType"] = o.CurrencyType
}
if !IsNil(o.Quantity) {
toSerialize["quantity"] = o.Quantity
}
if !IsNil(o.Amount) {
toSerialize["amount"] = o.Amount
}
return toSerialize, nil
}
type NullablePriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner struct {
value *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner
isSet bool
}
func (v NullablePriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) Get() *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner {
return v.value
}
func (v *NullablePriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) Set(val *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) {
v.value = val
v.isSet = true
}
func (v NullablePriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) IsSet() bool {
return v.isSet
}
func (v *NullablePriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner(val *PriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) *NullablePriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner {
return &NullablePriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner{value: val, isSet: true}
}
func (v NullablePriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePriceAndAvailabilityResponseInnerDiscountsInnerQuantityDiscountsInner) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}