-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_managed_namespaces.go
292 lines (250 loc) · 9.44 KB
/
model_managed_namespaces.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
// Code based on the AtlasAPI V2 OpenAPI file
package admin
import (
"encoding/json"
)
// ManagedNamespaces struct for ManagedNamespaces
type ManagedNamespaces struct {
// Human-readable label of the collection to manage for this Global Cluster.
Collection string `json:"collection"`
// Database parameter used to divide the *collection* into shards. Global clusters require a compound shard key. This compound shard key combines the location parameter and the user-selected custom key.
// Read only field.
CustomShardKey string `json:"customShardKey"`
// Human-readable label of the database to manage for this Global Cluster.
Db string `json:"db"`
// Flag that indicates whether someone hashed the custom shard key for the specified collection. If you set this value to `false`, MongoDB Cloud uses ranged sharding.
// Write only field.
IsCustomShardKeyHashed *bool `json:"isCustomShardKeyHashed,omitempty"`
// Flag that indicates whether someone [hashed](https://www.mongodb.com/docs/manual/reference/method/sh.shardCollection/#hashed-shard-keys) the custom shard key. If this parameter returns `false`, this cluster uses [ranged sharding](https://www.mongodb.com/docs/manual/core/ranged-sharding/).
// Write only field.
IsShardKeyUnique *bool `json:"isShardKeyUnique,omitempty"`
// Minimum number of chunks to create initially when sharding an empty collection with a [hashed shard key](https://www.mongodb.com/docs/manual/core/hashed-sharding/).
// Write only field.
NumInitialChunks *int64 `json:"numInitialChunks,omitempty"`
// Flag that indicates whether MongoDB Cloud should create and distribute initial chunks for an empty or non-existing collection. MongoDB Cloud distributes data based on the defined zones and zone ranges for the collection.
// Write only field.
PresplitHashedZones *bool `json:"presplitHashedZones,omitempty"`
}
// NewManagedNamespaces instantiates a new ManagedNamespaces 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 NewManagedNamespaces(collection string, customShardKey string, db string) *ManagedNamespaces {
this := ManagedNamespaces{}
this.Collection = collection
this.CustomShardKey = customShardKey
this.Db = db
var isCustomShardKeyHashed bool = false
this.IsCustomShardKeyHashed = &isCustomShardKeyHashed
var isShardKeyUnique bool = false
this.IsShardKeyUnique = &isShardKeyUnique
var presplitHashedZones bool = false
this.PresplitHashedZones = &presplitHashedZones
return &this
}
// NewManagedNamespacesWithDefaults instantiates a new ManagedNamespaces 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 NewManagedNamespacesWithDefaults() *ManagedNamespaces {
this := ManagedNamespaces{}
var isCustomShardKeyHashed bool = false
this.IsCustomShardKeyHashed = &isCustomShardKeyHashed
var isShardKeyUnique bool = false
this.IsShardKeyUnique = &isShardKeyUnique
var presplitHashedZones bool = false
this.PresplitHashedZones = &presplitHashedZones
return &this
}
// GetCollection returns the Collection field value
func (o *ManagedNamespaces) GetCollection() string {
if o == nil {
var ret string
return ret
}
return o.Collection
}
// GetCollectionOk returns a tuple with the Collection field value
// and a boolean to check if the value has been set.
func (o *ManagedNamespaces) GetCollectionOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Collection, true
}
// SetCollection sets field value
func (o *ManagedNamespaces) SetCollection(v string) {
o.Collection = v
}
// GetCustomShardKey returns the CustomShardKey field value
func (o *ManagedNamespaces) GetCustomShardKey() string {
if o == nil {
var ret string
return ret
}
return o.CustomShardKey
}
// GetCustomShardKeyOk returns a tuple with the CustomShardKey field value
// and a boolean to check if the value has been set.
func (o *ManagedNamespaces) GetCustomShardKeyOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CustomShardKey, true
}
// SetCustomShardKey sets field value
func (o *ManagedNamespaces) SetCustomShardKey(v string) {
o.CustomShardKey = v
}
// GetDb returns the Db field value
func (o *ManagedNamespaces) GetDb() string {
if o == nil {
var ret string
return ret
}
return o.Db
}
// GetDbOk returns a tuple with the Db field value
// and a boolean to check if the value has been set.
func (o *ManagedNamespaces) GetDbOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Db, true
}
// SetDb sets field value
func (o *ManagedNamespaces) SetDb(v string) {
o.Db = v
}
// GetIsCustomShardKeyHashed returns the IsCustomShardKeyHashed field value if set, zero value otherwise
func (o *ManagedNamespaces) GetIsCustomShardKeyHashed() bool {
if o == nil || IsNil(o.IsCustomShardKeyHashed) {
var ret bool
return ret
}
return *o.IsCustomShardKeyHashed
}
// GetIsCustomShardKeyHashedOk returns a tuple with the IsCustomShardKeyHashed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ManagedNamespaces) GetIsCustomShardKeyHashedOk() (*bool, bool) {
if o == nil || IsNil(o.IsCustomShardKeyHashed) {
return nil, false
}
return o.IsCustomShardKeyHashed, true
}
// HasIsCustomShardKeyHashed returns a boolean if a field has been set.
func (o *ManagedNamespaces) HasIsCustomShardKeyHashed() bool {
if o != nil && !IsNil(o.IsCustomShardKeyHashed) {
return true
}
return false
}
// SetIsCustomShardKeyHashed gets a reference to the given bool and assigns it to the IsCustomShardKeyHashed field.
func (o *ManagedNamespaces) SetIsCustomShardKeyHashed(v bool) {
o.IsCustomShardKeyHashed = &v
}
// GetIsShardKeyUnique returns the IsShardKeyUnique field value if set, zero value otherwise
func (o *ManagedNamespaces) GetIsShardKeyUnique() bool {
if o == nil || IsNil(o.IsShardKeyUnique) {
var ret bool
return ret
}
return *o.IsShardKeyUnique
}
// GetIsShardKeyUniqueOk returns a tuple with the IsShardKeyUnique field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ManagedNamespaces) GetIsShardKeyUniqueOk() (*bool, bool) {
if o == nil || IsNil(o.IsShardKeyUnique) {
return nil, false
}
return o.IsShardKeyUnique, true
}
// HasIsShardKeyUnique returns a boolean if a field has been set.
func (o *ManagedNamespaces) HasIsShardKeyUnique() bool {
if o != nil && !IsNil(o.IsShardKeyUnique) {
return true
}
return false
}
// SetIsShardKeyUnique gets a reference to the given bool and assigns it to the IsShardKeyUnique field.
func (o *ManagedNamespaces) SetIsShardKeyUnique(v bool) {
o.IsShardKeyUnique = &v
}
// GetNumInitialChunks returns the NumInitialChunks field value if set, zero value otherwise
func (o *ManagedNamespaces) GetNumInitialChunks() int64 {
if o == nil || IsNil(o.NumInitialChunks) {
var ret int64
return ret
}
return *o.NumInitialChunks
}
// GetNumInitialChunksOk returns a tuple with the NumInitialChunks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ManagedNamespaces) GetNumInitialChunksOk() (*int64, bool) {
if o == nil || IsNil(o.NumInitialChunks) {
return nil, false
}
return o.NumInitialChunks, true
}
// HasNumInitialChunks returns a boolean if a field has been set.
func (o *ManagedNamespaces) HasNumInitialChunks() bool {
if o != nil && !IsNil(o.NumInitialChunks) {
return true
}
return false
}
// SetNumInitialChunks gets a reference to the given int64 and assigns it to the NumInitialChunks field.
func (o *ManagedNamespaces) SetNumInitialChunks(v int64) {
o.NumInitialChunks = &v
}
// GetPresplitHashedZones returns the PresplitHashedZones field value if set, zero value otherwise
func (o *ManagedNamespaces) GetPresplitHashedZones() bool {
if o == nil || IsNil(o.PresplitHashedZones) {
var ret bool
return ret
}
return *o.PresplitHashedZones
}
// GetPresplitHashedZonesOk returns a tuple with the PresplitHashedZones field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ManagedNamespaces) GetPresplitHashedZonesOk() (*bool, bool) {
if o == nil || IsNil(o.PresplitHashedZones) {
return nil, false
}
return o.PresplitHashedZones, true
}
// HasPresplitHashedZones returns a boolean if a field has been set.
func (o *ManagedNamespaces) HasPresplitHashedZones() bool {
if o != nil && !IsNil(o.PresplitHashedZones) {
return true
}
return false
}
// SetPresplitHashedZones gets a reference to the given bool and assigns it to the PresplitHashedZones field.
func (o *ManagedNamespaces) SetPresplitHashedZones(v bool) {
o.PresplitHashedZones = &v
}
func (o ManagedNamespaces) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ManagedNamespaces) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["collection"] = o.Collection
toSerialize["db"] = o.Db
if !IsNil(o.IsCustomShardKeyHashed) {
toSerialize["isCustomShardKeyHashed"] = o.IsCustomShardKeyHashed
}
if !IsNil(o.IsShardKeyUnique) {
toSerialize["isShardKeyUnique"] = o.IsShardKeyUnique
}
if !IsNil(o.NumInitialChunks) {
toSerialize["numInitialChunks"] = o.NumInitialChunks
}
if !IsNil(o.PresplitHashedZones) {
toSerialize["presplitHashedZones"] = o.PresplitHashedZones
}
return toSerialize, nil
}