Skip to content

Commit 682f3fc

Browse files
APIBot: SDK update based on recent changes in Atlas API (#272)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: wtrocki <[email protected]>
1 parent 19d4c26 commit 682f3fc

File tree

74 files changed

+509
-392
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+509
-392
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Note that `atlas-sdk-go` only supports the two most recent major versions of Go.
1111
### Adding Dependency
1212

1313
```terminal
14-
go get go.mongodb.org/atlas-sdk/v20231115005
14+
go get go.mongodb.org/atlas-sdk/v20231115006
1515
```
1616

1717
### Using in the code
@@ -20,7 +20,7 @@ Construct a new Atlas SDK client, then use the various services on the client to
2020
access different parts of the Atlas API. For example:
2121

2222
```go
23-
import "go.mongodb.org/atlas-sdk/v20231115005/admin"
23+
import "go.mongodb.org/atlas-sdk/v20231115006/admin"
2424

2525
func example() {
2626
ctx := context.Background()

admin/atlas_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package admin // import "go.mongodb.org/atlas-sdk/v20231115005/admin"
1+
package admin // import "go.mongodb.org/atlas-sdk/v20231115006/admin"
22

33
import (
44
"errors"
@@ -8,7 +8,7 @@ import (
88
"strings"
99

1010
"github.com/mongodb-forks/digest"
11-
"go.mongodb.org/atlas-sdk/v20231115005/internal/core"
11+
"go.mongodb.org/atlas-sdk/v20231115006/internal/core"
1212
)
1313

1414
const (

admin/model_group_maintenance_window.go

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ type GroupMaintenanceWindow struct {
1313
// One-based integer that represents the day of the week that the maintenance window starts. | Value | Day of Week | |---|---| | `1` | Sunday | | `2` | Monday | | `3` | Tuesday | | `4` | Wednesday | | `5` | Thursday | | `6` | Friday | | `7` | Saturday |
1414
DayOfWeek int `json:"dayOfWeek"`
1515
// Zero-based integer that represents the hour of the of the day that the maintenance window starts according to a 24-hour clock. Use `0` for midnight and `12` for noon.
16-
HourOfDay int `json:"hourOfDay"`
16+
HourOfDay *int `json:"hourOfDay,omitempty"`
17+
// Number of times the current maintenance event for this project has been deferred.
18+
// Read only field.
19+
NumberOfDeferrals *int `json:"numberOfDeferrals,omitempty"`
1720
// Flag that indicates whether MongoDB Cloud starts the maintenance window immediately upon receiving this request. To start the maintenance window immediately for your project, MongoDB Cloud must have maintenance scheduled and you must set a maintenance window. This flag resets to `false` after MongoDB Cloud completes maintenance.
1821
StartASAP *bool `json:"startASAP,omitempty"`
1922
}
@@ -22,10 +25,9 @@ type GroupMaintenanceWindow struct {
2225
// This constructor will assign default values to properties that have it defined,
2326
// and makes sure properties required by API are set, but the set of arguments
2427
// will change when the set of required properties is changed
25-
func NewGroupMaintenanceWindow(dayOfWeek int, hourOfDay int) *GroupMaintenanceWindow {
28+
func NewGroupMaintenanceWindow(dayOfWeek int) *GroupMaintenanceWindow {
2629
this := GroupMaintenanceWindow{}
2730
this.DayOfWeek = dayOfWeek
28-
this.HourOfDay = hourOfDay
2931
return &this
3032
}
3133

@@ -94,28 +96,70 @@ func (o *GroupMaintenanceWindow) SetDayOfWeek(v int) {
9496
o.DayOfWeek = v
9597
}
9698

97-
// GetHourOfDay returns the HourOfDay field value
99+
// GetHourOfDay returns the HourOfDay field value if set, zero value otherwise
98100
func (o *GroupMaintenanceWindow) GetHourOfDay() int {
99-
if o == nil {
101+
if o == nil || IsNil(o.HourOfDay) {
100102
var ret int
101103
return ret
102104
}
103-
104-
return o.HourOfDay
105+
return *o.HourOfDay
105106
}
106107

107-
// GetHourOfDayOk returns a tuple with the HourOfDay field value
108+
// GetHourOfDayOk returns a tuple with the HourOfDay field value if set, nil otherwise
108109
// and a boolean to check if the value has been set.
109110
func (o *GroupMaintenanceWindow) GetHourOfDayOk() (*int, bool) {
110-
if o == nil {
111+
if o == nil || IsNil(o.HourOfDay) {
111112
return nil, false
112113
}
113-
return &o.HourOfDay, true
114+
115+
return o.HourOfDay, true
114116
}
115117

116-
// SetHourOfDay sets field value
118+
// HasHourOfDay returns a boolean if a field has been set.
119+
func (o *GroupMaintenanceWindow) HasHourOfDay() bool {
120+
if o != nil && !IsNil(o.HourOfDay) {
121+
return true
122+
}
123+
124+
return false
125+
}
126+
127+
// SetHourOfDay gets a reference to the given int and assigns it to the HourOfDay field.
117128
func (o *GroupMaintenanceWindow) SetHourOfDay(v int) {
118-
o.HourOfDay = v
129+
o.HourOfDay = &v
130+
}
131+
132+
// GetNumberOfDeferrals returns the NumberOfDeferrals field value if set, zero value otherwise
133+
func (o *GroupMaintenanceWindow) GetNumberOfDeferrals() int {
134+
if o == nil || IsNil(o.NumberOfDeferrals) {
135+
var ret int
136+
return ret
137+
}
138+
return *o.NumberOfDeferrals
139+
}
140+
141+
// GetNumberOfDeferralsOk returns a tuple with the NumberOfDeferrals field value if set, nil otherwise
142+
// and a boolean to check if the value has been set.
143+
func (o *GroupMaintenanceWindow) GetNumberOfDeferralsOk() (*int, bool) {
144+
if o == nil || IsNil(o.NumberOfDeferrals) {
145+
return nil, false
146+
}
147+
148+
return o.NumberOfDeferrals, true
149+
}
150+
151+
// HasNumberOfDeferrals returns a boolean if a field has been set.
152+
func (o *GroupMaintenanceWindow) HasNumberOfDeferrals() bool {
153+
if o != nil && !IsNil(o.NumberOfDeferrals) {
154+
return true
155+
}
156+
157+
return false
158+
}
159+
160+
// SetNumberOfDeferrals gets a reference to the given int and assigns it to the NumberOfDeferrals field.
161+
func (o *GroupMaintenanceWindow) SetNumberOfDeferrals(v int) {
162+
o.NumberOfDeferrals = &v
119163
}
120164

121165
// GetStartASAP returns the StartASAP field value if set, zero value otherwise
@@ -164,7 +208,9 @@ func (o GroupMaintenanceWindow) ToMap() (map[string]interface{}, error) {
164208
toSerialize["autoDeferOnceEnabled"] = o.AutoDeferOnceEnabled
165209
}
166210
toSerialize["dayOfWeek"] = o.DayOfWeek
167-
toSerialize["hourOfDay"] = o.HourOfDay
211+
if !IsNil(o.HourOfDay) {
212+
toSerialize["hourOfDay"] = o.HourOfDay
213+
}
168214
if !IsNil(o.StartASAP) {
169215
toSerialize["startASAP"] = o.StartASAP
170216
}

auth/device_flow.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"strings"
2323
"time"
2424

25-
core "go.mongodb.org/atlas-sdk/v20231115005/internal/core"
25+
core "go.mongodb.org/atlas-sdk/v20231115006/internal/core"
2626
)
2727

2828
const authExpiredError = "DEVICE_AUTHORIZATION_EXPIRED"

auth/oauth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"runtime"
2727
"strings"
2828

29-
"go.mongodb.org/atlas-sdk/v20231115005/internal/core"
29+
"go.mongodb.org/atlas-sdk/v20231115006/internal/core"
3030
)
3131

3232
const defaultBaseURL = "https://cloud.mongodb.com/"

auth/oauth_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"reflect"
2525
"testing"
2626

27-
core "go.mongodb.org/atlas-sdk/v20231115005/internal/core"
27+
core "go.mongodb.org/atlas-sdk/v20231115006/internal/core"
2828
)
2929

3030
const (

docs/doc_2_error_handling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Errors are represented by [ApiErrorObject](https://github.com/mongodb/atlas-sdk-
1010
To fetch the error object, execute the following:
1111

1212
```go
13-
import "go.mongodb.org/atlas-sdk/v20231115005/admin"
13+
import "go.mongodb.org/atlas-sdk/v20231115006/admin"
1414

1515
projects, response, err := admin.ProjectsApi.ListProjects(ctx).Execute()
1616
apiError, ok := admin.AsError(err)
@@ -22,7 +22,7 @@ fmt.Println(apiError)
2222
To check for the existence of a specific error code, execute the following:
2323

2424
```go
25-
import admin "go.mongodb.org/atlas-sdk/v20231115005/admin"
25+
import admin "go.mongodb.org/atlas-sdk/v20231115006/admin"
2626

2727
projects, response, err := admin.ProjectsApi.ListProjects(ctx).Execute()
2828
if admin.IsErrorCode(err, "code"){

docs/doc_3_migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The Atlas Go SDK doesn't rely on the deprecated [go-client-mongodb-atlas](https:
1818
The Atlas Go SDK has different methods for the initialization of the clients:
1919

2020
```go
21-
import admin "go.mongodb.org/atlas-sdk/v20231115005/admin"
21+
import admin "go.mongodb.org/atlas-sdk/v20231115006/admin"
2222
sdk, err := admin.NewClient(
2323
// Authentication using ApiKey and ApiSecret
2424
admin.UseDigestAuth(apiKey, apiSecret))

docs/doc_4_authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Construct a new Atlas SDK client, then use the services on the client to
1111
access different parts of the Atlas Admin API. For example:
1212

1313
```go
14-
import "go.mongodb.org/atlas-sdk/v20231115005/admin"
14+
import "go.mongodb.org/atlas-sdk/v20231115006/admin"
1515

1616
func example() {
1717
ctx := context.Background()

docs/docs/AWSClustersDNSApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"fmt"
2727
"os"
2828

29-
"go.mongodb.org/atlas-sdk/v20231115005/admin"
29+
"go.mongodb.org/atlas-sdk/v20231115006/admin"
3030
)
3131

3232
func main() {
@@ -99,7 +99,7 @@ import (
9999
"fmt"
100100
"os"
101101

102-
"go.mongodb.org/atlas-sdk/v20231115005/admin"
102+
"go.mongodb.org/atlas-sdk/v20231115006/admin"
103103
)
104104

105105
func main() {

0 commit comments

Comments
 (0)