Skip to content

Commit

Permalink
APIBot: SDK update based on recent changes in Atlas API (#235)
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: tibulca <[email protected]>
  • Loading branch information
3 people authored Nov 16, 2023
1 parent bea1252 commit d42cace
Show file tree
Hide file tree
Showing 103 changed files with 5,473 additions and 2,945 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
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/v20231001002
go get go.mongodb.org/atlas-sdk/v20231115001
```

### 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/v20231001002/admin"
import "go.mongodb.org/atlas-sdk/v20231115001/admin"

func example() {
ctx := context.Background()
Expand Down
670 changes: 670 additions & 0 deletions admin/api_atlas_search.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions admin/api_cloud_backups.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ type CloudBackupsApi interface {
/*
DeleteExportBucket Revoke Access to AWS S3 Bucket for Cloud Backup Snapshot Exports
Revoke MongoDB Cloud access to the specified AWS S3 bucket. This prevents this bucket to receive Atlas Cloud Backup snapshots. To use this resource, the requesting API Key must have the Project Owner role.
Revoke MongoDB Cloud access to the specified AWS S3 bucket. This prevents this bucket to receive Atlas Cloud Backup snapshots. Auto export must be disabled on all clusters in this project exporting to this bucket before revoking access. To use this resource, the requesting API Key must have the Project Owner role.
@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 @@ -1641,7 +1641,7 @@ func (r DeleteExportBucketApiRequest) Execute() (map[string]interface{}, *http.R
/*
DeleteExportBucket Revoke Access to AWS S3 Bucket for Cloud Backup Snapshot Exports
Revoke MongoDB Cloud access to the specified AWS S3 bucket. This prevents this bucket to receive Atlas Cloud Backup snapshots. To use this resource, the requesting API Key must have the Project Owner role.
Revoke MongoDB Cloud access to the specified AWS S3 bucket. This prevents this bucket to receive Atlas Cloud Backup snapshots. Auto export must be disabled on all clusters in this project exporting to this bucket before revoking access. To use this resource, the requesting API Key must have the Project Owner role.
@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
92 changes: 46 additions & 46 deletions admin/api_federated_authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ type FederatedAuthenticationApi interface {
getFederationSettingsExecute(r GetFederationSettingsApiRequest) (*OrgFederationSettings, *http.Response, error)

/*
GetIdentityProvider Return one SAML identity provider from the specified federation.
GetIdentityProvider Return one identity provider from the specified federation by id.
[experimental] Returns one SAML identity provider from the specified federation. To use this resource, the requesting API Key must have the Organization Owner role in one of the connected organizations.
[experimental] Returns one identity provider in the specified federation by the identity provider's id. To use this resource, the requesting API Key must have the Organization Owner role in one of the connected organizations. 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 federationSettingsId Unique 24-hexadecimal digit string that identifies your federation.
Expand All @@ -144,7 +144,7 @@ type FederatedAuthenticationApi interface {
*/
GetIdentityProvider(ctx context.Context, federationSettingsId string, identityProviderId string) GetIdentityProviderApiRequest
/*
GetIdentityProvider Return one SAML identity provider from the specified federation.
GetIdentityProvider Return one identity provider from the specified federation by id.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
Expand All @@ -154,7 +154,7 @@ type FederatedAuthenticationApi interface {
GetIdentityProviderWithParams(ctx context.Context, args *GetIdentityProviderApiParams) GetIdentityProviderApiRequest

// Interface only available internally
getIdentityProviderExecute(r GetIdentityProviderApiRequest) (*FederationSamlIdentityProvider, *http.Response, error)
getIdentityProviderExecute(r GetIdentityProviderApiRequest) (*FederationIdentityProvider, *http.Response, error)

/*
GetIdentityProviderMetadata Return the metadata of one identity provider in the specified federation.
Expand Down Expand Up @@ -330,18 +330,18 @@ type FederatedAuthenticationApi interface {
updateConnectedOrgConfigExecute(r UpdateConnectedOrgConfigApiRequest) (*ConnectedOrgConfig, *http.Response, error)

/*
UpdateIdentityProvider Update the SAML identity provider.
UpdateIdentityProvider Update the identity provider.
[experimental] Updates one SAML identity provider in the specified federation. To use this resource, the requesting API Key must have the Organization Owner role in one of the connected organizations.
[experimental] Updates one identity provider in the specified federation. To use this resource, the requesting API Key must have the Organization Owner role in one of the connected organizations. 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 federationSettingsId Unique 24-hexadecimal digit string that identifies your federation.
@param identityProviderId Unique 20-hexadecimal digit string that identifies the identity provider.
@return UpdateIdentityProviderApiRequest
*/
UpdateIdentityProvider(ctx context.Context, federationSettingsId string, identityProviderId string, samlIdentityProviderUpdate *SamlIdentityProviderUpdate) UpdateIdentityProviderApiRequest
UpdateIdentityProvider(ctx context.Context, federationSettingsId string, identityProviderId string, identityProviderUpdate *IdentityProviderUpdate) UpdateIdentityProviderApiRequest
/*
UpdateIdentityProvider Update the SAML identity provider.
UpdateIdentityProvider Update the identity provider.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
Expand All @@ -351,7 +351,7 @@ type FederatedAuthenticationApi interface {
UpdateIdentityProviderWithParams(ctx context.Context, args *UpdateIdentityProviderApiParams) UpdateIdentityProviderApiRequest

// Interface only available internally
updateIdentityProviderExecute(r UpdateIdentityProviderApiRequest) (*FederationSamlIdentityProvider, *http.Response, error)
updateIdentityProviderExecute(r UpdateIdentityProviderApiRequest) (*FederationIdentityProvider, *http.Response, error)

/*
UpdateRoleMapping Update One Role Mapping in One Organization
Expand Down Expand Up @@ -1086,14 +1086,14 @@ func (a *FederatedAuthenticationApiService) GetIdentityProviderWithParams(ctx co
}
}

func (r GetIdentityProviderApiRequest) Execute() (*FederationSamlIdentityProvider, *http.Response, error) {
func (r GetIdentityProviderApiRequest) Execute() (*FederationIdentityProvider, *http.Response, error) {
return r.ApiService.getIdentityProviderExecute(r)
}

/*
GetIdentityProvider Return one SAML identity provider from the specified federation.
GetIdentityProvider Return one identity provider from the specified federation by id.
[experimental] Returns one SAML identity provider from the specified federation. To use this resource, the requesting API Key must have the Organization Owner role in one of the connected organizations.
[experimental] Returns one identity provider in the specified federation by the identity provider's id. To use this resource, the requesting API Key must have the Organization Owner role in one of the connected organizations. 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 federationSettingsId Unique 24-hexadecimal digit string that identifies your federation.
Expand All @@ -1111,13 +1111,13 @@ func (a *FederatedAuthenticationApiService) GetIdentityProvider(ctx context.Cont

// Execute executes the request
//
// @return FederationSamlIdentityProvider
func (a *FederatedAuthenticationApiService) getIdentityProviderExecute(r GetIdentityProviderApiRequest) (*FederationSamlIdentityProvider, *http.Response, error) {
// @return FederationIdentityProvider
func (a *FederatedAuthenticationApiService) getIdentityProviderExecute(r GetIdentityProviderApiRequest) (*FederationIdentityProvider, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *FederationSamlIdentityProvider
localVarReturnValue *FederationIdentityProvider
)

localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FederatedAuthenticationApiService.GetIdentityProvider")
Expand Down Expand Up @@ -1155,7 +1155,7 @@ func (a *FederatedAuthenticationApiService) getIdentityProviderExecute(r GetIden
}

// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-01-01+json", "application/json"}
localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-11-15+json", "application/json"}

// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
Expand Down Expand Up @@ -2217,62 +2217,62 @@ func (a *FederatedAuthenticationApiService) updateConnectedOrgConfigExecute(r Up
}

type UpdateIdentityProviderApiRequest struct {
ctx context.Context
ApiService FederatedAuthenticationApi
federationSettingsId string
identityProviderId string
samlIdentityProviderUpdate *SamlIdentityProviderUpdate
ctx context.Context
ApiService FederatedAuthenticationApi
federationSettingsId string
identityProviderId string
identityProviderUpdate *IdentityProviderUpdate
}

type UpdateIdentityProviderApiParams struct {
FederationSettingsId string
IdentityProviderId string
SamlIdentityProviderUpdate *SamlIdentityProviderUpdate
FederationSettingsId string
IdentityProviderId string
IdentityProviderUpdate *IdentityProviderUpdate
}

func (a *FederatedAuthenticationApiService) UpdateIdentityProviderWithParams(ctx context.Context, args *UpdateIdentityProviderApiParams) UpdateIdentityProviderApiRequest {
return UpdateIdentityProviderApiRequest{
ApiService: a,
ctx: ctx,
federationSettingsId: args.FederationSettingsId,
identityProviderId: args.IdentityProviderId,
samlIdentityProviderUpdate: args.SamlIdentityProviderUpdate,
ApiService: a,
ctx: ctx,
federationSettingsId: args.FederationSettingsId,
identityProviderId: args.IdentityProviderId,
identityProviderUpdate: args.IdentityProviderUpdate,
}
}

func (r UpdateIdentityProviderApiRequest) Execute() (*FederationSamlIdentityProvider, *http.Response, error) {
func (r UpdateIdentityProviderApiRequest) Execute() (*FederationIdentityProvider, *http.Response, error) {
return r.ApiService.updateIdentityProviderExecute(r)
}

/*
UpdateIdentityProvider Update the SAML identity provider.
UpdateIdentityProvider Update the identity provider.
[experimental] Updates one SAML identity provider in the specified federation. To use this resource, the requesting API Key must have the Organization Owner role in one of the connected organizations.
[experimental] Updates one identity provider in the specified federation. To use this resource, the requesting API Key must have the Organization Owner role in one of the connected organizations. 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 federationSettingsId Unique 24-hexadecimal digit string that identifies your federation.
@param identityProviderId Unique 20-hexadecimal digit string that identifies the identity provider.
@return UpdateIdentityProviderApiRequest
*/
func (a *FederatedAuthenticationApiService) UpdateIdentityProvider(ctx context.Context, federationSettingsId string, identityProviderId string, samlIdentityProviderUpdate *SamlIdentityProviderUpdate) UpdateIdentityProviderApiRequest {
func (a *FederatedAuthenticationApiService) UpdateIdentityProvider(ctx context.Context, federationSettingsId string, identityProviderId string, identityProviderUpdate *IdentityProviderUpdate) UpdateIdentityProviderApiRequest {
return UpdateIdentityProviderApiRequest{
ApiService: a,
ctx: ctx,
federationSettingsId: federationSettingsId,
identityProviderId: identityProviderId,
samlIdentityProviderUpdate: samlIdentityProviderUpdate,
ApiService: a,
ctx: ctx,
federationSettingsId: federationSettingsId,
identityProviderId: identityProviderId,
identityProviderUpdate: identityProviderUpdate,
}
}

// Execute executes the request
//
// @return FederationSamlIdentityProvider
func (a *FederatedAuthenticationApiService) updateIdentityProviderExecute(r UpdateIdentityProviderApiRequest) (*FederationSamlIdentityProvider, *http.Response, error) {
// @return FederationIdentityProvider
func (a *FederatedAuthenticationApiService) updateIdentityProviderExecute(r UpdateIdentityProviderApiRequest) (*FederationIdentityProvider, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *FederationSamlIdentityProvider
localVarReturnValue *FederationIdentityProvider
)

localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FederatedAuthenticationApiService.UpdateIdentityProvider")
Expand All @@ -2299,12 +2299,12 @@ func (a *FederatedAuthenticationApiService) updateIdentityProviderExecute(r Upda
if strlen(r.identityProviderId) > 20 {
return localVarReturnValue, nil, reportError("identityProviderId must have less than 20 elements")
}
if r.samlIdentityProviderUpdate == nil {
return localVarReturnValue, nil, reportError("samlIdentityProviderUpdate is required and must be specified")
if r.identityProviderUpdate == nil {
return localVarReturnValue, nil, reportError("identityProviderUpdate is required and must be specified")
}

// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/vnd.atlas.2023-01-01+json"}
localVarHTTPContentTypes := []string{"application/vnd.atlas.2023-11-15+json"}

// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
Expand All @@ -2313,15 +2313,15 @@ func (a *FederatedAuthenticationApiService) updateIdentityProviderExecute(r Upda
}

// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-01-01+json", "application/json"}
localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-11-15+json", "application/json"}

// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.samlIdentityProviderUpdate
localVarPostBody = r.identityProviderUpdate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
Expand Down
4 changes: 2 additions & 2 deletions admin/atlas_client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package admin // import "go.mongodb.org/atlas-sdk/v20231001002/admin"
package admin // import "go.mongodb.org/atlas-sdk/v20231115001/admin"

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

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

const (
Expand Down
78 changes: 78 additions & 0 deletions admin/model_api_search_deployment_request.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Code based on the AtlasAPI V2 OpenAPI file

package admin

import (
"encoding/json"
)

// ApiSearchDeploymentRequest struct for ApiSearchDeploymentRequest
type ApiSearchDeploymentRequest struct {
// List of settings that configure the search nodes for your cluster.
Specs []ApiSearchDeploymentSpec `json:"specs,omitempty"`
}

// NewApiSearchDeploymentRequest instantiates a new ApiSearchDeploymentRequest 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 NewApiSearchDeploymentRequest() *ApiSearchDeploymentRequest {
this := ApiSearchDeploymentRequest{}
return &this
}

// NewApiSearchDeploymentRequestWithDefaults instantiates a new ApiSearchDeploymentRequest 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 NewApiSearchDeploymentRequestWithDefaults() *ApiSearchDeploymentRequest {
this := ApiSearchDeploymentRequest{}
return &this
}

// GetSpecs returns the Specs field value if set, zero value otherwise
func (o *ApiSearchDeploymentRequest) GetSpecs() []ApiSearchDeploymentSpec {
if o == nil || IsNil(o.Specs) {
var ret []ApiSearchDeploymentSpec
return ret
}
return o.Specs
}

// GetSpecsOk returns a tuple with the Specs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApiSearchDeploymentRequest) GetSpecsOk() ([]ApiSearchDeploymentSpec, bool) {
if o == nil || IsNil(o.Specs) {
return nil, false
}

return o.Specs, true
}

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

return false
}

// SetSpecs gets a reference to the given []ApiSearchDeploymentSpec and assigns it to the Specs field.
func (o *ApiSearchDeploymentRequest) SetSpecs(v []ApiSearchDeploymentSpec) {
o.Specs = v
}

func (o ApiSearchDeploymentRequest) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ApiSearchDeploymentRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Specs) {
toSerialize["specs"] = o.Specs
}
return toSerialize, nil
}
Loading

0 comments on commit d42cace

Please sign in to comment.