Bump version
This commit is contained in:
parent
250d72604e
commit
04e92891e3
638
api_accounts.go
638
api_accounts.go
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* Firefly III API v2.0.14
|
||||
*
|
||||
@ -12,12 +11,13 @@ package swagger
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/antihax/optional"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
"fmt"
|
||||
"github.com/antihax/optional"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
@ -26,6 +26,7 @@ var (
|
||||
)
|
||||
|
||||
type AttachmentsApiService service
|
||||
|
||||
/*
|
||||
AttachmentsApiService Delete an attachment.
|
||||
With this endpoint you delete an attachment, including any stored file data.
|
||||
@ -37,7 +38,7 @@ With this endpoint you delete an attachment, including any stored file data.
|
||||
*/
|
||||
|
||||
type AttachmentsApiDeleteAttachmentOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *AttachmentsApiService) DeleteAttachment(ctx context.Context, id string, localVarOptionals *AttachmentsApiDeleteAttachmentOpts) (*http.Response, error) {
|
||||
@ -46,7 +47,6 @@ func (a *AttachmentsApiService) DeleteAttachment(ctx context.Context, id string,
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@ -93,57 +93,57 @@ func (a *AttachmentsApiService) DeleteAttachment(ctx context.Context, id string,
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return 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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return 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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return 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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
AttachmentsApiService Download a single attachment.
|
||||
This endpoint allows you to download the binary content of a transaction. It will be sent to you as a download, using the content type \"application/octet-stream\" and content disposition \"attachment; filename=example.pdf\".
|
||||
@ -155,15 +155,15 @@ This endpoint allows you to download the binary content of a transaction. It wil
|
||||
*/
|
||||
|
||||
type AttachmentsApiDownloadAttachmentOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *AttachmentsApiService) DownloadAttachment(ctx context.Context, id string, localVarOptionals *AttachmentsApiDownloadAttachmentOpts) (*os.File, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue *os.File
|
||||
)
|
||||
|
||||
@ -213,7 +213,7 @@ func (a *AttachmentsApiService) DownloadAttachment(ctx context.Context, id strin
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -221,64 +221,65 @@ func (a *AttachmentsApiService) DownloadAttachment(ctx context.Context, id strin
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v *os.File
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
AttachmentsApiService Get a single attachment.
|
||||
Get a single attachment. This endpoint only returns the available metadata for the attachment. Actual file data is handled in two other endpoints (see below).
|
||||
@ -290,15 +291,15 @@ Get a single attachment. This endpoint only returns the available metadata for t
|
||||
*/
|
||||
|
||||
type AttachmentsApiGetAttachmentOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *AttachmentsApiService) GetAttachment(ctx context.Context, id string, localVarOptionals *AttachmentsApiGetAttachmentOpts) (AttachmentSingle, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue AttachmentSingle
|
||||
)
|
||||
|
||||
@ -348,7 +349,7 @@ func (a *AttachmentsApiService) GetAttachment(ctx context.Context, id string, lo
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -356,64 +357,65 @@ func (a *AttachmentsApiService) GetAttachment(ctx context.Context, id string, lo
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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 AttachmentSingle
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
AttachmentsApiService List all attachments.
|
||||
This endpoint lists all attachments.
|
||||
@ -426,17 +428,17 @@ This endpoint lists all attachments.
|
||||
*/
|
||||
|
||||
type AttachmentsApiListAttachmentOpts struct {
|
||||
XTraceId optional.Interface
|
||||
Limit optional.Int32
|
||||
Page optional.Int32
|
||||
XTraceId optional.Interface
|
||||
Limit optional.Int32
|
||||
Page optional.Int32
|
||||
}
|
||||
|
||||
func (a *AttachmentsApiService) ListAttachment(ctx context.Context, localVarOptionals *AttachmentsApiListAttachmentOpts) (AttachmentArray, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue AttachmentArray
|
||||
)
|
||||
|
||||
@ -491,7 +493,7 @@ func (a *AttachmentsApiService) ListAttachment(ctx context.Context, localVarOpti
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -499,64 +501,65 @@ func (a *AttachmentsApiService) ListAttachment(ctx context.Context, localVarOpti
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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 AttachmentArray
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
AttachmentsApiService Store a new attachment.
|
||||
Creates a new attachment. The data required can be submitted as a JSON body or as a list of parameters. You cannot use this endpoint to upload the actual file data (see below). This endpoint only creates the attachment object.
|
||||
@ -568,15 +571,15 @@ Creates a new attachment. The data required can be submitted as a JSON body or a
|
||||
*/
|
||||
|
||||
type AttachmentsApiStoreAttachmentOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *AttachmentsApiService) StoreAttachment(ctx context.Context, body AttachmentStore, localVarOptionals *AttachmentsApiStoreAttachmentOpts) (AttachmentSingle, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue AttachmentSingle
|
||||
)
|
||||
|
||||
@ -627,7 +630,7 @@ func (a *AttachmentsApiService) StoreAttachment(ctx context.Context, body Attach
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -635,74 +638,75 @@ func (a *AttachmentsApiService) StoreAttachment(ctx context.Context, body Attach
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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 AttachmentSingle
|
||||
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
|
||||
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 == 422 {
|
||||
var v ValidationErrorResponse
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
AttachmentsApiService Update existing attachment.
|
||||
Update the meta data for an existing attachment. This endpoint does not allow you to upload or download data. For that, see below.
|
||||
@ -715,15 +719,15 @@ Update the meta data for an existing attachment. This endpoint does not allow yo
|
||||
*/
|
||||
|
||||
type AttachmentsApiUpdateAttachmentOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *AttachmentsApiService) UpdateAttachment(ctx context.Context, body AttachmentUpdate, id string, localVarOptionals *AttachmentsApiUpdateAttachmentOpts) (AttachmentSingle, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue AttachmentSingle
|
||||
)
|
||||
|
||||
@ -775,7 +779,7 @@ func (a *AttachmentsApiService) UpdateAttachment(ctx context.Context, body Attac
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -783,74 +787,75 @@ func (a *AttachmentsApiService) UpdateAttachment(ctx context.Context, body Attac
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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 AttachmentSingle
|
||||
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
|
||||
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 == 422 {
|
||||
var v ValidationErrorResponse
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
AttachmentsApiService Upload an attachment.
|
||||
Use this endpoint to upload (and possible overwrite) the file contents of an attachment. Simply put the entire file in the body as binary data.
|
||||
@ -863,8 +868,8 @@ Use this endpoint to upload (and possible overwrite) the file contents of an att
|
||||
*/
|
||||
|
||||
type AttachmentsApiUploadAttachmentOpts struct {
|
||||
Body optional.Interface
|
||||
XTraceId optional.Interface
|
||||
Body optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *AttachmentsApiService) UploadAttachment(ctx context.Context, id string, localVarOptionals *AttachmentsApiUploadAttachmentOpts) (*http.Response, error) {
|
||||
@ -873,7 +878,6 @@ func (a *AttachmentsApiService) UploadAttachment(ctx context.Context, id string,
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@ -907,7 +911,7 @@ func (a *AttachmentsApiService) UploadAttachment(ctx context.Context, id string,
|
||||
// body params
|
||||
if localVarOptionals != nil && localVarOptionals.Body.IsSet() {
|
||||
|
||||
localVarOptionalBody:= localVarOptionals.Body.Value()
|
||||
localVarOptionalBody := localVarOptionals.Body.Value()
|
||||
localVarPostBody = &localVarOptionalBody
|
||||
}
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
@ -926,61 +930,60 @@ func (a *AttachmentsApiService) UploadAttachment(ctx context.Context, id string,
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return 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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return 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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return 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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 422 {
|
||||
var v ValidationErrorResponse
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
632
api_bills.go
632
api_bills.go
File diff suppressed because it is too large
Load Diff
1100
api_budgets.go
1100
api_budgets.go
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* Firefly III API v2.0.14
|
||||
*
|
||||
@ -12,13 +11,12 @@ package swagger
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/antihax/optional"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"fmt"
|
||||
"github.com/antihax/optional"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
@ -27,6 +25,7 @@ var (
|
||||
)
|
||||
|
||||
type CategoriesApiService service
|
||||
|
||||
/*
|
||||
CategoriesApiService Delete a category.
|
||||
Delete a category. Transactions will not be removed.
|
||||
@ -38,7 +37,7 @@ Delete a category. Transactions will not be removed.
|
||||
*/
|
||||
|
||||
type CategoriesApiDeleteCategoryOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *CategoriesApiService) DeleteCategory(ctx context.Context, id string, localVarOptionals *CategoriesApiDeleteCategoryOpts) (*http.Response, error) {
|
||||
@ -47,7 +46,6 @@ func (a *CategoriesApiService) DeleteCategory(ctx context.Context, id string, lo
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@ -94,57 +92,57 @@ func (a *CategoriesApiService) DeleteCategory(ctx context.Context, id string, lo
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return 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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return 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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return 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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
CategoriesApiService Get a single category.
|
||||
Get a single category.
|
||||
@ -158,17 +156,17 @@ Get a single category.
|
||||
*/
|
||||
|
||||
type CategoriesApiGetCategoryOpts struct {
|
||||
XTraceId optional.Interface
|
||||
Start optional.String
|
||||
End optional.String
|
||||
XTraceId optional.Interface
|
||||
Start optional.String
|
||||
End optional.String
|
||||
}
|
||||
|
||||
func (a *CategoriesApiService) GetCategory(ctx context.Context, id string, localVarOptionals *CategoriesApiGetCategoryOpts) (CategorySingle, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue CategorySingle
|
||||
)
|
||||
|
||||
@ -224,7 +222,7 @@ func (a *CategoriesApiService) GetCategory(ctx context.Context, id string, local
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -232,64 +230,65 @@ func (a *CategoriesApiService) GetCategory(ctx context.Context, id string, local
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v CategorySingle
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
CategoriesApiService Lists all attachments.
|
||||
Lists all attachments.
|
||||
@ -303,17 +302,17 @@ Lists all attachments.
|
||||
*/
|
||||
|
||||
type CategoriesApiListAttachmentByCategoryOpts struct {
|
||||
XTraceId optional.Interface
|
||||
Limit optional.Int32
|
||||
Page optional.Int32
|
||||
XTraceId optional.Interface
|
||||
Limit optional.Int32
|
||||
Page optional.Int32
|
||||
}
|
||||
|
||||
func (a *CategoriesApiService) ListAttachmentByCategory(ctx context.Context, id string, localVarOptionals *CategoriesApiListAttachmentByCategoryOpts) (AttachmentArray, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue AttachmentArray
|
||||
)
|
||||
|
||||
@ -369,7 +368,7 @@ func (a *CategoriesApiService) ListAttachmentByCategory(ctx context.Context, id
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -377,64 +376,65 @@ func (a *CategoriesApiService) ListAttachmentByCategory(ctx context.Context, id
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v AttachmentArray
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
CategoriesApiService List all categories.
|
||||
List all categories.
|
||||
@ -447,17 +447,17 @@ List all categories.
|
||||
*/
|
||||
|
||||
type CategoriesApiListCategoryOpts struct {
|
||||
XTraceId optional.Interface
|
||||
Limit optional.Int32
|
||||
Page optional.Int32
|
||||
XTraceId optional.Interface
|
||||
Limit optional.Int32
|
||||
Page optional.Int32
|
||||
}
|
||||
|
||||
func (a *CategoriesApiService) ListCategory(ctx context.Context, localVarOptionals *CategoriesApiListCategoryOpts) (CategoryArray, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue CategoryArray
|
||||
)
|
||||
|
||||
@ -512,7 +512,7 @@ func (a *CategoriesApiService) ListCategory(ctx context.Context, localVarOptiona
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -520,64 +520,65 @@ func (a *CategoriesApiService) ListCategory(ctx context.Context, localVarOptiona
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v CategoryArray
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
CategoriesApiService List all transactions in a category.
|
||||
List all transactions in a category, optionally limited to the date ranges specified.
|
||||
@ -594,20 +595,20 @@ List all transactions in a category, optionally limited to the date ranges speci
|
||||
*/
|
||||
|
||||
type CategoriesApiListTransactionByCategoryOpts struct {
|
||||
XTraceId optional.Interface
|
||||
Limit optional.Int32
|
||||
Page optional.Int32
|
||||
Start optional.String
|
||||
End optional.String
|
||||
Type_ optional.Interface
|
||||
XTraceId optional.Interface
|
||||
Limit optional.Int32
|
||||
Page optional.Int32
|
||||
Start optional.String
|
||||
End optional.String
|
||||
Type_ optional.Interface
|
||||
}
|
||||
|
||||
func (a *CategoriesApiService) ListTransactionByCategory(ctx context.Context, id string, localVarOptionals *CategoriesApiListTransactionByCategoryOpts) (TransactionArray, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue TransactionArray
|
||||
)
|
||||
|
||||
@ -672,7 +673,7 @@ func (a *CategoriesApiService) ListTransactionByCategory(ctx context.Context, id
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -680,64 +681,65 @@ func (a *CategoriesApiService) ListTransactionByCategory(ctx context.Context, id
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v TransactionArray
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
CategoriesApiService Store a new category
|
||||
Creates a new category. The data required can be submitted as a JSON body or as a list of parameters.
|
||||
@ -749,15 +751,15 @@ Creates a new category. The data required can be submitted as a JSON body or as
|
||||
*/
|
||||
|
||||
type CategoriesApiStoreCategoryOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *CategoriesApiService) StoreCategory(ctx context.Context, body Category, localVarOptionals *CategoriesApiStoreCategoryOpts) (CategorySingle, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue CategorySingle
|
||||
)
|
||||
|
||||
@ -808,7 +810,7 @@ func (a *CategoriesApiService) StoreCategory(ctx context.Context, body Category,
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -816,74 +818,75 @@ func (a *CategoriesApiService) StoreCategory(ctx context.Context, body Category,
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v CategorySingle
|
||||
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
|
||||
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 == 422 {
|
||||
var v ValidationErrorResponse
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
CategoriesApiService Update existing category.
|
||||
Update existing category.
|
||||
@ -896,15 +899,15 @@ Update existing category.
|
||||
*/
|
||||
|
||||
type CategoriesApiUpdateCategoryOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *CategoriesApiService) UpdateCategory(ctx context.Context, body CategoryUpdate, id string, localVarOptionals *CategoriesApiUpdateCategoryOpts) (CategorySingle, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue CategorySingle
|
||||
)
|
||||
|
||||
@ -956,7 +959,7 @@ func (a *CategoriesApiService) UpdateCategory(ctx context.Context, body Category
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -964,68 +967,68 @@ func (a *CategoriesApiService) UpdateCategory(ctx context.Context, body Category
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v CategorySingle
|
||||
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
|
||||
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 == 422 {
|
||||
var v ValidationErrorResponse
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* Firefly III API v2.0.14
|
||||
*
|
||||
@ -12,12 +11,12 @@ package swagger
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/antihax/optional"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"fmt"
|
||||
"github.com/antihax/optional"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
@ -26,6 +25,7 @@ var (
|
||||
)
|
||||
|
||||
type ConfigurationApiService service
|
||||
|
||||
/*
|
||||
ConfigurationApiService Get Firefly III system configuration values.
|
||||
Returns all editable and not-editable configuration values for this Firefly III installation
|
||||
@ -36,15 +36,15 @@ Returns all editable and not-editable configuration values for this Firefly III
|
||||
*/
|
||||
|
||||
type ConfigurationApiGetConfigurationOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *ConfigurationApiService) GetConfiguration(ctx context.Context, localVarOptionals *ConfigurationApiGetConfigurationOpts) ([]Configuration, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue []Configuration
|
||||
)
|
||||
|
||||
@ -93,7 +93,7 @@ func (a *ConfigurationApiService) GetConfiguration(ctx context.Context, localVar
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -101,64 +101,65 @@ func (a *ConfigurationApiService) GetConfiguration(ctx context.Context, localVar
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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 []Configuration
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
ConfigurationApiService Get a single Firefly III system configuration value
|
||||
Returns one configuration variable for this Firefly III installation
|
||||
@ -170,15 +171,15 @@ Returns one configuration variable for this Firefly III installation
|
||||
*/
|
||||
|
||||
type ConfigurationApiGetSingleConfigurationOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *ConfigurationApiService) GetSingleConfiguration(ctx context.Context, name ConfigValueFilter, localVarOptionals *ConfigurationApiGetSingleConfigurationOpts) (ConfigurationSingle, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue ConfigurationSingle
|
||||
)
|
||||
|
||||
@ -228,7 +229,7 @@ func (a *ConfigurationApiService) GetSingleConfiguration(ctx context.Context, na
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -236,64 +237,65 @@ func (a *ConfigurationApiService) GetSingleConfiguration(ctx context.Context, na
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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 ConfigurationSingle
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
ConfigurationApiService Update configuration value
|
||||
Set a single configuration value. Not all configuration values can be updated so the list of accepted configuration variables is small.
|
||||
@ -306,15 +308,15 @@ Set a single configuration value. Not all configuration values can be updated so
|
||||
*/
|
||||
|
||||
type ConfigurationApiSetConfigurationOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *ConfigurationApiService) SetConfiguration(ctx context.Context, value PolymorphicProperty, name ConfigValueUpdateFilter, localVarOptionals *ConfigurationApiSetConfigurationOpts) (ConfigurationSingle, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue ConfigurationSingle
|
||||
)
|
||||
|
||||
@ -347,7 +349,6 @@ func (a *ConfigurationApiService) SetConfiguration(ctx context.Context, value Po
|
||||
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &body
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
@ -366,7 +367,7 @@ func (a *ConfigurationApiService) SetConfiguration(ctx context.Context, value Po
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -374,68 +375,68 @@ func (a *ConfigurationApiService) SetConfiguration(ctx context.Context, value Po
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v ConfigurationSingle
|
||||
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
|
||||
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 == 422 {
|
||||
var v ValidationErrorResponse
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
855
api_data.go
855
api_data.go
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* Firefly III API v2.0.14
|
||||
*
|
||||
@ -12,13 +11,12 @@ package swagger
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/antihax/optional"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"fmt"
|
||||
"github.com/antihax/optional"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
@ -27,6 +25,7 @@ var (
|
||||
)
|
||||
|
||||
type PreferencesApiService service
|
||||
|
||||
/*
|
||||
PreferencesApiService Return a single preference.
|
||||
Return a single preference and the value.
|
||||
@ -38,15 +37,15 @@ Return a single preference and the value.
|
||||
*/
|
||||
|
||||
type PreferencesApiGetPreferenceOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *PreferencesApiService) GetPreference(ctx context.Context, name string, localVarOptionals *PreferencesApiGetPreferenceOpts) (PreferenceSingle, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue PreferenceSingle
|
||||
)
|
||||
|
||||
@ -96,7 +95,7 @@ func (a *PreferencesApiService) GetPreference(ctx context.Context, name string,
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -104,64 +103,65 @@ func (a *PreferencesApiService) GetPreference(ctx context.Context, name string,
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v PreferenceSingle
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
PreferencesApiService List all users preferences.
|
||||
List all of the preferences of the user.
|
||||
@ -174,17 +174,17 @@ List all of the preferences of the user.
|
||||
*/
|
||||
|
||||
type PreferencesApiListPreferenceOpts struct {
|
||||
XTraceId optional.Interface
|
||||
Limit optional.Int32
|
||||
Page optional.Int32
|
||||
XTraceId optional.Interface
|
||||
Limit optional.Int32
|
||||
Page optional.Int32
|
||||
}
|
||||
|
||||
func (a *PreferencesApiService) ListPreference(ctx context.Context, localVarOptionals *PreferencesApiListPreferenceOpts) (PreferenceArray, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue PreferenceArray
|
||||
)
|
||||
|
||||
@ -239,7 +239,7 @@ func (a *PreferencesApiService) ListPreference(ctx context.Context, localVarOpti
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -247,64 +247,65 @@ func (a *PreferencesApiService) ListPreference(ctx context.Context, localVarOpti
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v PreferenceArray
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
PreferencesApiService Store a new preference for this user.
|
||||
This endpoint creates a new preference. The name and data are free-format, and entirely up to you. If the preference is not used in Firefly III itself it may not be configurable through the user interface, but you can use this endpoint to persist custom data for your own app.
|
||||
@ -316,15 +317,15 @@ This endpoint creates a new preference. The name and data are free-format, and e
|
||||
*/
|
||||
|
||||
type PreferencesApiStorePreferenceOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *PreferencesApiService) StorePreference(ctx context.Context, body Preference, localVarOptionals *PreferencesApiStorePreferenceOpts) (PreferenceSingle, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue PreferenceSingle
|
||||
)
|
||||
|
||||
@ -375,7 +376,7 @@ func (a *PreferencesApiService) StorePreference(ctx context.Context, body Prefer
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -383,74 +384,75 @@ func (a *PreferencesApiService) StorePreference(ctx context.Context, body Prefer
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v PreferenceSingle
|
||||
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
|
||||
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 == 422 {
|
||||
var v ValidationErrorResponse
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
PreferencesApiService Update preference
|
||||
Update a user's preference.
|
||||
@ -463,15 +465,15 @@ Update a user's preference.
|
||||
*/
|
||||
|
||||
type PreferencesApiUpdatePreferenceOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *PreferencesApiService) UpdatePreference(ctx context.Context, body PreferenceUpdate, name string, localVarOptionals *PreferencesApiUpdatePreferenceOpts) (PreferenceSingle, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue PreferenceSingle
|
||||
)
|
||||
|
||||
@ -523,7 +525,7 @@ func (a *PreferencesApiService) UpdatePreference(ctx context.Context, body Prefe
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -531,68 +533,68 @@ func (a *PreferencesApiService) UpdatePreference(ctx context.Context, body Prefe
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v PreferenceSingle
|
||||
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
|
||||
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 == 422 {
|
||||
var v ValidationErrorResponse
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
389
api_users.go
389
api_users.go
@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* Firefly III API v2.0.14
|
||||
*
|
||||
@ -12,13 +11,12 @@ package swagger
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/antihax/optional"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"fmt"
|
||||
"github.com/antihax/optional"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
@ -27,6 +25,7 @@ var (
|
||||
)
|
||||
|
||||
type UsersApiService service
|
||||
|
||||
/*
|
||||
UsersApiService Delete a user.
|
||||
Delete a user. You cannot delete the user you're authenticated with. This cannot be undone. Be careful!
|
||||
@ -38,7 +37,7 @@ Delete a user. You cannot delete the user you're authenticated with. This c
|
||||
*/
|
||||
|
||||
type UsersApiDeleteUserOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *UsersApiService) DeleteUser(ctx context.Context, id string, localVarOptionals *UsersApiDeleteUserOpts) (*http.Response, error) {
|
||||
@ -47,7 +46,6 @@ func (a *UsersApiService) DeleteUser(ctx context.Context, id string, localVarOpt
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@ -94,57 +92,57 @@ func (a *UsersApiService) DeleteUser(ctx context.Context, id string, localVarOpt
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return 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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return 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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return 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 localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
UsersApiService Get a single user.
|
||||
Gets all info of a single user.
|
||||
@ -156,15 +154,15 @@ Gets all info of a single user.
|
||||
*/
|
||||
|
||||
type UsersApiGetUserOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *UsersApiService) GetUser(ctx context.Context, id string, localVarOptionals *UsersApiGetUserOpts) (UserSingle, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue UserSingle
|
||||
)
|
||||
|
||||
@ -214,7 +212,7 @@ func (a *UsersApiService) GetUser(ctx context.Context, id string, localVarOption
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -222,64 +220,65 @@ func (a *UsersApiService) GetUser(ctx context.Context, id string, localVarOption
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v UserSingle
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
UsersApiService List all users.
|
||||
List all the users in this instance of Firefly III.
|
||||
@ -292,17 +291,17 @@ List all the users in this instance of Firefly III.
|
||||
*/
|
||||
|
||||
type UsersApiListUserOpts struct {
|
||||
XTraceId optional.Interface
|
||||
Limit optional.Int32
|
||||
Page optional.Int32
|
||||
XTraceId optional.Interface
|
||||
Limit optional.Int32
|
||||
Page optional.Int32
|
||||
}
|
||||
|
||||
func (a *UsersApiService) ListUser(ctx context.Context, localVarOptionals *UsersApiListUserOpts) (UserArray, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue UserArray
|
||||
)
|
||||
|
||||
@ -357,7 +356,7 @@ func (a *UsersApiService) ListUser(ctx context.Context, localVarOptionals *Users
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -365,64 +364,65 @@ func (a *UsersApiService) ListUser(ctx context.Context, localVarOptionals *Users
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v UserArray
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
UsersApiService Store a new user
|
||||
Creates a new user. The data required can be submitted as a JSON body or as a list of parameters. The user will be given a random password, which they can reset using the \"forgot password\" function.
|
||||
@ -434,15 +434,15 @@ Creates a new user. The data required can be submitted as a JSON body or as a li
|
||||
*/
|
||||
|
||||
type UsersApiStoreUserOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *UsersApiService) StoreUser(ctx context.Context, body User, localVarOptionals *UsersApiStoreUserOpts) (UserSingle, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue UserSingle
|
||||
)
|
||||
|
||||
@ -493,7 +493,7 @@ func (a *UsersApiService) StoreUser(ctx context.Context, body User, localVarOpti
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -501,74 +501,75 @@ func (a *UsersApiService) StoreUser(ctx context.Context, body User, localVarOpti
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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 UserSingle
|
||||
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
|
||||
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 == 422 {
|
||||
var v ValidationErrorResponse
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
UsersApiService Update an existing user's information.
|
||||
Update existing user.
|
||||
@ -581,15 +582,15 @@ Update existing user.
|
||||
*/
|
||||
|
||||
type UsersApiUpdateUserOpts struct {
|
||||
XTraceId optional.Interface
|
||||
XTraceId optional.Interface
|
||||
}
|
||||
|
||||
func (a *UsersApiService) UpdateUser(ctx context.Context, body User, id string, localVarOptionals *UsersApiUpdateUserOpts) (UserSingle, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue UserSingle
|
||||
)
|
||||
|
||||
@ -641,7 +642,7 @@ func (a *UsersApiService) UpdateUser(ctx context.Context, body User, id string,
|
||||
|
||||
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"));
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@ -649,68 +650,68 @@ func (a *UsersApiService) UpdateUser(ctx context.Context, body User, id string,
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v UserSingle
|
||||
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
|
||||
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 == 422 {
|
||||
var v ValidationErrorResponse
|
||||
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
|
||||
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 == 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
}
|
||||
|
@ -9,9 +9,9 @@
|
||||
*/
|
||||
package swagger
|
||||
|
||||
type Configuration struct {
|
||||
Title *ConfigValueFilter `json:"title"`
|
||||
Value *PolymorphicProperty `json:"value"`
|
||||
// If this config variable can be edited by the user
|
||||
Editable bool `json:"editable"`
|
||||
}
|
||||
//type Configuration struct {
|
||||
// Title *ConfigValueFilter `json:"title"`
|
||||
// Value *PolymorphicProperty `json:"value"`
|
||||
// // If this config variable can be edited by the user
|
||||
// Editable bool `json:"editable"`
|
||||
//}
|
||||
|
Loading…
x
Reference in New Issue
Block a user