Documentation
¶
Index ¶
- Variables
- type AccountAttributes
- type AccountData
- type ClientConfig
- type ClientResponse
- type OrganisationApiClient
- func (c *OrganisationApiClient) CreateAccount(data AccountData) (*ClientResponse, error)
- func (c *OrganisationApiClient) CreateAccountWithContext(data AccountData, ctx context.Context) (*ClientResponse, error)
- func (c *OrganisationApiClient) DeleteAccount(id string, version int64) (*ClientResponse, error)
- func (c *OrganisationApiClient) DeleteAccountWithContext(id string, version int64, ctx context.Context) (*ClientResponse, error)
- func (c *OrganisationApiClient) FetchAccount(id string) (*ClientResponse, error)
- func (c *OrganisationApiClient) FetchAccountWithContext(id string, ctx context.Context) (*ClientResponse, error)
Constants ¶
This section is empty.
Variables ¶
var DebugClient = &OrganisationApiClient{ Client: http.DefaultClient, ClientConfig: DebugConfig, }
DebugClient Default client for debugging.
var DebugConfig = &ClientConfig{ RootUrl: defaultRootUrl, DebugLog: log.New(os.Stdout, "DEBUG\t", log.Ldate|log.Ltime), IsDebugEnabled: true, }
DebugConfig Config meant for debugging capabilities, with logging.
var DefaultClient = &OrganisationApiClient{ Client: &http.Client{ Timeout: 10 * time.Second, Transport: &http.Transport{ TLSHandshakeTimeout: 5 * time.Second, }, }, ClientConfig: DefaultConfig, }
DefaultClient Default client with timeout defined.
var DefaultConfig = &ClientConfig{ RootUrl: defaultRootUrl, DebugLog: nil, IsDebugEnabled: false, }
DefaultConfig Default config with no logging or debugging.
Functions ¶
This section is empty.
Types ¶
type AccountAttributes ¶
type AccountAttributes struct {
AccountClassification *string `json:"account_classification,omitempty"`
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"`
}
AccountAttributes Model representing the attributes of an account.
type AccountData ¶
type AccountData struct {
Attributes *AccountAttributes `json:"attributes,omitempty"`
ID string `json:"id,omitempty"`
OrganisationID string `json:"organisation_id,omitempty"`
Type string `json:"type,omitempty"`
Version *int64 `json:"version,omitempty"`
}
AccountData Model representing an account in the server.
type ClientConfig ¶
ClientConfig Struct representing the client config.
type ClientResponse ¶
type ClientResponse struct {
Data *AccountData
StatusCode int
Success bool
}
ClientResponse Represents a response from the API client, not the API itself.
type OrganisationApiClient ¶
type OrganisationApiClient struct {
*http.Client
ClientConfig *ClientConfig
}
OrganisationApiClient Struct for the API client. It uses http.Client as composition.
func (*OrganisationApiClient) CreateAccount ¶
func (c *OrganisationApiClient) CreateAccount(data AccountData) (*ClientResponse, error)
CreateAccount Creates a new resource given the AccountData. Uses defaultContext as the context.
func (*OrganisationApiClient) CreateAccountWithContext ¶
func (c *OrganisationApiClient) CreateAccountWithContext(data AccountData, ctx context.Context) (*ClientResponse, error)
CreateAccountWithContext Creates a new resource given the AccountData with the given context.
func (*OrganisationApiClient) DeleteAccount ¶
func (c *OrganisationApiClient) DeleteAccount(id string, version int64) (*ClientResponse, error)
DeleteAccount Deletes account with given id and version. Uses defaultContext as the context.
func (*OrganisationApiClient) DeleteAccountWithContext ¶
func (c *OrganisationApiClient) DeleteAccountWithContext(id string, version int64, ctx context.Context) (*ClientResponse, error)
DeleteAccountWithContext Deletes account with given id, version and context.
func (*OrganisationApiClient) FetchAccount ¶
func (c *OrganisationApiClient) FetchAccount(id string) (*ClientResponse, error)
FetchAccount Fetches the account given an id. Uses defaultContext as the context.
func (*OrganisationApiClient) FetchAccountWithContext ¶
func (c *OrganisationApiClient) FetchAccountWithContext(id string, ctx context.Context) (*ClientResponse, error)
FetchAccountWithContext Fetches the account given an id and context.