Skip to content

Commit e4b8378

Browse files
svc-apix-Botgithub-actions[bot]wtrocki
authored
APIBot: SDK update based on recent changes in Atlas API (#516)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: wtrocki <[email protected]>
1 parent c95de06 commit e4b8378

File tree

228 files changed

+16328
-3686
lines changed

Some content is hidden

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

228 files changed

+16328
-3686
lines changed

.mockery.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ filename: "{{ .InterfaceName | snakecase }}.go"
66
mockname: "{{.InterfaceName}}"
77

88
packages:
9-
go.mongodb.org/atlas-sdk/v20241113005/admin:
9+
go.mongodb.org/atlas-sdk/v20250219001/admin:
1010
config:
1111
include-regex: ".*Api"

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Note that `atlas-sdk-go` only supports the two most recent major versions of Go.
1212
### Adding Dependency
1313

1414
```terminal
15-
go get go.mongodb.org/atlas-sdk/v20241113005
15+
go get go.mongodb.org/atlas-sdk/v20250219001
1616
```
1717

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

2323
```go
24-
import "go.mongodb.org/atlas-sdk/v20241113005/admin"
24+
import "go.mongodb.org/atlas-sdk/v20250219001/admin"
2525

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

admin/api_mongo_db_cloud_users.go

+2,799-122
Large diffs are not rendered by default.

admin/api_organizations.go

+56-323
Large diffs are not rendered by default.

admin/api_performance_advisor.go

+282
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,54 @@ type PerformanceAdvisorApi interface {
130130
// Method available only for mocking purposes
131131
ListClusterSuggestedIndexesExecute(r ListClusterSuggestedIndexesApiRequest) (*PerformanceAdvisorResponse, *http.Response, error)
132132

133+
/*
134+
ListDropIndexes Returns Suggested Indexes to Drop
135+
136+
Returns the indexes that the Performance Advisor suggests to drop. The Performance Advisor suggests dropping unused, redundant, and hidden indexes to improve write performance and increase storage space. To use this resource, the requesting API Key must have the Project Read Only role.
137+
138+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
139+
@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.
140+
@param clusterName Human-readable label that identifies the cluster.
141+
@return ListDropIndexesApiRequest
142+
*/
143+
ListDropIndexes(ctx context.Context, groupId string, clusterName string) ListDropIndexesApiRequest
144+
/*
145+
ListDropIndexes Returns Suggested Indexes to Drop
146+
147+
148+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
149+
@param ListDropIndexesApiParams - Parameters for the request
150+
@return ListDropIndexesApiRequest
151+
*/
152+
ListDropIndexesWithParams(ctx context.Context, args *ListDropIndexesApiParams) ListDropIndexesApiRequest
153+
154+
// Method available only for mocking purposes
155+
ListDropIndexesExecute(r ListDropIndexesApiRequest) (*DropIndexSuggestionsResponse, *http.Response, error)
156+
157+
/*
158+
ListSchemaAdvice Return Schema Advice
159+
160+
Returns the schema suggestions that the Performance Advisor detects. The Performance Advisor provides holistic schema recommendations for your cluster by sampling documents in your most active collections and collections with slow-running queries. To use this resource, the requesting API Key must have the Project Read Only role.
161+
162+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
163+
@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.
164+
@param clusterName Human-readable label that identifies the cluster.
165+
@return ListSchemaAdviceApiRequest
166+
*/
167+
ListSchemaAdvice(ctx context.Context, groupId string, clusterName string) ListSchemaAdviceApiRequest
168+
/*
169+
ListSchemaAdvice Return Schema Advice
170+
171+
172+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
173+
@param ListSchemaAdviceApiParams - Parameters for the request
174+
@return ListSchemaAdviceApiRequest
175+
*/
176+
ListSchemaAdviceWithParams(ctx context.Context, args *ListSchemaAdviceApiParams) ListSchemaAdviceApiRequest
177+
178+
// Method available only for mocking purposes
179+
ListSchemaAdviceExecute(r ListSchemaAdviceApiRequest) (*SchemaAdvisorResponse, *http.Response, error)
180+
133181
/*
134182
ListSlowQueries Return Slow Queries
135183
@@ -819,6 +867,240 @@ func (a *PerformanceAdvisorApiService) ListClusterSuggestedIndexesExecute(r List
819867
return localVarReturnValue, localVarHTTPResponse, nil
820868
}
821869

870+
type ListDropIndexesApiRequest struct {
871+
ctx context.Context
872+
ApiService PerformanceAdvisorApi
873+
groupId string
874+
clusterName string
875+
}
876+
877+
type ListDropIndexesApiParams struct {
878+
GroupId string
879+
ClusterName string
880+
}
881+
882+
func (a *PerformanceAdvisorApiService) ListDropIndexesWithParams(ctx context.Context, args *ListDropIndexesApiParams) ListDropIndexesApiRequest {
883+
return ListDropIndexesApiRequest{
884+
ApiService: a,
885+
ctx: ctx,
886+
groupId: args.GroupId,
887+
clusterName: args.ClusterName,
888+
}
889+
}
890+
891+
func (r ListDropIndexesApiRequest) Execute() (*DropIndexSuggestionsResponse, *http.Response, error) {
892+
return r.ApiService.ListDropIndexesExecute(r)
893+
}
894+
895+
/*
896+
ListDropIndexes Returns Suggested Indexes to Drop
897+
898+
Returns the indexes that the Performance Advisor suggests to drop. The Performance Advisor suggests dropping unused, redundant, and hidden indexes to improve write performance and increase storage space. To use this resource, the requesting API Key must have the Project Read Only role.
899+
900+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
901+
@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.
902+
@param clusterName Human-readable label that identifies the cluster.
903+
@return ListDropIndexesApiRequest
904+
*/
905+
func (a *PerformanceAdvisorApiService) ListDropIndexes(ctx context.Context, groupId string, clusterName string) ListDropIndexesApiRequest {
906+
return ListDropIndexesApiRequest{
907+
ApiService: a,
908+
ctx: ctx,
909+
groupId: groupId,
910+
clusterName: clusterName,
911+
}
912+
}
913+
914+
// ListDropIndexesExecute executes the request
915+
//
916+
// @return DropIndexSuggestionsResponse
917+
func (a *PerformanceAdvisorApiService) ListDropIndexesExecute(r ListDropIndexesApiRequest) (*DropIndexSuggestionsResponse, *http.Response, error) {
918+
var (
919+
localVarHTTPMethod = http.MethodGet
920+
localVarPostBody any
921+
formFiles []formFile
922+
localVarReturnValue *DropIndexSuggestionsResponse
923+
)
924+
925+
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PerformanceAdvisorApiService.ListDropIndexes")
926+
if err != nil {
927+
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
928+
}
929+
930+
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/dropIndexSuggestions"
931+
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
932+
localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(r.clusterName), -1)
933+
934+
localVarHeaderParams := make(map[string]string)
935+
localVarQueryParams := url.Values{}
936+
localVarFormParams := url.Values{}
937+
938+
// to determine the Content-Type header
939+
localVarHTTPContentTypes := []string{}
940+
941+
// set Content-Type header
942+
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
943+
if localVarHTTPContentType != "" {
944+
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
945+
}
946+
947+
// to determine the Accept header (only first one)
948+
localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json"}
949+
950+
// set Accept header
951+
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
952+
if localVarHTTPHeaderAccept != "" {
953+
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
954+
}
955+
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
956+
if err != nil {
957+
return localVarReturnValue, nil, err
958+
}
959+
960+
localVarHTTPResponse, err := a.client.callAPI(req)
961+
if err != nil || localVarHTTPResponse == nil {
962+
return localVarReturnValue, localVarHTTPResponse, err
963+
}
964+
965+
if localVarHTTPResponse.StatusCode >= 300 {
966+
newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath)
967+
return localVarReturnValue, localVarHTTPResponse, newErr
968+
}
969+
970+
err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type"))
971+
if err != nil {
972+
defer localVarHTTPResponse.Body.Close()
973+
buf, readErr := io.ReadAll(localVarHTTPResponse.Body)
974+
if readErr != nil {
975+
err = readErr
976+
}
977+
newErr := &GenericOpenAPIError{
978+
body: buf,
979+
error: err.Error(),
980+
}
981+
return localVarReturnValue, localVarHTTPResponse, newErr
982+
}
983+
984+
return localVarReturnValue, localVarHTTPResponse, nil
985+
}
986+
987+
type ListSchemaAdviceApiRequest struct {
988+
ctx context.Context
989+
ApiService PerformanceAdvisorApi
990+
groupId string
991+
clusterName string
992+
}
993+
994+
type ListSchemaAdviceApiParams struct {
995+
GroupId string
996+
ClusterName string
997+
}
998+
999+
func (a *PerformanceAdvisorApiService) ListSchemaAdviceWithParams(ctx context.Context, args *ListSchemaAdviceApiParams) ListSchemaAdviceApiRequest {
1000+
return ListSchemaAdviceApiRequest{
1001+
ApiService: a,
1002+
ctx: ctx,
1003+
groupId: args.GroupId,
1004+
clusterName: args.ClusterName,
1005+
}
1006+
}
1007+
1008+
func (r ListSchemaAdviceApiRequest) Execute() (*SchemaAdvisorResponse, *http.Response, error) {
1009+
return r.ApiService.ListSchemaAdviceExecute(r)
1010+
}
1011+
1012+
/*
1013+
ListSchemaAdvice Return Schema Advice
1014+
1015+
Returns the schema suggestions that the Performance Advisor detects. The Performance Advisor provides holistic schema recommendations for your cluster by sampling documents in your most active collections and collections with slow-running queries. To use this resource, the requesting API Key must have the Project Read Only role.
1016+
1017+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
1018+
@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.
1019+
@param clusterName Human-readable label that identifies the cluster.
1020+
@return ListSchemaAdviceApiRequest
1021+
*/
1022+
func (a *PerformanceAdvisorApiService) ListSchemaAdvice(ctx context.Context, groupId string, clusterName string) ListSchemaAdviceApiRequest {
1023+
return ListSchemaAdviceApiRequest{
1024+
ApiService: a,
1025+
ctx: ctx,
1026+
groupId: groupId,
1027+
clusterName: clusterName,
1028+
}
1029+
}
1030+
1031+
// ListSchemaAdviceExecute executes the request
1032+
//
1033+
// @return SchemaAdvisorResponse
1034+
func (a *PerformanceAdvisorApiService) ListSchemaAdviceExecute(r ListSchemaAdviceApiRequest) (*SchemaAdvisorResponse, *http.Response, error) {
1035+
var (
1036+
localVarHTTPMethod = http.MethodGet
1037+
localVarPostBody any
1038+
formFiles []formFile
1039+
localVarReturnValue *SchemaAdvisorResponse
1040+
)
1041+
1042+
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PerformanceAdvisorApiService.ListSchemaAdvice")
1043+
if err != nil {
1044+
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
1045+
}
1046+
1047+
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/schemaAdvice"
1048+
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
1049+
localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(r.clusterName), -1)
1050+
1051+
localVarHeaderParams := make(map[string]string)
1052+
localVarQueryParams := url.Values{}
1053+
localVarFormParams := url.Values{}
1054+
1055+
// to determine the Content-Type header
1056+
localVarHTTPContentTypes := []string{}
1057+
1058+
// set Content-Type header
1059+
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
1060+
if localVarHTTPContentType != "" {
1061+
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
1062+
}
1063+
1064+
// to determine the Accept header (only first one)
1065+
localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json"}
1066+
1067+
// set Accept header
1068+
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
1069+
if localVarHTTPHeaderAccept != "" {
1070+
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
1071+
}
1072+
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
1073+
if err != nil {
1074+
return localVarReturnValue, nil, err
1075+
}
1076+
1077+
localVarHTTPResponse, err := a.client.callAPI(req)
1078+
if err != nil || localVarHTTPResponse == nil {
1079+
return localVarReturnValue, localVarHTTPResponse, err
1080+
}
1081+
1082+
if localVarHTTPResponse.StatusCode >= 300 {
1083+
newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath)
1084+
return localVarReturnValue, localVarHTTPResponse, newErr
1085+
}
1086+
1087+
err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type"))
1088+
if err != nil {
1089+
defer localVarHTTPResponse.Body.Close()
1090+
buf, readErr := io.ReadAll(localVarHTTPResponse.Body)
1091+
if readErr != nil {
1092+
err = readErr
1093+
}
1094+
newErr := &GenericOpenAPIError{
1095+
body: buf,
1096+
error: err.Error(),
1097+
}
1098+
return localVarReturnValue, localVarHTTPResponse, newErr
1099+
}
1100+
1101+
return localVarReturnValue, localVarHTTPResponse, nil
1102+
}
1103+
8221104
type ListSlowQueriesApiRequest struct {
8231105
ctx context.Context
8241106
ApiService PerformanceAdvisorApi

0 commit comments

Comments
 (0)