Skip to content

Commit d42cace

Browse files
github-actions[bot]tibulca
andauthored
APIBot: SDK update based on recent changes in Atlas API (#235)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: tibulca <[email protected]>
1 parent bea1252 commit d42cace

File tree

103 files changed

+5473
-2945
lines changed

Some content is hidden

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

103 files changed

+5473
-2945
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/v20231001002
14+
go get go.mongodb.org/atlas-sdk/v20231115001
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/v20231001002/admin"
23+
import "go.mongodb.org/atlas-sdk/v20231115001/admin"
2424

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

admin/api_atlas_search.go

Lines changed: 670 additions & 0 deletions
Large diffs are not rendered by default.

admin/api_cloud_backups.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ type CloudBackupsApi interface {
162162
/*
163163
DeleteExportBucket Revoke Access to AWS S3 Bucket for Cloud Backup Snapshot Exports
164164
165-
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.
165+
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.
166166
167167
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
168168
@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.
@@ -1641,7 +1641,7 @@ func (r DeleteExportBucketApiRequest) Execute() (map[string]interface{}, *http.R
16411641
/*
16421642
DeleteExportBucket Revoke Access to AWS S3 Bucket for Cloud Backup Snapshot Exports
16431643
1644-
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.
1644+
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.
16451645
16461646
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
16471647
@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.

admin/api_federated_authentication.go

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ type FederatedAuthenticationApi interface {
133133
getFederationSettingsExecute(r GetFederationSettingsApiRequest) (*OrgFederationSettings, *http.Response, error)
134134

135135
/*
136-
GetIdentityProvider Return one SAML identity provider from the specified federation.
136+
GetIdentityProvider Return one identity provider from the specified federation by id.
137137
138-
[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.
138+
[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}
139139
140140
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
141141
@param federationSettingsId Unique 24-hexadecimal digit string that identifies your federation.
@@ -144,7 +144,7 @@ type FederatedAuthenticationApi interface {
144144
*/
145145
GetIdentityProvider(ctx context.Context, federationSettingsId string, identityProviderId string) GetIdentityProviderApiRequest
146146
/*
147-
GetIdentityProvider Return one SAML identity provider from the specified federation.
147+
GetIdentityProvider Return one identity provider from the specified federation by id.
148148
149149
150150
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@@ -154,7 +154,7 @@ type FederatedAuthenticationApi interface {
154154
GetIdentityProviderWithParams(ctx context.Context, args *GetIdentityProviderApiParams) GetIdentityProviderApiRequest
155155

156156
// Interface only available internally
157-
getIdentityProviderExecute(r GetIdentityProviderApiRequest) (*FederationSamlIdentityProvider, *http.Response, error)
157+
getIdentityProviderExecute(r GetIdentityProviderApiRequest) (*FederationIdentityProvider, *http.Response, error)
158158

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

332332
/*
333-
UpdateIdentityProvider Update the SAML identity provider.
333+
UpdateIdentityProvider Update the identity provider.
334334
335-
[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.
335+
[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}
336336
337337
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
338338
@param federationSettingsId Unique 24-hexadecimal digit string that identifies your federation.
339339
@param identityProviderId Unique 20-hexadecimal digit string that identifies the identity provider.
340340
@return UpdateIdentityProviderApiRequest
341341
*/
342-
UpdateIdentityProvider(ctx context.Context, federationSettingsId string, identityProviderId string, samlIdentityProviderUpdate *SamlIdentityProviderUpdate) UpdateIdentityProviderApiRequest
342+
UpdateIdentityProvider(ctx context.Context, federationSettingsId string, identityProviderId string, identityProviderUpdate *IdentityProviderUpdate) UpdateIdentityProviderApiRequest
343343
/*
344-
UpdateIdentityProvider Update the SAML identity provider.
344+
UpdateIdentityProvider Update the identity provider.
345345
346346
347347
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@@ -351,7 +351,7 @@ type FederatedAuthenticationApi interface {
351351
UpdateIdentityProviderWithParams(ctx context.Context, args *UpdateIdentityProviderApiParams) UpdateIdentityProviderApiRequest
352352

353353
// Interface only available internally
354-
updateIdentityProviderExecute(r UpdateIdentityProviderApiRequest) (*FederationSamlIdentityProvider, *http.Response, error)
354+
updateIdentityProviderExecute(r UpdateIdentityProviderApiRequest) (*FederationIdentityProvider, *http.Response, error)
355355

356356
/*
357357
UpdateRoleMapping Update One Role Mapping in One Organization
@@ -1086,14 +1086,14 @@ func (a *FederatedAuthenticationApiService) GetIdentityProviderWithParams(ctx co
10861086
}
10871087
}
10881088

1089-
func (r GetIdentityProviderApiRequest) Execute() (*FederationSamlIdentityProvider, *http.Response, error) {
1089+
func (r GetIdentityProviderApiRequest) Execute() (*FederationIdentityProvider, *http.Response, error) {
10901090
return r.ApiService.getIdentityProviderExecute(r)
10911091
}
10921092

10931093
/*
1094-
GetIdentityProvider Return one SAML identity provider from the specified federation.
1094+
GetIdentityProvider Return one identity provider from the specified federation by id.
10951095
1096-
[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.
1096+
[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}
10971097
10981098
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
10991099
@param federationSettingsId Unique 24-hexadecimal digit string that identifies your federation.
@@ -1111,13 +1111,13 @@ func (a *FederatedAuthenticationApiService) GetIdentityProvider(ctx context.Cont
11111111

11121112
// Execute executes the request
11131113
//
1114-
// @return FederationSamlIdentityProvider
1115-
func (a *FederatedAuthenticationApiService) getIdentityProviderExecute(r GetIdentityProviderApiRequest) (*FederationSamlIdentityProvider, *http.Response, error) {
1114+
// @return FederationIdentityProvider
1115+
func (a *FederatedAuthenticationApiService) getIdentityProviderExecute(r GetIdentityProviderApiRequest) (*FederationIdentityProvider, *http.Response, error) {
11161116
var (
11171117
localVarHTTPMethod = http.MethodGet
11181118
localVarPostBody interface{}
11191119
formFiles []formFile
1120-
localVarReturnValue *FederationSamlIdentityProvider
1120+
localVarReturnValue *FederationIdentityProvider
11211121
)
11221122

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

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

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

22192219
type UpdateIdentityProviderApiRequest struct {
2220-
ctx context.Context
2221-
ApiService FederatedAuthenticationApi
2222-
federationSettingsId string
2223-
identityProviderId string
2224-
samlIdentityProviderUpdate *SamlIdentityProviderUpdate
2220+
ctx context.Context
2221+
ApiService FederatedAuthenticationApi
2222+
federationSettingsId string
2223+
identityProviderId string
2224+
identityProviderUpdate *IdentityProviderUpdate
22252225
}
22262226

22272227
type UpdateIdentityProviderApiParams struct {
2228-
FederationSettingsId string
2229-
IdentityProviderId string
2230-
SamlIdentityProviderUpdate *SamlIdentityProviderUpdate
2228+
FederationSettingsId string
2229+
IdentityProviderId string
2230+
IdentityProviderUpdate *IdentityProviderUpdate
22312231
}
22322232

22332233
func (a *FederatedAuthenticationApiService) UpdateIdentityProviderWithParams(ctx context.Context, args *UpdateIdentityProviderApiParams) UpdateIdentityProviderApiRequest {
22342234
return UpdateIdentityProviderApiRequest{
2235-
ApiService: a,
2236-
ctx: ctx,
2237-
federationSettingsId: args.FederationSettingsId,
2238-
identityProviderId: args.IdentityProviderId,
2239-
samlIdentityProviderUpdate: args.SamlIdentityProviderUpdate,
2235+
ApiService: a,
2236+
ctx: ctx,
2237+
federationSettingsId: args.FederationSettingsId,
2238+
identityProviderId: args.IdentityProviderId,
2239+
identityProviderUpdate: args.IdentityProviderUpdate,
22402240
}
22412241
}
22422242

2243-
func (r UpdateIdentityProviderApiRequest) Execute() (*FederationSamlIdentityProvider, *http.Response, error) {
2243+
func (r UpdateIdentityProviderApiRequest) Execute() (*FederationIdentityProvider, *http.Response, error) {
22442244
return r.ApiService.updateIdentityProviderExecute(r)
22452245
}
22462246

22472247
/*
2248-
UpdateIdentityProvider Update the SAML identity provider.
2248+
UpdateIdentityProvider Update the identity provider.
22492249
2250-
[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.
2250+
[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}
22512251
22522252
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
22532253
@param federationSettingsId Unique 24-hexadecimal digit string that identifies your federation.
22542254
@param identityProviderId Unique 20-hexadecimal digit string that identifies the identity provider.
22552255
@return UpdateIdentityProviderApiRequest
22562256
*/
2257-
func (a *FederatedAuthenticationApiService) UpdateIdentityProvider(ctx context.Context, federationSettingsId string, identityProviderId string, samlIdentityProviderUpdate *SamlIdentityProviderUpdate) UpdateIdentityProviderApiRequest {
2257+
func (a *FederatedAuthenticationApiService) UpdateIdentityProvider(ctx context.Context, federationSettingsId string, identityProviderId string, identityProviderUpdate *IdentityProviderUpdate) UpdateIdentityProviderApiRequest {
22582258
return UpdateIdentityProviderApiRequest{
2259-
ApiService: a,
2260-
ctx: ctx,
2261-
federationSettingsId: federationSettingsId,
2262-
identityProviderId: identityProviderId,
2263-
samlIdentityProviderUpdate: samlIdentityProviderUpdate,
2259+
ApiService: a,
2260+
ctx: ctx,
2261+
federationSettingsId: federationSettingsId,
2262+
identityProviderId: identityProviderId,
2263+
identityProviderUpdate: identityProviderUpdate,
22642264
}
22652265
}
22662266

22672267
// Execute executes the request
22682268
//
2269-
// @return FederationSamlIdentityProvider
2270-
func (a *FederatedAuthenticationApiService) updateIdentityProviderExecute(r UpdateIdentityProviderApiRequest) (*FederationSamlIdentityProvider, *http.Response, error) {
2269+
// @return FederationIdentityProvider
2270+
func (a *FederatedAuthenticationApiService) updateIdentityProviderExecute(r UpdateIdentityProviderApiRequest) (*FederationIdentityProvider, *http.Response, error) {
22712271
var (
22722272
localVarHTTPMethod = http.MethodPatch
22732273
localVarPostBody interface{}
22742274
formFiles []formFile
2275-
localVarReturnValue *FederationSamlIdentityProvider
2275+
localVarReturnValue *FederationIdentityProvider
22762276
)
22772277

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

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

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

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

23182318
// set Accept header
23192319
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
23202320
if localVarHTTPHeaderAccept != "" {
23212321
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
23222322
}
23232323
// body params
2324-
localVarPostBody = r.samlIdentityProviderUpdate
2324+
localVarPostBody = r.identityProviderUpdate
23252325
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
23262326
if err != nil {
23272327
return localVarReturnValue, nil, err

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/v20231001002/admin"
1+
package admin // import "go.mongodb.org/atlas-sdk/v20231115001/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/v20231001002/internal/core"
11+
"go.mongodb.org/atlas-sdk/v20231115001/internal/core"
1212
)
1313

1414
const (
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// Code based on the AtlasAPI V2 OpenAPI file
2+
3+
package admin
4+
5+
import (
6+
"encoding/json"
7+
)
8+
9+
// ApiSearchDeploymentRequest struct for ApiSearchDeploymentRequest
10+
type ApiSearchDeploymentRequest struct {
11+
// List of settings that configure the search nodes for your cluster.
12+
Specs []ApiSearchDeploymentSpec `json:"specs,omitempty"`
13+
}
14+
15+
// NewApiSearchDeploymentRequest instantiates a new ApiSearchDeploymentRequest object
16+
// This constructor will assign default values to properties that have it defined,
17+
// and makes sure properties required by API are set, but the set of arguments
18+
// will change when the set of required properties is changed
19+
func NewApiSearchDeploymentRequest() *ApiSearchDeploymentRequest {
20+
this := ApiSearchDeploymentRequest{}
21+
return &this
22+
}
23+
24+
// NewApiSearchDeploymentRequestWithDefaults instantiates a new ApiSearchDeploymentRequest object
25+
// This constructor will only assign default values to properties that have it defined,
26+
// but it doesn't guarantee that properties required by API are set
27+
func NewApiSearchDeploymentRequestWithDefaults() *ApiSearchDeploymentRequest {
28+
this := ApiSearchDeploymentRequest{}
29+
return &this
30+
}
31+
32+
// GetSpecs returns the Specs field value if set, zero value otherwise
33+
func (o *ApiSearchDeploymentRequest) GetSpecs() []ApiSearchDeploymentSpec {
34+
if o == nil || IsNil(o.Specs) {
35+
var ret []ApiSearchDeploymentSpec
36+
return ret
37+
}
38+
return o.Specs
39+
}
40+
41+
// GetSpecsOk returns a tuple with the Specs field value if set, nil otherwise
42+
// and a boolean to check if the value has been set.
43+
func (o *ApiSearchDeploymentRequest) GetSpecsOk() ([]ApiSearchDeploymentSpec, bool) {
44+
if o == nil || IsNil(o.Specs) {
45+
return nil, false
46+
}
47+
48+
return o.Specs, true
49+
}
50+
51+
// HasSpecs returns a boolean if a field has been set.
52+
func (o *ApiSearchDeploymentRequest) HasSpecs() bool {
53+
if o != nil && !IsNil(o.Specs) {
54+
return true
55+
}
56+
57+
return false
58+
}
59+
60+
// SetSpecs gets a reference to the given []ApiSearchDeploymentSpec and assigns it to the Specs field.
61+
func (o *ApiSearchDeploymentRequest) SetSpecs(v []ApiSearchDeploymentSpec) {
62+
o.Specs = v
63+
}
64+
65+
func (o ApiSearchDeploymentRequest) MarshalJSONWithoutReadOnly() ([]byte, error) {
66+
toSerialize, err := o.ToMap()
67+
if err != nil {
68+
return []byte{}, err
69+
}
70+
return json.Marshal(toSerialize)
71+
}
72+
func (o ApiSearchDeploymentRequest) ToMap() (map[string]interface{}, error) {
73+
toSerialize := map[string]interface{}{}
74+
if !IsNil(o.Specs) {
75+
toSerialize["specs"] = o.Specs
76+
}
77+
return toSerialize, nil
78+
}

0 commit comments

Comments
 (0)