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
|
|
|
"fmt"
|
|
|
|
"github.com/antihax/optional"
|
2024-04-10 12:14:55 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
// Linger please
|
|
|
|
var (
|
|
|
|
_ context.Context
|
|
|
|
)
|
|
|
|
|
|
|
|
type CurrenciesApiService service
|
|
|
|
/*
|
|
|
|
CurrenciesApiService Make currency default currency.
|
|
|
|
Make this currency the default currency for the user. If the currency is not enabled, it will be enabled as well.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param code The currency code.
|
|
|
|
* @param optional nil or *CurrenciesApiDefaultCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
@return CurrencySingle
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiDefaultCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) DefaultCurrency(ctx context.Context, code string, localVarOptionals *CurrenciesApiDefaultCurrencyOpts) (CurrencySingle, *http.Response, error) {
|
|
|
|
var (
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpMethod = strings.ToUpper("Post")
|
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
2024-04-10 12:14:55 +03:00
|
|
|
localVarReturnValue CurrencySingle
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies/{code}/default"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"code"+"}", fmt.Sprintf("%v", code), -1)
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
// to determine the Content-Type header
|
|
|
|
localVarHttpContentTypes := []string{}
|
|
|
|
|
|
|
|
// set Content-Type header
|
|
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
|
|
if localVarHttpContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpHeaderAccepts := []string{"application/vnd.api+json", "application/json"}
|
2024-04-10 12:14:55 +03:00
|
|
|
|
|
|
|
// 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 == 204 {
|
|
|
|
var v CurrencySingle
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService Delete a currency.
|
|
|
|
Delete a currency.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param code The currency code.
|
|
|
|
* @param optional nil or *CurrenciesApiDeleteCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiDeleteCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) DeleteCurrency(ctx context.Context, code string, localVarOptionals *CurrenciesApiDeleteCurrencyOpts) (*http.Response, error) {
|
|
|
|
var (
|
|
|
|
localVarHttpMethod = strings.ToUpper("Delete")
|
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
2024-05-11 14:43:57 +03:00
|
|
|
|
2024-04-10 12:14:55 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies/{code}"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"code"+"}", fmt.Sprintf("%v", code), -1)
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
// to determine the Content-Type header
|
|
|
|
localVarHttpContentTypes := []string{}
|
|
|
|
|
|
|
|
// set Content-Type header
|
|
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
|
|
if localVarHttpContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
|
|
|
localVarHttpHeaderAccepts := []string{"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 nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHttpResponse == nil {
|
|
|
|
return localVarHttpResponse, err
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
|
|
localVarHttpResponse.Body.Close()
|
|
|
|
if err != nil {
|
|
|
|
return localVarHttpResponse, err
|
|
|
|
}
|
|
|
|
|
2024-05-11 14:43:57 +03:00
|
|
|
|
2024-04-10 12:14:55 +03:00
|
|
|
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 localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
2024-04-10 12:14:55 +03:00
|
|
|
return 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 localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
2024-04-10 12:14:55 +03:00
|
|
|
return 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 localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
2024-04-10 12:14:55 +03:00
|
|
|
return 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 localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
2024-04-10 12:14:55 +03:00
|
|
|
return localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
return localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService Disable a currency.
|
|
|
|
Disable a currency.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param code The currency code.
|
|
|
|
* @param optional nil or *CurrenciesApiDisableCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
@return CurrencySingle
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiDisableCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) DisableCurrency(ctx context.Context, code string, localVarOptionals *CurrenciesApiDisableCurrencyOpts) (CurrencySingle, *http.Response, error) {
|
|
|
|
var (
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpMethod = strings.ToUpper("Post")
|
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
2024-04-10 12:14:55 +03:00
|
|
|
localVarReturnValue CurrencySingle
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies/{code}/disable"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"code"+"}", fmt.Sprintf("%v", code), -1)
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
// to determine the Content-Type header
|
|
|
|
localVarHttpContentTypes := []string{}
|
|
|
|
|
|
|
|
// set Content-Type header
|
|
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
|
|
if localVarHttpContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpHeaderAccepts := []string{"application/vnd.api+json", "application/json"}
|
2024-04-10 12:14:55 +03:00
|
|
|
|
|
|
|
// 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 == 204 {
|
|
|
|
var v CurrencySingle
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService Enable a single currency.
|
|
|
|
Enable a single currency.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param code The currency code.
|
|
|
|
* @param optional nil or *CurrenciesApiEnableCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
@return CurrencySingle
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiEnableCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) EnableCurrency(ctx context.Context, code string, localVarOptionals *CurrenciesApiEnableCurrencyOpts) (CurrencySingle, *http.Response, error) {
|
|
|
|
var (
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpMethod = strings.ToUpper("Post")
|
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
2024-04-10 12:14:55 +03:00
|
|
|
localVarReturnValue CurrencySingle
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies/{code}/enable"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"code"+"}", fmt.Sprintf("%v", code), -1)
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
// to determine the Content-Type header
|
|
|
|
localVarHttpContentTypes := []string{}
|
|
|
|
|
|
|
|
// set Content-Type header
|
|
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
|
|
if localVarHttpContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpHeaderAccepts := []string{"application/vnd.api+json", "application/json"}
|
2024-04-10 12:14:55 +03:00
|
|
|
|
|
|
|
// 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 == 204 {
|
|
|
|
var v CurrencySingle
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService Get a single currency.
|
|
|
|
Get a single currency.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param code The currency code.
|
|
|
|
* @param optional nil or *CurrenciesApiGetCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
@return CurrencySingle
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiGetCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) GetCurrency(ctx context.Context, code string, localVarOptionals *CurrenciesApiGetCurrencyOpts) (CurrencySingle, *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 CurrencySingle
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies/{code}"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"code"+"}", fmt.Sprintf("%v", code), -1)
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
// to determine the Content-Type header
|
|
|
|
localVarHttpContentTypes := []string{}
|
|
|
|
|
|
|
|
// set Content-Type header
|
|
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
|
|
if localVarHttpContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpHeaderAccepts := []string{"application/vnd.api+json", "application/json"}
|
2024-04-10 12:14:55 +03:00
|
|
|
|
|
|
|
// 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 == 200 {
|
|
|
|
var v CurrencySingle
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService Get the user's default currency.
|
|
|
|
Get the user's default currency.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param optional nil or *CurrenciesApiGetDefaultCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
@return CurrencySingle
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiGetDefaultCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) GetDefaultCurrency(ctx context.Context, localVarOptionals *CurrenciesApiGetDefaultCurrencyOpts) (CurrencySingle, *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 CurrencySingle
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies/default"
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
// to determine the Content-Type header
|
|
|
|
localVarHttpContentTypes := []string{}
|
|
|
|
|
|
|
|
// set Content-Type header
|
|
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
|
|
if localVarHttpContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
|
|
|
localVarHttpHeaderAccepts := []string{"application/json"}
|
|
|
|
|
|
|
|
// set Accept header
|
|
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
|
|
if localVarHttpHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
|
|
}
|
|
|
|
if 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 == 200 {
|
|
|
|
var v CurrencySingle
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService List all accounts with this currency.
|
|
|
|
List all accounts with this currency.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param code The currency code.
|
|
|
|
* @param optional nil or *CurrenciesApiListAccountByCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
|
|
|
|
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
|
2024-05-11 14:43:57 +03:00
|
|
|
* @param "Date" (optional.String) - A date formatted YYYY-MM-DD. When added to the request, Firefly III will show the account's balance on that day.
|
2024-04-10 12:14:55 +03:00
|
|
|
* @param "Type_" (optional.Interface of AccountTypeFilter) - Optional filter on the account type(s) returned
|
|
|
|
@return AccountArray
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiListAccountByCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
|
|
|
Limit optional.Int32
|
|
|
|
Page optional.Int32
|
|
|
|
Date optional.String
|
|
|
|
Type_ optional.Interface
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) ListAccountByCurrency(ctx context.Context, code string, localVarOptionals *CurrenciesApiListAccountByCurrencyOpts) (AccountArray, *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 AccountArray
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies/{code}/accounts"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"code"+"}", fmt.Sprintf("%v", code), -1)
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
|
|
|
|
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
|
|
|
|
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Date.IsSet() {
|
|
|
|
localVarQueryParams.Add("date", parameterToString(localVarOptionals.Date.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Type_.IsSet() {
|
|
|
|
localVarQueryParams.Add("type", parameterToString(localVarOptionals.Type_.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
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpHeaderAccepts := []string{"application/vnd.api+json", "application/json"}
|
2024-04-10 12:14:55 +03:00
|
|
|
|
|
|
|
// 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 == 200 {
|
|
|
|
var v AccountArray
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService List all available budgets with this currency.
|
|
|
|
List all available budgets with this currency.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param code The currency code.
|
|
|
|
* @param optional nil or *CurrenciesApiListAvailableBudgetByCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
|
|
|
|
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
|
|
|
|
@return AvailableBudgetArray
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiListAvailableBudgetByCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
|
|
|
Limit optional.Int32
|
|
|
|
Page optional.Int32
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) ListAvailableBudgetByCurrency(ctx context.Context, code string, localVarOptionals *CurrenciesApiListAvailableBudgetByCurrencyOpts) (AvailableBudgetArray, *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 AvailableBudgetArray
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies/{code}/available-budgets"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"code"+"}", fmt.Sprintf("%v", code), -1)
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
|
|
|
|
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
|
|
|
|
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.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
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpHeaderAccepts := []string{"application/vnd.api+json", "application/json"}
|
2024-04-10 12:14:55 +03:00
|
|
|
|
|
|
|
// 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 == 200 {
|
|
|
|
var v AvailableBudgetArray
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService List all bills with this currency.
|
|
|
|
List all bills with this currency.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param code The currency code.
|
|
|
|
* @param optional nil or *CurrenciesApiListBillByCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
|
|
|
|
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
|
|
|
|
@return BillArray
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiListBillByCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
|
|
|
Limit optional.Int32
|
|
|
|
Page optional.Int32
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) ListBillByCurrency(ctx context.Context, code string, localVarOptionals *CurrenciesApiListBillByCurrencyOpts) (BillArray, *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 BillArray
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies/{code}/bills"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"code"+"}", fmt.Sprintf("%v", code), -1)
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
|
|
|
|
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
|
|
|
|
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.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
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpHeaderAccepts := []string{"application/vnd.api+json", "application/json"}
|
2024-04-10 12:14:55 +03:00
|
|
|
|
|
|
|
// 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 == 200 {
|
|
|
|
var v BillArray
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService List all budget limits with this currency
|
|
|
|
List all budget limits with this currency
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param code The currency code.
|
|
|
|
* @param optional nil or *CurrenciesApiListBudgetLimitByCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
|
|
|
|
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
|
|
|
|
* @param "Start" (optional.String) - Start date for the budget limit list.
|
|
|
|
* @param "End" (optional.String) - End date for the budget limit list.
|
|
|
|
@return BudgetLimitArray
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiListBudgetLimitByCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
|
|
|
Limit optional.Int32
|
|
|
|
Page optional.Int32
|
|
|
|
Start optional.String
|
|
|
|
End optional.String
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) ListBudgetLimitByCurrency(ctx context.Context, code string, localVarOptionals *CurrenciesApiListBudgetLimitByCurrencyOpts) (BudgetLimitArray, *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 BudgetLimitArray
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies/{code}/budget_limits"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"code"+"}", fmt.Sprintf("%v", code), -1)
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
|
|
|
|
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
|
|
|
|
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Start.IsSet() {
|
|
|
|
localVarQueryParams.Add("start", parameterToString(localVarOptionals.Start.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.End.IsSet() {
|
|
|
|
localVarQueryParams.Add("end", parameterToString(localVarOptionals.End.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
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpHeaderAccepts := []string{"application/vnd.api+json", "application/json"}
|
2024-04-10 12:14:55 +03:00
|
|
|
|
|
|
|
// 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 == 200 {
|
|
|
|
var v BudgetLimitArray
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService List all currencies.
|
|
|
|
List all currencies.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param optional nil or *CurrenciesApiListCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
|
|
|
|
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
|
|
|
|
@return CurrencyArray
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiListCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
|
|
|
Limit optional.Int32
|
|
|
|
Page optional.Int32
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) ListCurrency(ctx context.Context, localVarOptionals *CurrenciesApiListCurrencyOpts) (CurrencyArray, *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 CurrencyArray
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies"
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
|
|
|
|
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
|
|
|
|
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.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
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpHeaderAccepts := []string{"application/vnd.api+json", "application/json"}
|
2024-04-10 12:14:55 +03:00
|
|
|
|
|
|
|
// 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 == 200 {
|
|
|
|
var v CurrencyArray
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService List all recurring transactions with this currency.
|
|
|
|
List all recurring transactions with this currency.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param code The currency code.
|
|
|
|
* @param optional nil or *CurrenciesApiListRecurrenceByCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
|
|
|
|
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
|
|
|
|
@return RecurrenceArray
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiListRecurrenceByCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
|
|
|
Limit optional.Int32
|
|
|
|
Page optional.Int32
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) ListRecurrenceByCurrency(ctx context.Context, code string, localVarOptionals *CurrenciesApiListRecurrenceByCurrencyOpts) (RecurrenceArray, *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 RecurrenceArray
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies/{code}/recurrences"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"code"+"}", fmt.Sprintf("%v", code), -1)
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
|
|
|
|
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
|
|
|
|
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.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
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpHeaderAccepts := []string{"application/vnd.api+json", "application/json"}
|
2024-04-10 12:14:55 +03:00
|
|
|
|
|
|
|
// 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 == 200 {
|
|
|
|
var v RecurrenceArray
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService List all rules with this currency.
|
|
|
|
List all rules with this currency.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param code The currency code.
|
|
|
|
* @param optional nil or *CurrenciesApiListRuleByCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
|
|
|
|
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
|
|
|
|
@return RuleArray
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiListRuleByCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
|
|
|
Limit optional.Int32
|
|
|
|
Page optional.Int32
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) ListRuleByCurrency(ctx context.Context, code string, localVarOptionals *CurrenciesApiListRuleByCurrencyOpts) (RuleArray, *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 RuleArray
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies/{code}/rules"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"code"+"}", fmt.Sprintf("%v", code), -1)
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
|
|
|
|
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
|
|
|
|
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.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
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpHeaderAccepts := []string{"application/vnd.api+json", "application/json"}
|
2024-04-10 12:14:55 +03:00
|
|
|
|
|
|
|
// 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 == 200 {
|
|
|
|
var v RuleArray
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService List all transactions with this currency.
|
|
|
|
List all transactions with this currency.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param code The currency code.
|
|
|
|
* @param optional nil or *CurrenciesApiListTransactionByCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
|
|
|
|
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
|
2024-05-11 14:43:57 +03:00
|
|
|
* @param "Start" (optional.String) - A date formatted YYYY-MM-DD, to limit the list of transactions.
|
|
|
|
* @param "End" (optional.String) - A date formatted YYYY-MM-DD, to limit the list of transactions.
|
2024-04-10 12:14:55 +03:00
|
|
|
* @param "Type_" (optional.Interface of TransactionTypeFilter) - Optional filter on the transaction type(s) returned
|
|
|
|
@return TransactionArray
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiListTransactionByCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
|
|
|
Limit optional.Int32
|
|
|
|
Page optional.Int32
|
|
|
|
Start optional.String
|
|
|
|
End optional.String
|
|
|
|
Type_ optional.Interface
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) ListTransactionByCurrency(ctx context.Context, code string, localVarOptionals *CurrenciesApiListTransactionByCurrencyOpts) (TransactionArray, *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 TransactionArray
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies/{code}/transactions"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"code"+"}", fmt.Sprintf("%v", code), -1)
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
|
|
|
|
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
|
|
|
|
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Start.IsSet() {
|
|
|
|
localVarQueryParams.Add("start", parameterToString(localVarOptionals.Start.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.End.IsSet() {
|
|
|
|
localVarQueryParams.Add("end", parameterToString(localVarOptionals.End.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Type_.IsSet() {
|
|
|
|
localVarQueryParams.Add("type", parameterToString(localVarOptionals.Type_.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
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpHeaderAccepts := []string{"application/vnd.api+json", "application/json"}
|
2024-04-10 12:14:55 +03:00
|
|
|
|
|
|
|
// 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 == 200 {
|
|
|
|
var v TransactionArray
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService Store a new currency
|
|
|
|
Creates a new currency. The data required can be submitted as a JSON body or as a list of parameters.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param body JSON array or key=value pairs with the necessary currency information. See the model for the exact specifications.
|
|
|
|
* @param optional nil or *CurrenciesApiStoreCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
@return CurrencySingle
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiStoreCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) StoreCurrency(ctx context.Context, body CurrencyStore, localVarOptionals *CurrenciesApiStoreCurrencyOpts) (CurrencySingle, *http.Response, error) {
|
|
|
|
var (
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpMethod = strings.ToUpper("Post")
|
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
2024-04-10 12:14:55 +03:00
|
|
|
localVarReturnValue CurrencySingle
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies"
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
// to determine the Content-Type header
|
|
|
|
localVarHttpContentTypes := []string{"application/json", "application/x-www-form-urlencoded"}
|
|
|
|
|
|
|
|
// set Content-Type header
|
|
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
|
|
if localVarHttpContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpHeaderAccepts := []string{"application/vnd.api+json", "application/json"}
|
2024-04-10 12:14:55 +03:00
|
|
|
|
|
|
|
// 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(), "")
|
|
|
|
}
|
|
|
|
// body params
|
|
|
|
localVarPostBody = &body
|
|
|
|
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 == 200 {
|
|
|
|
var v CurrencySingle
|
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 == 422 {
|
|
|
|
var v ValidationErrorResponse
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
CurrenciesApiService Update existing currency.
|
|
|
|
Update existing currency.
|
|
|
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param body JSON array with updated currency information. See the model for the exact specifications.
|
|
|
|
* @param code The currency code.
|
|
|
|
* @param optional nil or *CurrenciesApiUpdateCurrencyOpts - Optional Parameters:
|
|
|
|
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
|
|
|
|
@return CurrencySingle
|
|
|
|
*/
|
|
|
|
|
|
|
|
type CurrenciesApiUpdateCurrencyOpts struct {
|
2024-05-11 14:43:57 +03:00
|
|
|
XTraceId optional.Interface
|
2024-04-10 12:14:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *CurrenciesApiService) UpdateCurrency(ctx context.Context, body CurrencyUpdate, code string, localVarOptionals *CurrenciesApiUpdateCurrencyOpts) (CurrencySingle, *http.Response, error) {
|
|
|
|
var (
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpMethod = strings.ToUpper("Put")
|
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
2024-04-10 12:14:55 +03:00
|
|
|
localVarReturnValue CurrencySingle
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/v1/currencies/{code}"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"code"+"}", fmt.Sprintf("%v", code), -1)
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2024-05-11 14:43:57 +03:00
|
|
|
localVarHttpContentTypes := []string{"application/vnd.api+json", "application/x-www-form-urlencoded"}
|
2024-04-10 12:14:55 +03:00
|
|
|
|
|
|
|
// 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(), "")
|
|
|
|
}
|
|
|
|
// body params
|
|
|
|
localVarPostBody = &body
|
|
|
|
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 == 200 {
|
|
|
|
var v CurrencySingle
|
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 == 422 {
|
|
|
|
var v ValidationErrorResponse
|
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 == 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
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHttpResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHttpResponse, nil
|
|
|
|
}
|