Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ filename: "{{ .InterfaceName | snakecase }}.go"
mockname: "{{.InterfaceName}}"

packages:
go.mongodb.org/atlas-sdk/v20250312008/admin:
go.mongodb.org/atlas-sdk/v20250312009/admin:
config:
include-regex: ".*Api"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,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/v20250312008
go get go.mongodb.org/atlas-sdk/v20250312009
```

### Using in the code
Expand All @@ -21,7 +21,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/v20250312008/admin"
import "go.mongodb.org/atlas-sdk/v20250312009/admin"

func example() {
ctx := context.Background()
Expand Down
68 changes: 58 additions & 10 deletions admin/api_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,11 +649,13 @@ type CreateClusterApiRequest struct {
ApiService ClustersApi
groupId string
clusterDescription20240805 *ClusterDescription20240805
useEffectiveInstanceFields *bool
}

type CreateClusterApiParams struct {
GroupId string
ClusterDescription20240805 *ClusterDescription20240805
UseEffectiveInstanceFields *bool
}

func (a *ClustersApiService) CreateClusterWithParams(ctx context.Context, args *CreateClusterApiParams) CreateClusterApiRequest {
Expand All @@ -662,9 +664,16 @@ func (a *ClustersApiService) CreateClusterWithParams(ctx context.Context, args *
ctx: ctx,
groupId: args.GroupId,
clusterDescription20240805: args.ClusterDescription20240805,
useEffectiveInstanceFields: args.UseEffectiveInstanceFields,
}
}

// Controls how hardware specification fields are returned in the response after cluster creation. When set to true, returns the original client-specified values and provides separate effective fields showing current operational values. When false (default), hardware specification fields show current operational values directly. Primarily used for autoscaling compatibility.
func (r CreateClusterApiRequest) UseEffectiveInstanceFields(useEffectiveInstanceFields bool) CreateClusterApiRequest {
r.useEffectiveInstanceFields = &useEffectiveInstanceFields
return r
}

func (r CreateClusterApiRequest) Execute() (*ClusterDescription20240805, *http.Response, error) {
return r.ApiService.CreateClusterExecute(r)
}
Expand Down Expand Up @@ -735,6 +744,9 @@ func (a *ClustersApiService) CreateClusterExecute(r CreateClusterApiRequest) (*C
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.useEffectiveInstanceFields != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "Use-Effective-Instance-Fields", r.useEffectiveInstanceFields, "")
}
// body params
localVarPostBody = r.clusterDescription20240805
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
Expand Down Expand Up @@ -890,26 +902,35 @@ func (a *ClustersApiService) DeleteClusterExecute(r DeleteClusterApiRequest) (*h
}

type GetClusterApiRequest struct {
ctx context.Context
ApiService ClustersApi
groupId string
clusterName string
ctx context.Context
ApiService ClustersApi
groupId string
clusterName string
useEffectiveInstanceFields *bool
}

type GetClusterApiParams struct {
GroupId string
ClusterName string
GroupId string
ClusterName string
UseEffectiveInstanceFields *bool
}

func (a *ClustersApiService) GetClusterWithParams(ctx context.Context, args *GetClusterApiParams) GetClusterApiRequest {
return GetClusterApiRequest{
ApiService: a,
ctx: ctx,
groupId: args.GroupId,
clusterName: args.ClusterName,
ApiService: a,
ctx: ctx,
groupId: args.GroupId,
clusterName: args.ClusterName,
useEffectiveInstanceFields: args.UseEffectiveInstanceFields,
}
}

// Controls how hardware specification fields are returned in the response. When set to true, returns the original client-specified values and provides separate effective fields showing current operational values. When false (default), hardware specification fields show current operational values directly. Primarily used for autoscaling compatibility.
func (r GetClusterApiRequest) UseEffectiveInstanceFields(useEffectiveInstanceFields bool) GetClusterApiRequest {
r.useEffectiveInstanceFields = &useEffectiveInstanceFields
return r
}

func (r GetClusterApiRequest) Execute() (*ClusterDescription20240805, *http.Response, error) {
return r.ApiService.GetClusterExecute(r)
}
Expand Down Expand Up @@ -982,6 +1003,9 @@ func (a *ClustersApiService) GetClusterExecute(r GetClusterApiRequest) (*Cluster
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.useEffectiveInstanceFields != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "Use-Effective-Instance-Fields", r.useEffectiveInstanceFields, "")
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
Expand Down Expand Up @@ -1849,6 +1873,7 @@ type ListClustersApiRequest struct {
itemsPerPage *int
pageNum *int
includeDeletedWithRetainedBackups *bool
useEffectiveInstanceFields *bool
}

type ListClustersApiParams struct {
Expand All @@ -1857,6 +1882,7 @@ type ListClustersApiParams struct {
ItemsPerPage *int
PageNum *int
IncludeDeletedWithRetainedBackups *bool
UseEffectiveInstanceFields *bool
}

func (a *ClustersApiService) ListClustersWithParams(ctx context.Context, args *ListClustersApiParams) ListClustersApiRequest {
Expand All @@ -1868,6 +1894,7 @@ func (a *ClustersApiService) ListClustersWithParams(ctx context.Context, args *L
itemsPerPage: args.ItemsPerPage,
pageNum: args.PageNum,
includeDeletedWithRetainedBackups: args.IncludeDeletedWithRetainedBackups,
useEffectiveInstanceFields: args.UseEffectiveInstanceFields,
}
}

Expand Down Expand Up @@ -1895,6 +1922,12 @@ func (r ListClustersApiRequest) IncludeDeletedWithRetainedBackups(includeDeleted
return r
}

// Controls how hardware specification fields are returned in the response. When set to true, returns the original client-specified values and provides separate effective fields showing current operational values. When false (default), hardware specification fields show current operational values directly. Primarily used for autoscaling compatibility.
func (r ListClustersApiRequest) UseEffectiveInstanceFields(useEffectiveInstanceFields bool) ListClustersApiRequest {
r.useEffectiveInstanceFields = &useEffectiveInstanceFields
return r
}

func (r ListClustersApiRequest) Execute() (*PaginatedClusterDescription20240805, *http.Response, error) {
return r.ApiService.ListClustersExecute(r)
}
Expand Down Expand Up @@ -1989,6 +2022,9 @@ func (a *ClustersApiService) ListClustersExecute(r ListClustersApiRequest) (*Pag
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.useEffectiveInstanceFields != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "Use-Effective-Instance-Fields", r.useEffectiveInstanceFields, "")
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
Expand Down Expand Up @@ -2580,12 +2616,14 @@ type UpdateClusterApiRequest struct {
groupId string
clusterName string
clusterDescription20240805 *ClusterDescription20240805
useEffectiveInstanceFields *bool
}

type UpdateClusterApiParams struct {
GroupId string
ClusterName string
ClusterDescription20240805 *ClusterDescription20240805
UseEffectiveInstanceFields *bool
}

func (a *ClustersApiService) UpdateClusterWithParams(ctx context.Context, args *UpdateClusterApiParams) UpdateClusterApiRequest {
Expand All @@ -2595,9 +2633,16 @@ func (a *ClustersApiService) UpdateClusterWithParams(ctx context.Context, args *
groupId: args.GroupId,
clusterName: args.ClusterName,
clusterDescription20240805: args.ClusterDescription20240805,
useEffectiveInstanceFields: args.UseEffectiveInstanceFields,
}
}

// Controls how hardware specification fields are returned in the response after cluster updates. When set to true, returns the original client-specified values and provides separate effective fields showing current operational values. When false (default), hardware specification fields show current operational values directly. Note: When using this header with autoscaling enabled, MongoDB ignores replicationSpecs changes during updates. To intentionally override the replicationSpecs, disable this header.
func (r UpdateClusterApiRequest) UseEffectiveInstanceFields(useEffectiveInstanceFields bool) UpdateClusterApiRequest {
r.useEffectiveInstanceFields = &useEffectiveInstanceFields
return r
}

func (r UpdateClusterApiRequest) Execute() (*ClusterDescription20240805, *http.Response, error) {
return r.ApiService.UpdateClusterExecute(r)
}
Expand Down Expand Up @@ -2672,6 +2717,9 @@ func (a *ClustersApiService) UpdateClusterExecute(r UpdateClusterApiRequest) (*C
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.useEffectiveInstanceFields != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "Use-Effective-Instance-Fields", r.useEffectiveInstanceFields, "")
}
// body params
localVarPostBody = r.clusterDescription20240805
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
Expand Down
4 changes: 2 additions & 2 deletions admin/api_projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ type ProjectsApi interface {
/*
DeleteGroupInvite Remove One Invitation from One Project

Cancels one pending invitation sent to the specified MongoDB Cloud user to join a project. You can't cancel an invitation that the user accepted. To use this resource, the requesting Service Account or API Key must have the Project Owner role.
Cancels one pending invitation sent to the specified MongoDB Cloud user to join a project. You can't cancel an invitation that the user accepted. To use this resource, the requesting Service Account or API Key must have the Project Owner role. Note: deleting a project invitation does not delete an organization invitation even if they were created together.

@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 @@ -1099,7 +1099,7 @@ func (r DeleteGroupInviteApiRequest) Execute() (*http.Response, error) {
/*
DeleteGroupInvite Remove One Invitation from One Project

Cancels one pending invitation sent to the specified MongoDB Cloud user to join a project. You can't cancel an invitation that the user accepted. To use this resource, the requesting Service Account or API Key must have the Project Owner role.
Cancels one pending invitation sent to the specified MongoDB Cloud user to join a project. You can't cancel an invitation that the user accepted. To use this resource, the requesting Service Account or API Key must have the Project Owner role. Note: deleting a project invitation does not delete an organization invitation even if they were created together.

@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
Loading