diff --git a/mongodbatlas/online_archives.go b/mongodbatlas/online_archives.go index 566da4b2..c7f6fca2 100644 --- a/mongodbatlas/online_archives.go +++ b/mongodbatlas/online_archives.go @@ -197,9 +197,21 @@ type OnlineArchive struct { GroupID string `json:"groupId,omitempty"` PartitionFields []*PartitionFields `json:"partitionFields,omitempty"` Paused *bool `json:"paused,omitempty"` + Schedule *OnlineArchiveSchedule `json:"schedule,omitempty"` State string `json:"state,omitempty"` } +// OnlineArchiveSchedule represents the frequency and duration when archiving process occurs. +type OnlineArchiveSchedule struct { + Type string `json:"type,omitempty"` + DayOfMonth int32 `json:"dayOfMonth,omitempty"` + DayOfWeek int32 `json:"dayOfWeek,omitempty"` + EndHour *int32 `json:"endHour,omitempty"` + EndMinute *int32 `json:"endMinute,omitempty"` + StartHour *int32 `json:"startHour,omitempty"` + StartMinute *int32 `json:"startMinute,omitempty"` +} + // OnlineArchiveCriteria criteria to use for archiving data. type OnlineArchiveCriteria struct { DateField string `json:"dateField,omitempty"` // DateField is mandatory when Type is DATE diff --git a/mongodbatlas/online_archives_test.go b/mongodbatlas/online_archives_test.go index 8ad86d1f..148c5681 100644 --- a/mongodbatlas/online_archives_test.go +++ b/mongodbatlas/online_archives_test.go @@ -94,7 +94,14 @@ func TestOnlineArchiveServiceOp_List(t *testing.T) { "order": 2 } ], - "paused": false + "paused": false, + "schedule": { + "type": "DAILY", + "endHour": 1, + "endMinute": 1, + "startHour": 1, + "startMinute": 1 + } } ], "totalCount": 2 @@ -171,6 +178,13 @@ func TestOnlineArchiveServiceOp_List(t *testing.T) { }, }, Paused: pointer(false), + Schedule: &OnlineArchiveSchedule{ + EndHour: pointer(int32(1)), + EndMinute: pointer(int32(1)), + StartHour: pointer(int32(1)), + StartMinute: pointer(int32(1)), + Type: "DAILY", + }, }, }, TotalCount: 2,