Skip to content

Commit 1651e1d

Browse files
APIBot: SDK update based on recent changes in Atlas API (#261)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: oarbusi <[email protected]>
1 parent c374129 commit 1651e1d

File tree

74 files changed

+714
-399
lines changed

Some content is hidden

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

74 files changed

+714
-399
lines changed

README.md

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

1313
```terminal
14-
go get go.mongodb.org/atlas-sdk/v20231115003
14+
go get go.mongodb.org/atlas-sdk/v20231115004
1515
```
1616

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

2222
```go
23-
import "go.mongodb.org/atlas-sdk/v20231115003/admin"
23+
import "go.mongodb.org/atlas-sdk/v20231115004/admin"
2424

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

admin/api_federated_authentication.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ type FederatedAuthenticationApi interface {
249249
ListIdentityProvidersWithParams(ctx context.Context, args *ListIdentityProvidersApiParams) ListIdentityProvidersApiRequest
250250

251251
// Interface only available internally
252-
listIdentityProvidersExecute(r ListIdentityProvidersApiRequest) ([]FederationIdentityProvider, *http.Response, error)
252+
listIdentityProvidersExecute(r ListIdentityProvidersApiRequest) (*PaginatedFederationIdentityProvider, *http.Response, error)
253253

254254
/*
255255
ListRoleMappings Return All Role Mappings from One Organization
@@ -1558,7 +1558,7 @@ func (r ListIdentityProvidersApiRequest) Protocol(protocol string) ListIdentityP
15581558
return r
15591559
}
15601560

1561-
func (r ListIdentityProvidersApiRequest) Execute() ([]FederationIdentityProvider, *http.Response, error) {
1561+
func (r ListIdentityProvidersApiRequest) Execute() (*PaginatedFederationIdentityProvider, *http.Response, error) {
15621562
return r.ApiService.listIdentityProvidersExecute(r)
15631563
}
15641564

@@ -1581,13 +1581,13 @@ func (a *FederatedAuthenticationApiService) ListIdentityProviders(ctx context.Co
15811581

15821582
// Execute executes the request
15831583
//
1584-
// @return []FederationIdentityProvider
1585-
func (a *FederatedAuthenticationApiService) listIdentityProvidersExecute(r ListIdentityProvidersApiRequest) ([]FederationIdentityProvider, *http.Response, error) {
1584+
// @return PaginatedFederationIdentityProvider
1585+
func (a *FederatedAuthenticationApiService) listIdentityProvidersExecute(r ListIdentityProvidersApiRequest) (*PaginatedFederationIdentityProvider, *http.Response, error) {
15861586
var (
15871587
localVarHTTPMethod = http.MethodGet
15881588
localVarPostBody interface{}
15891589
formFiles []formFile
1590-
localVarReturnValue []FederationIdentityProvider
1590+
localVarReturnValue *PaginatedFederationIdentityProvider
15911591
)
15921592

15931593
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FederatedAuthenticationApiService.ListIdentityProviders")

admin/api_projects.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ type ProjectsApi interface {
421421
ReturnAllIPAddressesWithParams(ctx context.Context, args *ReturnAllIPAddressesApiParams) ReturnAllIPAddressesApiRequest
422422

423423
// Interface only available internally
424-
returnAllIPAddressesExecute(r ReturnAllIPAddressesApiRequest) ([]GroupIPAddresses, *http.Response, error)
424+
returnAllIPAddressesExecute(r ReturnAllIPAddressesApiRequest) (*GroupIPAddresses, *http.Response, error)
425425

426426
/*
427427
SetProjectLimit Set One Project Limit
@@ -2781,7 +2781,7 @@ func (a *ProjectsApiService) ReturnAllIPAddressesWithParams(ctx context.Context,
27812781
}
27822782
}
27832783

2784-
func (r ReturnAllIPAddressesApiRequest) Execute() ([]GroupIPAddresses, *http.Response, error) {
2784+
func (r ReturnAllIPAddressesApiRequest) Execute() (*GroupIPAddresses, *http.Response, error) {
27852785
return r.ApiService.returnAllIPAddressesExecute(r)
27862786
}
27872787

@@ -2804,13 +2804,13 @@ func (a *ProjectsApiService) ReturnAllIPAddresses(ctx context.Context, groupId s
28042804

28052805
// Execute executes the request
28062806
//
2807-
// @return []GroupIPAddresses
2808-
func (a *ProjectsApiService) returnAllIPAddressesExecute(r ReturnAllIPAddressesApiRequest) ([]GroupIPAddresses, *http.Response, error) {
2807+
// @return GroupIPAddresses
2808+
func (a *ProjectsApiService) returnAllIPAddressesExecute(r ReturnAllIPAddressesApiRequest) (*GroupIPAddresses, *http.Response, error) {
28092809
var (
28102810
localVarHTTPMethod = http.MethodGet
28112811
localVarPostBody interface{}
28122812
formFiles []formFile
2813-
localVarReturnValue []GroupIPAddresses
2813+
localVarReturnValue *GroupIPAddresses
28142814
)
28152815

28162816
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsApiService.ReturnAllIPAddresses")

admin/atlas_client.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package admin // import "go.mongodb.org/atlas-sdk/v20231115003/admin"
1+
package admin // import "go.mongodb.org/atlas-sdk/v20231115004/admin"
22

33
import (
44
"errors"
@@ -8,7 +8,7 @@ import (
88
"strings"
99

1010
"github.com/mongodb-forks/digest"
11-
"go.mongodb.org/atlas-sdk/v20231115003/internal/core"
11+
"go.mongodb.org/atlas-sdk/v20231115004/internal/core"
1212
)
1313

1414
const (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
// Code based on the AtlasAPI V2 OpenAPI file
2+
3+
package admin
4+
5+
import (
6+
"encoding/json"
7+
)
8+
9+
// PaginatedFederationIdentityProvider struct for PaginatedFederationIdentityProvider
10+
type PaginatedFederationIdentityProvider struct {
11+
// List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships.
12+
// Read only field.
13+
Links *[]Link `json:"links,omitempty"`
14+
// List of returned documents that MongoDB Cloud providers when completing this request.
15+
// Read only field.
16+
Results *[]FederationIdentityProvider `json:"results,omitempty"`
17+
// Number of documents returned in this response if **includeCount** query param is true.
18+
// Read only field.
19+
TotalCount *int `json:"totalCount,omitempty"`
20+
}
21+
22+
// NewPaginatedFederationIdentityProvider instantiates a new PaginatedFederationIdentityProvider object
23+
// This constructor will assign default values to properties that have it defined,
24+
// and makes sure properties required by API are set, but the set of arguments
25+
// will change when the set of required properties is changed
26+
func NewPaginatedFederationIdentityProvider() *PaginatedFederationIdentityProvider {
27+
this := PaginatedFederationIdentityProvider{}
28+
return &this
29+
}
30+
31+
// NewPaginatedFederationIdentityProviderWithDefaults instantiates a new PaginatedFederationIdentityProvider object
32+
// This constructor will only assign default values to properties that have it defined,
33+
// but it doesn't guarantee that properties required by API are set
34+
func NewPaginatedFederationIdentityProviderWithDefaults() *PaginatedFederationIdentityProvider {
35+
this := PaginatedFederationIdentityProvider{}
36+
return &this
37+
}
38+
39+
// GetLinks returns the Links field value if set, zero value otherwise
40+
func (o *PaginatedFederationIdentityProvider) GetLinks() []Link {
41+
if o == nil || IsNil(o.Links) {
42+
var ret []Link
43+
return ret
44+
}
45+
return *o.Links
46+
}
47+
48+
// GetLinksOk returns a tuple with the Links field value if set, nil otherwise
49+
// and a boolean to check if the value has been set.
50+
func (o *PaginatedFederationIdentityProvider) GetLinksOk() (*[]Link, bool) {
51+
if o == nil || IsNil(o.Links) {
52+
return nil, false
53+
}
54+
55+
return o.Links, true
56+
}
57+
58+
// HasLinks returns a boolean if a field has been set.
59+
func (o *PaginatedFederationIdentityProvider) HasLinks() bool {
60+
if o != nil && !IsNil(o.Links) {
61+
return true
62+
}
63+
64+
return false
65+
}
66+
67+
// SetLinks gets a reference to the given []Link and assigns it to the Links field.
68+
func (o *PaginatedFederationIdentityProvider) SetLinks(v []Link) {
69+
o.Links = &v
70+
}
71+
72+
// GetResults returns the Results field value if set, zero value otherwise
73+
func (o *PaginatedFederationIdentityProvider) GetResults() []FederationIdentityProvider {
74+
if o == nil || IsNil(o.Results) {
75+
var ret []FederationIdentityProvider
76+
return ret
77+
}
78+
return *o.Results
79+
}
80+
81+
// GetResultsOk returns a tuple with the Results field value if set, nil otherwise
82+
// and a boolean to check if the value has been set.
83+
func (o *PaginatedFederationIdentityProvider) GetResultsOk() (*[]FederationIdentityProvider, bool) {
84+
if o == nil || IsNil(o.Results) {
85+
return nil, false
86+
}
87+
88+
return o.Results, true
89+
}
90+
91+
// HasResults returns a boolean if a field has been set.
92+
func (o *PaginatedFederationIdentityProvider) HasResults() bool {
93+
if o != nil && !IsNil(o.Results) {
94+
return true
95+
}
96+
97+
return false
98+
}
99+
100+
// SetResults gets a reference to the given []FederationIdentityProvider and assigns it to the Results field.
101+
func (o *PaginatedFederationIdentityProvider) SetResults(v []FederationIdentityProvider) {
102+
o.Results = &v
103+
}
104+
105+
// GetTotalCount returns the TotalCount field value if set, zero value otherwise
106+
func (o *PaginatedFederationIdentityProvider) GetTotalCount() int {
107+
if o == nil || IsNil(o.TotalCount) {
108+
var ret int
109+
return ret
110+
}
111+
return *o.TotalCount
112+
}
113+
114+
// GetTotalCountOk returns a tuple with the TotalCount field value if set, nil otherwise
115+
// and a boolean to check if the value has been set.
116+
func (o *PaginatedFederationIdentityProvider) GetTotalCountOk() (*int, bool) {
117+
if o == nil || IsNil(o.TotalCount) {
118+
return nil, false
119+
}
120+
121+
return o.TotalCount, true
122+
}
123+
124+
// HasTotalCount returns a boolean if a field has been set.
125+
func (o *PaginatedFederationIdentityProvider) HasTotalCount() bool {
126+
if o != nil && !IsNil(o.TotalCount) {
127+
return true
128+
}
129+
130+
return false
131+
}
132+
133+
// SetTotalCount gets a reference to the given int and assigns it to the TotalCount field.
134+
func (o *PaginatedFederationIdentityProvider) SetTotalCount(v int) {
135+
o.TotalCount = &v
136+
}
137+
138+
func (o PaginatedFederationIdentityProvider) MarshalJSONWithoutReadOnly() ([]byte, error) {
139+
toSerialize, err := o.ToMap()
140+
if err != nil {
141+
return []byte{}, err
142+
}
143+
return json.Marshal(toSerialize)
144+
}
145+
func (o PaginatedFederationIdentityProvider) ToMap() (map[string]interface{}, error) {
146+
toSerialize := map[string]interface{}{}
147+
return toSerialize, nil
148+
}

auth/device_flow.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"strings"
2323
"time"
2424

25-
core "go.mongodb.org/atlas-sdk/v20231115003/internal/core"
25+
core "go.mongodb.org/atlas-sdk/v20231115004/internal/core"
2626
)
2727

2828
const authExpiredError = "DEVICE_AUTHORIZATION_EXPIRED"

auth/oauth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"runtime"
2727
"strings"
2828

29-
"go.mongodb.org/atlas-sdk/v20231115003/internal/core"
29+
"go.mongodb.org/atlas-sdk/v20231115004/internal/core"
3030
)
3131

3232
const defaultBaseURL = "https://cloud.mongodb.com/"

auth/oauth_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"reflect"
2525
"testing"
2626

27-
core "go.mongodb.org/atlas-sdk/v20231115003/internal/core"
27+
core "go.mongodb.org/atlas-sdk/v20231115004/internal/core"
2828
)
2929

3030
const (

docs/doc_2_error_handling.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Errors are represented by [ApiErrorObject](https://github.com/mongodb/atlas-sdk-
1010
To fetch the error object, execute the following:
1111

1212
```go
13-
import "go.mongodb.org/atlas-sdk/v20231115003/admin"
13+
import "go.mongodb.org/atlas-sdk/v20231115004/admin"
1414

1515
projects, response, err := admin.ProjectsApi.ListProjects(ctx).Execute()
1616
apiError, ok := admin.AsError(err)
@@ -22,7 +22,7 @@ fmt.Println(apiError)
2222
To check for the existence of a specific error code, execute the following:
2323

2424
```go
25-
import admin "go.mongodb.org/atlas-sdk/v20231115003/admin"
25+
import admin "go.mongodb.org/atlas-sdk/v20231115004/admin"
2626

2727
projects, response, err := admin.ProjectsApi.ListProjects(ctx).Execute()
2828
if admin.IsErrorCode(err, "code"){

docs/doc_3_migration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The Atlas Go SDK doesn't rely on the deprecated [go-client-mongodb-atlas](https:
1818
The Atlas Go SDK has different methods for the initialization of the clients:
1919

2020
```go
21-
import admin "go.mongodb.org/atlas-sdk/v20231115003/admin"
21+
import admin "go.mongodb.org/atlas-sdk/v20231115004/admin"
2222
sdk, err := admin.NewClient(
2323
// Authentication using ApiKey and ApiSecret
2424
admin.UseDigestAuth(apiKey, apiSecret))

docs/doc_4_authentication.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Construct a new Atlas SDK client, then use the services on the client to
1111
access different parts of the Atlas Admin API. For example:
1212

1313
```go
14-
import "go.mongodb.org/atlas-sdk/v20231115003/admin"
14+
import "go.mongodb.org/atlas-sdk/v20231115004/admin"
1515

1616
func example() {
1717
ctx := context.Background()

docs/doc_last_reference.md

+1
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ Class | Method | HTTP request | Description | [SDK Maturity](ht
588588
- [PaginatedContainerPeer](./docs/PaginatedContainerPeer.md)
589589
- [PaginatedDatabase](./docs/PaginatedDatabase.md)
590590
- [PaginatedDiskPartition](./docs/PaginatedDiskPartition.md)
591+
- [PaginatedFederationIdentityProvider](./docs/PaginatedFederationIdentityProvider.md)
591592
- [PaginatedHostViewAtlas](./docs/PaginatedHostViewAtlas.md)
592593
- [PaginatedIntegration](./docs/PaginatedIntegration.md)
593594
- [PaginatedNetworkAccess](./docs/PaginatedNetworkAccess.md)

docs/docs/AWSClustersDNSApi.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"fmt"
2727
"os"
2828

29-
"go.mongodb.org/atlas-sdk/v20231115003/admin"
29+
"go.mongodb.org/atlas-sdk/v20231115004/admin"
3030
)
3131

3232
func main() {
@@ -99,7 +99,7 @@ import (
9999
"fmt"
100100
"os"
101101

102-
"go.mongodb.org/atlas-sdk/v20231115003/admin"
102+
"go.mongodb.org/atlas-sdk/v20231115004/admin"
103103
)
104104

105105
func main() {

docs/docs/AccessTrackingApi.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"fmt"
2727
"os"
2828

29-
"go.mongodb.org/atlas-sdk/v20231115003/admin"
29+
"go.mongodb.org/atlas-sdk/v20231115004/admin"
3030
)
3131

3232
func main() {
@@ -112,7 +112,7 @@ import (
112112
"fmt"
113113
"os"
114114

115-
"go.mongodb.org/atlas-sdk/v20231115003/admin"
115+
"go.mongodb.org/atlas-sdk/v20231115004/admin"
116116
)
117117

118118
func main() {

0 commit comments

Comments
 (0)