-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_legacy_replication_spec.go
196 lines (166 loc) · 6.58 KB
/
model_legacy_replication_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
193
194
195
196
// Code based on the AtlasAPI V2 OpenAPI file
package admin
import (
"encoding/json"
)
// LegacyReplicationSpec struct for LegacyReplicationSpec
type LegacyReplicationSpec struct {
// Unique 24-hexadecimal digit string that identifies the replication object for a zone in a Global Cluster. - If you include existing zones in the request, you must specify this parameter. - If you add a new zone to an existing Global Cluster, you may specify this parameter. The request deletes any existing zones in a Global Cluster that you exclude from the request.
Id *string `json:"id,omitempty"`
// Positive integer that specifies the number of shards to deploy in each specified zone If you set this value to `1` and **clusterType** is `SHARDED`, MongoDB Cloud deploys a single-shard sharded cluster. Don't create a sharded cluster with a single shard for production environments. Single-shard sharded clusters don't provide the same benefits as multi-shard configurations. If you are upgrading a replica set to a sharded cluster, you cannot increase the number of shards in the same update request. You should wait until after the cluster has completed upgrading to sharded and you have reconnected all application clients to the MongoDB router before adding additional shards. Otherwise, your data might become inconsistent once MongoDB Cloud begins distributing data across shards.
NumShards *int `json:"numShards,omitempty"`
// Physical location where MongoDB Cloud provisions cluster nodes.
RegionsConfig *map[string]RegionSpec `json:"regionsConfig,omitempty"`
// Human-readable label that identifies the zone in a Global Cluster. Provide this value only if **clusterType** is `GEOSHARDED`.
ZoneName *string `json:"zoneName,omitempty"`
}
// NewLegacyReplicationSpec instantiates a new LegacyReplicationSpec 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 NewLegacyReplicationSpec() *LegacyReplicationSpec {
this := LegacyReplicationSpec{}
var numShards int = 1
this.NumShards = &numShards
return &this
}
// NewLegacyReplicationSpecWithDefaults instantiates a new LegacyReplicationSpec 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 NewLegacyReplicationSpecWithDefaults() *LegacyReplicationSpec {
this := LegacyReplicationSpec{}
var numShards int = 1
this.NumShards = &numShards
return &this
}
// GetId returns the Id field value if set, zero value otherwise
func (o *LegacyReplicationSpec) 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 *LegacyReplicationSpec) 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 *LegacyReplicationSpec) 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 *LegacyReplicationSpec) SetId(v string) {
o.Id = &v
}
// GetNumShards returns the NumShards field value if set, zero value otherwise
func (o *LegacyReplicationSpec) GetNumShards() int {
if o == nil || IsNil(o.NumShards) {
var ret int
return ret
}
return *o.NumShards
}
// GetNumShardsOk returns a tuple with the NumShards field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LegacyReplicationSpec) GetNumShardsOk() (*int, bool) {
if o == nil || IsNil(o.NumShards) {
return nil, false
}
return o.NumShards, true
}
// HasNumShards returns a boolean if a field has been set.
func (o *LegacyReplicationSpec) HasNumShards() bool {
if o != nil && !IsNil(o.NumShards) {
return true
}
return false
}
// SetNumShards gets a reference to the given int and assigns it to the NumShards field.
func (o *LegacyReplicationSpec) SetNumShards(v int) {
o.NumShards = &v
}
// GetRegionsConfig returns the RegionsConfig field value if set, zero value otherwise
func (o *LegacyReplicationSpec) GetRegionsConfig() map[string]RegionSpec {
if o == nil || IsNil(o.RegionsConfig) {
var ret map[string]RegionSpec
return ret
}
return *o.RegionsConfig
}
// GetRegionsConfigOk returns a tuple with the RegionsConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LegacyReplicationSpec) GetRegionsConfigOk() (*map[string]RegionSpec, bool) {
if o == nil || IsNil(o.RegionsConfig) {
return nil, false
}
return o.RegionsConfig, true
}
// HasRegionsConfig returns a boolean if a field has been set.
func (o *LegacyReplicationSpec) HasRegionsConfig() bool {
if o != nil && !IsNil(o.RegionsConfig) {
return true
}
return false
}
// SetRegionsConfig gets a reference to the given map[string]RegionSpec and assigns it to the RegionsConfig field.
func (o *LegacyReplicationSpec) SetRegionsConfig(v map[string]RegionSpec) {
o.RegionsConfig = &v
}
// GetZoneName returns the ZoneName field value if set, zero value otherwise
func (o *LegacyReplicationSpec) GetZoneName() string {
if o == nil || IsNil(o.ZoneName) {
var ret string
return ret
}
return *o.ZoneName
}
// GetZoneNameOk returns a tuple with the ZoneName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LegacyReplicationSpec) GetZoneNameOk() (*string, bool) {
if o == nil || IsNil(o.ZoneName) {
return nil, false
}
return o.ZoneName, true
}
// HasZoneName returns a boolean if a field has been set.
func (o *LegacyReplicationSpec) HasZoneName() bool {
if o != nil && !IsNil(o.ZoneName) {
return true
}
return false
}
// SetZoneName gets a reference to the given string and assigns it to the ZoneName field.
func (o *LegacyReplicationSpec) SetZoneName(v string) {
o.ZoneName = &v
}
func (o LegacyReplicationSpec) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LegacyReplicationSpec) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.NumShards) {
toSerialize["numShards"] = o.NumShards
}
if !IsNil(o.RegionsConfig) {
toSerialize["regionsConfig"] = o.RegionsConfig
}
if !IsNil(o.ZoneName) {
toSerialize["zoneName"] = o.ZoneName
}
return toSerialize, nil
}