[go: up one dir, main page]

Skip to content

Commit

Permalink
release v6.45.0
Browse files Browse the repository at this point in the history
  • Loading branch information
revilwang committed May 5, 2023
1 parent 7377a56 commit a7844db
Show file tree
Hide file tree
Showing 91 changed files with 4,409 additions and 627 deletions.
79 changes: 59 additions & 20 deletions README.md

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions api_account.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*
* Gate API v4
*
* Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.
*
* Contact: support@mail.gate.io
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/

package gateapi

import (
"context"
"io/ioutil"
"net/http"
"net/url"
)

// Linger please
var (
_ context.Context
)

// AccountApiService AccountApi service
type AccountApiService service

/*
GetAccountDetail Get account detail
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return AccountDetail
*/
func (a *AccountApiService) GetAccountDetail(ctx context.Context) (AccountDetail, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue AccountDetail
)

// create path and map variables
localVarPath := a.client.cfg.BasePath + "/account/detail"
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{"application/json"}

// 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 localVarReturnValue, nil, err
}

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

localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, 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 localVarReturnValue, localVarHTTPResponse, gateErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

return localVarReturnValue, localVarHTTPResponse, nil
}

0 comments on commit a7844db

Please sign in to comment.