Skip to content

Commit

Permalink
APIBot: SDK update based on recent changes in Atlas API (#221)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: wtrocki <wtrocki@users.noreply.github.com>
  • Loading branch information
3 people committed Oct 16, 2023
1 parent 803df01 commit d0d783c
Show file tree
Hide file tree
Showing 8 changed files with 342 additions and 17 deletions.
10 changes: 5 additions & 5 deletions admin/api_federated_authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ type FederatedAuthenticationApi interface {
ListRoleMappingsWithParams(ctx context.Context, args *ListRoleMappingsApiParams) ListRoleMappingsApiRequest

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

/*
RemoveConnectedOrgConfig Remove One Org Config Connected to One Federation
Expand Down Expand Up @@ -1784,7 +1784,7 @@ func (a *FederatedAuthenticationApiService) ListRoleMappingsWithParams(ctx conte
}
}

func (r ListRoleMappingsApiRequest) Execute() ([]AuthFederationRoleMapping, *http.Response, error) {
func (r ListRoleMappingsApiRequest) Execute() (*PaginatedRoleMapping, *http.Response, error) {
return r.ApiService.listRoleMappingsExecute(r)
}

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

// Execute executes the request
//
// @return []AuthFederationRoleMapping
func (a *FederatedAuthenticationApiService) listRoleMappingsExecute(r ListRoleMappingsApiRequest) ([]AuthFederationRoleMapping, *http.Response, error) {
// @return PaginatedRoleMapping
func (a *FederatedAuthenticationApiService) listRoleMappingsExecute(r ListRoleMappingsApiRequest) (*PaginatedRoleMapping, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue []AuthFederationRoleMapping
localVarReturnValue *PaginatedRoleMapping
)

localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FederatedAuthenticationApiService.ListRoleMappings")
Expand Down
145 changes: 145 additions & 0 deletions admin/model_paginated_role_mapping.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
// Code based on the AtlasAPI V2 OpenAPI file

package admin

import (
"encoding/json"
)

// PaginatedRoleMapping List role mappings from the specified organization in the specified federation.
type PaginatedRoleMapping struct {
// 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.
Links []Link `json:"links,omitempty"`
// List of returned documents that MongoDB Cloud providers when completing this request.
Results []AuthFederationRoleMapping `json:"results,omitempty"`
// Number of documents returned in this response.
TotalCount *int `json:"totalCount,omitempty"`
}

// NewPaginatedRoleMapping instantiates a new PaginatedRoleMapping object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewPaginatedRoleMapping() *PaginatedRoleMapping {
this := PaginatedRoleMapping{}
return &this
}

// NewPaginatedRoleMappingWithDefaults instantiates a new PaginatedRoleMapping object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewPaginatedRoleMappingWithDefaults() *PaginatedRoleMapping {
this := PaginatedRoleMapping{}
return &this
}

// GetLinks returns the Links field value if set, zero value otherwise
func (o *PaginatedRoleMapping) GetLinks() []Link {
if o == nil || IsNil(o.Links) {
var ret []Link
return ret
}
return o.Links
}

// GetLinksOk returns a tuple with the Links field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PaginatedRoleMapping) GetLinksOk() ([]Link, bool) {
if o == nil || IsNil(o.Links) {
return nil, false
}

return o.Links, true
}

// HasLinks returns a boolean if a field has been set.
func (o *PaginatedRoleMapping) HasLinks() bool {
if o != nil && !IsNil(o.Links) {
return true
}

return false
}

// SetLinks gets a reference to the given []Link and assigns it to the Links field.
func (o *PaginatedRoleMapping) SetLinks(v []Link) {
o.Links = v
}

// GetResults returns the Results field value if set, zero value otherwise
func (o *PaginatedRoleMapping) GetResults() []AuthFederationRoleMapping {
if o == nil || IsNil(o.Results) {
var ret []AuthFederationRoleMapping
return ret
}
return o.Results
}

// GetResultsOk returns a tuple with the Results field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PaginatedRoleMapping) GetResultsOk() ([]AuthFederationRoleMapping, bool) {
if o == nil || IsNil(o.Results) {
return nil, false
}

return o.Results, true
}

// HasResults returns a boolean if a field has been set.
func (o *PaginatedRoleMapping) HasResults() bool {
if o != nil && !IsNil(o.Results) {
return true
}

return false
}

// SetResults gets a reference to the given []AuthFederationRoleMapping and assigns it to the Results field.
func (o *PaginatedRoleMapping) SetResults(v []AuthFederationRoleMapping) {
o.Results = v
}

// GetTotalCount returns the TotalCount field value if set, zero value otherwise
func (o *PaginatedRoleMapping) GetTotalCount() int {
if o == nil || IsNil(o.TotalCount) {
var ret int
return ret
}
return *o.TotalCount
}

// GetTotalCountOk returns a tuple with the TotalCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PaginatedRoleMapping) GetTotalCountOk() (*int, bool) {
if o == nil || IsNil(o.TotalCount) {
return nil, false
}

return o.TotalCount, true
}

// HasTotalCount returns a boolean if a field has been set.
func (o *PaginatedRoleMapping) HasTotalCount() bool {
if o != nil && !IsNil(o.TotalCount) {
return true
}

return false
}

// SetTotalCount gets a reference to the given int and assigns it to the TotalCount field.
func (o *PaginatedRoleMapping) SetTotalCount(v int) {
o.TotalCount = &v
}

func (o PaginatedRoleMapping) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PaginatedRoleMapping) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
return toSerialize, nil
}
1 change: 1 addition & 0 deletions docs/doc_last_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ Class | Method | HTTP request | Description | [SDK Maturity](ht
- [PaginatedPipelineRun](./docs/PaginatedPipelineRun.md)
- [PaginatedPrivateNetworkEndpointIdEntry](./docs/PaginatedPrivateNetworkEndpointIdEntry.md)
- [PaginatedRestoreJob](./docs/PaginatedRestoreJob.md)
- [PaginatedRoleMapping](./docs/PaginatedRoleMapping.md)
- [PaginatedServerlessInstanceDescription](./docs/PaginatedServerlessInstanceDescription.md)
- [PaginatedSnapshot](./docs/PaginatedSnapshot.md)
- [PaginatedTeam](./docs/PaginatedTeam.md)
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/FederatedAuthenticationApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ Name | Type | Description | Notes

## ListRoleMappings

> []AuthFederationRoleMapping ListRoleMappings(ctx, federationSettingsId, orgId).Execute()
> PaginatedRoleMapping ListRoleMappings(ctx, federationSettingsId, orgId).Execute()
Return All Role Mappings from One Organization

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

### Return type

[**[]AuthFederationRoleMapping**](AuthFederationRoleMapping.md)
[**PaginatedRoleMapping**](PaginatedRoleMapping.md)

### Authorization
[DigestAuth](../README.md#Authentication)
Expand Down
105 changes: 105 additions & 0 deletions docs/docs/PaginatedRoleMapping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# PaginatedRoleMapping

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**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]
**Results** | Pointer to [**[]AuthFederationRoleMapping**](AuthFederationRoleMapping.md) | List of returned documents that MongoDB Cloud providers when completing this request. | [optional] [readonly]
**TotalCount** | Pointer to **int** | Number of documents returned in this response. | [optional] [readonly]

## Methods

### NewPaginatedRoleMapping

`func NewPaginatedRoleMapping() *PaginatedRoleMapping`

NewPaginatedRoleMapping instantiates a new PaginatedRoleMapping object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed

### NewPaginatedRoleMappingWithDefaults

`func NewPaginatedRoleMappingWithDefaults() *PaginatedRoleMapping`

NewPaginatedRoleMappingWithDefaults instantiates a new PaginatedRoleMapping object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set

### GetLinks

`func (o *PaginatedRoleMapping) GetLinks() []Link`

GetLinks returns the Links field if non-nil, zero value otherwise.

### GetLinksOk

`func (o *PaginatedRoleMapping) GetLinksOk() (*[]Link, bool)`

GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetLinks

`func (o *PaginatedRoleMapping) SetLinks(v []Link)`

SetLinks sets Links field to given value.

### HasLinks

`func (o *PaginatedRoleMapping) HasLinks() bool`

HasLinks returns a boolean if a field has been set.
### GetResults

`func (o *PaginatedRoleMapping) GetResults() []AuthFederationRoleMapping`

GetResults returns the Results field if non-nil, zero value otherwise.

### GetResultsOk

`func (o *PaginatedRoleMapping) GetResultsOk() (*[]AuthFederationRoleMapping, bool)`

GetResultsOk returns a tuple with the Results field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetResults

`func (o *PaginatedRoleMapping) SetResults(v []AuthFederationRoleMapping)`

SetResults sets Results field to given value.

### HasResults

`func (o *PaginatedRoleMapping) HasResults() bool`

HasResults returns a boolean if a field has been set.
### GetTotalCount

`func (o *PaginatedRoleMapping) GetTotalCount() int`

GetTotalCount returns the TotalCount field if non-nil, zero value otherwise.

### GetTotalCountOk

`func (o *PaginatedRoleMapping) GetTotalCountOk() (*int, bool)`

GetTotalCountOk returns a tuple with the TotalCount field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetTotalCount

`func (o *PaginatedRoleMapping) SetTotalCount(v int)`

SetTotalCount sets TotalCount field to given value.

### HasTotalCount

`func (o *PaginatedRoleMapping) HasTotalCount() bool`

HasTotalCount returns a boolean if a field has been set.

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


2 changes: 1 addition & 1 deletion internal/core/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package core
// For more information please see: https://github.com/mongodb/atlas-sdk-go/blob/main/docs/doc_1_concepts.md
const (
// SDK release tag version.
Version = "v20231001001.0.0"
Version = "v20231001001.1.0"
// Resource Version.
Resource = "20231001"
)
35 changes: 31 additions & 4 deletions openapi/atlas-api-transformed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ info:
termsOfService: https://www.mongodb.com/mongodb-management-service-terms-and-conditions
title: MongoDB Atlas Administration API
version: "2.0"
x-xgen-sha: 06c21141c5a079d3bc59583f490c6b222da388f8
x-xgen-sha: e4b64bb81696bc3cd4f242df4befad45bf855578
servers:
- url: https://cloud.mongodb.com
tags:
Expand Down Expand Up @@ -516,9 +516,7 @@ paths:
content:
application/vnd.atlas.2023-01-01+json:
schema:
type: array
items:
$ref: "#/components/schemas/AuthFederationRoleMapping"
$ref: "#/components/schemas/PaginatedRoleMapping"
x-xgen-version: 2023-01-01
description: OK
"400":
Expand Down Expand Up @@ -28732,6 +28730,35 @@ components:
description: Number of documents returned in this response.
minimum: 0
readOnly: true
PaginatedRoleMapping:
type: object
description: List role mappings from the specified organization in the specified
federation.
properties:
links:
type: array
description: 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.
externalDocs:
description: Web Linking Specification (RFC 5988)
url: https://datatracker.ietf.org/doc/html/rfc5988
items:
$ref: "#/components/schemas/Link"
readOnly: true
results:
type: array
description: List of returned documents that MongoDB Cloud providers when
completing this request.
items:
$ref: "#/components/schemas/AuthFederationRoleMapping"
readOnly: true
totalCount:
type: integer
format: int32
description: Number of documents returned in this response.
minimum: 0
readOnly: true
PaginatedServerlessInstanceDescription:
type: object
properties:
Expand Down
Loading

0 comments on commit d0d783c

Please sign in to comment.