Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIBot: SDK update based on recent changes in Atlas API #284

Merged
merged 3 commits into from Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -11,7 +11,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/v20231115007
go get go.mongodb.org/atlas-sdk/v20231115008
```

### Using in the code
Expand All @@ -20,7 +20,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/v20231115007/admin"
import "go.mongodb.org/atlas-sdk/v20231115008/admin"

func example() {
ctx := context.Background()
Expand Down
16 changes: 16 additions & 0 deletions admin/api_cloud_backups.go
Expand Up @@ -4620,11 +4620,13 @@ type UpdateDataProtectionSettingsApiRequest struct {
ApiService CloudBackupsApi
groupId string
dataProtectionSettings20231001 *DataProtectionSettings20231001
overwriteBackupPolicies *bool
}

type UpdateDataProtectionSettingsApiParams struct {
GroupId string
DataProtectionSettings20231001 *DataProtectionSettings20231001
OverwriteBackupPolicies *bool
}

func (a *CloudBackupsApiService) UpdateDataProtectionSettingsWithParams(ctx context.Context, args *UpdateDataProtectionSettingsApiParams) UpdateDataProtectionSettingsApiRequest {
Expand All @@ -4633,9 +4635,16 @@ func (a *CloudBackupsApiService) UpdateDataProtectionSettingsWithParams(ctx cont
ctx: ctx,
groupId: args.GroupId,
dataProtectionSettings20231001: args.DataProtectionSettings20231001,
overwriteBackupPolicies: args.OverwriteBackupPolicies,
}
}

// Flag that indicates whether to overwrite non complying backup policies with the new data protection settings or not.
func (r UpdateDataProtectionSettingsApiRequest) OverwriteBackupPolicies(overwriteBackupPolicies bool) UpdateDataProtectionSettingsApiRequest {
r.overwriteBackupPolicies = &overwriteBackupPolicies
return r
}

func (r UpdateDataProtectionSettingsApiRequest) Execute() (*DataProtectionSettings20231001, *http.Response, error) {
return r.ApiService.UpdateDataProtectionSettingsExecute(r)
}
Expand Down Expand Up @@ -4684,6 +4693,13 @@ func (a *CloudBackupsApiService) UpdateDataProtectionSettingsExecute(r UpdateDat
return localVarReturnValue, nil, reportError("dataProtectionSettings20231001 is required and must be specified")
}

if r.overwriteBackupPolicies != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "overwriteBackupPolicies", r.overwriteBackupPolicies, "")
} else {
var defaultValue bool = true
r.overwriteBackupPolicies = &defaultValue
parameterAddToHeaderOrQuery(localVarQueryParams, "overwriteBackupPolicies", r.overwriteBackupPolicies, "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/vnd.atlas.2023-10-01+json"}

Expand Down
38 changes: 19 additions & 19 deletions admin/api_clusters.go
Expand Up @@ -15,7 +15,7 @@ import (
type ClustersApi interface {

/*
CreateCluster Create One Multi-Cloud Cluster from One Project
CreateCluster Create One Cluster from One Project

Creates one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. This resource can create multi-cloud clusters. Each project supports up to 25 database deployments. To use this resource, the requesting API Key must have the Project Owner role. This feature is not available for serverless clusters. Deprecated versions: v2-{2023-01-01}

Expand All @@ -25,7 +25,7 @@ type ClustersApi interface {
*/
CreateCluster(ctx context.Context, groupId string, advancedClusterDescription *AdvancedClusterDescription) CreateClusterApiRequest
/*
CreateCluster Create One Multi-Cloud Cluster from One Project
CreateCluster Create One Cluster from One Project


@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
Expand All @@ -38,9 +38,9 @@ type ClustersApi interface {
CreateClusterExecute(r CreateClusterApiRequest) (*AdvancedClusterDescription, *http.Response, error)

/*
DeleteCluster Remove One Multi-Cloud Cluster from One Project
DeleteCluster Remove One Cluster from One Project

Removes one cluster with advanced features from the specified project. The cluster must have termination protection disabled in order to be deleted. To use this resource, the requesting API Key must have the Project Owner role. This feature is not available for serverless clusters. Deprecated versions: v2-{2023-01-01}
Removes one cluster from the specified project. The cluster must have termination protection disabled in order to be deleted. To use this resource, the requesting API Key must have the Project Owner role. This feature is not available for serverless clusters. Deprecated versions: v2-{2023-01-01}

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
Expand All @@ -49,7 +49,7 @@ type ClustersApi interface {
*/
DeleteCluster(ctx context.Context, groupId string, clusterName string) DeleteClusterApiRequest
/*
DeleteCluster Remove One Multi-Cloud Cluster from One Project
DeleteCluster Remove One Cluster from One Project


@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
Expand All @@ -62,18 +62,18 @@ type ClustersApi interface {
DeleteClusterExecute(r DeleteClusterApiRequest) (*http.Response, error)

/*
GetCluster Return One Multi-Cloud Cluster from One Project
GetCluster Return One Cluster from One Project

Returns the details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. The response includes multi-cloud clusters. To use this resource, the requesting API Key must have the Project Read Only role. This feature is not available for serverless clusters. Deprecated versions: v2-{2023-01-01}

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
@param clusterName Human-readable label that identifies this advanced cluster.
@param clusterName Human-readable label that identifies this cluster.
@return GetClusterApiRequest
*/
GetCluster(ctx context.Context, groupId string, clusterName string) GetClusterApiRequest
/*
GetCluster Return One Multi-Cloud Cluster from One Project
GetCluster Return One Cluster from One Project


@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
Expand Down Expand Up @@ -250,7 +250,7 @@ type ClustersApi interface {
LoadSampleDatasetExecute(r LoadSampleDatasetApiRequest) (*SampleDatasetStatus, *http.Response, error)

/*
TestFailover Test Failover for One Multi-Cloud Cluster
TestFailover Test Failover for One Cluster

Starts a failover test for the specified cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. A failover test checks how MongoDB Cloud handles the failure of the cluster's primary node. During the test, MongoDB Cloud shuts down the primary node and elects a new primary. To use this resource, the requesting API Key must have the Project Cluster Manager role. Deprecated versions: v2-{2023-01-01}

Expand All @@ -261,7 +261,7 @@ type ClustersApi interface {
*/
TestFailover(ctx context.Context, groupId string, clusterName string) TestFailoverApiRequest
/*
TestFailover Test Failover for One Multi-Cloud Cluster
TestFailover Test Failover for One Cluster


@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
Expand All @@ -274,7 +274,7 @@ type ClustersApi interface {
TestFailoverExecute(r TestFailoverApiRequest) (*http.Response, error)

/*
UpdateCluster Modify One Multi-Cloud Cluster from One Project
UpdateCluster Modify One Cluster from One Project

Updates the details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. This resource can update multi-cloud clusters. To update a cluster's termination protection, the requesting API Key must have the Project Owner role. For all other updates, the requesting API Key must have the Project Cluster Manager role. You can't modify a paused cluster (`paused : true`). You must call this endpoint to set `paused : false`. After this endpoint responds with `paused : false`, you can call it again with the changes you want to make to the cluster. This feature is not available for serverless clusters. Deprecated versions: v2-{2023-01-01}

Expand All @@ -285,7 +285,7 @@ type ClustersApi interface {
*/
UpdateCluster(ctx context.Context, groupId string, clusterName string, advancedClusterDescription *AdvancedClusterDescription) UpdateClusterApiRequest
/*
UpdateCluster Modify One Multi-Cloud Cluster from One Project
UpdateCluster Modify One Cluster from One Project


@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
Expand Down Expand Up @@ -397,7 +397,7 @@ func (r CreateClusterApiRequest) Execute() (*AdvancedClusterDescription, *http.R
}

/*
CreateCluster Create One Multi-Cloud Cluster from One Project
CreateCluster Create One Cluster from One Project

Creates one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. This resource can create multi-cloud clusters. Each project supports up to 25 database deployments. To use this resource, the requesting API Key must have the Project Owner role. This feature is not available for serverless clusters. Deprecated versions: v2-{2023-01-01}

Expand Down Expand Up @@ -539,9 +539,9 @@ func (r DeleteClusterApiRequest) Execute() (*http.Response, error) {
}

/*
DeleteCluster Remove One Multi-Cloud Cluster from One Project
DeleteCluster Remove One Cluster from One Project

Removes one cluster with advanced features from the specified project. The cluster must have termination protection disabled in order to be deleted. To use this resource, the requesting API Key must have the Project Owner role. This feature is not available for serverless clusters. Deprecated versions: v2-{2023-01-01}
Removes one cluster from the specified project. The cluster must have termination protection disabled in order to be deleted. To use this resource, the requesting API Key must have the Project Owner role. This feature is not available for serverless clusters. Deprecated versions: v2-{2023-01-01}

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
Expand Down Expand Up @@ -660,13 +660,13 @@ func (r GetClusterApiRequest) Execute() (*AdvancedClusterDescription, *http.Resp
}

/*
GetCluster Return One Multi-Cloud Cluster from One Project
GetCluster Return One Cluster from One Project

Returns the details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. The response includes multi-cloud clusters. To use this resource, the requesting API Key must have the Project Read Only role. This feature is not available for serverless clusters. Deprecated versions: v2-{2023-01-01}

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
@param clusterName Human-readable label that identifies this advanced cluster.
@param clusterName Human-readable label that identifies this cluster.
@return GetClusterApiRequest
*/
func (a *ClustersApiService) GetCluster(ctx context.Context, groupId string, clusterName string) GetClusterApiRequest {
Expand Down Expand Up @@ -1864,7 +1864,7 @@ func (r TestFailoverApiRequest) Execute() (*http.Response, error) {
}

/*
TestFailover Test Failover for One Multi-Cloud Cluster
TestFailover Test Failover for One Cluster

Starts a failover test for the specified cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. A failover test checks how MongoDB Cloud handles the failure of the cluster's primary node. During the test, MongoDB Cloud shuts down the primary node and elects a new primary. To use this resource, the requesting API Key must have the Project Cluster Manager role. Deprecated versions: v2-{2023-01-01}

Expand Down Expand Up @@ -1985,7 +1985,7 @@ func (r UpdateClusterApiRequest) Execute() (*AdvancedClusterDescription, *http.R
}

/*
UpdateCluster Modify One Multi-Cloud Cluster from One Project
UpdateCluster Modify One Cluster from One Project

Updates the details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. This resource can update multi-cloud clusters. To update a cluster's termination protection, the requesting API Key must have the Project Owner role. For all other updates, the requesting API Key must have the Project Cluster Manager role. You can't modify a paused cluster (`paused : true`). You must call this endpoint to set `paused : false`. After this endpoint responds with `paused : false`, you can call it again with the changes you want to make to the cluster. This feature is not available for serverless clusters. Deprecated versions: v2-{2023-01-01}

Expand Down
29 changes: 19 additions & 10 deletions admin/api_federated_authentication.go
Expand Up @@ -8,6 +8,7 @@ import (
"io"
"net/http"
"net/url"
"reflect"
"strings"
)

Expand Down Expand Up @@ -1871,14 +1872,14 @@ type ListIdentityProvidersApiRequest struct {
ctx context.Context
ApiService FederatedAuthenticationApi
federationSettingsId string
protocol *string
idpType *string
protocol *[]string
idpType *[]string
}

type ListIdentityProvidersApiParams struct {
FederationSettingsId string
Protocol *string
IdpType *string
Protocol *[]string
IdpType *[]string
}

func (a *FederatedAuthenticationApiService) ListIdentityProvidersWithParams(ctx context.Context, args *ListIdentityProvidersApiParams) ListIdentityProvidersApiRequest {
Expand All @@ -1891,14 +1892,14 @@ func (a *FederatedAuthenticationApiService) ListIdentityProvidersWithParams(ctx
}
}

// The protocols of the target identity providers. Defaults to SAML.
func (r ListIdentityProvidersApiRequest) Protocol(protocol string) ListIdentityProvidersApiRequest {
// The protocols of the target identity providers.
func (r ListIdentityProvidersApiRequest) Protocol(protocol []string) ListIdentityProvidersApiRequest {
r.protocol = &protocol
return r
}

// The types of the target identity providers. Defaults to WORKFORCE.
func (r ListIdentityProvidersApiRequest) IdpType(idpType string) ListIdentityProvidersApiRequest {
// The types of the target identity providers.
func (r ListIdentityProvidersApiRequest) IdpType(idpType []string) ListIdentityProvidersApiRequest {
r.idpType = &idpType
return r
}
Expand Down Expand Up @@ -1948,10 +1949,18 @@ func (a *FederatedAuthenticationApiService) ListIdentityProvidersExecute(r ListI
localVarFormParams := url.Values{}

if r.protocol != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "protocol", r.protocol, "")
t := *r.protocol
// Workaround for unused import
_ = reflect.Append
parameterAddToHeaderOrQuery(localVarQueryParams, "protocol", t, "multi")

}
if r.idpType != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "idpType", r.idpType, "")
t := *r.idpType
// Workaround for unused import
_ = reflect.Append
parameterAddToHeaderOrQuery(localVarQueryParams, "idpType", t, "multi")

}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
Expand Down