/* * Firefly III API v2.0.12 * * 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-03-16T05:34:43+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. * * API version: 2.0.12 * Contact: james@firefly-iii.org * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package firefly3 import ( "context" "github.com/antihax/optional" "io/ioutil" "net/http" "net/url" "strings" ) // Linger please var ( _ context.Context ) type AutocompleteApiService service /* AutocompleteApiService Returns all accounts of the user returned in a basic auto-complete array. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetAccountsACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. * @param "Date" (optional.String) - If the account is an asset account or a liability, the autocomplete will also return the balance of the account on this date. * @param "Types" (optional.Interface of []AccountTypeFilter) - Optional filter on the account type(s) used in the autocomplete. @return []AutocompleteAccount */ type AutocompleteApiGetAccountsACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 Date optional.String Types optional.Interface } func (a *AutocompleteApiService) GetAccountsAC(ctx context.Context, localVarOptionals *AutocompleteApiGetAccountsACOpts) ([]AutocompleteAccount, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompleteAccount ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/accounts" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Date.IsSet() { localVarQueryParams.Add("date", parameterToString(localVarOptionals.Date.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Types.IsSet() { localVarQueryParams.Add("types", parameterToString(localVarOptionals.Types.Value(), "csv")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompleteAccount err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all bills of the user returned in a basic auto-complete array. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetBillsACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompleteBill */ type AutocompleteApiGetBillsACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetBillsAC(ctx context.Context, localVarOptionals *AutocompleteApiGetBillsACOpts) ([]AutocompleteBill, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompleteBill ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/bills" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompleteBill err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all budgets of the user returned in a basic auto-complete array. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetBudgetsACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompleteBudget */ type AutocompleteApiGetBudgetsACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetBudgetsAC(ctx context.Context, localVarOptionals *AutocompleteApiGetBudgetsACOpts) ([]AutocompleteBudget, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompleteBudget ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/budgets" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompleteBudget err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all categories of the user returned in a basic auto-complete array. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetCategoriesACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompleteCategory */ type AutocompleteApiGetCategoriesACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetCategoriesAC(ctx context.Context, localVarOptionals *AutocompleteApiGetCategoriesACOpts) ([]AutocompleteCategory, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompleteCategory ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/categories" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompleteCategory err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all currencies of the user returned in a basic auto-complete array. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetCurrenciesACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompleteCurrency */ type AutocompleteApiGetCurrenciesACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetCurrenciesAC(ctx context.Context, localVarOptionals *AutocompleteApiGetCurrenciesACOpts) ([]AutocompleteCurrency, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompleteCurrency ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/currencies" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompleteCurrency err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all currencies of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetCurrenciesCodeACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompleteCurrencyCode */ type AutocompleteApiGetCurrenciesCodeACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetCurrenciesCodeAC(ctx context.Context, localVarOptionals *AutocompleteApiGetCurrenciesCodeACOpts) ([]AutocompleteCurrencyCode, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompleteCurrencyCode ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/currencies-with-code" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompleteCurrencyCode err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all object groups of the user returned in a basic auto-complete array. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetObjectGroupsACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompleteObjectGroup */ type AutocompleteApiGetObjectGroupsACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetObjectGroupsAC(ctx context.Context, localVarOptionals *AutocompleteApiGetObjectGroupsACOpts) ([]AutocompleteObjectGroup, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompleteObjectGroup ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/object-groups" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompleteObjectGroup err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all piggy banks of the user returned in a basic auto-complete array. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetPiggiesACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompletePiggy */ type AutocompleteApiGetPiggiesACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetPiggiesAC(ctx context.Context, localVarOptionals *AutocompleteApiGetPiggiesACOpts) ([]AutocompletePiggy, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompletePiggy ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/piggy-banks" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompletePiggy err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all piggy banks of the user returned in a basic auto-complete array complemented with balance information. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetPiggiesBalanceACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompletePiggyBalance */ type AutocompleteApiGetPiggiesBalanceACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetPiggiesBalanceAC(ctx context.Context, localVarOptionals *AutocompleteApiGetPiggiesBalanceACOpts) ([]AutocompletePiggyBalance, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompletePiggyBalance ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/piggy-banks-with-balance" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompletePiggyBalance err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all recurring transactions of the user returned in a basic auto-complete array. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetRecurringACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompleteRecurrence */ type AutocompleteApiGetRecurringACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetRecurringAC(ctx context.Context, localVarOptionals *AutocompleteApiGetRecurringACOpts) ([]AutocompleteRecurrence, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompleteRecurrence ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/recurring" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompleteRecurrence err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all rule groups of the user returned in a basic auto-complete array. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetRuleGroupsACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompleteRuleGroup */ type AutocompleteApiGetRuleGroupsACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetRuleGroupsAC(ctx context.Context, localVarOptionals *AutocompleteApiGetRuleGroupsACOpts) ([]AutocompleteRuleGroup, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompleteRuleGroup ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/rule-groups" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompleteRuleGroup err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all rules of the user returned in a basic auto-complete array. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetRulesACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompleteRule */ type AutocompleteApiGetRulesACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetRulesAC(ctx context.Context, localVarOptionals *AutocompleteApiGetRulesACOpts) ([]AutocompleteRule, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompleteRule ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/rules" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompleteRule err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all tags of the user returned in a basic auto-complete array. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetTagACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompleteTag */ type AutocompleteApiGetTagACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetTagAC(ctx context.Context, localVarOptionals *AutocompleteApiGetTagACOpts) ([]AutocompleteTag, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompleteTag ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/tags" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompleteTag err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all transaction types returned in a basic auto-complete array. English only. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetTransactionTypesACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompleteTransactionType */ type AutocompleteApiGetTransactionTypesACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetTransactionTypesAC(ctx context.Context, localVarOptionals *AutocompleteApiGetTransactionTypesACOpts) ([]AutocompleteTransactionType, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompleteTransactionType ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/transaction-types" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompleteTransactionType err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all transaction descriptions of the user returned in a basic auto-complete array. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetTransactionsACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompleteTransaction */ type AutocompleteApiGetTransactionsACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetTransactionsAC(ctx context.Context, localVarOptionals *AutocompleteApiGetTransactionsACOpts) ([]AutocompleteTransaction, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompleteTransaction ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/transactions" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompleteTransaction err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* AutocompleteApiService Returns all transactions, complemented with their ID, of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *AutocompleteApiGetTransactionsIDACOpts - Optional Parameters: * @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request. * @param "Query" (optional.String) - The autocomplete search query. * @param "Limit" (optional.Int32) - The number of items returned. @return []AutocompleteTransactionId */ type AutocompleteApiGetTransactionsIDACOpts struct { XTraceId optional.Interface Query optional.String Limit optional.Int32 } func (a *AutocompleteApiService) GetTransactionsIDAC(ctx context.Context, localVarOptionals *AutocompleteApiGetTransactionsIDACOpts) ([]AutocompleteTransactionId, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue []AutocompleteTransactionId ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/autocomplete/transactions-with-id" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.Query.IsSet() { localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() { localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "") } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 401 { var v UnauthenticatedResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v NotFoundResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 400 { var v BadRequestResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 500 { var v InternalExceptionResponse err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 200 { var v []AutocompleteTransactionId err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil }