Skip to content

Commit 352f644

Browse files
wtrockigithub-actions[bot]
authored andcommitted
temp: client update
1 parent 115afc2 commit 352f644

File tree

93 files changed

+2514
-156
lines changed

Some content is hidden

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

93 files changed

+2514
-156
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/v20250312009/admin:
9+
github.com/mongodb/atlas-sdk-go/admin:
1010
config:
1111
include-regex: ".*Api"

admin/api_open_api.go

Lines changed: 314 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,314 @@
1+
// Code based on the AtlasAPI V2 OpenAPI file
2+
3+
package admin
4+
5+
import (
6+
"context"
7+
"io"
8+
"net/http"
9+
"net/url"
10+
)
11+
12+
type OpenAPIApi interface {
13+
14+
/*
15+
GetOpenapiInfo Return General Information on MongoDB Atlas Administration API OpenAPI Specification
16+
17+
This resource returns general information about the MongoDB Atlas Administration API OpenAPI Specification. Deprecated versions: v2-{2024-05-30}
18+
19+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
20+
@return GetOpenapiInfoApiRequest
21+
*/
22+
GetOpenapiInfo(ctx context.Context) GetOpenapiInfoApiRequest
23+
/*
24+
GetOpenapiInfo Return General Information on MongoDB Atlas Administration API OpenAPI Specification
25+
26+
27+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
28+
@param GetOpenapiInfoApiParams - Parameters for the request
29+
@return GetOpenapiInfoApiRequest
30+
*/
31+
GetOpenapiInfoWithParams(ctx context.Context, args *GetOpenapiInfoApiParams) GetOpenapiInfoApiRequest
32+
33+
// Method available only for mocking purposes
34+
GetOpenapiInfoExecute(r GetOpenapiInfoApiRequest) (*OpenApiInfo, *http.Response, error)
35+
36+
/*
37+
ListOpenapiVersions Return All Versions for One Environment
38+
39+
API that provides a list of available versionsfor a given environment.
40+
41+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
42+
@return ListOpenapiVersionsApiRequest
43+
*/
44+
ListOpenapiVersions(ctx context.Context) ListOpenapiVersionsApiRequest
45+
/*
46+
ListOpenapiVersions Return All Versions for One Environment
47+
48+
49+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
50+
@param ListOpenapiVersionsApiParams - Parameters for the request
51+
@return ListOpenapiVersionsApiRequest
52+
*/
53+
ListOpenapiVersionsWithParams(ctx context.Context, args *ListOpenapiVersionsApiParams) ListOpenapiVersionsApiRequest
54+
55+
// Method available only for mocking purposes
56+
ListOpenapiVersionsExecute(r ListOpenapiVersionsApiRequest) (*PaginatedApiVersions, *http.Response, error)
57+
}
58+
59+
// OpenAPIApiService OpenAPIApi service
60+
type OpenAPIApiService service
61+
62+
type GetOpenapiInfoApiRequest struct {
63+
ctx context.Context
64+
ApiService OpenAPIApi
65+
}
66+
67+
type GetOpenapiInfoApiParams struct {
68+
}
69+
70+
func (a *OpenAPIApiService) GetOpenapiInfoWithParams(ctx context.Context, args *GetOpenapiInfoApiParams) GetOpenapiInfoApiRequest {
71+
return GetOpenapiInfoApiRequest{
72+
ApiService: a,
73+
ctx: ctx,
74+
}
75+
}
76+
77+
func (r GetOpenapiInfoApiRequest) Execute() (*OpenApiInfo, *http.Response, error) {
78+
return r.ApiService.GetOpenapiInfoExecute(r)
79+
}
80+
81+
/*
82+
GetOpenapiInfo Return General Information on MongoDB Atlas Administration API OpenAPI Specification
83+
84+
This resource returns general information about the MongoDB Atlas Administration API OpenAPI Specification. Deprecated versions: v2-{2024-05-30}
85+
86+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
87+
@return GetOpenapiInfoApiRequest
88+
*/
89+
func (a *OpenAPIApiService) GetOpenapiInfo(ctx context.Context) GetOpenapiInfoApiRequest {
90+
return GetOpenapiInfoApiRequest{
91+
ApiService: a,
92+
ctx: ctx,
93+
}
94+
}
95+
96+
// GetOpenapiInfoExecute executes the request
97+
//
98+
// @return OpenApiInfo
99+
func (a *OpenAPIApiService) GetOpenapiInfoExecute(r GetOpenapiInfoApiRequest) (*OpenApiInfo, *http.Response, error) {
100+
var (
101+
localVarHTTPMethod = http.MethodGet
102+
localVarPostBody any
103+
formFiles []formFile
104+
localVarReturnValue *OpenApiInfo
105+
)
106+
107+
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OpenAPIApiService.GetOpenapiInfo")
108+
if err != nil {
109+
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
110+
}
111+
112+
localVarPath := localBasePath + "/api/atlas/v2/openapi/info"
113+
114+
localVarHeaderParams := make(map[string]string)
115+
localVarQueryParams := url.Values{}
116+
localVarFormParams := url.Values{}
117+
118+
// to determine the Content-Type header
119+
localVarHTTPContentTypes := []string{}
120+
121+
// set Content-Type header
122+
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
123+
if localVarHTTPContentType != "" {
124+
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
125+
}
126+
127+
// to determine the Accept header (only first one)
128+
localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json"}
129+
130+
// set Accept header
131+
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
132+
if localVarHTTPHeaderAccept != "" {
133+
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
134+
}
135+
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
136+
if err != nil {
137+
return localVarReturnValue, nil, err
138+
}
139+
140+
localVarHTTPResponse, err := a.client.callAPI(req)
141+
if err != nil || localVarHTTPResponse == nil {
142+
return localVarReturnValue, localVarHTTPResponse, err
143+
}
144+
145+
if localVarHTTPResponse.StatusCode >= 300 {
146+
newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath)
147+
return localVarReturnValue, localVarHTTPResponse, newErr
148+
}
149+
150+
err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type"))
151+
if err != nil {
152+
defer localVarHTTPResponse.Body.Close()
153+
buf, readErr := io.ReadAll(localVarHTTPResponse.Body)
154+
if readErr != nil {
155+
err = readErr
156+
}
157+
newErr := &GenericOpenAPIError{
158+
body: buf,
159+
error: err.Error(),
160+
}
161+
return localVarReturnValue, localVarHTTPResponse, newErr
162+
}
163+
164+
return localVarReturnValue, localVarHTTPResponse, nil
165+
}
166+
167+
type ListOpenapiVersionsApiRequest struct {
168+
ctx context.Context
169+
ApiService OpenAPIApi
170+
itemsPerPage *int
171+
pageNum *int
172+
env *string
173+
}
174+
175+
type ListOpenapiVersionsApiParams struct {
176+
ItemsPerPage *int
177+
PageNum *int
178+
Env *string
179+
}
180+
181+
func (a *OpenAPIApiService) ListOpenapiVersionsWithParams(ctx context.Context, args *ListOpenapiVersionsApiParams) ListOpenapiVersionsApiRequest {
182+
return ListOpenapiVersionsApiRequest{
183+
ApiService: a,
184+
ctx: ctx,
185+
itemsPerPage: args.ItemsPerPage,
186+
pageNum: args.PageNum,
187+
env: args.Env,
188+
}
189+
}
190+
191+
// Number of items that the response returns per page.
192+
func (r ListOpenapiVersionsApiRequest) ItemsPerPage(itemsPerPage int) ListOpenapiVersionsApiRequest {
193+
r.itemsPerPage = &itemsPerPage
194+
return r
195+
}
196+
197+
// Number of the page that displays the current set of the total objects that the response returns.
198+
func (r ListOpenapiVersionsApiRequest) PageNum(pageNum int) ListOpenapiVersionsApiRequest {
199+
r.pageNum = &pageNum
200+
return r
201+
}
202+
203+
// The environment to get the versions from. If not provided, it returnsthe versions for the given MongoDB URL. (E.g. prod for cloud.mongodb.com).
204+
func (r ListOpenapiVersionsApiRequest) Env(env string) ListOpenapiVersionsApiRequest {
205+
r.env = &env
206+
return r
207+
}
208+
209+
func (r ListOpenapiVersionsApiRequest) Execute() (*PaginatedApiVersions, *http.Response, error) {
210+
return r.ApiService.ListOpenapiVersionsExecute(r)
211+
}
212+
213+
/*
214+
ListOpenapiVersions Return All Versions for One Environment
215+
216+
API that provides a list of available versionsfor a given environment.
217+
218+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
219+
@return ListOpenapiVersionsApiRequest
220+
*/
221+
func (a *OpenAPIApiService) ListOpenapiVersions(ctx context.Context) ListOpenapiVersionsApiRequest {
222+
return ListOpenapiVersionsApiRequest{
223+
ApiService: a,
224+
ctx: ctx,
225+
}
226+
}
227+
228+
// ListOpenapiVersionsExecute executes the request
229+
//
230+
// @return PaginatedApiVersions
231+
func (a *OpenAPIApiService) ListOpenapiVersionsExecute(r ListOpenapiVersionsApiRequest) (*PaginatedApiVersions, *http.Response, error) {
232+
var (
233+
localVarHTTPMethod = http.MethodGet
234+
localVarPostBody any
235+
formFiles []formFile
236+
localVarReturnValue *PaginatedApiVersions
237+
)
238+
239+
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OpenAPIApiService.ListOpenapiVersions")
240+
if err != nil {
241+
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
242+
}
243+
244+
localVarPath := localBasePath + "/api/atlas/v2/unauth/openapi/versions"
245+
246+
localVarHeaderParams := make(map[string]string)
247+
localVarQueryParams := url.Values{}
248+
localVarFormParams := url.Values{}
249+
250+
if r.itemsPerPage != nil {
251+
parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "")
252+
} else {
253+
var defaultValue int = 100
254+
r.itemsPerPage = &defaultValue
255+
parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "")
256+
}
257+
if r.pageNum != nil {
258+
parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "")
259+
} else {
260+
var defaultValue int = 1
261+
r.pageNum = &defaultValue
262+
parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "")
263+
}
264+
if r.env != nil {
265+
parameterAddToHeaderOrQuery(localVarQueryParams, "env", r.env, "")
266+
}
267+
// to determine the Content-Type header
268+
localVarHTTPContentTypes := []string{}
269+
270+
// set Content-Type header
271+
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
272+
if localVarHTTPContentType != "" {
273+
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
274+
}
275+
276+
// to determine the Accept header (only first one)
277+
localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json"}
278+
279+
// set Accept header
280+
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
281+
if localVarHTTPHeaderAccept != "" {
282+
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
283+
}
284+
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
285+
if err != nil {
286+
return localVarReturnValue, nil, err
287+
}
288+
289+
localVarHTTPResponse, err := a.client.callAPI(req)
290+
if err != nil || localVarHTTPResponse == nil {
291+
return localVarReturnValue, localVarHTTPResponse, err
292+
}
293+
294+
if localVarHTTPResponse.StatusCode >= 300 {
295+
newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath)
296+
return localVarReturnValue, localVarHTTPResponse, newErr
297+
}
298+
299+
err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type"))
300+
if err != nil {
301+
defer localVarHTTPResponse.Body.Close()
302+
buf, readErr := io.ReadAll(localVarHTTPResponse.Body)
303+
if readErr != nil {
304+
err = readErr
305+
}
306+
newErr := &GenericOpenAPIError{
307+
body: buf,
308+
error: err.Error(),
309+
}
310+
return localVarReturnValue, localVarHTTPResponse, newErr
311+
}
312+
313+
return localVarReturnValue, localVarHTTPResponse, nil
314+
}

admin/api_teams.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ import (
1313
type TeamsApi interface {
1414

1515
/*
16-
AddGroupTeams Add One Team to One Project
16+
AddGroupTeams Add Multiple Teams to One Project
1717
18-
Adds one team to the specified project. All members of the team share the same project access. MongoDB Cloud limits the number of users to a maximum of 100 teams per project and a maximum of 250 teams per organization. To use this resource, the requesting Service Account or API Key must have the Project Owner role.
18+
Adds multiple teams to the specified project. All members of a team share the same project access. MongoDB Cloud limits the number of users to a maximum of 100 teams per project and a maximum of 250 teams per organization. To use this resource, the requesting Service Account or API Key must have the Project Owner role.
1919
2020
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2121
@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.
22-
@param teamRole Team to add to the specified project.
22+
@param teamRole Teams and their roles to be added to the specified project.
2323
@return AddGroupTeamsApiRequest
2424
*/
2525
AddGroupTeams(ctx context.Context, groupId string, teamRole *[]TeamRole) AddGroupTeamsApiRequest
2626
/*
27-
AddGroupTeams Add One Team to One Project
27+
AddGroupTeams Add Multiple Teams to One Project
2828
2929
3030
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@@ -368,9 +368,9 @@ func (r AddGroupTeamsApiRequest) Execute() (*PaginatedTeamRole, *http.Response,
368368
}
369369

370370
/*
371-
AddGroupTeams Add One Team to One Project
371+
AddGroupTeams Add Multiple Teams to One Project
372372
373-
Adds one team to the specified project. All members of the team share the same project access. MongoDB Cloud limits the number of users to a maximum of 100 teams per project and a maximum of 250 teams per organization. To use this resource, the requesting Service Account or API Key must have the Project Owner role.
373+
Adds multiple teams to the specified project. All members of a team share the same project access. MongoDB Cloud limits the number of users to a maximum of 100 teams per project and a maximum of 250 teams per organization. To use this resource, the requesting Service Account or API Key must have the Project Owner role.
374374
375375
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
376376
@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_third_party_integrations.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ type ThirdPartyIntegrationsApi interface {
6464
/*
6565
GetGroupIntegration Return One Third-Party Service Integration
6666
67-
Returns the settings for configuring integration with one third-party service. These settings apply to all databases managed in one MongoDB Cloud project. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role. Viewing log export to S3, Splunk, and Datadog is currently in preview. Please contact your Customer Success Manager (CSM) for access.
67+
Returns the settings for configuring integration with one third-party service. These settings apply to all databases managed in one MongoDB Cloud project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Viewing log export to S3, Splunk, and Datadog is currently in preview. Please contact your Customer Success Manager (CSM) for access.
6868
6969
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
7070
@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.
@@ -88,7 +88,7 @@ type ThirdPartyIntegrationsApi interface {
8888
/*
8989
ListGroupIntegrations Return All Active Third-Party Service Integrations
9090
91-
Returns the settings that permit integrations with all configured third-party services. These settings apply to all databases managed in one MongoDB Cloud project. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role.
91+
Returns the settings that permit integrations with all configured third-party services. These settings apply to all databases managed in one MongoDB Cloud project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role.
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.
@@ -451,7 +451,7 @@ func (r GetGroupIntegrationApiRequest) Execute() (*ThirdPartyIntegration, *http.
451451
/*
452452
GetGroupIntegration Return One Third-Party Service Integration
453453
454-
Returns the settings for configuring integration with one third-party service. These settings apply to all databases managed in one MongoDB Cloud project. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role. Viewing log export to S3, Splunk, and Datadog is currently in preview. Please contact your Customer Success Manager (CSM) for access.
454+
Returns the settings for configuring integration with one third-party service. These settings apply to all databases managed in one MongoDB Cloud project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Viewing log export to S3, Splunk, and Datadog is currently in preview. Please contact your Customer Success Manager (CSM) for access.
455455
456456
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
457457
@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.
@@ -598,7 +598,7 @@ func (r ListGroupIntegrationsApiRequest) Execute() (*PaginatedIntegration, *http
598598
/*
599599
ListGroupIntegrations Return All Active Third-Party Service Integrations
600600
601-
Returns the settings that permit integrations with all configured third-party services. These settings apply to all databases managed in one MongoDB Cloud project. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role.
601+
Returns the settings that permit integrations with all configured third-party services. These settings apply to all databases managed in one MongoDB Cloud project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role.
602602
603603
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
604604
@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)