Skip to content

Commit

Permalink
APIBot: SDK update based on recent changes in Atlas API (#317)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: blva <40155621+blva@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 25, 2024
1 parent 1144033 commit a162a40
Show file tree
Hide file tree
Showing 131 changed files with 720 additions and 480 deletions.
2 changes: 1 addition & 1 deletion .mockery.yaml
Expand Up @@ -6,6 +6,6 @@ filename: "{{ .InterfaceName | snakecase }}.go"
mockname: "{{.InterfaceName}}"

packages:
go.mongodb.org/atlas-sdk/v20231115011/admin:
go.mongodb.org/atlas-sdk/v20231115012/admin:
config:
include-regex: ".*Api"
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -12,7 +12,7 @@ Note that `atlas-sdk-go` only supports the two most recent major versions of Go.
### Adding Dependency

```terminal
go get go.mongodb.org/atlas-sdk/v20231115011
go get go.mongodb.org/atlas-sdk/v20231115012
```

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

```go
import "go.mongodb.org/atlas-sdk/v20231115011/admin"
import "go.mongodb.org/atlas-sdk/v20231115012/admin"

func example() {
ctx := context.Background()
Expand Down
4 changes: 2 additions & 2 deletions admin/atlas_client.go
@@ -1,4 +1,4 @@
package admin // import "go.mongodb.org/atlas-sdk/v20231115011/admin"
package admin // import "go.mongodb.org/atlas-sdk/v20231115012/admin"

import (
"errors"
Expand All @@ -8,7 +8,7 @@ import (
"strings"

"github.com/mongodb-forks/digest"
"go.mongodb.org/atlas-sdk/v20231115011/internal/core"
"go.mongodb.org/atlas-sdk/v20231115012/internal/core"
)

const (
Expand Down
38 changes: 38 additions & 0 deletions admin/model_alerts_notification_root_for_group.go
Expand Up @@ -14,6 +14,8 @@ type AlertsNotificationRootForGroup struct {
DatadogRegion *string `json:"datadogRegion,omitempty"`
// Number of minutes that MongoDB Cloud waits after detecting an alert condition before it sends out the first notification.
DelayMin *int `json:"delayMin,omitempty"`
// The id of the associated integration, the credentials of which to use for requests.
IntegrationId *string `json:"integrationId,omitempty"`
// Number of minutes to wait between successive notifications. MongoDB Cloud sends notifications until someone acknowledges the unacknowledged alert. PagerDuty, VictorOps, and OpsGenie notifications don't return this element. Configure and manage the notification interval within each of those services.
IntervalMin *int `json:"intervalMin,omitempty"`
// The notifierId is a system-generated unique identifier assigned to each notification method. This is needed when updating third-party notifications without requiring explicit authentication credentials.
Expand Down Expand Up @@ -192,6 +194,39 @@ func (o *AlertsNotificationRootForGroup) SetDelayMin(v int) {
o.DelayMin = &v
}

// GetIntegrationId returns the IntegrationId field value if set, zero value otherwise
func (o *AlertsNotificationRootForGroup) GetIntegrationId() string {
if o == nil || IsNil(o.IntegrationId) {
var ret string
return ret
}
return *o.IntegrationId
}

// GetIntegrationIdOk returns a tuple with the IntegrationId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsNotificationRootForGroup) GetIntegrationIdOk() (*string, bool) {
if o == nil || IsNil(o.IntegrationId) {
return nil, false
}

return o.IntegrationId, true
}

// HasIntegrationId returns a boolean if a field has been set.
func (o *AlertsNotificationRootForGroup) HasIntegrationId() bool {
if o != nil && !IsNil(o.IntegrationId) {
return true
}

return false
}

// SetIntegrationId gets a reference to the given string and assigns it to the IntegrationId field.
func (o *AlertsNotificationRootForGroup) SetIntegrationId(v string) {
o.IntegrationId = &v
}

// GetIntervalMin returns the IntervalMin field value if set, zero value otherwise
func (o *AlertsNotificationRootForGroup) GetIntervalMin() int {
if o == nil || IsNil(o.IntervalMin) {
Expand Down Expand Up @@ -1002,6 +1037,9 @@ func (o AlertsNotificationRootForGroup) ToMap() (map[string]interface{}, error)
if !IsNil(o.DelayMin) {
toSerialize["delayMin"] = o.DelayMin
}
if !IsNil(o.IntegrationId) {
toSerialize["integrationId"] = o.IntegrationId
}
if !IsNil(o.IntervalMin) {
toSerialize["intervalMin"] = o.IntervalMin
}
Expand Down
36 changes: 23 additions & 13 deletions admin/model_connected_org_config.go
Expand Up @@ -15,7 +15,7 @@ type ConnectedOrgConfig struct {
// Value that indicates whether domain restriction is enabled for this connected org.
DomainRestrictionEnabled bool `json:"domainRestrictionEnabled"`
// Legacy 20-hexadecimal digit string that identifies the UI access identity provider that this connected org config is associated with. This id can be found within the Federation Management Console > Identity Providers tab by clicking the info icon in the IdP ID row of a configured identity provider.
IdentityProviderId string `json:"identityProviderId"`
IdentityProviderId *string `json:"identityProviderId,omitempty"`
// Unique 24-hexadecimal digit string that identifies the connected organization configuration.
// Read only field.
OrgId string `json:"orgId"`
Expand All @@ -31,10 +31,9 @@ type ConnectedOrgConfig struct {
// 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 NewConnectedOrgConfig(domainRestrictionEnabled bool, identityProviderId string, orgId string) *ConnectedOrgConfig {
func NewConnectedOrgConfig(domainRestrictionEnabled bool, orgId string) *ConnectedOrgConfig {
this := ConnectedOrgConfig{}
this.DomainRestrictionEnabled = domainRestrictionEnabled
this.IdentityProviderId = identityProviderId
this.OrgId = orgId
return &this
}
Expand Down Expand Up @@ -137,28 +136,37 @@ func (o *ConnectedOrgConfig) SetDomainRestrictionEnabled(v bool) {
o.DomainRestrictionEnabled = v
}

// GetIdentityProviderId returns the IdentityProviderId field value
// GetIdentityProviderId returns the IdentityProviderId field value if set, zero value otherwise
func (o *ConnectedOrgConfig) GetIdentityProviderId() string {
if o == nil {
if o == nil || IsNil(o.IdentityProviderId) {
var ret string
return ret
}

return o.IdentityProviderId
return *o.IdentityProviderId
}

// GetIdentityProviderIdOk returns a tuple with the IdentityProviderId field value
// GetIdentityProviderIdOk returns a tuple with the IdentityProviderId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConnectedOrgConfig) GetIdentityProviderIdOk() (*string, bool) {
if o == nil {
if o == nil || IsNil(o.IdentityProviderId) {
return nil, false
}
return &o.IdentityProviderId, true

return o.IdentityProviderId, true
}

// SetIdentityProviderId sets field value
// HasIdentityProviderId returns a boolean if a field has been set.
func (o *ConnectedOrgConfig) HasIdentityProviderId() bool {
if o != nil && !IsNil(o.IdentityProviderId) {
return true
}

return false
}

// SetIdentityProviderId gets a reference to the given string and assigns it to the IdentityProviderId field.
func (o *ConnectedOrgConfig) SetIdentityProviderId(v string) {
o.IdentityProviderId = v
o.IdentityProviderId = &v
}

// GetOrgId returns the OrgId field value
Expand Down Expand Up @@ -300,7 +308,9 @@ func (o ConnectedOrgConfig) ToMap() (map[string]interface{}, error) {
toSerialize["domainAllowList"] = o.DomainAllowList
}
toSerialize["domainRestrictionEnabled"] = o.DomainRestrictionEnabled
toSerialize["identityProviderId"] = o.IdentityProviderId
if !IsNil(o.IdentityProviderId) {
toSerialize["identityProviderId"] = o.IdentityProviderId
}
if !IsNil(o.PostAuthRoleGrants) {
toSerialize["postAuthRoleGrants"] = o.PostAuthRoleGrants
}
Expand Down
38 changes: 38 additions & 0 deletions admin/model_third_party_integration.go
Expand Up @@ -8,6 +8,8 @@ import (

// ThirdPartyIntegration Collection of settings that describe third-party integrations.
type ThirdPartyIntegration struct {
// Integration id.
Id *string `json:"id,omitempty"`
// Integration type Alternatively: Human-readable label that identifies the service to which you want to integrate with MongoDB Cloud. The value must match the third-party service integration type. Alternatively: Human-readable label that identifies the service to which you want to integrate with MongoDB Cloud. The value must match the third-party service integration type. Alternatively: Human-readable label that identifies the service to which you want to integrate with MongoDB Cloud. The value must match the third-party service integration type. Alternatively: Human-readable label that identifies the service to which you want to integrate with MongoDB Cloud. The value must match the third-party service integration type. Alternatively: Human-readable label that identifies the service to which you want to integrate with MongoDB Cloud. The value must match the third-party service integration type. Alternatively: Human-readable label that identifies the service to which you want to integrate with MongoDB Cloud. The value must match the third-party service integration type. Alternatively: Human-readable label that identifies the service to which you want to integrate with MongoDB Cloud. The value must match the third-party service integration type. Alternatively: Human-readable label that identifies the service to which you want to integrate with MongoDB Cloud. The value must match the third-party service integration type. Alternatively: Human-readable label that identifies the service to which you want to integrate with MongoDB Cloud. The value must match the third-party service integration type.
Type *string `json:"type,omitempty"`
// Key that allows MongoDB Cloud to access your Datadog account. **NOTE**: After you create a notification which requires an API or integration key, the key appears partially redacted when you: * View or edit the alert through the Atlas UI. * Query the alert for the notification through the Atlas Administration API. Alternatively: Key that allows MongoDB Cloud to access your Opsgenie account. **NOTE**: After you create a notification which requires an API or integration key, the key appears partially redacted when you: * View or edit the alert through the Atlas UI. * Query the alert for the notification through the Atlas Administration API. Alternatively: Key that allows MongoDB Cloud to access your VictorOps account. **NOTE**: After you create a notification which requires an API or integration key, the key appears partially redacted when you: * View or edit the alert through the Atlas UI. * Query the alert for the notification through the Atlas Administration API.
Expand Down Expand Up @@ -66,6 +68,39 @@ func NewThirdPartyIntegrationWithDefaults() *ThirdPartyIntegration {
return &this
}

// GetId returns the Id field value if set, zero value otherwise
func (o *ThirdPartyIntegration) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}

// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ThirdPartyIntegration) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}

return o.Id, true
}

// HasId returns a boolean if a field has been set.
func (o *ThirdPartyIntegration) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}

return false
}

// SetId gets a reference to the given string and assigns it to the Id field.
func (o *ThirdPartyIntegration) SetId(v string) {
o.Id = &v
}

// GetType returns the Type field value if set, zero value otherwise
func (o *ThirdPartyIntegration) GetType() string {
if o == nil || IsNil(o.Type) {
Expand Down Expand Up @@ -702,6 +737,9 @@ func (o ThirdPartyIntegration) MarshalJSONWithoutReadOnly() ([]byte, error) {
}
func (o ThirdPartyIntegration) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
Expand Down
2 changes: 1 addition & 1 deletion auth/device_flow.go
Expand Up @@ -22,7 +22,7 @@ import (
"strings"
"time"

core "go.mongodb.org/atlas-sdk/v20231115011/internal/core"
core "go.mongodb.org/atlas-sdk/v20231115012/internal/core"
)

const authExpiredError = "DEVICE_AUTHORIZATION_EXPIRED"
Expand Down
2 changes: 1 addition & 1 deletion auth/oauth.go
Expand Up @@ -26,7 +26,7 @@ import (
"runtime"
"strings"

"go.mongodb.org/atlas-sdk/v20231115011/internal/core"
"go.mongodb.org/atlas-sdk/v20231115012/internal/core"
)

const defaultBaseURL = "https://cloud.mongodb.com/"
Expand Down
2 changes: 1 addition & 1 deletion auth/oauth_test.go
Expand Up @@ -24,7 +24,7 @@ import (
"reflect"
"testing"

core "go.mongodb.org/atlas-sdk/v20231115011/internal/core"
core "go.mongodb.org/atlas-sdk/v20231115012/internal/core"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions docs/doc_2_error_handling.md
Expand Up @@ -9,7 +9,7 @@ Errors are represented by [ApiErrorObject](https://github.com/mongodb/atlas-sdk-
To fetch the error object, execute the following:

```go
import "go.mongodb.org/atlas-sdk/v20231115011/admin"
import "go.mongodb.org/atlas-sdk/v20231115012/admin"

projects, response, err := admin.ProjectsApi.ListProjects(ctx).Execute()
apiError, ok := admin.AsError(err)
Expand All @@ -21,7 +21,7 @@ fmt.Println(apiError)
To check for the existence of a specific error code (e.g. `MAXIMUM_INDEXES_FOR_TENANT_EXCEEDED`), execute the following:

```go
import admin "go.mongodb.org/atlas-sdk/v20231115011/admin"
import admin "go.mongodb.org/atlas-sdk/v20231115012/admin"

projects, response, err := admin.ProjectsApi.ListProjects(ctx).Execute()
if admin.IsErrorCode(err, "code"){
Expand All @@ -34,7 +34,7 @@ if admin.IsErrorCode(err, "code"){
To check for the existence of a specific HTTP response error code, execute the following:

```go
import admin "go.mongodb.org/atlas-sdk/v20231115011/admin"
import admin "go.mongodb.org/atlas-sdk/v20231115012/admin"

projects, response, err := admin.ProjectsApi.ListProjects(ctx).Execute()
apiError, ok := admin.AsError(err)
Expand Down
2 changes: 1 addition & 1 deletion docs/doc_3_migration.md
Expand Up @@ -18,7 +18,7 @@ The Atlas Go SDK doesn't rely on the deprecated [go-client-mongodb-atlas](https:
The Atlas Go SDK has different methods for the initialization of the clients:

```go
import admin "go.mongodb.org/atlas-sdk/v20231115011/admin"
import admin "go.mongodb.org/atlas-sdk/v20231115012/admin"
sdk, err := admin.NewClient(
// Authentication using ApiKey and ApiSecret
admin.UseDigestAuth(apiKey, apiSecret))
Expand Down
2 changes: 1 addition & 1 deletion docs/doc_4_authentication.md
Expand Up @@ -11,7 +11,7 @@ Construct a new Atlas SDK client, then use the services on the client to
access different parts of the Atlas Admin API. For example:

```go
import "go.mongodb.org/atlas-sdk/v20231115011/admin"
import "go.mongodb.org/atlas-sdk/v20231115012/admin"

func example() {
ctx := context.Background()
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/AWSClustersDNSApi.md
Expand Up @@ -26,7 +26,7 @@ import (
"fmt"
"os"

"go.mongodb.org/atlas-sdk/v20231115011/admin"
"go.mongodb.org/atlas-sdk/v20231115012/admin"
)

func main() {
Expand Down Expand Up @@ -99,7 +99,7 @@ import (
"fmt"
"os"

"go.mongodb.org/atlas-sdk/v20231115011/admin"
"go.mongodb.org/atlas-sdk/v20231115012/admin"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/AccessTrackingApi.md
Expand Up @@ -26,7 +26,7 @@ import (
"fmt"
"os"

"go.mongodb.org/atlas-sdk/v20231115011/admin"
"go.mongodb.org/atlas-sdk/v20231115012/admin"
)

func main() {
Expand Down Expand Up @@ -112,7 +112,7 @@ import (
"fmt"
"os"

"go.mongodb.org/atlas-sdk/v20231115011/admin"
"go.mongodb.org/atlas-sdk/v20231115012/admin"
)

func main() {
Expand Down

0 comments on commit a162a40

Please sign in to comment.