/
model_api_config.go
405 lines (341 loc) · 12.8 KB
/
model_api_config.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
/*
Equinix Fabric API v4
Equinix Fabric is an advanced software-defined interconnection solution that enables you to directly, securely and dynamically connect to distributed infrastructure and digital ecosystems on platform Equinix via a single port, Customers can use Fabric to connect to: </br> 1. Cloud Service Providers - Clouds, network and other service providers. </br> 2. Enterprises - Other Equinix customers, vendors and partners. </br> 3. Myself - Another customer instance deployed at Equinix. </br>
API version: 4.12
Contact: api-support@equinix.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package fabricv4
import (
"encoding/json"
)
// checks if the ApiConfig type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ApiConfig{}
// ApiConfig Configuration for API based Integration for Service Profile
type ApiConfig struct {
// Setting indicating whether the API is available (true) or not (false).
ApiAvailable *bool `json:"apiAvailable,omitempty"`
IntegrationId *string `json:"integrationId,omitempty"`
// Setting indicating that the port is managed by Equinix (true) or not (false).
EquinixManagedPort *bool `json:"equinixManagedPort,omitempty"`
// Setting indicating that the VLAN is managed by Equinix (true) or not (false).
EquinixManagedVlan *bool `json:"equinixManagedVlan,omitempty"`
// Setting showing that oversubscription support is available (true) or not (false). The default is false. Oversubscription is the sale of more than the available network bandwidth. This practice is common and legitimate. After all, many customers use less bandwidth than they've purchased. And network users don't consume bandwidth all at the same time. The leftover bandwidth can be sold to other customers. When demand surges, operational and engineering resources can be shifted to accommodate the load.
AllowOverSubscription *bool `json:"allowOverSubscription,omitempty"`
// A cap on oversubscription.
OverSubscriptionLimit *int32 `json:"overSubscriptionLimit,omitempty"`
BandwidthFromApi *bool `json:"bandwidthFromApi,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ApiConfig ApiConfig
// NewApiConfig instantiates a new ApiConfig 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 NewApiConfig() *ApiConfig {
this := ApiConfig{}
var apiAvailable bool = false
this.ApiAvailable = &apiAvailable
var equinixManagedPort bool = false
this.EquinixManagedPort = &equinixManagedPort
var equinixManagedVlan bool = false
this.EquinixManagedVlan = &equinixManagedVlan
var allowOverSubscription bool = false
this.AllowOverSubscription = &allowOverSubscription
var overSubscriptionLimit int32 = 1
this.OverSubscriptionLimit = &overSubscriptionLimit
var bandwidthFromApi bool = false
this.BandwidthFromApi = &bandwidthFromApi
return &this
}
// NewApiConfigWithDefaults instantiates a new ApiConfig 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 NewApiConfigWithDefaults() *ApiConfig {
this := ApiConfig{}
var apiAvailable bool = false
this.ApiAvailable = &apiAvailable
var equinixManagedPort bool = false
this.EquinixManagedPort = &equinixManagedPort
var equinixManagedVlan bool = false
this.EquinixManagedVlan = &equinixManagedVlan
var allowOverSubscription bool = false
this.AllowOverSubscription = &allowOverSubscription
var overSubscriptionLimit int32 = 1
this.OverSubscriptionLimit = &overSubscriptionLimit
var bandwidthFromApi bool = false
this.BandwidthFromApi = &bandwidthFromApi
return &this
}
// GetApiAvailable returns the ApiAvailable field value if set, zero value otherwise.
func (o *ApiConfig) GetApiAvailable() bool {
if o == nil || IsNil(o.ApiAvailable) {
var ret bool
return ret
}
return *o.ApiAvailable
}
// GetApiAvailableOk returns a tuple with the ApiAvailable field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApiConfig) GetApiAvailableOk() (*bool, bool) {
if o == nil || IsNil(o.ApiAvailable) {
return nil, false
}
return o.ApiAvailable, true
}
// HasApiAvailable returns a boolean if a field has been set.
func (o *ApiConfig) HasApiAvailable() bool {
if o != nil && !IsNil(o.ApiAvailable) {
return true
}
return false
}
// SetApiAvailable gets a reference to the given bool and assigns it to the ApiAvailable field.
func (o *ApiConfig) SetApiAvailable(v bool) {
o.ApiAvailable = &v
}
// GetIntegrationId returns the IntegrationId field value if set, zero value otherwise.
func (o *ApiConfig) GetIntegrationId() string {
if o == nil || IsNil(o.IntegrationId) {
var ret string
return ret
}
return *o.IntegrationId
}
// GetIntegrationIdOk returns a tuple with the IntegrationId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApiConfig) GetIntegrationIdOk() (*string, bool) {
if o == nil || IsNil(o.IntegrationId) {
return nil, false
}
return o.IntegrationId, true
}
// HasIntegrationId returns a boolean if a field has been set.
func (o *ApiConfig) HasIntegrationId() bool {
if o != nil && !IsNil(o.IntegrationId) {
return true
}
return false
}
// SetIntegrationId gets a reference to the given string and assigns it to the IntegrationId field.
func (o *ApiConfig) SetIntegrationId(v string) {
o.IntegrationId = &v
}
// GetEquinixManagedPort returns the EquinixManagedPort field value if set, zero value otherwise.
func (o *ApiConfig) GetEquinixManagedPort() bool {
if o == nil || IsNil(o.EquinixManagedPort) {
var ret bool
return ret
}
return *o.EquinixManagedPort
}
// GetEquinixManagedPortOk returns a tuple with the EquinixManagedPort field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApiConfig) GetEquinixManagedPortOk() (*bool, bool) {
if o == nil || IsNil(o.EquinixManagedPort) {
return nil, false
}
return o.EquinixManagedPort, true
}
// HasEquinixManagedPort returns a boolean if a field has been set.
func (o *ApiConfig) HasEquinixManagedPort() bool {
if o != nil && !IsNil(o.EquinixManagedPort) {
return true
}
return false
}
// SetEquinixManagedPort gets a reference to the given bool and assigns it to the EquinixManagedPort field.
func (o *ApiConfig) SetEquinixManagedPort(v bool) {
o.EquinixManagedPort = &v
}
// GetEquinixManagedVlan returns the EquinixManagedVlan field value if set, zero value otherwise.
func (o *ApiConfig) GetEquinixManagedVlan() bool {
if o == nil || IsNil(o.EquinixManagedVlan) {
var ret bool
return ret
}
return *o.EquinixManagedVlan
}
// GetEquinixManagedVlanOk returns a tuple with the EquinixManagedVlan field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApiConfig) GetEquinixManagedVlanOk() (*bool, bool) {
if o == nil || IsNil(o.EquinixManagedVlan) {
return nil, false
}
return o.EquinixManagedVlan, true
}
// HasEquinixManagedVlan returns a boolean if a field has been set.
func (o *ApiConfig) HasEquinixManagedVlan() bool {
if o != nil && !IsNil(o.EquinixManagedVlan) {
return true
}
return false
}
// SetEquinixManagedVlan gets a reference to the given bool and assigns it to the EquinixManagedVlan field.
func (o *ApiConfig) SetEquinixManagedVlan(v bool) {
o.EquinixManagedVlan = &v
}
// GetAllowOverSubscription returns the AllowOverSubscription field value if set, zero value otherwise.
func (o *ApiConfig) GetAllowOverSubscription() bool {
if o == nil || IsNil(o.AllowOverSubscription) {
var ret bool
return ret
}
return *o.AllowOverSubscription
}
// GetAllowOverSubscriptionOk returns a tuple with the AllowOverSubscription field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApiConfig) GetAllowOverSubscriptionOk() (*bool, bool) {
if o == nil || IsNil(o.AllowOverSubscription) {
return nil, false
}
return o.AllowOverSubscription, true
}
// HasAllowOverSubscription returns a boolean if a field has been set.
func (o *ApiConfig) HasAllowOverSubscription() bool {
if o != nil && !IsNil(o.AllowOverSubscription) {
return true
}
return false
}
// SetAllowOverSubscription gets a reference to the given bool and assigns it to the AllowOverSubscription field.
func (o *ApiConfig) SetAllowOverSubscription(v bool) {
o.AllowOverSubscription = &v
}
// GetOverSubscriptionLimit returns the OverSubscriptionLimit field value if set, zero value otherwise.
func (o *ApiConfig) GetOverSubscriptionLimit() int32 {
if o == nil || IsNil(o.OverSubscriptionLimit) {
var ret int32
return ret
}
return *o.OverSubscriptionLimit
}
// GetOverSubscriptionLimitOk returns a tuple with the OverSubscriptionLimit field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApiConfig) GetOverSubscriptionLimitOk() (*int32, bool) {
if o == nil || IsNil(o.OverSubscriptionLimit) {
return nil, false
}
return o.OverSubscriptionLimit, true
}
// HasOverSubscriptionLimit returns a boolean if a field has been set.
func (o *ApiConfig) HasOverSubscriptionLimit() bool {
if o != nil && !IsNil(o.OverSubscriptionLimit) {
return true
}
return false
}
// SetOverSubscriptionLimit gets a reference to the given int32 and assigns it to the OverSubscriptionLimit field.
func (o *ApiConfig) SetOverSubscriptionLimit(v int32) {
o.OverSubscriptionLimit = &v
}
// GetBandwidthFromApi returns the BandwidthFromApi field value if set, zero value otherwise.
func (o *ApiConfig) GetBandwidthFromApi() bool {
if o == nil || IsNil(o.BandwidthFromApi) {
var ret bool
return ret
}
return *o.BandwidthFromApi
}
// GetBandwidthFromApiOk returns a tuple with the BandwidthFromApi field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApiConfig) GetBandwidthFromApiOk() (*bool, bool) {
if o == nil || IsNil(o.BandwidthFromApi) {
return nil, false
}
return o.BandwidthFromApi, true
}
// HasBandwidthFromApi returns a boolean if a field has been set.
func (o *ApiConfig) HasBandwidthFromApi() bool {
if o != nil && !IsNil(o.BandwidthFromApi) {
return true
}
return false
}
// SetBandwidthFromApi gets a reference to the given bool and assigns it to the BandwidthFromApi field.
func (o *ApiConfig) SetBandwidthFromApi(v bool) {
o.BandwidthFromApi = &v
}
func (o ApiConfig) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ApiConfig) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ApiAvailable) {
toSerialize["apiAvailable"] = o.ApiAvailable
}
if !IsNil(o.IntegrationId) {
toSerialize["integrationId"] = o.IntegrationId
}
if !IsNil(o.EquinixManagedPort) {
toSerialize["equinixManagedPort"] = o.EquinixManagedPort
}
if !IsNil(o.EquinixManagedVlan) {
toSerialize["equinixManagedVlan"] = o.EquinixManagedVlan
}
if !IsNil(o.AllowOverSubscription) {
toSerialize["allowOverSubscription"] = o.AllowOverSubscription
}
if !IsNil(o.OverSubscriptionLimit) {
toSerialize["overSubscriptionLimit"] = o.OverSubscriptionLimit
}
if !IsNil(o.BandwidthFromApi) {
toSerialize["bandwidthFromApi"] = o.BandwidthFromApi
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ApiConfig) UnmarshalJSON(data []byte) (err error) {
varApiConfig := _ApiConfig{}
err = json.Unmarshal(data, &varApiConfig)
if err != nil {
return err
}
*o = ApiConfig(varApiConfig)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "apiAvailable")
delete(additionalProperties, "integrationId")
delete(additionalProperties, "equinixManagedPort")
delete(additionalProperties, "equinixManagedVlan")
delete(additionalProperties, "allowOverSubscription")
delete(additionalProperties, "overSubscriptionLimit")
delete(additionalProperties, "bandwidthFromApi")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableApiConfig struct {
value *ApiConfig
isSet bool
}
func (v NullableApiConfig) Get() *ApiConfig {
return v.value
}
func (v *NullableApiConfig) Set(val *ApiConfig) {
v.value = val
v.isSet = true
}
func (v NullableApiConfig) IsSet() bool {
return v.isSet
}
func (v *NullableApiConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableApiConfig(val *ApiConfig) *NullableApiConfig {
return &NullableApiConfig{value: val, isSet: true}
}
func (v NullableApiConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableApiConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}