-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_database_rolling_index_request.go
211 lines (179 loc) · 5.9 KB
/
model_database_rolling_index_request.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
// Code based on the AtlasAPI V2 OpenAPI file
package admin
import (
"encoding/json"
)
// DatabaseRollingIndexRequest struct for DatabaseRollingIndexRequest
type DatabaseRollingIndexRequest struct {
Collation *Collation `json:"collation,omitempty"`
// Human-readable label of the collection for which MongoDB Cloud creates an index.
// Write only field.
Collection string `json:"collection"`
// Human-readable label of the database that holds the collection on which MongoDB Cloud creates an index.
// Write only field.
Db string `json:"db"`
// List that contains one or more objects that describe the parameters that you want to index.
// Write only field.
Keys *[]map[string]string `json:"keys,omitempty"`
Options *IndexOptions `json:"options,omitempty"`
}
// NewDatabaseRollingIndexRequest instantiates a new DatabaseRollingIndexRequest 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 NewDatabaseRollingIndexRequest(collection string, db string) *DatabaseRollingIndexRequest {
this := DatabaseRollingIndexRequest{}
this.Collection = collection
this.Db = db
return &this
}
// NewDatabaseRollingIndexRequestWithDefaults instantiates a new DatabaseRollingIndexRequest 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 NewDatabaseRollingIndexRequestWithDefaults() *DatabaseRollingIndexRequest {
this := DatabaseRollingIndexRequest{}
return &this
}
// GetCollation returns the Collation field value if set, zero value otherwise
func (o *DatabaseRollingIndexRequest) GetCollation() Collation {
if o == nil || IsNil(o.Collation) {
var ret Collation
return ret
}
return *o.Collation
}
// GetCollationOk returns a tuple with the Collation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DatabaseRollingIndexRequest) GetCollationOk() (*Collation, bool) {
if o == nil || IsNil(o.Collation) {
return nil, false
}
return o.Collation, true
}
// HasCollation returns a boolean if a field has been set.
func (o *DatabaseRollingIndexRequest) HasCollation() bool {
if o != nil && !IsNil(o.Collation) {
return true
}
return false
}
// SetCollation gets a reference to the given Collation and assigns it to the Collation field.
func (o *DatabaseRollingIndexRequest) SetCollation(v Collation) {
o.Collation = &v
}
// GetCollection returns the Collection field value
func (o *DatabaseRollingIndexRequest) 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 *DatabaseRollingIndexRequest) GetCollectionOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Collection, true
}
// SetCollection sets field value
func (o *DatabaseRollingIndexRequest) SetCollection(v string) {
o.Collection = v
}
// GetDb returns the Db field value
func (o *DatabaseRollingIndexRequest) 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 *DatabaseRollingIndexRequest) GetDbOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Db, true
}
// SetDb sets field value
func (o *DatabaseRollingIndexRequest) SetDb(v string) {
o.Db = v
}
// GetKeys returns the Keys field value if set, zero value otherwise
func (o *DatabaseRollingIndexRequest) GetKeys() []map[string]string {
if o == nil || IsNil(o.Keys) {
var ret []map[string]string
return ret
}
return *o.Keys
}
// GetKeysOk returns a tuple with the Keys field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DatabaseRollingIndexRequest) GetKeysOk() (*[]map[string]string, bool) {
if o == nil || IsNil(o.Keys) {
return nil, false
}
return o.Keys, true
}
// HasKeys returns a boolean if a field has been set.
func (o *DatabaseRollingIndexRequest) HasKeys() bool {
if o != nil && !IsNil(o.Keys) {
return true
}
return false
}
// SetKeys gets a reference to the given []map[string]string and assigns it to the Keys field.
func (o *DatabaseRollingIndexRequest) SetKeys(v []map[string]string) {
o.Keys = &v
}
// GetOptions returns the Options field value if set, zero value otherwise
func (o *DatabaseRollingIndexRequest) GetOptions() IndexOptions {
if o == nil || IsNil(o.Options) {
var ret IndexOptions
return ret
}
return *o.Options
}
// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DatabaseRollingIndexRequest) GetOptionsOk() (*IndexOptions, bool) {
if o == nil || IsNil(o.Options) {
return nil, false
}
return o.Options, true
}
// HasOptions returns a boolean if a field has been set.
func (o *DatabaseRollingIndexRequest) HasOptions() bool {
if o != nil && !IsNil(o.Options) {
return true
}
return false
}
// SetOptions gets a reference to the given IndexOptions and assigns it to the Options field.
func (o *DatabaseRollingIndexRequest) SetOptions(v IndexOptions) {
o.Options = &v
}
func (o DatabaseRollingIndexRequest) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DatabaseRollingIndexRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Collation) {
toSerialize["collation"] = o.Collation
}
toSerialize["collection"] = o.Collection
toSerialize["db"] = o.Db
if !IsNil(o.Keys) {
toSerialize["keys"] = o.Keys
}
if !IsNil(o.Options) {
toSerialize["options"] = o.Options
}
return toSerialize, nil
}