go-firefly3/api_insight.go

3499 lines
137 KiB
Go
Raw Normal View History

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 15:26:56 +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 15:26:56 +03:00
package firefly3
2024-04-10 12:14:55 +03:00
import (
"context"
2024-05-11 15:26:56 +03:00
"github.com/antihax/optional"
2024-04-10 12:14:55 +03:00
"io/ioutil"
"net/http"
"net/url"
"strings"
)
// Linger please
var (
_ context.Context
)
type InsightApiService service
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into expenses, grouped by asset account.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the expenses made by the user, grouped by asset account.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightExpenseAssetOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID's will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightGroupEntry
*/
type InsightApiInsightExpenseAssetOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightExpenseAsset(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightExpenseAssetOpts) ([]InsightGroupEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightGroupEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/expense/asset"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightGroupEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into expenses, grouped by bill.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the expenses made by the user, grouped by (any) bill.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightExpenseBillOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Bills" (optional.Interface of []int64) - The bills to be included in the results.
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightGroupEntry
*/
type InsightApiInsightExpenseBillOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Bills optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightExpenseBill(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightExpenseBillOpts) ([]InsightGroupEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightGroupEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/expense/bill"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Bills.IsSet() {
localVarQueryParams.Add("bills[]", parameterToString(localVarOptionals.Bills.Value(), "multi"))
}
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightGroupEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into expenses, grouped by budget.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the expenses made by the user, grouped by (any) budget.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightExpenseBudgetOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Budgets" (optional.Interface of []int64) - The budgets to be included in the results.
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightGroupEntry
*/
type InsightApiInsightExpenseBudgetOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Budgets optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightExpenseBudget(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightExpenseBudgetOpts) ([]InsightGroupEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightGroupEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/expense/budget"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Budgets.IsSet() {
localVarQueryParams.Add("budgets[]", parameterToString(localVarOptionals.Budgets.Value(), "multi"))
}
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightGroupEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into expenses, grouped by category.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the expenses made by the user, grouped by (any) category.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightExpenseCategoryOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Categories" (optional.Interface of []int64) - The categories to be included in the results.
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightGroupEntry
*/
type InsightApiInsightExpenseCategoryOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Categories optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightExpenseCategory(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightExpenseCategoryOpts) ([]InsightGroupEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightGroupEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/expense/category"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Categories.IsSet() {
localVarQueryParams.Add("categories[]", parameterToString(localVarOptionals.Categories.Value(), "multi"))
}
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightGroupEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into expenses, grouped by expense account.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the expenses made by the user, grouped by expense account.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightExpenseExpenseOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you add the accounts ID&#x27;s of expense accounts, only those accounts are included in the results. If you include ID&#x27;s of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. You can combine both asset / liability and expense account ID&#x27;s. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightGroupEntry
*/
type InsightApiInsightExpenseExpenseOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightExpenseExpense(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightExpenseExpenseOpts) ([]InsightGroupEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightGroupEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/expense/expense"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightGroupEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into expenses, without bill.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the expenses made by the user, including only expenses with no bill.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightExpenseNoBillOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightTotalEntry
*/
type InsightApiInsightExpenseNoBillOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightExpenseNoBill(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightExpenseNoBillOpts) ([]InsightTotalEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightTotalEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/expense/no-bill"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightTotalEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into expenses, without budget.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the expenses made by the user, including only expenses with no budget.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightExpenseNoBudgetOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightTotalEntry
*/
type InsightApiInsightExpenseNoBudgetOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightExpenseNoBudget(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightExpenseNoBudgetOpts) ([]InsightTotalEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightTotalEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/expense/no-budget"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightTotalEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into expenses, without category.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the expenses made by the user, including only expenses with no category.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightExpenseNoCategoryOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightTotalEntry
*/
type InsightApiInsightExpenseNoCategoryOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightExpenseNoCategory(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightExpenseNoCategoryOpts) ([]InsightTotalEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightTotalEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/expense/no-category"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightTotalEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into expenses, without tag.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the expenses made by the user, including only expenses with no tag.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightExpenseNoTagOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightTotalEntry
*/
type InsightApiInsightExpenseNoTagOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightExpenseNoTag(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightExpenseNoTagOpts) ([]InsightTotalEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightTotalEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/expense/no-tag"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightTotalEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into expenses, grouped by tag.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the expenses made by the user, grouped by (any) tag.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightExpenseTagOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Tags" (optional.Interface of []int64) - The tags to be included in the results.
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightGroupEntry
*/
type InsightApiInsightExpenseTagOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Tags optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightExpenseTag(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightExpenseTagOpts) ([]InsightGroupEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightGroupEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/expense/tag"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Tags.IsSet() {
localVarQueryParams.Add("tags[]", parameterToString(localVarOptionals.Tags.Value(), "multi"))
}
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightGroupEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into total expenses.
2024-05-11 15:26:56 +03:00
This endpoint gives a sum of the total expenses made by the user.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightExpenseTotalOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightTotalEntry
*/
type InsightApiInsightExpenseTotalOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightExpenseTotal(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightExpenseTotalOpts) ([]InsightTotalEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightTotalEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/expense/total"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightTotalEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into income, grouped by asset account.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the income received by the user, grouped by asset account.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightIncomeAssetOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only deposits to those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightGroupEntry
*/
type InsightApiInsightIncomeAssetOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightIncomeAsset(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightIncomeAssetOpts) ([]InsightGroupEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightGroupEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/income/asset"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightGroupEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into income, grouped by category.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the income received by the user, grouped by (any) category.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightIncomeCategoryOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Categories" (optional.Interface of []int64) - The categories to be included in the results.
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only deposits to those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightGroupEntry
*/
type InsightApiInsightIncomeCategoryOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Categories optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightIncomeCategory(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightIncomeCategoryOpts) ([]InsightGroupEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightGroupEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/income/category"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Categories.IsSet() {
localVarQueryParams.Add("categories[]", parameterToString(localVarOptionals.Categories.Value(), "multi"))
}
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightGroupEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into income, without category.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the income received by the user, including only income with no category.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightIncomeNoCategoryOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only deposits to those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightTotalEntry
*/
type InsightApiInsightIncomeNoCategoryOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightIncomeNoCategory(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightIncomeNoCategoryOpts) ([]InsightTotalEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightTotalEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/income/no-category"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightTotalEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into income, without tag.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the income received by the user, including only income with no tag.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightIncomeNoTagOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only deposits to those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightTotalEntry
*/
type InsightApiInsightIncomeNoTagOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightIncomeNoTag(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightIncomeNoTagOpts) ([]InsightTotalEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightTotalEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/income/no-tag"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightTotalEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into income, grouped by revenue account.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the income received by the user, grouped by revenue account.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightIncomeRevenueOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you add the accounts ID&#x27;s of revenue accounts, only those accounts are included in the results. If you include ID&#x27;s of asset accounts or liabilities, only deposits to those asset accounts / liabilities will be included. You can combine both asset / liability and deposit account ID&#x27;s. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightGroupEntry
*/
type InsightApiInsightIncomeRevenueOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightIncomeRevenue(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightIncomeRevenueOpts) ([]InsightGroupEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightGroupEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/income/revenue"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightGroupEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into income, grouped by tag.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the income received by the user, grouped by (any) tag.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightIncomeTagOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Tags" (optional.Interface of []int64) - The tags to be included in the results.
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only deposits to those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightGroupEntry
*/
type InsightApiInsightIncomeTagOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Tags optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightIncomeTag(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightIncomeTagOpts) ([]InsightGroupEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightGroupEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/income/tag"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Tags.IsSet() {
localVarQueryParams.Add("tags[]", parameterToString(localVarOptionals.Tags.Value(), "multi"))
}
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightGroupEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into total income.
2024-05-11 15:26:56 +03:00
This endpoint gives a sum of the total income received by the user.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightIncomeTotalOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only deposits to those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightTotalEntry
*/
type InsightApiInsightIncomeTotalOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightIncomeTotal(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightIncomeTotalOpts) ([]InsightTotalEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightTotalEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/income/total"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightTotalEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into transfers, grouped by category.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the transfers made by the user, grouped by (any) category.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightTransferCategoryOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Categories" (optional.Interface of []int64) - The categories to be included in the results.
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only transfers between those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightGroupEntry
*/
type InsightApiInsightTransferCategoryOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Categories optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightTransferCategory(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightTransferCategoryOpts) ([]InsightGroupEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightGroupEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/transfer/category"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Categories.IsSet() {
localVarQueryParams.Add("categories[]", parameterToString(localVarOptionals.Categories.Value(), "multi"))
}
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightGroupEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into transfers, without category.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the transfers made by the user, including only transfers with no category.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightTransferNoCategoryOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only transfers between those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightTotalEntry
*/
type InsightApiInsightTransferNoCategoryOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightTransferNoCategory(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightTransferNoCategoryOpts) ([]InsightTotalEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightTotalEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/transfer/no-category"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightTotalEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into expenses, without tag.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the transfers made by the user, including only transfers with no tag.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightTransferNoTagOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only transfers from those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightTotalEntry
*/
type InsightApiInsightTransferNoTagOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightTransferNoTag(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightTransferNoTagOpts) ([]InsightTotalEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightTotalEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/transfer/no-tag"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightTotalEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into transfers, grouped by tag.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the transfers created by the user, grouped by (any) tag.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightTransferTagOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Tags" (optional.Interface of []int64) - The tags to be included in the results.
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only transfers between those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightGroupEntry
*/
type InsightApiInsightTransferTagOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Tags optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightTransferTag(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightTransferTagOpts) ([]InsightGroupEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightGroupEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/transfer/tag"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Tags.IsSet() {
localVarQueryParams.Add("tags[]", parameterToString(localVarOptionals.Tags.Value(), "multi"))
}
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightGroupEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into total transfers.
2024-05-11 15:26:56 +03:00
This endpoint gives a sum of the total amount transfers made by the user.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightTransferTotalOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only transfers between those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightTotalEntry
*/
type InsightApiInsightTransferTotalOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightTransferTotal(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightTransferTotalOpts) ([]InsightTotalEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightTotalEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/transfer/total"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightTotalEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
2024-05-11 15:26:56 +03:00
2024-04-10 12:14:55 +03:00
/*
InsightApiService Insight into transfers, grouped by account.
2024-05-11 15:26:56 +03:00
This endpoint gives a summary of the transfers made by the user, grouped by asset account or lability.
2024-04-10 12:14:55 +03:00
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2024-05-11 15:26:56 +03:00
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
2024-04-10 12:14:55 +03:00
* @param optional nil or *InsightApiInsightTransfersOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
2024-05-11 15:26:56 +03:00
* @param "Accounts" (optional.Interface of []int64) - The accounts to be included in the results. If you include ID&#x27;s of asset accounts or liabilities, only transfers between those asset accounts / liabilities will be included. Other account ID&#x27;s will be ignored.
2024-04-10 12:14:55 +03:00
@return []InsightTransferEntry
*/
type InsightApiInsightTransfersOpts struct {
2024-05-11 15:26:56 +03:00
XTraceId optional.Interface
Accounts optional.Interface
2024-04-10 12:14:55 +03:00
}
func (a *InsightApiService) InsightTransfers(ctx context.Context, start string, end string, localVarOptionals *InsightApiInsightTransfersOpts) ([]InsightTransferEntry, *http.Response, error) {
var (
2024-05-11 15:26:56 +03:00
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
2024-04-10 12:14:55 +03:00
localVarReturnValue []InsightTransferEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/insight/transfer/asset"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.Accounts.IsSet() {
localVarQueryParams.Add("accounts[]", parameterToString(localVarOptionals.Accounts.Value(), "multi"))
}
// 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 15:26:56 +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 15:26:56 +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 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
if localVarHttpResponse.StatusCode == 200 {
var v []InsightTransferEntry
2024-05-11 15:26:56 +03:00
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
2024-04-10 12:14:55 +03:00
return localVarReturnValue, localVarHttpResponse, newErr
2024-05-11 15:26:56 +03:00
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
2024-04-10 12:14:55 +03:00
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}