transactions

package
v0.0.0-...-2502b59 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client for transactions API

func (*Client) CreateTransaction

func (a *Client) CreateTransaction(params *CreateTransactionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTransactionCreated, error)

CreateTransaction creates a single transaction or multiple transactions

Creates a single transaction or multiple transactions. If you provide a body containing a `transaction` object, a single transaction will be created and if you provide a body containing a `transactions` array, multiple transactions will be created. Scheduled transactions cannot be created on this endpoint.

func (*Client) SetTransport

func (a *Client) SetTransport(transport runtime.ClientTransport)

SetTransport changes the transport on the client

type ClientOption

type ClientOption func(*runtime.ClientOperation)

ClientOption is the option for Client methods

type ClientService

type ClientService interface {
	CreateTransaction(params *CreateTransactionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTransactionCreated, error)

	SetTransport(transport runtime.ClientTransport)
}

ClientService is the interface for Client methods

func New

func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService

New creates a new transactions API client.

type CreateTransactionBadRequest

type CreateTransactionBadRequest struct {
	Payload *models.ErrorResponse
}

CreateTransactionBadRequest describes a response with status code 400, with default header values.

The request could not be understood due to malformed syntax or validation error(s).

func NewCreateTransactionBadRequest

func NewCreateTransactionBadRequest() *CreateTransactionBadRequest

NewCreateTransactionBadRequest creates a CreateTransactionBadRequest with default headers values

func (*CreateTransactionBadRequest) Code

func (o *CreateTransactionBadRequest) Code() int

Code gets the status code for the create transaction bad request response

func (*CreateTransactionBadRequest) Error

func (*CreateTransactionBadRequest) GetPayload

func (*CreateTransactionBadRequest) IsClientError

func (o *CreateTransactionBadRequest) IsClientError() bool

IsClientError returns true when this create transaction bad request response has a 4xx status code

func (*CreateTransactionBadRequest) IsCode

func (o *CreateTransactionBadRequest) IsCode(code int) bool

IsCode returns true when this create transaction bad request response a status code equal to that given

func (*CreateTransactionBadRequest) IsRedirect

func (o *CreateTransactionBadRequest) IsRedirect() bool

IsRedirect returns true when this create transaction bad request response has a 3xx status code

func (*CreateTransactionBadRequest) IsServerError

func (o *CreateTransactionBadRequest) IsServerError() bool

IsServerError returns true when this create transaction bad request response has a 5xx status code

func (*CreateTransactionBadRequest) IsSuccess

func (o *CreateTransactionBadRequest) IsSuccess() bool

IsSuccess returns true when this create transaction bad request response has a 2xx status code

func (*CreateTransactionBadRequest) String

func (o *CreateTransactionBadRequest) String() string

type CreateTransactionConflict

type CreateTransactionConflict struct {
	Payload *models.ErrorResponse
}

CreateTransactionConflict describes a response with status code 409, with default header values.

A transaction on the same account with the same `import_id` already exists.

func NewCreateTransactionConflict

func NewCreateTransactionConflict() *CreateTransactionConflict

NewCreateTransactionConflict creates a CreateTransactionConflict with default headers values

func (*CreateTransactionConflict) Code

func (o *CreateTransactionConflict) Code() int

Code gets the status code for the create transaction conflict response

func (*CreateTransactionConflict) Error

func (o *CreateTransactionConflict) Error() string

func (*CreateTransactionConflict) GetPayload

func (*CreateTransactionConflict) IsClientError

func (o *CreateTransactionConflict) IsClientError() bool

IsClientError returns true when this create transaction conflict response has a 4xx status code

func (*CreateTransactionConflict) IsCode

func (o *CreateTransactionConflict) IsCode(code int) bool

IsCode returns true when this create transaction conflict response a status code equal to that given

func (*CreateTransactionConflict) IsRedirect

func (o *CreateTransactionConflict) IsRedirect() bool

IsRedirect returns true when this create transaction conflict response has a 3xx status code

func (*CreateTransactionConflict) IsServerError

func (o *CreateTransactionConflict) IsServerError() bool

IsServerError returns true when this create transaction conflict response has a 5xx status code

func (*CreateTransactionConflict) IsSuccess

func (o *CreateTransactionConflict) IsSuccess() bool

IsSuccess returns true when this create transaction conflict response has a 2xx status code

func (*CreateTransactionConflict) String

func (o *CreateTransactionConflict) String() string

type CreateTransactionCreated

type CreateTransactionCreated struct {
	Payload *models.SaveTransactionsResponse
}

CreateTransactionCreated describes a response with status code 201, with default header values.

The transaction or transactions were successfully created

func NewCreateTransactionCreated

func NewCreateTransactionCreated() *CreateTransactionCreated

NewCreateTransactionCreated creates a CreateTransactionCreated with default headers values

func (*CreateTransactionCreated) Code

func (o *CreateTransactionCreated) Code() int

Code gets the status code for the create transaction created response

func (*CreateTransactionCreated) Error

func (o *CreateTransactionCreated) Error() string

func (*CreateTransactionCreated) GetPayload

func (*CreateTransactionCreated) IsClientError

func (o *CreateTransactionCreated) IsClientError() bool

IsClientError returns true when this create transaction created response has a 4xx status code

func (*CreateTransactionCreated) IsCode

func (o *CreateTransactionCreated) IsCode(code int) bool

IsCode returns true when this create transaction created response a status code equal to that given

func (*CreateTransactionCreated) IsRedirect

func (o *CreateTransactionCreated) IsRedirect() bool

IsRedirect returns true when this create transaction created response has a 3xx status code

func (*CreateTransactionCreated) IsServerError

func (o *CreateTransactionCreated) IsServerError() bool

IsServerError returns true when this create transaction created response has a 5xx status code

func (*CreateTransactionCreated) IsSuccess

func (o *CreateTransactionCreated) IsSuccess() bool

IsSuccess returns true when this create transaction created response has a 2xx status code

func (*CreateTransactionCreated) String

func (o *CreateTransactionCreated) String() string

type CreateTransactionParams

type CreateTransactionParams struct {

	/* BudgetID.

	   The id of the budget. "last-used" can be used to specify the last used budget and "default" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
	*/
	BudgetID string

	/* Data.

	   The transaction or transactions to create.  To create a single transaction you can specify a value for the `transaction` object and to create multiple transactions you can specify an array of `transactions`.  It is expected that you will only provide a value for one of these objects.
	*/
	Data *models.PostTransactionsWrapper

	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

CreateTransactionParams contains all the parameters to send to the API endpoint

for the create transaction operation.

Typically these are written to a http.Request.

func NewCreateTransactionParams

func NewCreateTransactionParams() *CreateTransactionParams

NewCreateTransactionParams creates a new CreateTransactionParams object, with the default timeout for this client.

Default values are not hydrated, since defaults are normally applied by the API server side.

To enforce default values in parameter, use SetDefaults or WithDefaults.

func NewCreateTransactionParamsWithContext

func NewCreateTransactionParamsWithContext(ctx context.Context) *CreateTransactionParams

NewCreateTransactionParamsWithContext creates a new CreateTransactionParams object with the ability to set a context for a request.

func NewCreateTransactionParamsWithHTTPClient

func NewCreateTransactionParamsWithHTTPClient(client *http.Client) *CreateTransactionParams

NewCreateTransactionParamsWithHTTPClient creates a new CreateTransactionParams object with the ability to set a custom HTTPClient for a request.

func NewCreateTransactionParamsWithTimeout

func NewCreateTransactionParamsWithTimeout(timeout time.Duration) *CreateTransactionParams

NewCreateTransactionParamsWithTimeout creates a new CreateTransactionParams object with the ability to set a timeout on a request.

func (*CreateTransactionParams) SetBudgetID

func (o *CreateTransactionParams) SetBudgetID(budgetID string)

SetBudgetID adds the budgetId to the create transaction params

func (*CreateTransactionParams) SetContext

func (o *CreateTransactionParams) SetContext(ctx context.Context)

SetContext adds the context to the create transaction params

func (*CreateTransactionParams) SetData

SetData adds the data to the create transaction params

func (*CreateTransactionParams) SetDefaults

func (o *CreateTransactionParams) SetDefaults()

SetDefaults hydrates default values in the create transaction params (not the query body).

All values with no default are reset to their zero value.

func (*CreateTransactionParams) SetHTTPClient

func (o *CreateTransactionParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the create transaction params

func (*CreateTransactionParams) SetTimeout

func (o *CreateTransactionParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the create transaction params

func (*CreateTransactionParams) WithBudgetID

func (o *CreateTransactionParams) WithBudgetID(budgetID string) *CreateTransactionParams

WithBudgetID adds the budgetID to the create transaction params

func (*CreateTransactionParams) WithContext

WithContext adds the context to the create transaction params

func (*CreateTransactionParams) WithData

WithData adds the data to the create transaction params

func (*CreateTransactionParams) WithDefaults

WithDefaults hydrates default values in the create transaction params (not the query body).

All values with no default are reset to their zero value.

func (*CreateTransactionParams) WithHTTPClient

func (o *CreateTransactionParams) WithHTTPClient(client *http.Client) *CreateTransactionParams

WithHTTPClient adds the HTTPClient to the create transaction params

func (*CreateTransactionParams) WithTimeout

WithTimeout adds the timeout to the create transaction params

func (*CreateTransactionParams) WriteToRequest

WriteToRequest writes these params to a swagger request

type CreateTransactionReader

type CreateTransactionReader struct {
	// contains filtered or unexported fields
}

CreateTransactionReader is a Reader for the CreateTransaction structure.

func (*CreateTransactionReader) ReadResponse

func (o *CreateTransactionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL