interview

package module
v0.0.0-...-f251ba7 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

client-library

client-library

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountAttributes

type AccountAttributes struct {
	AccountClassification   *string  `json:"account_classification,omitempty" validate:"required,oneof='Personal' 'Business'"`
	AccountMatchingOptOut   *bool    `json:"account_matching_opt_out,omitempty"`
	AccountNumber           string   `json:"account_number,omitempty"`
	AlternativeNames        []string `json:"alternative_names,omitempty"`
	BankID                  string   `json:"bank_id,omitempty"`
	BankIDCode              string   `json:"bank_id_code,omitempty"`
	BaseCurrency            string   `json:"base_currency,omitempty"`
	Bic                     string   `json:"bic,omitempty"`
	Country                 *string  `json:"country,omitempty"`
	Iban                    string   `json:"iban,omitempty"`
	JointAccount            *bool    `json:"joint_account,omitempty"`
	Name                    []string `json:"name,omitempty"`
	SecondaryIdentification string   `json:"secondary_identification,omitempty"`
	Status                  *string  `json:"status,omitempty"`
	Switched                *bool    `json:"switched,omitempty"`
}

type AccountData

type AccountData struct {
	Attributes     *AccountAttributes `json:"attributes,omitempty"`
	ID             string             `json:"id,omitempty" valid:"uuid"`
	OrganisationID string             `json:"organisation_id,omitempty" valid:"uuid"`
	Type           string             `json:"type,omitempty"`
	Version        *int64             `json:"version,omitempty"`
}

Account represents an account in the form3 org section. See https://api-docs.form3.tech/api.html#organisation-accounts for more information about fields.

func (*AccountData) Validate

func (account *AccountData) Validate() error

Validade is responsible to validate if the struct has the all mandatory fields to create a new record.

type Client

type Client struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Client is a helper to handle with the api calls

func NewClient

func NewClient() *Client

NewClient is used to initialize the client that will be used to call the API.

func (*Client) Create

func (c *Client) Create(account *AccountData) (*AccountData, error)

Create is a method used to create a new account. Is expected a struct AccountData as a parameter and the return will be the created object or an error.

func (*Client) Delete

func (c *Client) Delete(id string, version int) (bool, error)

Delete is a method used to delete an account by id. Is expected a valid uuid and the version of the account as a parameter and the return will be a boolean.

func (*Client) Fetch

func (c *Client) Fetch(id string) (*AccountData, error)

Fetch is a method used to find an account by id. Is expected a valid uuid as a parameter and the return will be the account found object or an error.

Jump to

Keyboard shortcuts

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