bi

package
v0.0.0-...-a7c217f Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBI

type EventBI string

EventBI is a type used for the events sent by BI in the webhooks

const (
	// EventConnectionSynced is emitted after a connection has been synced
	EventConnectionSynced EventBI = "CONNECTION_SYNCED"
	// EventConnectionDeleted is emitted after a connection has been deleted
	EventConnectionDeleted EventBI = "CONNECTION_DELETED"
	// EventAccountEnabled is emitted after a bank account was enabled
	EventAccountEnabled EventBI = "ACCOUNT_ENABLED"
	// EventAccountDisabled is emitted after a bank account was disabled
	EventAccountDisabled EventBI = "ACCOUNT_DISABLED"
)

func ParseEventBI

func ParseEventBI(evt string) (EventBI, error)

ParseEventBI returns the event of the webhook, or an error if the event cannot be handled by the stack.

type WebhookCall

type WebhookCall struct {
	Instance *instance.Instance
	Token    string
	BIurl    string
	Event    EventBI
	Payload  map[string]interface{}
	// contains filtered or unexported fields
}

WebhookCall contains the data relative to a call from BI for a webhook.

func (*WebhookCall) Fire

func (c *WebhookCall) Fire() error

Fire is used when the stack receives a call for a BI webhook, with an bearer token and a JSON payload. It will try to find a matching io.cozy.account and a io.cozy.trigger, and launch a job for them if needed.

Jump to

Keyboard shortcuts

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