/
model_cloud_region_config.go
377 lines (317 loc) · 13 KB
/
model_cloud_region_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
// Code based on the AtlasAPI V2 OpenAPI file
package admin
import (
"encoding/json"
)
// CloudRegionConfig Cloud service provider on which MongoDB Cloud provisions the hosts.
type CloudRegionConfig struct {
ElectableSpecs *HardwareSpec `json:"electableSpecs,omitempty"`
// Precedence is given to this region when a primary election occurs. If your **regionConfigs** has only **readOnlySpecs**, **analyticsSpecs**, or both, set this value to `0`. If you have multiple **regionConfigs** objects (your cluster is multi-region or multi-cloud), they must have priorities in descending order. The highest priority is `7`. **Example:** If you have three regions, their priorities would be `7`, `6`, and `5` respectively. If you added two more regions for supporting electable nodes, the priorities of those regions would be `4` and `3` respectively.
Priority *int `json:"priority,omitempty"`
// Cloud service provider on which MongoDB Cloud provisions the hosts. Set dedicated clusters to `AWS`, `GCP`, `AZURE` or `TENANT`.
ProviderName *string `json:"providerName,omitempty"`
// Physical location of your MongoDB cluster nodes. The region you choose can affect network latency for clients accessing your databases. The region name is only returned in the response for single-region clusters. When MongoDB Cloud deploys a dedicated cluster, it checks if a VPC or VPC connection exists for that provider and region. If not, MongoDB Cloud creates them as part of the deployment. It assigns the VPC a Classless Inter-Domain Routing (CIDR) block. To limit a new VPC peering connection to one Classless Inter-Domain Routing (CIDR) block and region, create the connection first. Deploy the cluster after the connection starts. GCP Clusters and Multi-region clusters require one VPC peering connection for each region. MongoDB nodes can use only the peering connection that resides in the same region as the nodes to communicate with the peered VPC.
RegionName *string `json:"regionName,omitempty"`
AnalyticsAutoScaling *AdvancedAutoScalingSettings `json:"analyticsAutoScaling,omitempty"`
AnalyticsSpecs *DedicatedHardwareSpec `json:"analyticsSpecs,omitempty"`
AutoScaling *AdvancedAutoScalingSettings `json:"autoScaling,omitempty"`
ReadOnlySpecs *DedicatedHardwareSpec `json:"readOnlySpecs,omitempty"`
// Cloud service provider on which MongoDB Cloud provisioned the multi-tenant cluster. The resource returns this parameter when **providerName** is `TENANT` and **electableSpecs.instanceSize** is `M0`, `M2` or `M5`.
BackingProviderName *string `json:"backingProviderName,omitempty"`
}
// NewCloudRegionConfig instantiates a new CloudRegionConfig 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 NewCloudRegionConfig() *CloudRegionConfig {
this := CloudRegionConfig{}
return &this
}
// NewCloudRegionConfigWithDefaults instantiates a new CloudRegionConfig 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 NewCloudRegionConfigWithDefaults() *CloudRegionConfig {
this := CloudRegionConfig{}
return &this
}
// GetElectableSpecs returns the ElectableSpecs field value if set, zero value otherwise
func (o *CloudRegionConfig) GetElectableSpecs() HardwareSpec {
if o == nil || IsNil(o.ElectableSpecs) {
var ret HardwareSpec
return ret
}
return *o.ElectableSpecs
}
// GetElectableSpecsOk returns a tuple with the ElectableSpecs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CloudRegionConfig) GetElectableSpecsOk() (*HardwareSpec, bool) {
if o == nil || IsNil(o.ElectableSpecs) {
return nil, false
}
return o.ElectableSpecs, true
}
// HasElectableSpecs returns a boolean if a field has been set.
func (o *CloudRegionConfig) HasElectableSpecs() bool {
if o != nil && !IsNil(o.ElectableSpecs) {
return true
}
return false
}
// SetElectableSpecs gets a reference to the given HardwareSpec and assigns it to the ElectableSpecs field.
func (o *CloudRegionConfig) SetElectableSpecs(v HardwareSpec) {
o.ElectableSpecs = &v
}
// GetPriority returns the Priority field value if set, zero value otherwise
func (o *CloudRegionConfig) GetPriority() int {
if o == nil || IsNil(o.Priority) {
var ret int
return ret
}
return *o.Priority
}
// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CloudRegionConfig) GetPriorityOk() (*int, bool) {
if o == nil || IsNil(o.Priority) {
return nil, false
}
return o.Priority, true
}
// HasPriority returns a boolean if a field has been set.
func (o *CloudRegionConfig) HasPriority() bool {
if o != nil && !IsNil(o.Priority) {
return true
}
return false
}
// SetPriority gets a reference to the given int and assigns it to the Priority field.
func (o *CloudRegionConfig) SetPriority(v int) {
o.Priority = &v
}
// GetProviderName returns the ProviderName field value if set, zero value otherwise
func (o *CloudRegionConfig) GetProviderName() string {
if o == nil || IsNil(o.ProviderName) {
var ret string
return ret
}
return *o.ProviderName
}
// GetProviderNameOk returns a tuple with the ProviderName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CloudRegionConfig) GetProviderNameOk() (*string, bool) {
if o == nil || IsNil(o.ProviderName) {
return nil, false
}
return o.ProviderName, true
}
// HasProviderName returns a boolean if a field has been set.
func (o *CloudRegionConfig) HasProviderName() bool {
if o != nil && !IsNil(o.ProviderName) {
return true
}
return false
}
// SetProviderName gets a reference to the given string and assigns it to the ProviderName field.
func (o *CloudRegionConfig) SetProviderName(v string) {
o.ProviderName = &v
}
// GetRegionName returns the RegionName field value if set, zero value otherwise
func (o *CloudRegionConfig) GetRegionName() string {
if o == nil || IsNil(o.RegionName) {
var ret string
return ret
}
return *o.RegionName
}
// GetRegionNameOk returns a tuple with the RegionName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CloudRegionConfig) GetRegionNameOk() (*string, bool) {
if o == nil || IsNil(o.RegionName) {
return nil, false
}
return o.RegionName, true
}
// HasRegionName returns a boolean if a field has been set.
func (o *CloudRegionConfig) HasRegionName() bool {
if o != nil && !IsNil(o.RegionName) {
return true
}
return false
}
// SetRegionName gets a reference to the given string and assigns it to the RegionName field.
func (o *CloudRegionConfig) SetRegionName(v string) {
o.RegionName = &v
}
// GetAnalyticsAutoScaling returns the AnalyticsAutoScaling field value if set, zero value otherwise
func (o *CloudRegionConfig) GetAnalyticsAutoScaling() AdvancedAutoScalingSettings {
if o == nil || IsNil(o.AnalyticsAutoScaling) {
var ret AdvancedAutoScalingSettings
return ret
}
return *o.AnalyticsAutoScaling
}
// GetAnalyticsAutoScalingOk returns a tuple with the AnalyticsAutoScaling field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CloudRegionConfig) GetAnalyticsAutoScalingOk() (*AdvancedAutoScalingSettings, bool) {
if o == nil || IsNil(o.AnalyticsAutoScaling) {
return nil, false
}
return o.AnalyticsAutoScaling, true
}
// HasAnalyticsAutoScaling returns a boolean if a field has been set.
func (o *CloudRegionConfig) HasAnalyticsAutoScaling() bool {
if o != nil && !IsNil(o.AnalyticsAutoScaling) {
return true
}
return false
}
// SetAnalyticsAutoScaling gets a reference to the given AdvancedAutoScalingSettings and assigns it to the AnalyticsAutoScaling field.
func (o *CloudRegionConfig) SetAnalyticsAutoScaling(v AdvancedAutoScalingSettings) {
o.AnalyticsAutoScaling = &v
}
// GetAnalyticsSpecs returns the AnalyticsSpecs field value if set, zero value otherwise
func (o *CloudRegionConfig) GetAnalyticsSpecs() DedicatedHardwareSpec {
if o == nil || IsNil(o.AnalyticsSpecs) {
var ret DedicatedHardwareSpec
return ret
}
return *o.AnalyticsSpecs
}
// GetAnalyticsSpecsOk returns a tuple with the AnalyticsSpecs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CloudRegionConfig) GetAnalyticsSpecsOk() (*DedicatedHardwareSpec, bool) {
if o == nil || IsNil(o.AnalyticsSpecs) {
return nil, false
}
return o.AnalyticsSpecs, true
}
// HasAnalyticsSpecs returns a boolean if a field has been set.
func (o *CloudRegionConfig) HasAnalyticsSpecs() bool {
if o != nil && !IsNil(o.AnalyticsSpecs) {
return true
}
return false
}
// SetAnalyticsSpecs gets a reference to the given DedicatedHardwareSpec and assigns it to the AnalyticsSpecs field.
func (o *CloudRegionConfig) SetAnalyticsSpecs(v DedicatedHardwareSpec) {
o.AnalyticsSpecs = &v
}
// GetAutoScaling returns the AutoScaling field value if set, zero value otherwise
func (o *CloudRegionConfig) GetAutoScaling() AdvancedAutoScalingSettings {
if o == nil || IsNil(o.AutoScaling) {
var ret AdvancedAutoScalingSettings
return ret
}
return *o.AutoScaling
}
// GetAutoScalingOk returns a tuple with the AutoScaling field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CloudRegionConfig) GetAutoScalingOk() (*AdvancedAutoScalingSettings, bool) {
if o == nil || IsNil(o.AutoScaling) {
return nil, false
}
return o.AutoScaling, true
}
// HasAutoScaling returns a boolean if a field has been set.
func (o *CloudRegionConfig) HasAutoScaling() bool {
if o != nil && !IsNil(o.AutoScaling) {
return true
}
return false
}
// SetAutoScaling gets a reference to the given AdvancedAutoScalingSettings and assigns it to the AutoScaling field.
func (o *CloudRegionConfig) SetAutoScaling(v AdvancedAutoScalingSettings) {
o.AutoScaling = &v
}
// GetReadOnlySpecs returns the ReadOnlySpecs field value if set, zero value otherwise
func (o *CloudRegionConfig) GetReadOnlySpecs() DedicatedHardwareSpec {
if o == nil || IsNil(o.ReadOnlySpecs) {
var ret DedicatedHardwareSpec
return ret
}
return *o.ReadOnlySpecs
}
// GetReadOnlySpecsOk returns a tuple with the ReadOnlySpecs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CloudRegionConfig) GetReadOnlySpecsOk() (*DedicatedHardwareSpec, bool) {
if o == nil || IsNil(o.ReadOnlySpecs) {
return nil, false
}
return o.ReadOnlySpecs, true
}
// HasReadOnlySpecs returns a boolean if a field has been set.
func (o *CloudRegionConfig) HasReadOnlySpecs() bool {
if o != nil && !IsNil(o.ReadOnlySpecs) {
return true
}
return false
}
// SetReadOnlySpecs gets a reference to the given DedicatedHardwareSpec and assigns it to the ReadOnlySpecs field.
func (o *CloudRegionConfig) SetReadOnlySpecs(v DedicatedHardwareSpec) {
o.ReadOnlySpecs = &v
}
// GetBackingProviderName returns the BackingProviderName field value if set, zero value otherwise
func (o *CloudRegionConfig) GetBackingProviderName() string {
if o == nil || IsNil(o.BackingProviderName) {
var ret string
return ret
}
return *o.BackingProviderName
}
// GetBackingProviderNameOk returns a tuple with the BackingProviderName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CloudRegionConfig) GetBackingProviderNameOk() (*string, bool) {
if o == nil || IsNil(o.BackingProviderName) {
return nil, false
}
return o.BackingProviderName, true
}
// HasBackingProviderName returns a boolean if a field has been set.
func (o *CloudRegionConfig) HasBackingProviderName() bool {
if o != nil && !IsNil(o.BackingProviderName) {
return true
}
return false
}
// SetBackingProviderName gets a reference to the given string and assigns it to the BackingProviderName field.
func (o *CloudRegionConfig) SetBackingProviderName(v string) {
o.BackingProviderName = &v
}
func (o CloudRegionConfig) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CloudRegionConfig) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ElectableSpecs) {
toSerialize["electableSpecs"] = o.ElectableSpecs
}
if !IsNil(o.Priority) {
toSerialize["priority"] = o.Priority
}
if !IsNil(o.ProviderName) {
toSerialize["providerName"] = o.ProviderName
}
if !IsNil(o.RegionName) {
toSerialize["regionName"] = o.RegionName
}
if !IsNil(o.AnalyticsAutoScaling) {
toSerialize["analyticsAutoScaling"] = o.AnalyticsAutoScaling
}
if !IsNil(o.AnalyticsSpecs) {
toSerialize["analyticsSpecs"] = o.AnalyticsSpecs
}
if !IsNil(o.AutoScaling) {
toSerialize["autoScaling"] = o.AutoScaling
}
if !IsNil(o.ReadOnlySpecs) {
toSerialize["readOnlySpecs"] = o.ReadOnlySpecs
}
if !IsNil(o.BackingProviderName) {
toSerialize["backingProviderName"] = o.BackingProviderName
}
return toSerialize, nil
}