Skip to content

Commit e79e169

Browse files
authored
APIBot: SDK update based on recent changes in Atlas API (#502)
1 parent 5cdb685 commit e79e169

File tree

299 files changed

+2466
-1702
lines changed

Some content is hidden

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

299 files changed

+2466
-1702
lines changed

.mockery.yaml

Lines changed: 1 addition & 1 deletion
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/v20241113003/admin:
9+
go.mongodb.org/atlas-sdk/v20241113004/admin:
1010
config:
1111
include-regex: ".*Api"

README.md

Lines changed: 2 additions & 2 deletions
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/v20241113003
15+
go get go.mongodb.org/atlas-sdk/v20241113004
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/v20241113003/admin"
24+
import "go.mongodb.org/atlas-sdk/v20241113004/admin"
2525

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

admin/api_cloud_backups.go

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,29 @@ type CloudBackupsApi interface {
236236
// Method available only for mocking purposes
237237
DeleteShardedClusterBackupExecute(r DeleteShardedClusterBackupApiRequest) (any, *http.Response, error)
238238

239+
/*
240+
DisableDataProtectionSettings Disable the Backup Compliance Policy settings
241+
242+
Disables the Backup Compliance Policy settings with the specified project. As a prerequisite, a support ticket needs to be file first, instructions in https://www.mongodb.com/docs/atlas/backup/cloud-backup/backup-compliance-policy/. To use this resource, the requesting API Key must have the Project Owner role.
243+
244+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
245+
@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.
246+
@return DisableDataProtectionSettingsApiRequest
247+
*/
248+
DisableDataProtectionSettings(ctx context.Context, groupId string) DisableDataProtectionSettingsApiRequest
249+
/*
250+
DisableDataProtectionSettings Disable the Backup Compliance Policy settings
251+
252+
253+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
254+
@param DisableDataProtectionSettingsApiParams - Parameters for the request
255+
@return DisableDataProtectionSettingsApiRequest
256+
*/
257+
DisableDataProtectionSettingsWithParams(ctx context.Context, args *DisableDataProtectionSettingsApiParams) DisableDataProtectionSettingsApiRequest
258+
259+
// Method available only for mocking purposes
260+
DisableDataProtectionSettingsExecute(r DisableDataProtectionSettingsApiRequest) (any, *http.Response, error)
261+
239262
/*
240263
GetBackupExportJob Return One Snapshot Export Job
241264
@@ -1833,6 +1856,117 @@ func (a *CloudBackupsApiService) DeleteShardedClusterBackupExecute(r DeleteShard
18331856
return localVarReturnValue, localVarHTTPResponse, nil
18341857
}
18351858

1859+
type DisableDataProtectionSettingsApiRequest struct {
1860+
ctx context.Context
1861+
ApiService CloudBackupsApi
1862+
groupId string
1863+
}
1864+
1865+
type DisableDataProtectionSettingsApiParams struct {
1866+
GroupId string
1867+
}
1868+
1869+
func (a *CloudBackupsApiService) DisableDataProtectionSettingsWithParams(ctx context.Context, args *DisableDataProtectionSettingsApiParams) DisableDataProtectionSettingsApiRequest {
1870+
return DisableDataProtectionSettingsApiRequest{
1871+
ApiService: a,
1872+
ctx: ctx,
1873+
groupId: args.GroupId,
1874+
}
1875+
}
1876+
1877+
func (r DisableDataProtectionSettingsApiRequest) Execute() (any, *http.Response, error) {
1878+
return r.ApiService.DisableDataProtectionSettingsExecute(r)
1879+
}
1880+
1881+
/*
1882+
DisableDataProtectionSettings Disable the Backup Compliance Policy settings
1883+
1884+
Disables the Backup Compliance Policy settings with the specified project. As a prerequisite, a support ticket needs to be file first, instructions in https://www.mongodb.com/docs/atlas/backup/cloud-backup/backup-compliance-policy/. To use this resource, the requesting API Key must have the Project Owner role.
1885+
1886+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
1887+
@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.
1888+
@return DisableDataProtectionSettingsApiRequest
1889+
*/
1890+
func (a *CloudBackupsApiService) DisableDataProtectionSettings(ctx context.Context, groupId string) DisableDataProtectionSettingsApiRequest {
1891+
return DisableDataProtectionSettingsApiRequest{
1892+
ApiService: a,
1893+
ctx: ctx,
1894+
groupId: groupId,
1895+
}
1896+
}
1897+
1898+
// DisableDataProtectionSettingsExecute executes the request
1899+
//
1900+
// @return any
1901+
func (a *CloudBackupsApiService) DisableDataProtectionSettingsExecute(r DisableDataProtectionSettingsApiRequest) (any, *http.Response, error) {
1902+
var (
1903+
localVarHTTPMethod = http.MethodDelete
1904+
localVarPostBody any
1905+
formFiles []formFile
1906+
localVarReturnValue any
1907+
)
1908+
1909+
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CloudBackupsApiService.DisableDataProtectionSettings")
1910+
if err != nil {
1911+
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
1912+
}
1913+
1914+
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/backupCompliancePolicy"
1915+
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
1916+
1917+
localVarHeaderParams := make(map[string]string)
1918+
localVarQueryParams := url.Values{}
1919+
localVarFormParams := url.Values{}
1920+
1921+
// to determine the Content-Type header
1922+
localVarHTTPContentTypes := []string{}
1923+
1924+
// set Content-Type header
1925+
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
1926+
if localVarHTTPContentType != "" {
1927+
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
1928+
}
1929+
1930+
// to determine the Accept header (only first one)
1931+
localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-11-13+json"}
1932+
1933+
// set Accept header
1934+
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
1935+
if localVarHTTPHeaderAccept != "" {
1936+
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
1937+
}
1938+
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
1939+
if err != nil {
1940+
return localVarReturnValue, nil, err
1941+
}
1942+
1943+
localVarHTTPResponse, err := a.client.callAPI(req)
1944+
if err != nil || localVarHTTPResponse == nil {
1945+
return localVarReturnValue, localVarHTTPResponse, err
1946+
}
1947+
1948+
if localVarHTTPResponse.StatusCode >= 300 {
1949+
newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath)
1950+
return localVarReturnValue, localVarHTTPResponse, newErr
1951+
}
1952+
1953+
err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type"))
1954+
if err != nil {
1955+
defer localVarHTTPResponse.Body.Close()
1956+
buf, readErr := io.ReadAll(localVarHTTPResponse.Body)
1957+
if readErr != nil {
1958+
err = readErr
1959+
}
1960+
newErr := &GenericOpenAPIError{
1961+
body: buf,
1962+
error: err.Error(),
1963+
}
1964+
return localVarReturnValue, localVarHTTPResponse, newErr
1965+
}
1966+
1967+
return localVarReturnValue, localVarHTTPResponse, nil
1968+
}
1969+
18361970
type GetBackupExportJobApiRequest struct {
18371971
ctx context.Context
18381972
ApiService CloudBackupsApi

admin/api_clusters.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ type ClustersApi interface {
8888
/*
8989
GetClusterAdvancedConfiguration Return One Advanced Configuration Options for One Cluster
9090
91-
Returns the advanced configuration details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. Advanced configuration details include the read/write concern, index and oplog limits, and other database settings. This feature isn't available for `M0` free clusters, `M2` and `M5` shared-tier clusters, or serverless clusters. To use this resource, the requesting API Key must have the Project Read Only role. Deprecated versions: v2-{2023-01-01}
91+
Returns the advanced configuration details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. Advanced configuration details include the read/write concern, index and oplog limits, and other database settings. This feature isn't available for `M0` free clusters, `M2` and `M5` shared-tier clusters, flex clusters, or serverless clusters. To use this resource, the requesting API Key must have the Project Read Only role. Deprecated versions: v2-{2023-01-01}
9292
9393
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
9494
@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.
@@ -399,7 +399,7 @@ type ClustersApi interface {
399399
/*
400400
UpdateClusterAdvancedConfiguration Update Advanced Configuration Options for One Cluster
401401
402-
Updates the advanced configuration details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. Advanced configuration details include the read/write concern, index and oplog limits, and other database settings. To use this resource, the requesting API Key must have the Project Cluster Manager role. This feature isn't available for `M0` free clusters, `M2` and `M5` shared-tier clusters, or serverless clusters. Deprecated versions: v2-{2023-01-01}
402+
Updates the advanced configuration details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. Advanced configuration details include the read/write concern, index and oplog limits, and other database settings. To use this resource, the requesting API Key must have the Project Cluster Manager role. This feature isn't available for `M0` free clusters, `M2` and `M5` shared-tier clusters, flex clusters, or serverless clusters. Deprecated versions: v2-{2023-01-01}
403403
404404
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
405405
@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.
@@ -850,7 +850,7 @@ func (r GetClusterAdvancedConfigurationApiRequest) Execute() (*ClusterDescriptio
850850
/*
851851
GetClusterAdvancedConfiguration Return One Advanced Configuration Options for One Cluster
852852
853-
Returns the advanced configuration details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. Advanced configuration details include the read/write concern, index and oplog limits, and other database settings. This feature isn't available for `M0` free clusters, `M2` and `M5` shared-tier clusters, or serverless clusters. To use this resource, the requesting API Key must have the Project Read Only role. Deprecated versions: v2-{2023-01-01}
853+
Returns the advanced configuration details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. Advanced configuration details include the read/write concern, index and oplog limits, and other database settings. This feature isn't available for `M0` free clusters, `M2` and `M5` shared-tier clusters, flex clusters, or serverless clusters. To use this resource, the requesting API Key must have the Project Read Only role. Deprecated versions: v2-{2023-01-01}
854854
855855
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
856856
@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.
@@ -2545,7 +2545,7 @@ func (r UpdateClusterAdvancedConfigurationApiRequest) Execute() (*ClusterDescrip
25452545
/*
25462546
UpdateClusterAdvancedConfiguration Update Advanced Configuration Options for One Cluster
25472547
2548-
Updates the advanced configuration details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. Advanced configuration details include the read/write concern, index and oplog limits, and other database settings. To use this resource, the requesting API Key must have the Project Cluster Manager role. This feature isn't available for `M0` free clusters, `M2` and `M5` shared-tier clusters, or serverless clusters. Deprecated versions: v2-{2023-01-01}
2548+
Updates the advanced configuration details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. Advanced configuration details include the read/write concern, index and oplog limits, and other database settings. To use this resource, the requesting API Key must have the Project Cluster Manager role. This feature isn't available for `M0` free clusters, `M2` and `M5` shared-tier clusters, flex clusters, or serverless clusters. Deprecated versions: v2-{2023-01-01}
25492549
25502550
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
25512551
@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_monitoring_and_logs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ type MonitoringAndLogsApi interface {
122122
/*
123123
GetHostLogs Download Logs for One Cluster Host in One Project
124124
125-
Returns a compressed (.gz) log file that contains a range of log messages for the specified host for the specified project. MongoDB updates process and audit logs from the cluster backend infrastructure every five minutes. Logs are stored in chunks approximately five minutes in length, but this duration may vary. If you poll the API for log files, we recommend polling every five minutes even though consecutive polls could contain some overlapping logs. This feature isn't available for `M0` free clusters, `M2`, `M5`, or serverless clusters. To use this resource, the requesting API Key must have the Project Data Access Read Only or higher role. The API does not support direct calls with the json response schema. You must request a gzip response schema using an accept header of the format: "Accept: application/vnd.atlas.YYYY-MM-DD+gzip". Deprecated versions: v2-{2023-01-01}
125+
Returns a compressed (.gz) log file that contains a range of log messages for the specified host for the specified project. MongoDB updates process and audit logs from the cluster backend infrastructure every five minutes. Logs are stored in chunks approximately five minutes in length, but this duration may vary. If you poll the API for log files, we recommend polling every five minutes even though consecutive polls could contain some overlapping logs. This feature isn't available for `M0` free clusters, `M2`, `M5`, flex, or serverless clusters. To use this resource, the requesting API Key must have the Project Data Access Read Only or higher role. The API does not support direct calls with the json response schema. You must request a gzip response schema using an accept header of the format: "Accept: application/vnd.atlas.YYYY-MM-DD+gzip". Deprecated versions: v2-{2023-01-01}
126126
127127
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
128128
@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.
@@ -1047,7 +1047,7 @@ func (r GetHostLogsApiRequest) Execute() (io.ReadCloser, *http.Response, error)
10471047
/*
10481048
GetHostLogs Download Logs for One Cluster Host in One Project
10491049
1050-
Returns a compressed (.gz) log file that contains a range of log messages for the specified host for the specified project. MongoDB updates process and audit logs from the cluster backend infrastructure every five minutes. Logs are stored in chunks approximately five minutes in length, but this duration may vary. If you poll the API for log files, we recommend polling every five minutes even though consecutive polls could contain some overlapping logs. This feature isn't available for `M0` free clusters, `M2`, `M5`, or serverless clusters. To use this resource, the requesting API Key must have the Project Data Access Read Only or higher role. The API does not support direct calls with the json response schema. You must request a gzip response schema using an accept header of the format: "Accept: application/vnd.atlas.YYYY-MM-DD+gzip". Deprecated versions: v2-{2023-01-01}
1050+
Returns a compressed (.gz) log file that contains a range of log messages for the specified host for the specified project. MongoDB updates process and audit logs from the cluster backend infrastructure every five minutes. Logs are stored in chunks approximately five minutes in length, but this duration may vary. If you poll the API for log files, we recommend polling every five minutes even though consecutive polls could contain some overlapping logs. This feature isn't available for `M0` free clusters, `M2`, `M5`, flex, or serverless clusters. To use this resource, the requesting API Key must have the Project Data Access Read Only or higher role. The API does not support direct calls with the json response schema. You must request a gzip response schema using an accept header of the format: "Accept: application/vnd.atlas.YYYY-MM-DD+gzip". Deprecated versions: v2-{2023-01-01}
10511051
10521052
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
10531053
@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.

0 commit comments

Comments
 (0)