-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_api_atlas_snapshot_schedule.go
328 lines (280 loc) · 11.1 KB
/
model_api_atlas_snapshot_schedule.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
// Code based on the AtlasAPI V2 OpenAPI file
package admin
import (
"encoding/json"
)
// ApiAtlasSnapshotSchedule struct for ApiAtlasSnapshotSchedule
type ApiAtlasSnapshotSchedule struct {
// Quantity of time expressed in minutes between successive cluster checkpoints. This parameter applies only to sharded clusters. This number determines the granularity of continuous cloud backups for sharded clusters.
ClusterCheckpointIntervalMin int `json:"clusterCheckpointIntervalMin"`
// Unique 24-hexadecimal digit string that identifies the cluster with the snapshot you want to return.
ClusterId string `json:"clusterId"`
// Quantity of time to keep daily snapshots. MongoDB Cloud expresses this value in days. Set this value to `0` to disable daily snapshot retention.
DailySnapshotRetentionDays int `json:"dailySnapshotRetentionDays"`
// Unique 24-hexadecimal digit string that identifies the project that contains the cluster.
// Read only field.
GroupId string `json:"groupId"`
// List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships.
// Read only field.
Links *[]Link `json:"links,omitempty"`
// Number of months that MongoDB Cloud must keep monthly snapshots. Set this value to `0` to disable monthly snapshot retention.
MonthlySnapshotRetentionMonths int `json:"monthlySnapshotRetentionMonths"`
// Number of hours before the current time from which MongoDB Cloud can create a Continuous Cloud Backup snapshot.
PointInTimeWindowHours int `json:"pointInTimeWindowHours"`
// Number of hours that must elapse before taking another snapshot.
SnapshotIntervalHours int `json:"snapshotIntervalHours"`
// Number of days that MongoDB Cloud must keep recent snapshots.
SnapshotRetentionDays int `json:"snapshotRetentionDays"`
// Number of weeks that MongoDB Cloud must keep weekly snapshots. Set this value to `0` to disable weekly snapshot retention.
WeeklySnapshotRetentionWeeks int `json:"weeklySnapshotRetentionWeeks"`
}
// NewApiAtlasSnapshotSchedule instantiates a new ApiAtlasSnapshotSchedule 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 NewApiAtlasSnapshotSchedule(clusterCheckpointIntervalMin int, clusterId string, dailySnapshotRetentionDays int, groupId string, monthlySnapshotRetentionMonths int, pointInTimeWindowHours int, snapshotIntervalHours int, snapshotRetentionDays int, weeklySnapshotRetentionWeeks int) *ApiAtlasSnapshotSchedule {
this := ApiAtlasSnapshotSchedule{}
this.ClusterCheckpointIntervalMin = clusterCheckpointIntervalMin
this.ClusterId = clusterId
this.DailySnapshotRetentionDays = dailySnapshotRetentionDays
this.GroupId = groupId
this.MonthlySnapshotRetentionMonths = monthlySnapshotRetentionMonths
this.PointInTimeWindowHours = pointInTimeWindowHours
this.SnapshotIntervalHours = snapshotIntervalHours
this.SnapshotRetentionDays = snapshotRetentionDays
this.WeeklySnapshotRetentionWeeks = weeklySnapshotRetentionWeeks
return &this
}
// NewApiAtlasSnapshotScheduleWithDefaults instantiates a new ApiAtlasSnapshotSchedule 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 NewApiAtlasSnapshotScheduleWithDefaults() *ApiAtlasSnapshotSchedule {
this := ApiAtlasSnapshotSchedule{}
return &this
}
// GetClusterCheckpointIntervalMin returns the ClusterCheckpointIntervalMin field value
func (o *ApiAtlasSnapshotSchedule) GetClusterCheckpointIntervalMin() int {
if o == nil {
var ret int
return ret
}
return o.ClusterCheckpointIntervalMin
}
// GetClusterCheckpointIntervalMinOk returns a tuple with the ClusterCheckpointIntervalMin field value
// and a boolean to check if the value has been set.
func (o *ApiAtlasSnapshotSchedule) GetClusterCheckpointIntervalMinOk() (*int, bool) {
if o == nil {
return nil, false
}
return &o.ClusterCheckpointIntervalMin, true
}
// SetClusterCheckpointIntervalMin sets field value
func (o *ApiAtlasSnapshotSchedule) SetClusterCheckpointIntervalMin(v int) {
o.ClusterCheckpointIntervalMin = v
}
// GetClusterId returns the ClusterId field value
func (o *ApiAtlasSnapshotSchedule) GetClusterId() string {
if o == nil {
var ret string
return ret
}
return o.ClusterId
}
// GetClusterIdOk returns a tuple with the ClusterId field value
// and a boolean to check if the value has been set.
func (o *ApiAtlasSnapshotSchedule) GetClusterIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ClusterId, true
}
// SetClusterId sets field value
func (o *ApiAtlasSnapshotSchedule) SetClusterId(v string) {
o.ClusterId = v
}
// GetDailySnapshotRetentionDays returns the DailySnapshotRetentionDays field value
func (o *ApiAtlasSnapshotSchedule) GetDailySnapshotRetentionDays() int {
if o == nil {
var ret int
return ret
}
return o.DailySnapshotRetentionDays
}
// GetDailySnapshotRetentionDaysOk returns a tuple with the DailySnapshotRetentionDays field value
// and a boolean to check if the value has been set.
func (o *ApiAtlasSnapshotSchedule) GetDailySnapshotRetentionDaysOk() (*int, bool) {
if o == nil {
return nil, false
}
return &o.DailySnapshotRetentionDays, true
}
// SetDailySnapshotRetentionDays sets field value
func (o *ApiAtlasSnapshotSchedule) SetDailySnapshotRetentionDays(v int) {
o.DailySnapshotRetentionDays = v
}
// GetGroupId returns the GroupId field value
func (o *ApiAtlasSnapshotSchedule) GetGroupId() string {
if o == nil {
var ret string
return ret
}
return o.GroupId
}
// GetGroupIdOk returns a tuple with the GroupId field value
// and a boolean to check if the value has been set.
func (o *ApiAtlasSnapshotSchedule) GetGroupIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.GroupId, true
}
// SetGroupId sets field value
func (o *ApiAtlasSnapshotSchedule) SetGroupId(v string) {
o.GroupId = v
}
// GetLinks returns the Links field value if set, zero value otherwise
func (o *ApiAtlasSnapshotSchedule) GetLinks() []Link {
if o == nil || IsNil(o.Links) {
var ret []Link
return ret
}
return *o.Links
}
// GetLinksOk returns a tuple with the Links field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApiAtlasSnapshotSchedule) GetLinksOk() (*[]Link, bool) {
if o == nil || IsNil(o.Links) {
return nil, false
}
return o.Links, true
}
// HasLinks returns a boolean if a field has been set.
func (o *ApiAtlasSnapshotSchedule) HasLinks() bool {
if o != nil && !IsNil(o.Links) {
return true
}
return false
}
// SetLinks gets a reference to the given []Link and assigns it to the Links field.
func (o *ApiAtlasSnapshotSchedule) SetLinks(v []Link) {
o.Links = &v
}
// GetMonthlySnapshotRetentionMonths returns the MonthlySnapshotRetentionMonths field value
func (o *ApiAtlasSnapshotSchedule) GetMonthlySnapshotRetentionMonths() int {
if o == nil {
var ret int
return ret
}
return o.MonthlySnapshotRetentionMonths
}
// GetMonthlySnapshotRetentionMonthsOk returns a tuple with the MonthlySnapshotRetentionMonths field value
// and a boolean to check if the value has been set.
func (o *ApiAtlasSnapshotSchedule) GetMonthlySnapshotRetentionMonthsOk() (*int, bool) {
if o == nil {
return nil, false
}
return &o.MonthlySnapshotRetentionMonths, true
}
// SetMonthlySnapshotRetentionMonths sets field value
func (o *ApiAtlasSnapshotSchedule) SetMonthlySnapshotRetentionMonths(v int) {
o.MonthlySnapshotRetentionMonths = v
}
// GetPointInTimeWindowHours returns the PointInTimeWindowHours field value
func (o *ApiAtlasSnapshotSchedule) GetPointInTimeWindowHours() int {
if o == nil {
var ret int
return ret
}
return o.PointInTimeWindowHours
}
// GetPointInTimeWindowHoursOk returns a tuple with the PointInTimeWindowHours field value
// and a boolean to check if the value has been set.
func (o *ApiAtlasSnapshotSchedule) GetPointInTimeWindowHoursOk() (*int, bool) {
if o == nil {
return nil, false
}
return &o.PointInTimeWindowHours, true
}
// SetPointInTimeWindowHours sets field value
func (o *ApiAtlasSnapshotSchedule) SetPointInTimeWindowHours(v int) {
o.PointInTimeWindowHours = v
}
// GetSnapshotIntervalHours returns the SnapshotIntervalHours field value
func (o *ApiAtlasSnapshotSchedule) GetSnapshotIntervalHours() int {
if o == nil {
var ret int
return ret
}
return o.SnapshotIntervalHours
}
// GetSnapshotIntervalHoursOk returns a tuple with the SnapshotIntervalHours field value
// and a boolean to check if the value has been set.
func (o *ApiAtlasSnapshotSchedule) GetSnapshotIntervalHoursOk() (*int, bool) {
if o == nil {
return nil, false
}
return &o.SnapshotIntervalHours, true
}
// SetSnapshotIntervalHours sets field value
func (o *ApiAtlasSnapshotSchedule) SetSnapshotIntervalHours(v int) {
o.SnapshotIntervalHours = v
}
// GetSnapshotRetentionDays returns the SnapshotRetentionDays field value
func (o *ApiAtlasSnapshotSchedule) GetSnapshotRetentionDays() int {
if o == nil {
var ret int
return ret
}
return o.SnapshotRetentionDays
}
// GetSnapshotRetentionDaysOk returns a tuple with the SnapshotRetentionDays field value
// and a boolean to check if the value has been set.
func (o *ApiAtlasSnapshotSchedule) GetSnapshotRetentionDaysOk() (*int, bool) {
if o == nil {
return nil, false
}
return &o.SnapshotRetentionDays, true
}
// SetSnapshotRetentionDays sets field value
func (o *ApiAtlasSnapshotSchedule) SetSnapshotRetentionDays(v int) {
o.SnapshotRetentionDays = v
}
// GetWeeklySnapshotRetentionWeeks returns the WeeklySnapshotRetentionWeeks field value
func (o *ApiAtlasSnapshotSchedule) GetWeeklySnapshotRetentionWeeks() int {
if o == nil {
var ret int
return ret
}
return o.WeeklySnapshotRetentionWeeks
}
// GetWeeklySnapshotRetentionWeeksOk returns a tuple with the WeeklySnapshotRetentionWeeks field value
// and a boolean to check if the value has been set.
func (o *ApiAtlasSnapshotSchedule) GetWeeklySnapshotRetentionWeeksOk() (*int, bool) {
if o == nil {
return nil, false
}
return &o.WeeklySnapshotRetentionWeeks, true
}
// SetWeeklySnapshotRetentionWeeks sets field value
func (o *ApiAtlasSnapshotSchedule) SetWeeklySnapshotRetentionWeeks(v int) {
o.WeeklySnapshotRetentionWeeks = v
}
func (o ApiAtlasSnapshotSchedule) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ApiAtlasSnapshotSchedule) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["clusterCheckpointIntervalMin"] = o.ClusterCheckpointIntervalMin
toSerialize["clusterId"] = o.ClusterId
toSerialize["dailySnapshotRetentionDays"] = o.DailySnapshotRetentionDays
toSerialize["monthlySnapshotRetentionMonths"] = o.MonthlySnapshotRetentionMonths
toSerialize["pointInTimeWindowHours"] = o.PointInTimeWindowHours
toSerialize["snapshotIntervalHours"] = o.SnapshotIntervalHours
toSerialize["snapshotRetentionDays"] = o.SnapshotRetentionDays
toSerialize["weeklySnapshotRetentionWeeks"] = o.WeeklySnapshotRetentionWeeks
return toSerialize, nil
}