Skip to content

Commit

Permalink
APIBot: SDK update based on recent changes in Atlas API (#371)
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 <[email protected]>
  • Loading branch information
3 people authored Aug 8, 2024
1 parent ca2ab7b commit e52b379
Show file tree
Hide file tree
Showing 204 changed files with 7,867 additions and 4,581 deletions.
2 changes: 1 addition & 1 deletion .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ filename: "{{ .InterfaceName | snakecase }}.go"
mockname: "{{.InterfaceName}}"

packages:
go.mongodb.org/atlas-sdk/v20240530005/admin:
go.mongodb.org/atlas-sdk/v20240805001/admin:
config:
include-regex: ".*Api"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,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/v20240530005
go get go.mongodb.org/atlas-sdk/v20240805001
```

### Using in the code
Expand All @@ -21,7 +21,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/v20240530005/admin"
import "go.mongodb.org/atlas-sdk/v20240805001/admin"

func example() {
ctx := context.Background()
Expand Down
98 changes: 49 additions & 49 deletions admin/api_cloud_backups.go

Large diffs are not rendered by default.

190 changes: 95 additions & 95 deletions admin/api_clusters.go

Large diffs are not rendered by default.

132 changes: 66 additions & 66 deletions admin/api_global_clusters.go

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions admin/api_invoices.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io"
"net/http"
"net/url"
"reflect"
"strings"
)

Expand Down Expand Up @@ -643,6 +644,11 @@ type ListInvoicesApiRequest struct {
itemsPerPage *int
pageNum *int
viewLinkedInvoices *bool
statusNames *[]string
fromDate *string
toDate *string
sortBy *string
orderBy *string
}

type ListInvoicesApiParams struct {
Expand All @@ -651,6 +657,11 @@ type ListInvoicesApiParams struct {
ItemsPerPage *int
PageNum *int
ViewLinkedInvoices *bool
StatusNames *[]string
FromDate *string
ToDate *string
SortBy *string
OrderBy *string
}

func (a *InvoicesApiService) ListInvoicesWithParams(ctx context.Context, args *ListInvoicesApiParams) ListInvoicesApiRequest {
Expand All @@ -662,6 +673,11 @@ func (a *InvoicesApiService) ListInvoicesWithParams(ctx context.Context, args *L
itemsPerPage: args.ItemsPerPage,
pageNum: args.PageNum,
viewLinkedInvoices: args.ViewLinkedInvoices,
statusNames: args.StatusNames,
fromDate: args.FromDate,
toDate: args.ToDate,
sortBy: args.SortBy,
orderBy: args.OrderBy,
}
}

Expand Down Expand Up @@ -689,6 +705,36 @@ func (r ListInvoicesApiRequest) ViewLinkedInvoices(viewLinkedInvoices bool) List
return r
}

// Statuses of the invoice to be retrieved. Omit to return invoices of all statuses.
func (r ListInvoicesApiRequest) StatusNames(statusNames []string) ListInvoicesApiRequest {
r.statusNames = &statusNames
return r
}

// Retrieve the invoices the startDates of which are greater than or equal to the fromDate. If omit, the invoices return will go back to earliest startDate.
func (r ListInvoicesApiRequest) FromDate(fromDate string) ListInvoicesApiRequest {
r.fromDate = &fromDate
return r
}

// Retrieve the invoices the endDates of which are smaller than or equal to the toDate. If omit, the invoices return will go further to latest endDate.
func (r ListInvoicesApiRequest) ToDate(toDate string) ListInvoicesApiRequest {
r.toDate = &toDate
return r
}

// Field used to sort the returned invoices by. Use in combination with orderBy parameter to control the order of the result.
func (r ListInvoicesApiRequest) SortBy(sortBy string) ListInvoicesApiRequest {
r.sortBy = &sortBy
return r
}

// Field used to order the returned invoices by. Use in combination of sortBy parameter to control the order of the result.
func (r ListInvoicesApiRequest) OrderBy(orderBy string) ListInvoicesApiRequest {
r.orderBy = &orderBy
return r
}

func (r ListInvoicesApiRequest) Execute() (*PaginatedApiInvoiceMetadata, *http.Response, error) {
return r.ApiService.ListInvoicesExecute(r)
}
Expand Down Expand Up @@ -762,6 +808,33 @@ func (a *InvoicesApiService) ListInvoicesExecute(r ListInvoicesApiRequest) (*Pag
r.viewLinkedInvoices = &defaultValue
parameterAddToHeaderOrQuery(localVarQueryParams, "viewLinkedInvoices", r.viewLinkedInvoices, "")
}
if r.statusNames != nil {
t := *r.statusNames
// Workaround for unused import
_ = reflect.Append
parameterAddToHeaderOrQuery(localVarQueryParams, "statusNames", t, "multi")

}
if r.fromDate != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "fromDate", r.fromDate, "")
}
if r.toDate != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "toDate", r.toDate, "")
}
if r.sortBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "")
} else {
var defaultValue string = "END_DATE"
r.sortBy = &defaultValue
parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "")
}
if r.orderBy != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "")
} else {
var defaultValue string = "desc"
r.orderBy = &defaultValue
parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}

Expand Down
4 changes: 2 additions & 2 deletions admin/api_network_peering.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ type NetworkPeeringApi interface {
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
@param containerId Unique 24-hexadecimal digit string that identifies the MongoDB Cloud network container that you want to remove.
@param containerId Unique 24-hexadecimal digit string that identifies the MongoDB Cloud network container.
@return GetPeeringContainerApiRequest
*/
GetPeeringContainer(ctx context.Context, groupId string, containerId string) GetPeeringContainerApiRequest
Expand Down Expand Up @@ -1081,7 +1081,7 @@ Returns details about one network peering container in one specified project. Ne
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
@param containerId Unique 24-hexadecimal digit string that identifies the MongoDB Cloud network container that you want to remove.
@param containerId Unique 24-hexadecimal digit string that identifies the MongoDB Cloud network container.
@return GetPeeringContainerApiRequest
*/
func (a *NetworkPeeringApiService) GetPeeringContainer(ctx context.Context, groupId string, containerId string) GetPeeringContainerApiRequest {
Expand Down
10 changes: 5 additions & 5 deletions admin/api_programmatic_api_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type ProgrammaticAPIKeysApi interface {
AddProjectApiKeyWithParams(ctx context.Context, args *AddProjectApiKeyApiParams) AddProjectApiKeyApiRequest

// Method available only for mocking purposes
AddProjectApiKeyExecute(r AddProjectApiKeyApiRequest) (*ApiKeyUserDetails, *http.Response, error)
AddProjectApiKeyExecute(r AddProjectApiKeyApiRequest) (interface{}, *http.Response, error)

/*
CreateApiKey Create One Organization API Key
Expand Down Expand Up @@ -380,7 +380,7 @@ func (a *ProgrammaticAPIKeysApiService) AddProjectApiKeyWithParams(ctx context.C
}
}

func (r AddProjectApiKeyApiRequest) Execute() (*ApiKeyUserDetails, *http.Response, error) {
func (r AddProjectApiKeyApiRequest) Execute() (interface{}, *http.Response, error) {
return r.ApiService.AddProjectApiKeyExecute(r)
}

Expand All @@ -406,13 +406,13 @@ func (a *ProgrammaticAPIKeysApiService) AddProjectApiKey(ctx context.Context, gr

// Execute executes the request
//
// @return ApiKeyUserDetails
func (a *ProgrammaticAPIKeysApiService) AddProjectApiKeyExecute(r AddProjectApiKeyApiRequest) (*ApiKeyUserDetails, *http.Response, error) {
// @return interface{}
func (a *ProgrammaticAPIKeysApiService) AddProjectApiKeyExecute(r AddProjectApiKeyApiRequest) (interface{}, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ApiKeyUserDetails
localVarReturnValue interface{}
)

localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProgrammaticAPIKeysApiService.AddProjectApiKey")
Expand Down
Loading

0 comments on commit e52b379

Please sign in to comment.