go-firefly3/api_autocomplete.go

2310 lines
87 KiB
Go
Raw Normal View History

2024-05-11 14:43:57 +03:00
2024-04-10 12:14:55 +03:00
/*
2024-05-11 14:43:57 +03:00
* Firefly III API v2.0.14
2024-04-10 12:14:55 +03:00
*
2024-05-11 14:43:57 +03:00
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-04-20T05:28:29+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
2024-04-10 12:14:55 +03:00
*
2024-05-11 14:43:57 +03:00
* API version: 2.0.14
2024-04-10 12:14:55 +03:00
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
2024-05-11 14:43:57 +03:00
package swagger
2024-04-10 12:14:55 +03:00
import (
"context"
"io/ioutil"
"net/http"
"net/url"
"strings"
2024-05-11 14:43:57 +03:00
"github.com/antihax/optional"
2024-04-10 12:14:55 +03:00
)
// Linger please
var (
_ context.Context
)
type AutocompleteApiService service
/*
AutocompleteApiService Returns all accounts of the user returned in a basic auto-complete array.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetAccountsACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
* @param "Date" (optional.String) - If the account is an asset account or a liability, the autocomplete will also return the balance of the account on this date.
* @param "Types" (optional.Interface of []AccountTypeFilter) - Optional filter on the account type(s) used in the autocomplete.
@return []AutocompleteAccount
*/
type AutocompleteApiGetAccountsACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
Date optional.String
Types optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetAccountsAC(ctx context.Context, localVarOptionals *AutocompleteApiGetAccountsACOpts) ([]AutocompleteAccount, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompleteAccount
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/accounts"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Date.IsSet() {
localVarQueryParams.Add("date", parameterToString(localVarOptionals.Date.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Types.IsSet() {
localVarQueryParams.Add("types", parameterToString(localVarOptionals.Types.Value(), "csv"))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompleteAccount
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all bills of the user returned in a basic auto-complete array.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetBillsACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompleteBill
*/
type AutocompleteApiGetBillsACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetBillsAC(ctx context.Context, localVarOptionals *AutocompleteApiGetBillsACOpts) ([]AutocompleteBill, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompleteBill
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/bills"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompleteBill
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all budgets of the user returned in a basic auto-complete array.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetBudgetsACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompleteBudget
*/
type AutocompleteApiGetBudgetsACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetBudgetsAC(ctx context.Context, localVarOptionals *AutocompleteApiGetBudgetsACOpts) ([]AutocompleteBudget, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompleteBudget
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/budgets"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompleteBudget
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all categories of the user returned in a basic auto-complete array.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetCategoriesACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompleteCategory
*/
type AutocompleteApiGetCategoriesACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetCategoriesAC(ctx context.Context, localVarOptionals *AutocompleteApiGetCategoriesACOpts) ([]AutocompleteCategory, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompleteCategory
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/categories"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompleteCategory
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all currencies of the user returned in a basic auto-complete array.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetCurrenciesACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompleteCurrency
*/
type AutocompleteApiGetCurrenciesACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetCurrenciesAC(ctx context.Context, localVarOptionals *AutocompleteApiGetCurrenciesACOpts) ([]AutocompleteCurrency, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompleteCurrency
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/currencies"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompleteCurrency
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all currencies of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetCurrenciesCodeACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompleteCurrencyCode
*/
type AutocompleteApiGetCurrenciesCodeACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetCurrenciesCodeAC(ctx context.Context, localVarOptionals *AutocompleteApiGetCurrenciesCodeACOpts) ([]AutocompleteCurrencyCode, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompleteCurrencyCode
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/currencies-with-code"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompleteCurrencyCode
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all object groups of the user returned in a basic auto-complete array.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetObjectGroupsACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompleteObjectGroup
*/
type AutocompleteApiGetObjectGroupsACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetObjectGroupsAC(ctx context.Context, localVarOptionals *AutocompleteApiGetObjectGroupsACOpts) ([]AutocompleteObjectGroup, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompleteObjectGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/object-groups"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompleteObjectGroup
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all piggy banks of the user returned in a basic auto-complete array.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetPiggiesACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompletePiggy
*/
type AutocompleteApiGetPiggiesACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetPiggiesAC(ctx context.Context, localVarOptionals *AutocompleteApiGetPiggiesACOpts) ([]AutocompletePiggy, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompletePiggy
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/piggy-banks"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompletePiggy
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all piggy banks of the user returned in a basic auto-complete array complemented with balance information.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetPiggiesBalanceACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompletePiggyBalance
*/
type AutocompleteApiGetPiggiesBalanceACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetPiggiesBalanceAC(ctx context.Context, localVarOptionals *AutocompleteApiGetPiggiesBalanceACOpts) ([]AutocompletePiggyBalance, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompletePiggyBalance
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/piggy-banks-with-balance"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompletePiggyBalance
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all recurring transactions of the user returned in a basic auto-complete array.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetRecurringACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompleteRecurrence
*/
type AutocompleteApiGetRecurringACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetRecurringAC(ctx context.Context, localVarOptionals *AutocompleteApiGetRecurringACOpts) ([]AutocompleteRecurrence, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompleteRecurrence
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/recurring"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompleteRecurrence
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all rule groups of the user returned in a basic auto-complete array.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetRuleGroupsACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompleteRuleGroup
*/
type AutocompleteApiGetRuleGroupsACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetRuleGroupsAC(ctx context.Context, localVarOptionals *AutocompleteApiGetRuleGroupsACOpts) ([]AutocompleteRuleGroup, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompleteRuleGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/rule-groups"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompleteRuleGroup
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all rules of the user returned in a basic auto-complete array.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetRulesACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompleteRule
*/
type AutocompleteApiGetRulesACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetRulesAC(ctx context.Context, localVarOptionals *AutocompleteApiGetRulesACOpts) ([]AutocompleteRule, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompleteRule
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/rules"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompleteRule
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all tags of the user returned in a basic auto-complete array.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetTagACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompleteTag
*/
type AutocompleteApiGetTagACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetTagAC(ctx context.Context, localVarOptionals *AutocompleteApiGetTagACOpts) ([]AutocompleteTag, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompleteTag
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/tags"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompleteTag
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all transaction types returned in a basic auto-complete array. English only.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetTransactionTypesACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompleteTransactionType
*/
type AutocompleteApiGetTransactionTypesACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetTransactionTypesAC(ctx context.Context, localVarOptionals *AutocompleteApiGetTransactionTypesACOpts) ([]AutocompleteTransactionType, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompleteTransactionType
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/transaction-types"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompleteTransactionType
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all transaction descriptions of the user returned in a basic auto-complete array.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetTransactionsACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompleteTransaction
*/
type AutocompleteApiGetTransactionsACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetTransactionsAC(ctx context.Context, localVarOptionals *AutocompleteApiGetTransactionsACOpts) ([]AutocompleteTransaction, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompleteTransaction
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/transactions"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompleteTransaction
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AutocompleteApiService Returns all transactions, complemented with their ID, of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AutocompleteApiGetTransactionsIDACOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Query" (optional.String) - The autocomplete search query.
* @param "Limit" (optional.Int32) - The number of items returned.
@return []AutocompleteTransactionId
*/
type AutocompleteApiGetTransactionsIDACOpts struct {
2024-05-11 14:43:57 +03:00
XTraceId optional.Interface
Query optional.String
Limit optional.Int32
2024-04-10 12:14:55 +03:00
}
func (a *AutocompleteApiService) GetTransactionsIDAC(ctx context.Context, localVarOptionals *AutocompleteApiGetTransactionsIDACOpts) ([]AutocompleteTransactionId, *http.Response, error) {
var (
2024-05-11 14:43:57 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []AutocompleteTransactionId
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/transactions-with-id"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Query.IsSet() {
localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
// 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 localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 {
// If we succeed, return the data, otherwise pass on to decode error.
2024-05-11 14:43:57 +03:00
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
2024-05-11 14:43:57 +03:00
body: localVarBody,
2024-04-10 12:14:55 +03:00
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []AutocompleteTransactionId
2024-05-11 14:43:57 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}