Skip to content

Commit

Permalink
APIBot: SDK update based on recent changes in Atlas API (#261)
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: oarbusi <[email protected]>
  • Loading branch information
3 people authored Jan 18, 2024
1 parent c374129 commit 1651e1d
Show file tree
Hide file tree
Showing 74 changed files with 714 additions and 399 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Note that `atlas-sdk-go` only supports the two most recent major versions of Go.
### Adding Dependency

```terminal
go get go.mongodb.org/atlas-sdk/v20231115003
go get go.mongodb.org/atlas-sdk/v20231115004
```

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

```go
import "go.mongodb.org/atlas-sdk/v20231115003/admin"
import "go.mongodb.org/atlas-sdk/v20231115004/admin"

func example() {
ctx := context.Background()
Expand Down
10 changes: 5 additions & 5 deletions admin/api_federated_authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ type FederatedAuthenticationApi interface {
ListIdentityProvidersWithParams(ctx context.Context, args *ListIdentityProvidersApiParams) ListIdentityProvidersApiRequest

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

/*
ListRoleMappings Return All Role Mappings from One Organization
Expand Down Expand Up @@ -1558,7 +1558,7 @@ func (r ListIdentityProvidersApiRequest) Protocol(protocol string) ListIdentityP
return r
}

func (r ListIdentityProvidersApiRequest) Execute() ([]FederationIdentityProvider, *http.Response, error) {
func (r ListIdentityProvidersApiRequest) Execute() (*PaginatedFederationIdentityProvider, *http.Response, error) {
return r.ApiService.listIdentityProvidersExecute(r)
}

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

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

localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FederatedAuthenticationApiService.ListIdentityProviders")
Expand Down
10 changes: 5 additions & 5 deletions admin/api_projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ type ProjectsApi interface {
ReturnAllIPAddressesWithParams(ctx context.Context, args *ReturnAllIPAddressesApiParams) ReturnAllIPAddressesApiRequest

// Interface only available internally
returnAllIPAddressesExecute(r ReturnAllIPAddressesApiRequest) ([]GroupIPAddresses, *http.Response, error)
returnAllIPAddressesExecute(r ReturnAllIPAddressesApiRequest) (*GroupIPAddresses, *http.Response, error)

/*
SetProjectLimit Set One Project Limit
Expand Down Expand Up @@ -2781,7 +2781,7 @@ func (a *ProjectsApiService) ReturnAllIPAddressesWithParams(ctx context.Context,
}
}

func (r ReturnAllIPAddressesApiRequest) Execute() ([]GroupIPAddresses, *http.Response, error) {
func (r ReturnAllIPAddressesApiRequest) Execute() (*GroupIPAddresses, *http.Response, error) {
return r.ApiService.returnAllIPAddressesExecute(r)
}

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

// Execute executes the request
//
// @return []GroupIPAddresses
func (a *ProjectsApiService) returnAllIPAddressesExecute(r ReturnAllIPAddressesApiRequest) ([]GroupIPAddresses, *http.Response, error) {
// @return GroupIPAddresses
func (a *ProjectsApiService) returnAllIPAddressesExecute(r ReturnAllIPAddressesApiRequest) (*GroupIPAddresses, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue []GroupIPAddresses
localVarReturnValue *GroupIPAddresses
)

localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsApiService.ReturnAllIPAddresses")
Expand Down
4 changes: 2 additions & 2 deletions admin/atlas_client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package admin // import "go.mongodb.org/atlas-sdk/v20231115003/admin"
package admin // import "go.mongodb.org/atlas-sdk/v20231115004/admin"

import (
"errors"
Expand All @@ -8,7 +8,7 @@ import (
"strings"

"github.com/mongodb-forks/digest"
"go.mongodb.org/atlas-sdk/v20231115003/internal/core"
"go.mongodb.org/atlas-sdk/v20231115004/internal/core"
)

const (
Expand Down
148 changes: 148 additions & 0 deletions admin/model_paginated_federation_identity_provider.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
// Code based on the AtlasAPI V2 OpenAPI file

package admin

import (
"encoding/json"
)

// PaginatedFederationIdentityProvider struct for PaginatedFederationIdentityProvider
type PaginatedFederationIdentityProvider 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.
// Read only field.
Links *[]Link `json:"links,omitempty"`
// List of returned documents that MongoDB Cloud providers when completing this request.
// Read only field.
Results *[]FederationIdentityProvider `json:"results,omitempty"`
// Number of documents returned in this response if **includeCount** query param is true.
// Read only field.
TotalCount *int `json:"totalCount,omitempty"`
}

// NewPaginatedFederationIdentityProvider instantiates a new PaginatedFederationIdentityProvider 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 NewPaginatedFederationIdentityProvider() *PaginatedFederationIdentityProvider {
this := PaginatedFederationIdentityProvider{}
return &this
}

// NewPaginatedFederationIdentityProviderWithDefaults instantiates a new PaginatedFederationIdentityProvider 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 NewPaginatedFederationIdentityProviderWithDefaults() *PaginatedFederationIdentityProvider {
this := PaginatedFederationIdentityProvider{}
return &this
}

// GetLinks returns the Links field value if set, zero value otherwise
func (o *PaginatedFederationIdentityProvider) 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 *PaginatedFederationIdentityProvider) 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 *PaginatedFederationIdentityProvider) 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 *PaginatedFederationIdentityProvider) SetLinks(v []Link) {
o.Links = &v
}

// GetResults returns the Results field value if set, zero value otherwise
func (o *PaginatedFederationIdentityProvider) GetResults() []FederationIdentityProvider {
if o == nil || IsNil(o.Results) {
var ret []FederationIdentityProvider
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 *PaginatedFederationIdentityProvider) GetResultsOk() (*[]FederationIdentityProvider, 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 *PaginatedFederationIdentityProvider) HasResults() bool {
if o != nil && !IsNil(o.Results) {
return true
}

return false
}

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

// GetTotalCount returns the TotalCount field value if set, zero value otherwise
func (o *PaginatedFederationIdentityProvider) 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 *PaginatedFederationIdentityProvider) 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 *PaginatedFederationIdentityProvider) 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 *PaginatedFederationIdentityProvider) SetTotalCount(v int) {
o.TotalCount = &v
}

func (o PaginatedFederationIdentityProvider) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PaginatedFederationIdentityProvider) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
return toSerialize, nil
}
2 changes: 1 addition & 1 deletion auth/device_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"strings"
"time"

core "go.mongodb.org/atlas-sdk/v20231115003/internal/core"
core "go.mongodb.org/atlas-sdk/v20231115004/internal/core"
)

const authExpiredError = "DEVICE_AUTHORIZATION_EXPIRED"
Expand Down
2 changes: 1 addition & 1 deletion auth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"runtime"
"strings"

"go.mongodb.org/atlas-sdk/v20231115003/internal/core"
"go.mongodb.org/atlas-sdk/v20231115004/internal/core"
)

const defaultBaseURL = "https://cloud.mongodb.com/"
Expand Down
2 changes: 1 addition & 1 deletion auth/oauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"reflect"
"testing"

core "go.mongodb.org/atlas-sdk/v20231115003/internal/core"
core "go.mongodb.org/atlas-sdk/v20231115004/internal/core"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions docs/doc_2_error_handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Errors are represented by [ApiErrorObject](https://github.com/mongodb/atlas-sdk-
To fetch the error object, execute the following:

```go
import "go.mongodb.org/atlas-sdk/v20231115003/admin"
import "go.mongodb.org/atlas-sdk/v20231115004/admin"

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

```go
import admin "go.mongodb.org/atlas-sdk/v20231115003/admin"
import admin "go.mongodb.org/atlas-sdk/v20231115004/admin"

projects, response, err := admin.ProjectsApi.ListProjects(ctx).Execute()
if admin.IsErrorCode(err, "code"){
Expand Down
2 changes: 1 addition & 1 deletion docs/doc_3_migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The Atlas Go SDK doesn't rely on the deprecated [go-client-mongodb-atlas](https:
The Atlas Go SDK has different methods for the initialization of the clients:

```go
import admin "go.mongodb.org/atlas-sdk/v20231115003/admin"
import admin "go.mongodb.org/atlas-sdk/v20231115004/admin"
sdk, err := admin.NewClient(
// Authentication using ApiKey and ApiSecret
admin.UseDigestAuth(apiKey, apiSecret))
Expand Down
2 changes: 1 addition & 1 deletion docs/doc_4_authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Construct a new Atlas SDK client, then use the services on the client to
access different parts of the Atlas Admin API. For example:

```go
import "go.mongodb.org/atlas-sdk/v20231115003/admin"
import "go.mongodb.org/atlas-sdk/v20231115004/admin"

func example() {
ctx := context.Background()
Expand Down
1 change: 1 addition & 0 deletions docs/doc_last_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ Class | Method | HTTP request | Description | [SDK Maturity](ht
- [PaginatedContainerPeer](./docs/PaginatedContainerPeer.md)
- [PaginatedDatabase](./docs/PaginatedDatabase.md)
- [PaginatedDiskPartition](./docs/PaginatedDiskPartition.md)
- [PaginatedFederationIdentityProvider](./docs/PaginatedFederationIdentityProvider.md)
- [PaginatedHostViewAtlas](./docs/PaginatedHostViewAtlas.md)
- [PaginatedIntegration](./docs/PaginatedIntegration.md)
- [PaginatedNetworkAccess](./docs/PaginatedNetworkAccess.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/AWSClustersDNSApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"fmt"
"os"

"go.mongodb.org/atlas-sdk/v20231115003/admin"
"go.mongodb.org/atlas-sdk/v20231115004/admin"
)

func main() {
Expand Down Expand Up @@ -99,7 +99,7 @@ import (
"fmt"
"os"

"go.mongodb.org/atlas-sdk/v20231115003/admin"
"go.mongodb.org/atlas-sdk/v20231115004/admin"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/AccessTrackingApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"fmt"
"os"

"go.mongodb.org/atlas-sdk/v20231115003/admin"
"go.mongodb.org/atlas-sdk/v20231115004/admin"
)

func main() {
Expand Down Expand Up @@ -112,7 +112,7 @@ import (
"fmt"
"os"

"go.mongodb.org/atlas-sdk/v20231115003/admin"
"go.mongodb.org/atlas-sdk/v20231115004/admin"
)

func main() {
Expand Down
Loading

0 comments on commit 1651e1d

Please sign in to comment.