api

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package api contains autogenerated REST client.

Index

Constants

View Source
const DefaultBaseURL = "https://web.moneylover.me/api"

DefaultBaseURL is the default base URL for this service.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL string
	Timeout time.Duration
	// InstrumentCtxFunc allows adding operation info to context.
	// A pointer to request structure passed into the function.
	// Nil value is ignored.
	InstrumentCtxFunc func(ctx context.Context, method, pattern string, reqStruct interface{}) context.Context
	// contains filtered or unexported fields
}

Client is a REST service HTTP client.

func NewClient

func NewClient() *Client

NewClient creates client instance with default transport.

func (*Client) PostCategoryListAll

func (c *Client) PostCategoryListAll(ctx context.Context, request PostCategoryListAllRequest) (result PostCategoryListAllResponse, err error)

PostCategoryListAll performs REST operation.

func (*Client) PostToken

func (c *Client) PostToken(ctx context.Context, request PostTokenRequest) (result PostTokenResponse, err error)

PostToken performs REST operation.

func (*Client) PostTransactionList

func (c *Client) PostTransactionList(ctx context.Context, request PostTransactionListRequest) (result PostTransactionListResponse, err error)

PostTransactionList performs REST operation.

func (*Client) PostUserLoginURL

func (c *Client) PostUserLoginURL(ctx context.Context, request PostUserLoginURLRequest) (result PostUserLoginURLResponse, err error)

PostUserLoginURL performs REST operation.

func (*Client) SetTransport

func (c *Client) SetTransport(transport http.RoundTripper)

SetTransport sets client transport.

type ListCategoryResponse

type ListCategoryResponse struct {
	Error  int64                   `json:"error,omitempty"`
	Msg    string                  `json:"msg,omitempty"`
	Action string                  `json:"action,omitempty"`
	Data   []category.FlatCategory `json:"data"` // Required.
}

ListCategoryResponse structure is generated from "#/components/schemas/ListCategoryResponse".

type ListTransactionRequest

type ListTransactionRequest struct {
	WalletID string `json:"walletId"` // Required.
	// Format: date-time.
	// Required.
	StartDate time.Time `json:"startDate"`
	// Format: date-time.
	// Required.
	EndDate time.Time `json:"endDate"`
}

ListTransactionRequest structure is generated from "#/components/schemas/ListTransactionRequest".

type ListTransactionResponse

type ListTransactionResponse struct {
	Error  int64                       `json:"error,omitempty"`
	Msg    string                      `json:"msg,omitempty"`
	Action string                      `json:"action,omitempty"`
	Data   ListTransactionResponseData `json:"data"` // Required.
}

ListTransactionResponse structure is generated from "#/components/schemas/ListTransactionResponse".

type ListTransactionResponseData

type ListTransactionResponseData struct {
	Daterange    *ListTransactionResponseDataDaterange `json:"daterange,omitempty"`
	Transactions []transaction.Transaction             `json:"transactions"` // Required.
}

ListTransactionResponseData structure is generated from "#/components/schemas/ListTransactionResponse->data".

type ListTransactionResponseDataDaterange

type ListTransactionResponseDataDaterange struct {
	StartDate string `json:"startDate,omitempty"` // Format: date.
	EndDate   string `json:"endDate,omitempty"`   // Format: date.
}

ListTransactionResponseDataDaterange structure is generated from "#/components/schemas/ListTransactionResponse->data->daterange".

type LoginResponse

type LoginResponse struct {
	Error  int64             `json:"error,omitempty"`
	Msg    string            `json:"msg,omitempty"`
	Action string            `json:"action,omitempty"`
	Data   LoginResponseData `json:"data"` // Required.
}

LoginResponse structure is generated from "#/components/schemas/LoginResponse".

type LoginResponseData

type LoginResponseData struct {
	Status       bool   `json:"status,omitempty"`
	RequestToken string `json:"request_token,omitempty"`
	// Format: uri.
	// Required.
	LoginURL string `json:"login_url"`
}

LoginResponseData structure is generated from "#/components/schemas/LoginResponse->data".

type PostCategoryListAllRequest

type PostCategoryListAllRequest struct {
}

PostCategoryListAllRequest is operation request value.

type PostCategoryListAllResponse

type PostCategoryListAllResponse struct {
	StatusCode int
	ValueOK    *ListCategoryResponse // ValueOK is a value of 200 OK response.
}

PostCategoryListAllResponse is operation response value.

type PostTokenRequest

type PostTokenRequest struct {
	Authorization string        // Authorization is a required `Authorization` parameter in header.
	Client        *string       // Client is an optional `client` parameter in header.
	Body          *TokenRequest // Body is a JSON request body.
}

PostTokenRequest is operation request value.

type PostTokenResponse

type PostTokenResponse struct {
	StatusCode int
	ValueOK    *TokenResponse // ValueOK is a value of 200 OK response.
}

PostTokenResponse is operation response value.

type PostTransactionListRequest

type PostTransactionListRequest struct {
	Body *ListTransactionRequest // Body is a JSON request body.
}

PostTransactionListRequest is operation request value.

type PostTransactionListResponse

type PostTransactionListResponse struct {
	StatusCode int
	ValueOK    *ListTransactionResponse // ValueOK is a value of 200 OK response.
}

PostTransactionListResponse is operation response value.

type PostUserLoginURLRequest

type PostUserLoginURLRequest struct {
}

PostUserLoginURLRequest is operation request value.

type PostUserLoginURLResponse

type PostUserLoginURLResponse struct {
	StatusCode int
	ValueOK    *LoginResponse // ValueOK is a value of 200 OK response.
}

PostUserLoginURLResponse is operation response value.

type TokenRequest

type TokenRequest struct {
	ClientInfo bool `json:"client_info,omitempty"`
	// Format: email.
	// Required.
	Email string `json:"email"`
	// Format: password.
	// Required.
	Password string `json:"password"`
}

TokenRequest structure is generated from "#/components/schemas/TokenRequest".

type TokenResponse

type TokenResponse struct {
	Status bool `json:"status,omitempty"`
	// Format: byte.
	// Required.
	AccessToken string           `json:"access_token"`
	Expire      types.UnixString `json:"expire"` // Required.
	// Format: byte.
	// Required.
	RefreshToken string                   `json:"refresh_token"`
	ClientInfo   *TokenResponseClientInfo `json:"client_info,omitempty"`
}

TokenResponse structure is generated from "#/components/schemas/TokenResponse".

type TokenResponseClientInfo

type TokenResponseClientInfo struct {
	Name     string `json:"name,omitempty"`
	Internal bool   `json:"internal,omitempty"`
}

TokenResponseClientInfo structure is generated from "#/components/schemas/TokenResponse->client_info".

Jump to

Keyboard shortcuts

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