-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_menu_entity.go
349 lines (287 loc) · 9.95 KB
/
model_menu_entity.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
// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved.
// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file
/*
GrabFood
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: 1.1.3
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package grabfood
import (
"encoding/json"
)
// checks if the MenuEntity type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MenuEntity{}
// MenuEntity struct for MenuEntity
type MenuEntity struct {
// The record's ID on the partner system. For example, the item id in case type is ITEM, modifier id is MODIFIER.
Id *string `json:"id,omitempty"`
// The record's price in minor unit format.
Price *int64 `json:"price,omitempty"`
// The record's availableStatus. Note: In order to set an item as \"UNAVAILABLE\", it is required to update both the `availableStatus` and `maxStock` fields, whereby the `maxStock` value should be set to 0.
AvailableStatus *string `json:"availableStatus,omitempty"`
// Available stocks under inventory for this item. Auto reduce when there is order placed for this item. Note: It is necessary to set `maxStock` to 0 if the `availableStatus` of the item is \"UNAVAILABLE\". Item will be set to \"AVAILABLE\" if `maxStock` > 0.
MaxStock *int64 `json:"maxStock,omitempty"`
// Price configuration (in minor unit) for different service, order type and channel combination. If a service type does not have a specified price, it will utilize the default price of the item.
AdvancedPricings []UpdateAdvancedPricing `json:"advancedPricings,omitempty"`
// Purchasability is set to true by default for all service type, unless it is explicitly set to false. Modifier will reuse it’s item’s purchasability.
Purchasabilities []UpdatePurchasability `json:"purchasabilities,omitempty"`
AdditionalProperties map[string]interface{}
}
type _MenuEntity MenuEntity
// NewMenuEntity instantiates a new MenuEntity 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 NewMenuEntity() *MenuEntity {
this := MenuEntity{}
return &this
}
// NewMenuEntityWithDefaults instantiates a new MenuEntity 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 NewMenuEntityWithDefaults() *MenuEntity {
this := MenuEntity{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *MenuEntity) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MenuEntity) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *MenuEntity) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *MenuEntity) SetId(v string) {
o.Id = &v
}
// GetPrice returns the Price field value if set, zero value otherwise.
func (o *MenuEntity) GetPrice() int64 {
if o == nil || IsNil(o.Price) {
var ret int64
return ret
}
return *o.Price
}
// GetPriceOk returns a tuple with the Price field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MenuEntity) GetPriceOk() (*int64, bool) {
if o == nil || IsNil(o.Price) {
return nil, false
}
return o.Price, true
}
// HasPrice returns a boolean if a field has been set.
func (o *MenuEntity) HasPrice() bool {
if o != nil && !IsNil(o.Price) {
return true
}
return false
}
// SetPrice gets a reference to the given int64 and assigns it to the Price field.
func (o *MenuEntity) SetPrice(v int64) {
o.Price = &v
}
// GetAvailableStatus returns the AvailableStatus field value if set, zero value otherwise.
func (o *MenuEntity) GetAvailableStatus() string {
if o == nil || IsNil(o.AvailableStatus) {
var ret string
return ret
}
return *o.AvailableStatus
}
// GetAvailableStatusOk returns a tuple with the AvailableStatus field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MenuEntity) GetAvailableStatusOk() (*string, bool) {
if o == nil || IsNil(o.AvailableStatus) {
return nil, false
}
return o.AvailableStatus, true
}
// HasAvailableStatus returns a boolean if a field has been set.
func (o *MenuEntity) HasAvailableStatus() bool {
if o != nil && !IsNil(o.AvailableStatus) {
return true
}
return false
}
// SetAvailableStatus gets a reference to the given string and assigns it to the AvailableStatus field.
func (o *MenuEntity) SetAvailableStatus(v string) {
o.AvailableStatus = &v
}
// GetMaxStock returns the MaxStock field value if set, zero value otherwise.
func (o *MenuEntity) GetMaxStock() int64 {
if o == nil || IsNil(o.MaxStock) {
var ret int64
return ret
}
return *o.MaxStock
}
// GetMaxStockOk returns a tuple with the MaxStock field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MenuEntity) GetMaxStockOk() (*int64, bool) {
if o == nil || IsNil(o.MaxStock) {
return nil, false
}
return o.MaxStock, true
}
// HasMaxStock returns a boolean if a field has been set.
func (o *MenuEntity) HasMaxStock() bool {
if o != nil && !IsNil(o.MaxStock) {
return true
}
return false
}
// SetMaxStock gets a reference to the given int64 and assigns it to the MaxStock field.
func (o *MenuEntity) SetMaxStock(v int64) {
o.MaxStock = &v
}
// GetAdvancedPricings returns the AdvancedPricings field value if set, zero value otherwise.
func (o *MenuEntity) GetAdvancedPricings() []UpdateAdvancedPricing {
if o == nil || IsNil(o.AdvancedPricings) {
var ret []UpdateAdvancedPricing
return ret
}
return o.AdvancedPricings
}
// GetAdvancedPricingsOk returns a tuple with the AdvancedPricings field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MenuEntity) GetAdvancedPricingsOk() ([]UpdateAdvancedPricing, bool) {
if o == nil || IsNil(o.AdvancedPricings) {
return nil, false
}
return o.AdvancedPricings, true
}
// HasAdvancedPricings returns a boolean if a field has been set.
func (o *MenuEntity) HasAdvancedPricings() bool {
if o != nil && !IsNil(o.AdvancedPricings) {
return true
}
return false
}
// SetAdvancedPricings gets a reference to the given []UpdateAdvancedPricing and assigns it to the AdvancedPricings field.
func (o *MenuEntity) SetAdvancedPricings(v []UpdateAdvancedPricing) {
o.AdvancedPricings = v
}
// GetPurchasabilities returns the Purchasabilities field value if set, zero value otherwise.
func (o *MenuEntity) GetPurchasabilities() []UpdatePurchasability {
if o == nil || IsNil(o.Purchasabilities) {
var ret []UpdatePurchasability
return ret
}
return o.Purchasabilities
}
// GetPurchasabilitiesOk returns a tuple with the Purchasabilities field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MenuEntity) GetPurchasabilitiesOk() ([]UpdatePurchasability, bool) {
if o == nil || IsNil(o.Purchasabilities) {
return nil, false
}
return o.Purchasabilities, true
}
// HasPurchasabilities returns a boolean if a field has been set.
func (o *MenuEntity) HasPurchasabilities() bool {
if o != nil && !IsNil(o.Purchasabilities) {
return true
}
return false
}
// SetPurchasabilities gets a reference to the given []UpdatePurchasability and assigns it to the Purchasabilities field.
func (o *MenuEntity) SetPurchasabilities(v []UpdatePurchasability) {
o.Purchasabilities = v
}
func (o MenuEntity) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MenuEntity) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Price) {
toSerialize["price"] = o.Price
}
if !IsNil(o.AvailableStatus) {
toSerialize["availableStatus"] = o.AvailableStatus
}
if !IsNil(o.MaxStock) {
toSerialize["maxStock"] = o.MaxStock
}
if !IsNil(o.AdvancedPricings) {
toSerialize["advancedPricings"] = o.AdvancedPricings
}
if !IsNil(o.Purchasabilities) {
toSerialize["purchasabilities"] = o.Purchasabilities
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *MenuEntity) UnmarshalJSON(data []byte) (err error) {
varMenuEntity := _MenuEntity{}
err = json.Unmarshal(data, &varMenuEntity)
if err != nil {
return err
}
*o = MenuEntity(varMenuEntity)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "id")
delete(additionalProperties, "price")
delete(additionalProperties, "availableStatus")
delete(additionalProperties, "maxStock")
delete(additionalProperties, "advancedPricings")
delete(additionalProperties, "purchasabilities")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableMenuEntity struct {
value *MenuEntity
isSet bool
}
func (v NullableMenuEntity) Get() *MenuEntity {
return v.value
}
func (v *NullableMenuEntity) Set(val *MenuEntity) {
v.value = val
v.isSet = true
}
func (v NullableMenuEntity) IsSet() bool {
return v.isSet
}
func (v *NullableMenuEntity) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMenuEntity(val *MenuEntity) *NullableMenuEntity {
return &NullableMenuEntity{value: val, isSet: true}
}
func (v NullableMenuEntity) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMenuEntity) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}