Skip to content

Commit d0d783c

Browse files
APIBot: SDK update based on recent changes in Atlas API (#221)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: wtrocki <[email protected]>
1 parent 803df01 commit d0d783c

File tree

8 files changed

+342
-17
lines changed

8 files changed

+342
-17
lines changed

admin/api_federated_authentication.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ type FederatedAuthenticationApi interface {
273273
ListRoleMappingsWithParams(ctx context.Context, args *ListRoleMappingsApiParams) ListRoleMappingsApiRequest
274274

275275
// Interface only available internally
276-
listRoleMappingsExecute(r ListRoleMappingsApiRequest) ([]AuthFederationRoleMapping, *http.Response, error)
276+
listRoleMappingsExecute(r ListRoleMappingsApiRequest) (*PaginatedRoleMapping, *http.Response, error)
277277

278278
/*
279279
RemoveConnectedOrgConfig Remove One Org Config Connected to One Federation
@@ -1784,7 +1784,7 @@ func (a *FederatedAuthenticationApiService) ListRoleMappingsWithParams(ctx conte
17841784
}
17851785
}
17861786

1787-
func (r ListRoleMappingsApiRequest) Execute() ([]AuthFederationRoleMapping, *http.Response, error) {
1787+
func (r ListRoleMappingsApiRequest) Execute() (*PaginatedRoleMapping, *http.Response, error) {
17881788
return r.ApiService.listRoleMappingsExecute(r)
17891789
}
17901790

@@ -1809,13 +1809,13 @@ func (a *FederatedAuthenticationApiService) ListRoleMappings(ctx context.Context
18091809

18101810
// Execute executes the request
18111811
//
1812-
// @return []AuthFederationRoleMapping
1813-
func (a *FederatedAuthenticationApiService) listRoleMappingsExecute(r ListRoleMappingsApiRequest) ([]AuthFederationRoleMapping, *http.Response, error) {
1812+
// @return PaginatedRoleMapping
1813+
func (a *FederatedAuthenticationApiService) listRoleMappingsExecute(r ListRoleMappingsApiRequest) (*PaginatedRoleMapping, *http.Response, error) {
18141814
var (
18151815
localVarHTTPMethod = http.MethodGet
18161816
localVarPostBody interface{}
18171817
formFiles []formFile
1818-
localVarReturnValue []AuthFederationRoleMapping
1818+
localVarReturnValue *PaginatedRoleMapping
18191819
)
18201820

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

docs/doc_last_reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ Class | Method | HTTP request | Description | [SDK Maturity](ht
577577
- [PaginatedPipelineRun](./docs/PaginatedPipelineRun.md)
578578
- [PaginatedPrivateNetworkEndpointIdEntry](./docs/PaginatedPrivateNetworkEndpointIdEntry.md)
579579
- [PaginatedRestoreJob](./docs/PaginatedRestoreJob.md)
580+
- [PaginatedRoleMapping](./docs/PaginatedRoleMapping.md)
580581
- [PaginatedServerlessInstanceDescription](./docs/PaginatedServerlessInstanceDescription.md)
581582
- [PaginatedSnapshot](./docs/PaginatedSnapshot.md)
582583
- [PaginatedTeam](./docs/PaginatedTeam.md)

docs/docs/FederatedAuthenticationApi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ Name | Type | Description | Notes
826826

827827
## ListRoleMappings
828828

829-
> []AuthFederationRoleMapping ListRoleMappings(ctx, federationSettingsId, orgId).Execute()
829+
> PaginatedRoleMapping ListRoleMappings(ctx, federationSettingsId, orgId).Execute()
830830
831831
Return All Role Mappings from One Organization
832832

@@ -864,7 +864,7 @@ func main() {
864864
apiError := admin.AsError(err)
865865
fmt.Fprintf(os.Stderr, "Error obj: %v\n", apiError)
866866
}
867-
// response from `ListRoleMappings`: []AuthFederationRoleMapping
867+
// response from `ListRoleMappings`: PaginatedRoleMapping
868868
fmt.Fprintf(os.Stdout, "Response from `FederatedAuthenticationApi.ListRoleMappings`: %v\n", resp)
869869
}
870870
```
@@ -890,7 +890,7 @@ Name | Type | Description | Notes
890890

891891
### Return type
892892

893-
[**[]AuthFederationRoleMapping**](AuthFederationRoleMapping.md)
893+
[**PaginatedRoleMapping**](PaginatedRoleMapping.md)
894894

895895
### Authorization
896896
[DigestAuth](../README.md#Authentication)

docs/docs/PaginatedRoleMapping.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# PaginatedRoleMapping
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**Links** | Pointer to [**[]Link**](Link.md) | 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. | [optional] [readonly]
8+
**Results** | Pointer to [**[]AuthFederationRoleMapping**](AuthFederationRoleMapping.md) | List of returned documents that MongoDB Cloud providers when completing this request. | [optional] [readonly]
9+
**TotalCount** | Pointer to **int** | Number of documents returned in this response. | [optional] [readonly]
10+
11+
## Methods
12+
13+
### NewPaginatedRoleMapping
14+
15+
`func NewPaginatedRoleMapping() *PaginatedRoleMapping`
16+
17+
NewPaginatedRoleMapping instantiates a new PaginatedRoleMapping object
18+
This constructor will assign default values to properties that have it defined,
19+
and makes sure properties required by API are set, but the set of arguments
20+
will change when the set of required properties is changed
21+
22+
### NewPaginatedRoleMappingWithDefaults
23+
24+
`func NewPaginatedRoleMappingWithDefaults() *PaginatedRoleMapping`
25+
26+
NewPaginatedRoleMappingWithDefaults instantiates a new PaginatedRoleMapping object
27+
This constructor will only assign default values to properties that have it defined,
28+
but it doesn't guarantee that properties required by API are set
29+
30+
### GetLinks
31+
32+
`func (o *PaginatedRoleMapping) GetLinks() []Link`
33+
34+
GetLinks returns the Links field if non-nil, zero value otherwise.
35+
36+
### GetLinksOk
37+
38+
`func (o *PaginatedRoleMapping) GetLinksOk() (*[]Link, bool)`
39+
40+
GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise
41+
and a boolean to check if the value has been set.
42+
43+
### SetLinks
44+
45+
`func (o *PaginatedRoleMapping) SetLinks(v []Link)`
46+
47+
SetLinks sets Links field to given value.
48+
49+
### HasLinks
50+
51+
`func (o *PaginatedRoleMapping) HasLinks() bool`
52+
53+
HasLinks returns a boolean if a field has been set.
54+
### GetResults
55+
56+
`func (o *PaginatedRoleMapping) GetResults() []AuthFederationRoleMapping`
57+
58+
GetResults returns the Results field if non-nil, zero value otherwise.
59+
60+
### GetResultsOk
61+
62+
`func (o *PaginatedRoleMapping) GetResultsOk() (*[]AuthFederationRoleMapping, bool)`
63+
64+
GetResultsOk returns a tuple with the Results field if it's non-nil, zero value otherwise
65+
and a boolean to check if the value has been set.
66+
67+
### SetResults
68+
69+
`func (o *PaginatedRoleMapping) SetResults(v []AuthFederationRoleMapping)`
70+
71+
SetResults sets Results field to given value.
72+
73+
### HasResults
74+
75+
`func (o *PaginatedRoleMapping) HasResults() bool`
76+
77+
HasResults returns a boolean if a field has been set.
78+
### GetTotalCount
79+
80+
`func (o *PaginatedRoleMapping) GetTotalCount() int`
81+
82+
GetTotalCount returns the TotalCount field if non-nil, zero value otherwise.
83+
84+
### GetTotalCountOk
85+
86+
`func (o *PaginatedRoleMapping) GetTotalCountOk() (*int, bool)`
87+
88+
GetTotalCountOk returns a tuple with the TotalCount field if it's non-nil, zero value otherwise
89+
and a boolean to check if the value has been set.
90+
91+
### SetTotalCount
92+
93+
`func (o *PaginatedRoleMapping) SetTotalCount(v int)`
94+
95+
SetTotalCount sets TotalCount field to given value.
96+
97+
### HasTotalCount
98+
99+
`func (o *PaginatedRoleMapping) HasTotalCount() bool`
100+
101+
HasTotalCount returns a boolean if a field has been set.
102+
103+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
104+
105+

internal/core/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package core
55
// For more information please see: https://github.com/mongodb/atlas-sdk-go/blob/main/docs/doc_1_concepts.md
66
const (
77
// SDK release tag version.
8-
Version = "v20231001001.0.0"
8+
Version = "v20231001001.1.0"
99
// Resource Version.
1010
Resource = "20231001"
1111
)

openapi/atlas-api-transformed.yaml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ info:
2424
termsOfService: https://www.mongodb.com/mongodb-management-service-terms-and-conditions
2525
title: MongoDB Atlas Administration API
2626
version: "2.0"
27-
x-xgen-sha: 06c21141c5a079d3bc59583f490c6b222da388f8
27+
x-xgen-sha: e4b64bb81696bc3cd4f242df4befad45bf855578
2828
servers:
2929
- url: https://cloud.mongodb.com
3030
tags:
@@ -516,9 +516,7 @@ paths:
516516
content:
517517
application/vnd.atlas.2023-01-01+json:
518518
schema:
519-
type: array
520-
items:
521-
$ref: "#/components/schemas/AuthFederationRoleMapping"
519+
$ref: "#/components/schemas/PaginatedRoleMapping"
522520
x-xgen-version: 2023-01-01
523521
description: OK
524522
"400":
@@ -28732,6 +28730,35 @@ components:
2873228730
description: Number of documents returned in this response.
2873328731
minimum: 0
2873428732
readOnly: true
28733+
PaginatedRoleMapping:
28734+
type: object
28735+
description: List role mappings from the specified organization in the specified
28736+
federation.
28737+
properties:
28738+
links:
28739+
type: array
28740+
description: List of one or more Uniform Resource Locators (URLs) that point to
28741+
API sub-resources, related API resources, or both. RFC 5988 outlines
28742+
these relationships.
28743+
externalDocs:
28744+
description: Web Linking Specification (RFC 5988)
28745+
url: https://datatracker.ietf.org/doc/html/rfc5988
28746+
items:
28747+
$ref: "#/components/schemas/Link"
28748+
readOnly: true
28749+
results:
28750+
type: array
28751+
description: List of returned documents that MongoDB Cloud providers when
28752+
completing this request.
28753+
items:
28754+
$ref: "#/components/schemas/AuthFederationRoleMapping"
28755+
readOnly: true
28756+
totalCount:
28757+
type: integer
28758+
format: int32
28759+
description: Number of documents returned in this response.
28760+
minimum: 0
28761+
readOnly: true
2873528762
PaginatedServerlessInstanceDescription:
2873628763
type: object
2873728764
properties:

0 commit comments

Comments
 (0)