Skip to content

Commit 92ba675

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

File tree

193 files changed

+3689
-1434
lines changed

Some content is hidden

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

193 files changed

+3689
-1434
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/v20250219001/admin:
9+
go.mongodb.org/atlas-sdk/v20250312001/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/v20250219001
15+
go get go.mongodb.org/atlas-sdk/v20250312001
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/v20250219001/admin"
24+
import "go.mongodb.org/atlas-sdk/v20250312001/admin"
2525

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

admin/api_atlas_search.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ type AtlasSearchApi interface {
199199
/*
200200
GetAtlasSearchDeployment Return Search Nodes
201201
202-
Return the Search Nodes for the specified cluster. Deprecated versions: v2-{2023-01-01}
202+
Returns the Search Nodes for the specified cluster. Deprecated versions: v2-{2024-05-30}, v2-{2023-01-01}
203203
204204
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
205205
@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.
@@ -1406,7 +1406,7 @@ func (r GetAtlasSearchDeploymentApiRequest) Execute() (*ApiSearchDeploymentRespo
14061406
/*
14071407
GetAtlasSearchDeployment Return Search Nodes
14081408
1409-
Return the Search Nodes for the specified cluster. Deprecated versions: v2-{2023-01-01}
1409+
Returns the Search Nodes for the specified cluster. Deprecated versions: v2-{2024-05-30}, v2-{2023-01-01}
14101410
14111411
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
14121412
@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.
@@ -1456,7 +1456,7 @@ func (a *AtlasSearchApiService) GetAtlasSearchDeploymentExecute(r GetAtlasSearch
14561456
}
14571457

14581458
// to determine the Accept header (only first one)
1459-
localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-05-30+json"}
1459+
localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2025-03-12+json"}
14601460

14611461
// set Accept header
14621462
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)

admin/api_clusters.go

+149
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,34 @@ import (
1313

1414
type ClustersApi interface {
1515

16+
/*
17+
AutoScalingConfiguration Get cluster internal configuration of sharded cluster AutoScaling operations
18+
19+
Returns the internal configuration of AutoScaling for sharded clusters. This endpoint can be used for diagnostic purposes to ensure that sharded clusters updated from older APIs have gained support for AutoScaling each shard independently.
20+
21+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
22+
@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.
23+
@param clusterName Human-readable label that identifies this cluster.
24+
@return AutoScalingConfigurationApiRequest
25+
26+
Deprecated: this method has been deprecated. Please check the latest resource version for ClustersApi
27+
*/
28+
AutoScalingConfiguration(ctx context.Context, groupId string, clusterName string) AutoScalingConfigurationApiRequest
29+
/*
30+
AutoScalingConfiguration Get cluster internal configuration of sharded cluster AutoScaling operations
31+
32+
33+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
34+
@param AutoScalingConfigurationApiParams - Parameters for the request
35+
@return AutoScalingConfigurationApiRequest
36+
37+
Deprecated: this method has been deprecated. Please check the latest resource version for ClustersApi
38+
*/
39+
AutoScalingConfigurationWithParams(ctx context.Context, args *AutoScalingConfigurationApiParams) AutoScalingConfigurationApiRequest
40+
41+
// Method available only for mocking purposes
42+
AutoScalingConfigurationExecute(r AutoScalingConfigurationApiRequest) (*ClusterDescriptionAutoScalingModeConfiguration, *http.Response, error)
43+
1644
/*
1745
CreateCluster Create One Cluster from One Project
1846
@@ -489,6 +517,127 @@ type ClustersApi interface {
489517
// ClustersApiService ClustersApi service
490518
type ClustersApiService service
491519

520+
type AutoScalingConfigurationApiRequest struct {
521+
ctx context.Context
522+
ApiService ClustersApi
523+
groupId string
524+
clusterName string
525+
}
526+
527+
type AutoScalingConfigurationApiParams struct {
528+
GroupId string
529+
ClusterName string
530+
}
531+
532+
func (a *ClustersApiService) AutoScalingConfigurationWithParams(ctx context.Context, args *AutoScalingConfigurationApiParams) AutoScalingConfigurationApiRequest {
533+
return AutoScalingConfigurationApiRequest{
534+
ApiService: a,
535+
ctx: ctx,
536+
groupId: args.GroupId,
537+
clusterName: args.ClusterName,
538+
}
539+
}
540+
541+
func (r AutoScalingConfigurationApiRequest) Execute() (*ClusterDescriptionAutoScalingModeConfiguration, *http.Response, error) {
542+
return r.ApiService.AutoScalingConfigurationExecute(r)
543+
}
544+
545+
/*
546+
AutoScalingConfiguration Get cluster internal configuration of sharded cluster AutoScaling operations
547+
548+
Returns the internal configuration of AutoScaling for sharded clusters. This endpoint can be used for diagnostic purposes to ensure that sharded clusters updated from older APIs have gained support for AutoScaling each shard independently.
549+
550+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
551+
@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.
552+
@param clusterName Human-readable label that identifies this cluster.
553+
@return AutoScalingConfigurationApiRequest
554+
555+
Deprecated
556+
*/
557+
func (a *ClustersApiService) AutoScalingConfiguration(ctx context.Context, groupId string, clusterName string) AutoScalingConfigurationApiRequest {
558+
return AutoScalingConfigurationApiRequest{
559+
ApiService: a,
560+
ctx: ctx,
561+
groupId: groupId,
562+
clusterName: clusterName,
563+
}
564+
}
565+
566+
// AutoScalingConfigurationExecute executes the request
567+
//
568+
// @return ClusterDescriptionAutoScalingModeConfiguration
569+
//
570+
// Deprecated
571+
func (a *ClustersApiService) AutoScalingConfigurationExecute(r AutoScalingConfigurationApiRequest) (*ClusterDescriptionAutoScalingModeConfiguration, *http.Response, error) {
572+
var (
573+
localVarHTTPMethod = http.MethodGet
574+
localVarPostBody any
575+
formFiles []formFile
576+
localVarReturnValue *ClusterDescriptionAutoScalingModeConfiguration
577+
)
578+
579+
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClustersApiService.AutoScalingConfiguration")
580+
if err != nil {
581+
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
582+
}
583+
584+
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/autoScalingConfiguration"
585+
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
586+
localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(r.clusterName), -1)
587+
588+
localVarHeaderParams := make(map[string]string)
589+
localVarQueryParams := url.Values{}
590+
localVarFormParams := url.Values{}
591+
592+
// to determine the Content-Type header
593+
localVarHTTPContentTypes := []string{}
594+
595+
// set Content-Type header
596+
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
597+
if localVarHTTPContentType != "" {
598+
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
599+
}
600+
601+
// to determine the Accept header (only first one)
602+
localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json"}
603+
604+
// set Accept header
605+
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
606+
if localVarHTTPHeaderAccept != "" {
607+
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
608+
}
609+
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
610+
if err != nil {
611+
return localVarReturnValue, nil, err
612+
}
613+
614+
localVarHTTPResponse, err := a.client.callAPI(req)
615+
if err != nil || localVarHTTPResponse == nil {
616+
return localVarReturnValue, localVarHTTPResponse, err
617+
}
618+
619+
if localVarHTTPResponse.StatusCode >= 300 {
620+
newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath)
621+
return localVarReturnValue, localVarHTTPResponse, newErr
622+
}
623+
624+
err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type"))
625+
if err != nil {
626+
defer localVarHTTPResponse.Body.Close()
627+
buf, readErr := io.ReadAll(localVarHTTPResponse.Body)
628+
if readErr != nil {
629+
err = readErr
630+
}
631+
newErr := &GenericOpenAPIError{
632+
body: buf,
633+
error: err.Error(),
634+
}
635+
return localVarReturnValue, localVarHTTPResponse, newErr
636+
}
637+
638+
return localVarReturnValue, localVarHTTPResponse, nil
639+
}
640+
492641
type CreateClusterApiRequest struct {
493642
ctx context.Context
494643
ApiService ClustersApi

0 commit comments

Comments
 (0)