[go: up one dir, main page]

Skip to content

Commit

Permalink
release v6.67.0
Browse files Browse the repository at this point in the history
  • Loading branch information
revilwang committed Mar 12, 2024
1 parent 62a4607 commit 9120fff
Show file tree
Hide file tree
Showing 126 changed files with 4,917 additions and 237 deletions.
65 changes: 57 additions & 8 deletions README.md

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions api_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,11 @@ DeleteSTPGroupUsers Delete the user in the STP group
- Only the main account that created this STP group is allowed to delete users from the STP user group - Deletion is limited to accounts under the current main account; cross-account deletion is not permitted
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param stpId STP Group ID
- @param requestBody User ID
- @param userId STP user ID, multiple can be separated by commas
@return []StpGroupUser
*/
func (a *AccountApiService) DeleteSTPGroupUsers(ctx context.Context, stpId int64, requestBody []int64) ([]StpGroupUser, *http.Response, error) {
func (a *AccountApiService) DeleteSTPGroupUsers(ctx context.Context, stpId int64, userId int64) ([]StpGroupUser, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
Expand All @@ -529,8 +529,9 @@ func (a *AccountApiService) DeleteSTPGroupUsers(ctx context.Context, stpId int64
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}

localVarQueryParams.Add("user_id", parameterToString(userId, ""))
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
localVarHTTPContentTypes := []string{}

// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
Expand All @@ -546,8 +547,6 @@ func (a *AccountApiService) DeleteSTPGroupUsers(ctx context.Context, stpId int64
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = &requestBody
if ctx == nil {
ctx = context.Background()
}
Expand Down
140 changes: 50 additions & 90 deletions api_earn.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ package gateapi

import (
"context"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"strings"
)

// Linger please
Expand Down Expand Up @@ -361,95 +361,25 @@ func (a *EarnApiService) PlaceDualOrder(ctx context.Context, placeDualInvestment
return localVarHTTPResponse, nil
}

/*
CancelDualOrder Cancel Dual Investment order
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param orderId Order ID
*/
func (a *EarnApiService) CancelDualOrder(ctx context.Context, orderId int32) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
)

// create path and map variables
localVarPath := a.client.cfg.BasePath + "/earn/dual/orders/{order_id}"
localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", url.QueryEscape(parameterToString(orderId, "")), -1)

localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}

// to determine the Content-Type header
localVarHTTPContentTypes := []string{}

// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}

// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}

// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if ctx == nil {
ctx = context.Background()
}
if ctx.Value(ContextGateAPIV4) == nil {
// for compatibility, set configuration key and secret to context if ContextGateAPIV4 value is not present
ctx = context.WithValue(ctx, ContextGateAPIV4, GateAPIV4{
Key: a.client.cfg.Key,
Secret: a.client.cfg.Secret,
})
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}

localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}

localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarHTTPResponse, err
}

if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status + ", " + string(localVarBody),
}
var gateErr GateAPIError
if e := a.client.decode(&gateErr, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")); e == nil && gateErr.Label != "" {
gateErr.APIError = newErr
return localVarHTTPResponse, gateErr
}
return localVarHTTPResponse, newErr
}

return localVarHTTPResponse, nil
// ListStructuredProductsOpts Optional parameters for the method 'ListStructuredProducts'
type ListStructuredProductsOpts struct {
Type_ optional.String
Page optional.Int32
Limit optional.Int32
}

/*
ListStructuredProducts Structured Product List
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param structuredGetProjectListRequest
- @param status Status (default: all) `in_process`-processing `will_begin`-unstarted `wait_settlement`-unsettled `done`-finish
- @param optional nil or *ListStructuredProductsOpts - Optional Parameters:
- @param "Type_" (optional.String) - Product Type (default all) `SharkFin2.0`-SharkFin `BullishSharkFin`-BullishSharkFin `BearishSharkFin`-BearishSharkFin `DoubleNoTouch`-DoubleNoTouch `RangeAccrual`-RangeAccrual `SnowBall`-SnowBall
- @param "Page" (optional.Int32) - Page number
- @param "Limit" (optional.Int32) - Maximum number of records to be returned in a single list
@return []StructuredGetProjectList
*/
func (a *EarnApiService) ListStructuredProducts(ctx context.Context, structuredGetProjectListRequest StructuredGetProjectListRequest) ([]StructuredGetProjectList, *http.Response, error) {
func (a *EarnApiService) ListStructuredProducts(ctx context.Context, status string, localVarOptionals *ListStructuredProductsOpts) ([]StructuredGetProjectList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
Expand All @@ -465,8 +395,18 @@ func (a *EarnApiService) ListStructuredProducts(ctx context.Context, structuredG
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}

if localVarOptionals != nil && localVarOptionals.Type_.IsSet() {
localVarQueryParams.Add("type", parameterToString(localVarOptionals.Type_.Value(), ""))
}
localVarQueryParams.Add("status", parameterToString(status, ""))
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
localVarHTTPContentTypes := []string{}

// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
Expand All @@ -482,8 +422,6 @@ func (a *EarnApiService) ListStructuredProducts(ctx context.Context, structuredG
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = &structuredGetProjectListRequest
if ctx == nil {
ctx = context.Background()
}
Expand Down Expand Up @@ -529,14 +467,26 @@ func (a *EarnApiService) ListStructuredProducts(ctx context.Context, structuredG
return localVarReturnValue, localVarHTTPResponse, nil
}

// ListStructuredOrdersOpts Optional parameters for the method 'ListStructuredOrders'
type ListStructuredOrdersOpts struct {
From optional.Int64
To optional.Int64
Page optional.Int32
Limit optional.Int32
}

/*
ListStructuredOrders Structured Product Order List
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param structuredOrderListRequest
- @param optional nil or *ListStructuredOrdersOpts - Optional Parameters:
- @param "From" (optional.Int64) - Start timestamp
- @param "To" (optional.Int64) - End timestamp
- @param "Page" (optional.Int32) - Page number
- @param "Limit" (optional.Int32) - Maximum number of records to be returned in a single list
@return []StructuredOrderList
*/
func (a *EarnApiService) ListStructuredOrders(ctx context.Context, structuredOrderListRequest StructuredOrderListRequest) ([]StructuredOrderList, *http.Response, error) {
func (a *EarnApiService) ListStructuredOrders(ctx context.Context, localVarOptionals *ListStructuredOrdersOpts) ([]StructuredOrderList, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
Expand All @@ -552,8 +502,20 @@ func (a *EarnApiService) ListStructuredOrders(ctx context.Context, structuredOrd
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}

if localVarOptionals != nil && localVarOptionals.From.IsSet() {
localVarQueryParams.Add("from", parameterToString(localVarOptionals.From.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.To.IsSet() {
localVarQueryParams.Add("to", parameterToString(localVarOptionals.To.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
localVarHTTPContentTypes := []string{}

// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
Expand All @@ -569,8 +531,6 @@ func (a *EarnApiService) ListStructuredOrders(ctx context.Context, structuredOrd
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = &structuredOrderListRequest
if ctx == nil {
ctx = context.Background()
}
Expand Down
10 changes: 10 additions & 0 deletions api_earn_uni.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,8 @@ type ListUniInterestRecordsOpts struct {
Currency optional.String
Page optional.Int32
Limit optional.Int32
From optional.Int64
To optional.Int64
}

/*
Expand All @@ -703,6 +705,8 @@ ListUniInterestRecords List interest records
- @param "Currency" (optional.String) - Retrieve data of the specified currency
- @param "Page" (optional.Int32) - Page number
- @param "Limit" (optional.Int32) - Maximum response items. Default: 100, minimum: 1, Maximum: 100
- @param "From" (optional.Int64) - Start timestamp
- @param "To" (optional.Int64) - End timestamp
@return []UniInterestRecord
*/
Expand Down Expand Up @@ -731,6 +735,12 @@ func (a *EarnUniApiService) ListUniInterestRecords(ctx context.Context, localVar
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.From.IsSet() {
localVarQueryParams.Add("from", parameterToString(localVarOptionals.From.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.To.IsSet() {
localVarQueryParams.Add("to", parameterToString(localVarOptionals.To.Value(), ""))
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}

Expand Down
Loading

0 comments on commit 9120fff

Please sign in to comment.