/
model_region_spec.go
192 lines (162 loc) · 6 KB
/
model_region_spec.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
// Code based on the AtlasAPI V2 OpenAPI file
package admin
import (
"encoding/json"
)
// RegionSpec Physical location where MongoDB Cloud provisions cluster nodes.
type RegionSpec struct {
// Number of analytics nodes in the region. Analytics nodes handle analytic data such as reporting queries from MongoDB Connector for Business Intelligence on MongoDB Cloud. Analytics nodes are read-only, and can never become the primary. Use **replicationSpecs[n].{region}.analyticsNodes** instead.
AnalyticsNodes *int `json:"analyticsNodes,omitempty"`
// Number of electable nodes to deploy in the specified region. Electable nodes can become the primary and can facilitate local reads. Use **replicationSpecs[n].{region}.electableNodes** instead.
ElectableNodes *int `json:"electableNodes,omitempty"`
// Number that indicates the election priority of the region. To identify the Preferred Region of the cluster, set this parameter to `7`. The primary node runs in the **Preferred Region**. To identify a read-only region, set this parameter to `0`.
Priority *int `json:"priority,omitempty"`
// Number of read-only nodes in the region. Read-only nodes can never become the primary member, but can facilitate local reads. Use **replicationSpecs[n].{region}.readOnlyNodes** instead.
ReadOnlyNodes *int `json:"readOnlyNodes,omitempty"`
}
// NewRegionSpec instantiates a new RegionSpec 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 NewRegionSpec() *RegionSpec {
this := RegionSpec{}
return &this
}
// NewRegionSpecWithDefaults instantiates a new RegionSpec 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 NewRegionSpecWithDefaults() *RegionSpec {
this := RegionSpec{}
return &this
}
// GetAnalyticsNodes returns the AnalyticsNodes field value if set, zero value otherwise
func (o *RegionSpec) GetAnalyticsNodes() int {
if o == nil || IsNil(o.AnalyticsNodes) {
var ret int
return ret
}
return *o.AnalyticsNodes
}
// GetAnalyticsNodesOk returns a tuple with the AnalyticsNodes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegionSpec) GetAnalyticsNodesOk() (*int, bool) {
if o == nil || IsNil(o.AnalyticsNodes) {
return nil, false
}
return o.AnalyticsNodes, true
}
// HasAnalyticsNodes returns a boolean if a field has been set.
func (o *RegionSpec) HasAnalyticsNodes() bool {
if o != nil && !IsNil(o.AnalyticsNodes) {
return true
}
return false
}
// SetAnalyticsNodes gets a reference to the given int and assigns it to the AnalyticsNodes field.
func (o *RegionSpec) SetAnalyticsNodes(v int) {
o.AnalyticsNodes = &v
}
// GetElectableNodes returns the ElectableNodes field value if set, zero value otherwise
func (o *RegionSpec) GetElectableNodes() int {
if o == nil || IsNil(o.ElectableNodes) {
var ret int
return ret
}
return *o.ElectableNodes
}
// GetElectableNodesOk returns a tuple with the ElectableNodes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegionSpec) GetElectableNodesOk() (*int, bool) {
if o == nil || IsNil(o.ElectableNodes) {
return nil, false
}
return o.ElectableNodes, true
}
// HasElectableNodes returns a boolean if a field has been set.
func (o *RegionSpec) HasElectableNodes() bool {
if o != nil && !IsNil(o.ElectableNodes) {
return true
}
return false
}
// SetElectableNodes gets a reference to the given int and assigns it to the ElectableNodes field.
func (o *RegionSpec) SetElectableNodes(v int) {
o.ElectableNodes = &v
}
// GetPriority returns the Priority field value if set, zero value otherwise
func (o *RegionSpec) 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 *RegionSpec) 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 *RegionSpec) 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 *RegionSpec) SetPriority(v int) {
o.Priority = &v
}
// GetReadOnlyNodes returns the ReadOnlyNodes field value if set, zero value otherwise
func (o *RegionSpec) GetReadOnlyNodes() int {
if o == nil || IsNil(o.ReadOnlyNodes) {
var ret int
return ret
}
return *o.ReadOnlyNodes
}
// GetReadOnlyNodesOk returns a tuple with the ReadOnlyNodes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RegionSpec) GetReadOnlyNodesOk() (*int, bool) {
if o == nil || IsNil(o.ReadOnlyNodes) {
return nil, false
}
return o.ReadOnlyNodes, true
}
// HasReadOnlyNodes returns a boolean if a field has been set.
func (o *RegionSpec) HasReadOnlyNodes() bool {
if o != nil && !IsNil(o.ReadOnlyNodes) {
return true
}
return false
}
// SetReadOnlyNodes gets a reference to the given int and assigns it to the ReadOnlyNodes field.
func (o *RegionSpec) SetReadOnlyNodes(v int) {
o.ReadOnlyNodes = &v
}
func (o RegionSpec) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RegionSpec) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AnalyticsNodes) {
toSerialize["analyticsNodes"] = o.AnalyticsNodes
}
if !IsNil(o.ElectableNodes) {
toSerialize["electableNodes"] = o.ElectableNodes
}
if !IsNil(o.Priority) {
toSerialize["priority"] = o.Priority
}
if !IsNil(o.ReadOnlyNodes) {
toSerialize["readOnlyNodes"] = o.ReadOnlyNodes
}
return toSerialize, nil
}