accounts: github.com/moov-io/accounts/client Index | Files

package openapi

import "github.com/moov-io/accounts/client"

Index

Package Files

api_accounts.go client.go configuration.go model_account.go model_account_address.go model_create_account.go model_create_account_address.go model_create_phone.go model_create_transaction.go model_error.go model_phone.go model_transaction.go model_transaction_line.go response.go

Variables

var (
    // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
    ContextOAuth2 = contextKey("token")

    // ContextBasicAuth takes BasicAuth as authentication for the request.
    ContextBasicAuth = contextKey("basic")

    // ContextAccessToken takes a string oauth2 access token as authentication for the request.
    ContextAccessToken = contextKey("accesstoken")

    // ContextAPIKey takes an APIKey as authentication for the request
    ContextAPIKey = contextKey("apikey")
)

func CacheExpires Uses

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

type APIClient Uses

type APIClient struct {
    AccountsApi *AccountsApiService
    // contains filtered or unexported fields
}

APIClient manages communication with the Accounts API API v1.0.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient Uses

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath Uses

func (c *APIClient) ChangeBasePath(path string)

ChangeBasePath changes base path to allow switching to mocks

func (*APIClient) GetConfig Uses

func (c *APIClient) GetConfig() *Configuration

Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior

type APIKey Uses

type APIKey struct {
    Key    string
    Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse Uses

type APIResponse struct {
    *http.Response `json:"-"`
    Message        string `json:"message,omitempty"`
    // Operation is the name of the OpenAPI operation.
    Operation string `json:"operation,omitempty"`
    // RequestURL is the request URL. This value is always available, even if the
    // embedded *http.Response is nil.
    RequestURL string `json:"url,omitempty"`
    // Method is the HTTP method used for the request.  This value is always
    // available, even if the embedded *http.Response is nil.
    Method string `json:"method,omitempty"`
    // Payload holds the contents of the response body (which may be nil or empty).
    // This is provided here as the raw response.Body() reader will have already
    // been drained.
    Payload []byte `json:"-"`
}

APIResponse stores the API response returned by the server.

func NewAPIResponse Uses

func NewAPIResponse(r *http.Response) *APIResponse

NewAPIResponse returns a new APIResonse object.

func NewAPIResponseWithError Uses

func NewAPIResponseWithError(errorMessage string) *APIResponse

NewAPIResponseWithError returns a new APIResponse object with the provided error message.

type Account Uses

type Account struct {
    // The unique identifier for an account
    ID  string `json:"ID,omitempty"`
    // The unique identifier for the customer who owns the account
    CustomerID string `json:"customerID,omitempty"`
    // Caller defined label for this account.
    Name string `json:"name,omitempty"`
    // A unique Account number at the bank.
    AccountNumber string `json:"accountNumber,omitempty"`
    // Last four digits of an account number
    AccountNumberMasked string `json:"accountNumberMasked,omitempty"`
    // Routing Transit Number is a nine-digit number assigned by the ABA
    RoutingNumber string `json:"routingNumber,omitempty"`
    // Status of the account being created.
    Status string `json:"status,omitempty"`
    // Product type of the account
    Type      string    `json:"type,omitempty"`
    CreatedAt time.Time `json:"createdAt,omitempty"`
    ClosedAt  time.Time `json:"closedAt,omitempty"`
    // Last time the object was modified except balances
    LastModified time.Time `json:"lastModified,omitempty"`
    // Total balance of account in USD cents.
    Balance int32 `json:"balance,omitempty"`
    // Balance available in USD cents to be drawn
    BalanceAvailable int32 `json:"balanceAvailable,omitempty"`
    // Balance of pending transactions in USD cents
    BalancePending int32 `json:"balancePending,omitempty"`
}

Account struct for Account

type AccountAddress Uses

type AccountAddress struct {
    Type string `json:"type,omitempty"`
    // First line of the address
    Address1 string `json:"address1,omitempty"`
    // Second line of the address
    Address2 string `json:"address2,omitempty"`
    City     string `json:"city,omitempty"`
    // two charcer code of US state
    State      string `json:"state,omitempty"`
    PostalCode string `json:"postalCode,omitempty"`
    Country    string `json:"country,omitempty"`
    // Address has been validated for customer
    Validated bool `json:"validated,omitempty"`
    // Address is currently being used for customer
    Active bool `json:"active,omitempty"`
}

AccountAddress struct for AccountAddress

type AccountsApiService Uses

type AccountsApiService service

AccountsApiService AccountsApi service

func (*AccountsApiService) CreateAccount Uses

func (a *AccountsApiService) CreateAccount(ctx _context.Context, xUserID string, createAccount CreateAccount, localVarOptionals *CreateAccountOpts) (Account, *_nethttp.Response, error)

CreateAccount Create Account Create an account for a Customer. Leaving the number blank will generate a random value.

* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param xUserID Moov User ID header, required in all requests
* @param createAccount
* @param optional nil or *CreateAccountOpts - Optional Parameters:
* @param "XRequestID" (optional.String) -  Optional Request ID allows application developer to trace requests through the systems logs

@return Account

func (*AccountsApiService) CreateTransaction Uses

func (a *AccountsApiService) CreateTransaction(ctx _context.Context, xUserID string, createTransaction CreateTransaction, localVarOptionals *CreateTransactionOpts) (Transaction, *_nethttp.Response, error)

CreateTransaction Create Transaction Post a transaction against multiple accounts. All transaction lines must sum to zero. No money is created or destroyed in a transaction - only moved from account to account. Accounts can be referred to in a Transaction without creating them first.

* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param xUserID Moov User ID header, required in all requests
* @param createTransaction
* @param optional nil or *CreateTransactionOpts - Optional Parameters:
* @param "XRequestID" (optional.String) -  Optional Request ID allows application developer to trace requests through the systems logs

@return Transaction

func (*AccountsApiService) GetAccountTransactions Uses

func (a *AccountsApiService) GetAccountTransactions(ctx _context.Context, accountID string, xUserID string, localVarOptionals *GetAccountTransactionsOpts) ([]Transaction, *_nethttp.Response, error)

GetAccountTransactions Get Account transactions Get transactions for an account. Ordered descending from their posted date.

* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param accountID Account ID
* @param xUserID Moov User ID header, required in all requests
* @param optional nil or *GetAccountTransactionsOpts - Optional Parameters:
* @param "Limit" (optional.Float32) -  Maximum number of transactions to return
* @param "XRequestID" (optional.String) -  Optional Request ID allows application developer to trace requests through the systems logs

@return []Transaction

func (*AccountsApiService) Ping Uses

func (a *AccountsApiService) Ping(ctx _context.Context) (*_nethttp.Response, error)

Ping Ping Accounts service Check the Accounts service to check if running

* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

func (*AccountsApiService) ReverseTransaction Uses

func (a *AccountsApiService) ReverseTransaction(ctx _context.Context, transactionID string, xUserID string, localVarOptionals *ReverseTransactionOpts) (Transaction, *_nethttp.Response, error)

ReverseTransaction Reverse a transaction Reverse a transaction by debiting the credited and crediting the debited amounts among all accounts involved.

* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param transactionID Transaction ID
* @param xUserID Moov User ID header, required in all requests
* @param optional nil or *ReverseTransactionOpts - Optional Parameters:
* @param "XRequestID" (optional.String) -  Optional Request ID allows application developer to trace requests through the systems logs

@return Transaction

func (*AccountsApiService) SearchAccounts Uses

func (a *AccountsApiService) SearchAccounts(ctx _context.Context, xUserID string, localVarOptionals *SearchAccountsOpts) ([]Account, *_nethttp.Response, error)

SearchAccounts Search for Accounts Find accounts which match all specified query parameters

* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param xUserID Moov User ID header, required in all requests
* @param optional nil or *SearchAccountsOpts - Optional Parameters:
* @param "Number" (optional.String) -  Account number
* @param "RoutingNumber" (optional.String) -  ABA routing number for the Financial Institution
* @param "Type_" (optional.String) -  Account type
* @param "CustomerID" (optional.String) -  Customer ID associated to accounts
* @param "XRequestID" (optional.String) -  Optional Request ID allows application developer to trace requests through the systems logs

@return []Account

type BasicAuth Uses

type BasicAuth struct {
    UserName string `json:"userName,omitempty"`
    Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Configuration Uses

type Configuration struct {
    BasePath      string            `json:"basePath,omitempty"`
    Host          string            `json:"host,omitempty"`
    Scheme        string            `json:"scheme,omitempty"`
    DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
    UserAgent     string            `json:"userAgent,omitempty"`
    HTTPClient    *http.Client
}

Configuration stores the configuration of the API client

func NewConfiguration Uses

func NewConfiguration() *Configuration

NewConfiguration returns a new Configuration object

func (*Configuration) AddDefaultHeader Uses

func (c *Configuration) AddDefaultHeader(key string, value string)

AddDefaultHeader adds a new HTTP header to the default header in the request

type CreateAccount Uses

type CreateAccount struct {
    // Customer ID associated with accounts
    CustomerID string `json:"customerID"`
    // Initial balance of account in USD cents. This amount is to be deposited from an account at another Financial Institution or in-person (i.e. cash) on account creation.
    Balance int32 `json:"balance"`
    // Caller defined label for this account.
    Name string `json:"name"`
    // Random number to be used as unique to distinguish this Account
    Number string `json:"number,omitempty"`
    // Product type of the account
    Type string `json:"type"`
}

CreateAccount struct for CreateAccount

type CreateAccountAddress Uses

type CreateAccountAddress struct {
    Type string `json:"type"`
    // First line of the address
    Address1 string `json:"address1"`
    // Second line of the address
    Address2 string `json:"address2"`
    City     string `json:"city"`
    // two charcer code of US state
    State      string `json:"state"`
    PostalCode string `json:"postalCode"`
    Country    string `json:"country"`
}

CreateAccountAddress struct for CreateAccountAddress

type CreateAccountOpts Uses

type CreateAccountOpts struct {
    XRequestID optional.String
}

CreateAccountOpts Optional parameters for the method 'CreateAccount'

type CreatePhone Uses

type CreatePhone struct {
    // phone number
    Number string `json:"number"`
    Type   string `json:"type"`
}

CreatePhone struct for CreatePhone

type CreateTransaction Uses

type CreateTransaction struct {
    Lines []TransactionLine `json:"lines,omitempty"`
}

CreateTransaction struct for CreateTransaction

type CreateTransactionOpts Uses

type CreateTransactionOpts struct {
    XRequestID optional.String
}

CreateTransactionOpts Optional parameters for the method 'CreateTransaction'

type Error Uses

type Error struct {
    // An error message describing the problem intended for humans.
    Error string `json:"error"`
}

Error struct for Error

type GenericOpenAPIError Uses

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

GenericOpenAPIError Provides access to the body, error and model on returned errors.

func (GenericOpenAPIError) Body Uses

func (e GenericOpenAPIError) Body() []byte

Body returns the raw bytes of the response

func (GenericOpenAPIError) Error Uses

func (e GenericOpenAPIError) Error() string

Error returns non-empty string if there was an error.

func (GenericOpenAPIError) Model Uses

func (e GenericOpenAPIError) Model() interface{}

Model returns the unpacked model of the error

type GetAccountTransactionsOpts Uses

type GetAccountTransactionsOpts struct {
    Limit      optional.Float32
    XRequestID optional.String
}

GetAccountTransactionsOpts Optional parameters for the method 'GetAccountTransactions'

type Phone Uses

type Phone struct {
    // phone number
    Number string `json:"number,omitempty"`
    // phone number has been validated to connect with customer
    Valid bool   `json:"valid,omitempty"`
    Type  string `json:"type,omitempty"`
}

Phone struct for Phone

type ReverseTransactionOpts Uses

type ReverseTransactionOpts struct {
    XRequestID optional.String
}

ReverseTransactionOpts Optional parameters for the method 'ReverseTransaction'

type SearchAccountsOpts Uses

type SearchAccountsOpts struct {
    Number        optional.String
    RoutingNumber optional.String
    Type_         optional.String
    CustomerID    optional.String
    XRequestID    optional.String
}

SearchAccountsOpts Optional parameters for the method 'SearchAccounts'

type Transaction Uses

type Transaction struct {
    // Unique ID of a transaction
    ID        string            `json:"ID,omitempty"`
    Timestamp time.Time         `json:"timestamp,omitempty"`
    Lines     []TransactionLine `json:"lines,omitempty"`
}

Transaction struct for Transaction

type TransactionLine Uses

type TransactionLine struct {
    // Account ID
    AccountID string `json:"accountID,omitempty"`
    Purpose   string `json:"purpose,omitempty"`
    // Change in account balance (in USD cents)
    Amount float32 `json:"amount,omitempty"`
}

TransactionLine struct for TransactionLine

Package openapi imports 21 packages (graph). Updated 2020-05-21. Refresh now. Tools for package owners.