From d0d783c4f53e760a7c98b65e59f17f3cfb05d84b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 13:44:27 +0100 Subject: [PATCH] APIBot: SDK update based on recent changes in Atlas API (#221) Co-authored-by: github-actions[bot] Co-authored-by: wtrocki --- admin/api_federated_authentication.go | 10 +- admin/model_paginated_role_mapping.go | 145 ++++++++++++++++++++++++ docs/doc_last_reference.md | 1 + docs/docs/FederatedAuthenticationApi.md | 6 +- docs/docs/PaginatedRoleMapping.md | 105 +++++++++++++++++ internal/core/version.go | 2 +- openapi/atlas-api-transformed.yaml | 35 +++++- openapi/atlas-api.yaml | 55 ++++++++- 8 files changed, 342 insertions(+), 17 deletions(-) create mode 100644 admin/model_paginated_role_mapping.go create mode 100644 docs/docs/PaginatedRoleMapping.md diff --git a/admin/api_federated_authentication.go b/admin/api_federated_authentication.go index c5d891de..6b70bdcf 100644 --- a/admin/api_federated_authentication.go +++ b/admin/api_federated_authentication.go @@ -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 @@ -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) } @@ -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") diff --git a/admin/model_paginated_role_mapping.go b/admin/model_paginated_role_mapping.go new file mode 100644 index 00000000..4fd20b1f --- /dev/null +++ b/admin/model_paginated_role_mapping.go @@ -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 +} diff --git a/docs/doc_last_reference.md b/docs/doc_last_reference.md index 63d66c17..a9656cc0 100644 --- a/docs/doc_last_reference.md +++ b/docs/doc_last_reference.md @@ -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) diff --git a/docs/docs/FederatedAuthenticationApi.md b/docs/docs/FederatedAuthenticationApi.md index 2e9bc837..9ec06416 100644 --- a/docs/docs/FederatedAuthenticationApi.md +++ b/docs/docs/FederatedAuthenticationApi.md @@ -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 @@ -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) } ``` @@ -890,7 +890,7 @@ Name | Type | Description | Notes ### Return type -[**[]AuthFederationRoleMapping**](AuthFederationRoleMapping.md) +[**PaginatedRoleMapping**](PaginatedRoleMapping.md) ### Authorization [DigestAuth](../README.md#Authentication) diff --git a/docs/docs/PaginatedRoleMapping.md b/docs/docs/PaginatedRoleMapping.md new file mode 100644 index 00000000..30f8899d --- /dev/null +++ b/docs/docs/PaginatedRoleMapping.md @@ -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) + + diff --git a/internal/core/version.go b/internal/core/version.go index 7fabda2b..e1f3be5c 100644 --- a/internal/core/version.go +++ b/internal/core/version.go @@ -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" ) diff --git a/openapi/atlas-api-transformed.yaml b/openapi/atlas-api-transformed.yaml index d5790331..60ecd790 100644 --- a/openapi/atlas-api-transformed.yaml +++ b/openapi/atlas-api-transformed.yaml @@ -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: @@ -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": @@ -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: diff --git a/openapi/atlas-api.yaml b/openapi/atlas-api.yaml index e737b9b6..4236ba2b 100644 --- a/openapi/atlas-api.yaml +++ b/openapi/atlas-api.yaml @@ -19,7 +19,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: @@ -486,9 +486,7 @@ paths: content: application/vnd.atlas.2023-01-01+json: schema: - type: array - items: - $ref: '#/components/schemas/AuthFederationRoleMapping' + $ref: '#/components/schemas/PaginatedRoleMappingView' x-xgen-version: 2023-01-01 description: OK "400": @@ -26673,7 +26671,17 @@ components: enum: - DB_CHECK_SUBMITTED - DB_CHECK_UPDATED + - CLUSTER_SAMPLED_FOR_DB_CHECK + - DB_CHECK_SCHEDULED_FOR_CLUSTER + - DB_CHECK_DEFERRED_FOR_CLUSTER + - CLUSTER_OPTED_OUT_OF_DB_CHECK title: NDS DB Check Audit Types + - type: string + enum: + - CLUSTER_SAMPLED_FOR_DATA_VALIDATION + - DATA_VALIDATION_SUBMITTED_FOR_CLUSTER + - CLUSTER_OPTED_OUT_OF_DATA_VALIDATION + title: NDS Data Validation Audit Types - type: string enum: - MAINTENANCE_IN_ADVANCED @@ -28726,7 +28734,17 @@ components: enum: - DB_CHECK_SUBMITTED - DB_CHECK_UPDATED + - CLUSTER_SAMPLED_FOR_DB_CHECK + - DB_CHECK_SCHEDULED_FOR_CLUSTER + - DB_CHECK_DEFERRED_FOR_CLUSTER + - CLUSTER_OPTED_OUT_OF_DB_CHECK title: NDS DB Check Audit Types + - type: string + enum: + - CLUSTER_SAMPLED_FOR_DATA_VALIDATION + - DATA_VALIDATION_SUBMITTED_FOR_CLUSTER + - CLUSTER_OPTED_OUT_OF_DATA_VALIDATION + title: NDS Data Validation Audit Types - type: string enum: - COMPUTE_AUTO_SCALE_INITIATED @@ -37419,6 +37437,35 @@ components: description: Number of documents returned in this response. minimum: 0 readOnly: true + PaginatedRoleMappingView: + 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 PaginatedServerlessInstanceDescriptionView: type: object properties: