Skip to content

Commit 459be4d

Browse files
APIBot: SDK update based on recent changes in Atlas API (#246)
1 parent 176fd5e commit 459be4d

File tree

122 files changed

+3172
-1310
lines changed

Some content is hidden

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

122 files changed

+3172
-1310
lines changed

README.md

+2-2
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/v20231115002
14+
go get go.mongodb.org/atlas-sdk/v20231115003
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/v20231115002/admin"
23+
import "go.mongodb.org/atlas-sdk/v20231115003/admin"
2424

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

admin/api_cloud_migration_service.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type CloudMigrationServiceApi interface {
4545
4646
You can use this API endpoint for push live migrations only. Your API Key must have the Organization Owner role to successfully call this resource.
4747
48-
**NOTE**: Migrating time-series collections is not yet supported on MongoDB v6.0 or higher. Migrations on MongoDB v6.0 or higher will skip any time-series collections on the source cluster.
48+
**NOTE**: Migrating time-series collections is not yet supported on MongoDB 6.0 or higher. Migrations on MongoDB 6.0 or higher will skip any time-series collections on the source cluster.
4949
5050
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
5151
@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.
@@ -383,7 +383,7 @@ Migrate one cluster that Cloud or Ops Manager manages to MongoDB Atlas.
383383
384384
You can use this API endpoint for push live migrations only. Your API Key must have the Organization Owner role to successfully call this resource.
385385
386-
**NOTE**: Migrating time-series collections is not yet supported on MongoDB v6.0 or higher. Migrations on MongoDB v6.0 or higher will skip any time-series collections on the source cluster.
386+
**NOTE**: Migrating time-series collections is not yet supported on MongoDB 6.0 or higher. Migrations on MongoDB 6.0 or higher will skip any time-series collections on the source cluster.
387387
388388
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
389389
@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_default.go

+157
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
// Code based on the AtlasAPI V2 OpenAPI file
2+
3+
package admin
4+
5+
import (
6+
"bytes"
7+
"context"
8+
"io"
9+
"net/http"
10+
"net/url"
11+
)
12+
13+
type DefaultApi interface {
14+
15+
/*
16+
ReturnAllControlPlaneIPAddresses Return All Control Plane IP Addresses
17+
18+
[experimental] Returns all control plane IP addresses.
19+
20+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
21+
@return ReturnAllControlPlaneIPAddressesApiRequest
22+
*/
23+
ReturnAllControlPlaneIPAddresses(ctx context.Context) ReturnAllControlPlaneIPAddressesApiRequest
24+
/*
25+
ReturnAllControlPlaneIPAddresses Return All Control Plane IP Addresses
26+
27+
28+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
29+
@param ReturnAllControlPlaneIPAddressesApiParams - Parameters for the request
30+
@return ReturnAllControlPlaneIPAddressesApiRequest
31+
*/
32+
ReturnAllControlPlaneIPAddressesWithParams(ctx context.Context, args *ReturnAllControlPlaneIPAddressesApiParams) ReturnAllControlPlaneIPAddressesApiRequest
33+
34+
// Interface only available internally
35+
returnAllControlPlaneIPAddressesExecute(r ReturnAllControlPlaneIPAddressesApiRequest) (*ControlPlaneIPAddresses, *http.Response, error)
36+
}
37+
38+
// DefaultApiService DefaultApi service
39+
type DefaultApiService service
40+
41+
type ReturnAllControlPlaneIPAddressesApiRequest struct {
42+
ctx context.Context
43+
ApiService DefaultApi
44+
}
45+
46+
type ReturnAllControlPlaneIPAddressesApiParams struct {
47+
}
48+
49+
func (a *DefaultApiService) ReturnAllControlPlaneIPAddressesWithParams(ctx context.Context, args *ReturnAllControlPlaneIPAddressesApiParams) ReturnAllControlPlaneIPAddressesApiRequest {
50+
return ReturnAllControlPlaneIPAddressesApiRequest{
51+
ApiService: a,
52+
ctx: ctx,
53+
}
54+
}
55+
56+
func (r ReturnAllControlPlaneIPAddressesApiRequest) Execute() (*ControlPlaneIPAddresses, *http.Response, error) {
57+
return r.ApiService.returnAllControlPlaneIPAddressesExecute(r)
58+
}
59+
60+
/*
61+
ReturnAllControlPlaneIPAddresses Return All Control Plane IP Addresses
62+
63+
[experimental] Returns all control plane IP addresses.
64+
65+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
66+
@return ReturnAllControlPlaneIPAddressesApiRequest
67+
*/
68+
func (a *DefaultApiService) ReturnAllControlPlaneIPAddresses(ctx context.Context) ReturnAllControlPlaneIPAddressesApiRequest {
69+
return ReturnAllControlPlaneIPAddressesApiRequest{
70+
ApiService: a,
71+
ctx: ctx,
72+
}
73+
}
74+
75+
// Execute executes the request
76+
//
77+
// @return ControlPlaneIPAddresses
78+
func (a *DefaultApiService) returnAllControlPlaneIPAddressesExecute(r ReturnAllControlPlaneIPAddressesApiRequest) (*ControlPlaneIPAddresses, *http.Response, error) {
79+
var (
80+
localVarHTTPMethod = http.MethodGet
81+
localVarPostBody interface{}
82+
formFiles []formFile
83+
localVarReturnValue *ControlPlaneIPAddresses
84+
)
85+
86+
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ReturnAllControlPlaneIPAddresses")
87+
if err != nil {
88+
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
89+
}
90+
91+
localVarPath := localBasePath + "/api/atlas/v2/unauth/controlPlaneIPAddresses"
92+
93+
localVarHeaderParams := make(map[string]string)
94+
localVarQueryParams := url.Values{}
95+
localVarFormParams := url.Values{}
96+
97+
// to determine the Content-Type header
98+
localVarHTTPContentTypes := []string{}
99+
100+
// set Content-Type header
101+
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
102+
if localVarHTTPContentType != "" {
103+
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
104+
}
105+
106+
// to determine the Accept header
107+
localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-11-15+json", "application/json"}
108+
109+
// set Accept header
110+
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
111+
if localVarHTTPHeaderAccept != "" {
112+
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
113+
}
114+
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
115+
if err != nil {
116+
return localVarReturnValue, nil, err
117+
}
118+
119+
localVarHTTPResponse, err := a.client.callAPI(req)
120+
if err != nil || localVarHTTPResponse == nil {
121+
return localVarReturnValue, localVarHTTPResponse, err
122+
}
123+
124+
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
125+
localVarHTTPResponse.Body.Close()
126+
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
127+
if err != nil {
128+
return localVarReturnValue, localVarHTTPResponse, err
129+
}
130+
131+
if localVarHTTPResponse.StatusCode >= 300 {
132+
newErr := &GenericOpenAPIError{
133+
body: localVarBody,
134+
error: localVarHTTPResponse.Status,
135+
}
136+
var v ApiError
137+
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
138+
if err != nil {
139+
newErr.error = err.Error()
140+
return localVarReturnValue, localVarHTTPResponse, newErr
141+
}
142+
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, localVarHTTPMethod, localVarPath, v)
143+
newErr.model = v
144+
return localVarReturnValue, localVarHTTPResponse, newErr
145+
}
146+
147+
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
148+
if err != nil {
149+
newErr := &GenericOpenAPIError{
150+
body: localVarBody,
151+
error: err.Error(),
152+
}
153+
return localVarReturnValue, localVarHTTPResponse, newErr
154+
}
155+
156+
return localVarReturnValue, localVarHTTPResponse, nil
157+
}

admin/api_programmatic_api_keys.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type ProgrammaticAPIKeysApi interface {
1616
/*
1717
AddProjectApiKey Assign One Organization API Key to One Project
1818
19-
[experimental] Assigns the specified organization API key to the specified project. Users with the Project Owner role in the project associated with the API key can then use the organization API key to access the resources. To use this resource, the requesting API Key must have the Project User Admin role.
19+
[experimental] Assigns the specified organization API key to the specified project. Users with the Project Owner role in the project associated with the API key can then use the organization API key to access the resources. To use this resource, the requesting API Key must have the Project Owner role.
2020
2121
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2222
@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.
@@ -87,7 +87,7 @@ type ProgrammaticAPIKeysApi interface {
8787
/*
8888
CreateProjectApiKey Create and Assign One Organization API Key to One Project
8989
90-
Creates and assigns the specified organization API key to the specified project. Users with the Project Owner role in the project associated with the API key can use the organization API key to access the resources. To use this resource, the requesting API Key must have the Project User Admin role.
90+
Creates and assigns the specified organization API key to the specified project. Users with the Project Owner role in the project associated with the API key can use the organization API key to access the resources. To use this resource, the requesting API Key must have the Project Owner role.
9191
9292
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
9393
@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.
@@ -255,7 +255,7 @@ type ProgrammaticAPIKeysApi interface {
255255
/*
256256
ListProjectApiKeys Return All Organization API Keys Assigned to One Project
257257
258-
Returns all organization API keys that you assigned to the specified project. Users with the Project Owner role in the project associated with the API key can use the organization API key to access the resources. To use this resource, the requesting API Key must have the Project User Admin role.
258+
Returns all organization API keys that you assigned to the specified project. Users with the Project Owner role in the project associated with the API key can use the organization API key to access the resources. To use this resource, the requesting API Key must have the Project Owner role.
259259
260260
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
261261
@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.
@@ -278,7 +278,7 @@ type ProgrammaticAPIKeysApi interface {
278278
/*
279279
RemoveProjectApiKey Unassign One Organization API Key from One Project
280280
281-
Removes one organization API key from the specified project. To use this resource, the requesting API Key must have the Project User Admin role.
281+
Removes one organization API key from the specified project. To use this resource, the requesting API Key must have the Project Owner role.
282282
283283
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
284284
@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.
@@ -382,7 +382,7 @@ func (r AddProjectApiKeyApiRequest) Execute() (*ApiKeyUserDetails, *http.Respons
382382
/*
383383
AddProjectApiKey Assign One Organization API Key to One Project
384384
385-
[experimental] Assigns the specified organization API key to the specified project. Users with the Project Owner role in the project associated with the API key can then use the organization API key to access the resources. To use this resource, the requesting API Key must have the Project User Admin role.
385+
[experimental] Assigns the specified organization API key to the specified project. Users with the Project Owner role in the project associated with the API key can then use the organization API key to access the resources. To use this resource, the requesting API Key must have the Project Owner role.
386386
387387
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
388388
@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.
@@ -868,7 +868,7 @@ func (r CreateProjectApiKeyApiRequest) Execute() (*ApiKeyUserDetails, *http.Resp
868868
/*
869869
CreateProjectApiKey Create and Assign One Organization API Key to One Project
870870
871-
Creates and assigns the specified organization API key to the specified project. Users with the Project Owner role in the project associated with the API key can use the organization API key to access the resources. To use this resource, the requesting API Key must have the Project User Admin role.
871+
Creates and assigns the specified organization API key to the specified project. Users with the Project Owner role in the project associated with the API key can use the organization API key to access the resources. To use this resource, the requesting API Key must have the Project Owner role.
872872
873873
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
874874
@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.
@@ -1979,7 +1979,7 @@ func (r ListProjectApiKeysApiRequest) Execute() (*PaginatedApiApiUser, *http.Res
19791979
/*
19801980
ListProjectApiKeys Return All Organization API Keys Assigned to One Project
19811981
1982-
Returns all organization API keys that you assigned to the specified project. Users with the Project Owner role in the project associated with the API key can use the organization API key to access the resources. To use this resource, the requesting API Key must have the Project User Admin role.
1982+
Returns all organization API keys that you assigned to the specified project. Users with the Project Owner role in the project associated with the API key can use the organization API key to access the resources. To use this resource, the requesting API Key must have the Project Owner role.
19831983
19841984
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
19851985
@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.
@@ -2133,7 +2133,7 @@ func (r RemoveProjectApiKeyApiRequest) Execute() (map[string]interface{}, *http.
21332133
/*
21342134
RemoveProjectApiKey Unassign One Organization API Key from One Project
21352135
2136-
Removes one organization API key from the specified project. To use this resource, the requesting API Key must have the Project User Admin role.
2136+
Removes one organization API key from the specified project. To use this resource, the requesting API Key must have the Project Owner role.
21372137
21382138
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
21392139
@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/atlas_client.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package admin // import "go.mongodb.org/atlas-sdk/v20231115002/admin"
1+
package admin // import "go.mongodb.org/atlas-sdk/v20231115003/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/v20231115002/internal/core"
11+
"go.mongodb.org/atlas-sdk/v20231115003/internal/core"
1212
)
1313

1414
const (

admin/client.go

+3
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ type APIClient struct {
7070

7171
DatabaseUsersApi DatabaseUsersApi
7272

73+
DefaultApi DefaultApi
74+
7375
EncryptionAtRestUsingCustomerKeyManagementApi EncryptionAtRestUsingCustomerKeyManagementApi
7476

7577
EventsApi EventsApi
@@ -162,6 +164,7 @@ func NewAPIClient(cfg *Configuration) *APIClient {
162164
c.DataFederationApi = (*DataFederationApiService)(&c.common)
163165
c.DataLakePipelinesApi = (*DataLakePipelinesApiService)(&c.common)
164166
c.DatabaseUsersApi = (*DatabaseUsersApiService)(&c.common)
167+
c.DefaultApi = (*DefaultApiService)(&c.common)
165168
c.EncryptionAtRestUsingCustomerKeyManagementApi = (*EncryptionAtRestUsingCustomerKeyManagementApiService)(&c.common)
166169
c.EventsApi = (*EventsApiService)(&c.common)
167170
c.FederatedAuthenticationApi = (*FederatedAuthenticationApiService)(&c.common)

admin/model_api_key_user_details.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"encoding/json"
77
)
88

9-
// ApiKeyUserDetails struct for ApiKeyUserDetails
9+
// ApiKeyUserDetails Details of the Programmatic API Keys.
1010
type ApiKeyUserDetails struct {
1111
// Purpose or explanation provided when someone created this organization API key.
1212
Desc *string `json:"desc,omitempty"`

0 commit comments

Comments
 (0)