/
model_v1_limit_range_item.go
312 lines (261 loc) · 9.14 KB
/
model_v1_limit_range_item.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
/*
Arvancloud PaaS REST API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: v1.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package paas
import (
"encoding/json"
)
// checks if the V1LimitRangeItem type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &V1LimitRangeItem{}
// V1LimitRangeItem LimitRangeItem defines a min/max usage limit for any resource that matches on kind.
type V1LimitRangeItem struct {
// Default resource requirement limit value by resource name if resource limit is omitted.
Default map[string]interface{} `json:"default,omitempty"`
// DefaultRequest is the default resource requirement request value by resource name if resource request is omitted.
DefaultRequest map[string]interface{} `json:"defaultRequest,omitempty"`
// Max usage constraints on this kind by resource name.
Max map[string]interface{} `json:"max,omitempty"`
// MaxLimitRequestRatio if specified, the named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource.
MaxLimitRequestRatio map[string]interface{} `json:"maxLimitRequestRatio,omitempty"`
// Min usage constraints on this kind by resource name.
Min map[string]interface{} `json:"min,omitempty"`
// Type of resource that this limit applies to.
Type *string `json:"type,omitempty"`
}
// NewV1LimitRangeItem instantiates a new V1LimitRangeItem 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 NewV1LimitRangeItem() *V1LimitRangeItem {
this := V1LimitRangeItem{}
return &this
}
// NewV1LimitRangeItemWithDefaults instantiates a new V1LimitRangeItem 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 NewV1LimitRangeItemWithDefaults() *V1LimitRangeItem {
this := V1LimitRangeItem{}
return &this
}
// GetDefault returns the Default field value if set, zero value otherwise.
func (o *V1LimitRangeItem) GetDefault() map[string]interface{} {
if o == nil || IsNil(o.Default) {
var ret map[string]interface{}
return ret
}
return o.Default
}
// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1LimitRangeItem) GetDefaultOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Default) {
return map[string]interface{}{}, false
}
return o.Default, true
}
// HasDefault returns a boolean if a field has been set.
func (o *V1LimitRangeItem) HasDefault() bool {
if o != nil && !IsNil(o.Default) {
return true
}
return false
}
// SetDefault gets a reference to the given map[string]interface{} and assigns it to the Default field.
func (o *V1LimitRangeItem) SetDefault(v map[string]interface{}) {
o.Default = v
}
// GetDefaultRequest returns the DefaultRequest field value if set, zero value otherwise.
func (o *V1LimitRangeItem) GetDefaultRequest() map[string]interface{} {
if o == nil || IsNil(o.DefaultRequest) {
var ret map[string]interface{}
return ret
}
return o.DefaultRequest
}
// GetDefaultRequestOk returns a tuple with the DefaultRequest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1LimitRangeItem) GetDefaultRequestOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.DefaultRequest) {
return map[string]interface{}{}, false
}
return o.DefaultRequest, true
}
// HasDefaultRequest returns a boolean if a field has been set.
func (o *V1LimitRangeItem) HasDefaultRequest() bool {
if o != nil && !IsNil(o.DefaultRequest) {
return true
}
return false
}
// SetDefaultRequest gets a reference to the given map[string]interface{} and assigns it to the DefaultRequest field.
func (o *V1LimitRangeItem) SetDefaultRequest(v map[string]interface{}) {
o.DefaultRequest = v
}
// GetMax returns the Max field value if set, zero value otherwise.
func (o *V1LimitRangeItem) GetMax() map[string]interface{} {
if o == nil || IsNil(o.Max) {
var ret map[string]interface{}
return ret
}
return o.Max
}
// GetMaxOk returns a tuple with the Max field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1LimitRangeItem) GetMaxOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Max) {
return map[string]interface{}{}, false
}
return o.Max, true
}
// HasMax returns a boolean if a field has been set.
func (o *V1LimitRangeItem) HasMax() bool {
if o != nil && !IsNil(o.Max) {
return true
}
return false
}
// SetMax gets a reference to the given map[string]interface{} and assigns it to the Max field.
func (o *V1LimitRangeItem) SetMax(v map[string]interface{}) {
o.Max = v
}
// GetMaxLimitRequestRatio returns the MaxLimitRequestRatio field value if set, zero value otherwise.
func (o *V1LimitRangeItem) GetMaxLimitRequestRatio() map[string]interface{} {
if o == nil || IsNil(o.MaxLimitRequestRatio) {
var ret map[string]interface{}
return ret
}
return o.MaxLimitRequestRatio
}
// GetMaxLimitRequestRatioOk returns a tuple with the MaxLimitRequestRatio field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1LimitRangeItem) GetMaxLimitRequestRatioOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.MaxLimitRequestRatio) {
return map[string]interface{}{}, false
}
return o.MaxLimitRequestRatio, true
}
// HasMaxLimitRequestRatio returns a boolean if a field has been set.
func (o *V1LimitRangeItem) HasMaxLimitRequestRatio() bool {
if o != nil && !IsNil(o.MaxLimitRequestRatio) {
return true
}
return false
}
// SetMaxLimitRequestRatio gets a reference to the given map[string]interface{} and assigns it to the MaxLimitRequestRatio field.
func (o *V1LimitRangeItem) SetMaxLimitRequestRatio(v map[string]interface{}) {
o.MaxLimitRequestRatio = v
}
// GetMin returns the Min field value if set, zero value otherwise.
func (o *V1LimitRangeItem) GetMin() map[string]interface{} {
if o == nil || IsNil(o.Min) {
var ret map[string]interface{}
return ret
}
return o.Min
}
// GetMinOk returns a tuple with the Min field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1LimitRangeItem) GetMinOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Min) {
return map[string]interface{}{}, false
}
return o.Min, true
}
// HasMin returns a boolean if a field has been set.
func (o *V1LimitRangeItem) HasMin() bool {
if o != nil && !IsNil(o.Min) {
return true
}
return false
}
// SetMin gets a reference to the given map[string]interface{} and assigns it to the Min field.
func (o *V1LimitRangeItem) SetMin(v map[string]interface{}) {
o.Min = v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *V1LimitRangeItem) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1LimitRangeItem) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *V1LimitRangeItem) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *V1LimitRangeItem) SetType(v string) {
o.Type = &v
}
func (o V1LimitRangeItem) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o V1LimitRangeItem) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Default) {
toSerialize["default"] = o.Default
}
if !IsNil(o.DefaultRequest) {
toSerialize["defaultRequest"] = o.DefaultRequest
}
if !IsNil(o.Max) {
toSerialize["max"] = o.Max
}
if !IsNil(o.MaxLimitRequestRatio) {
toSerialize["maxLimitRequestRatio"] = o.MaxLimitRequestRatio
}
if !IsNil(o.Min) {
toSerialize["min"] = o.Min
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
return toSerialize, nil
}
type NullableV1LimitRangeItem struct {
value *V1LimitRangeItem
isSet bool
}
func (v NullableV1LimitRangeItem) Get() *V1LimitRangeItem {
return v.value
}
func (v *NullableV1LimitRangeItem) Set(val *V1LimitRangeItem) {
v.value = val
v.isSet = true
}
func (v NullableV1LimitRangeItem) IsSet() bool {
return v.isSet
}
func (v *NullableV1LimitRangeItem) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableV1LimitRangeItem(val *V1LimitRangeItem) *NullableV1LimitRangeItem {
return &NullableV1LimitRangeItem{value: val, isSet: true}
}
func (v NullableV1LimitRangeItem) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableV1LimitRangeItem) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}