elarian

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: MIT Imports: 18 Imported by: 0

README

Elarian

A convenient way to interact with the Elarian APIs.

Install

You can install the package from github by running:

go get github.com/elarianltd/go-sdk

Usage

package main

import (
 "log"
 "os"
 "os/signal"
 "syscall"

 elarian "github.com/elarianltd/go-sdk"
)

const (
 AppID  string = "appID"
 OrgID  string = "orgID"
 APIKey string = "apiKey"
)

func main() {
 var (
  custNumber *elarian.CustomerNumber
  channel    *elarian.MessagingChannelNumber
  opts       *elarian.Options
 )

 opts = &elarian.Options{
  APIKey:             aPIKey,
  OrgID:              orgID,
  AppID:              appID,
  AllowNotifications: true,
  Log:                true,
 }
 service, err := elarian.Connect(opts, nil)
 if err != nil {
  log.Fatalf("Error Initializing Elarian: %v \n", err)
 }
 defer service.Disconnect()

 sigs := make(chan os.Signal, 1)
 signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
 go func() {
  <-sigs
  log.Println("Disconnecting From Elarian")
  service.Disconnect()
  os.Exit(0)
 }()

 custNumber = &elarian.CustomerNumber{Number: "+254708752502", Provider: elarian.CustomerNumberProviderCellular}
 channel = &elarian.MessagingChannelNumber{Number: "21356", Channel: elarian.MessagingChannelSms}

 ctx, cancel := context.WithTimeout(context.Background(), time.Duration(time.Second*30))
 defer cancel()
 response, err := service.SendMessage(ctx, custNumber, channel, elarian.TextMessage("Hello world from the go sdk"))
 if err != nil {
  log.Fatalf("Message not send %v \n", err.Error())
 }
 log.Printf("Status %d Description %s \n customerID %s \n", response.Status, response.Description, response.CustomerID)
}

See example for a full sample app.

Documentation

Take a look at the API docs here. For detailed info on this SDK, see the reference.

Development

Run all tests:

make test

See SDK Spec for reference.

Issues

If you find a bug, please file an issue on our issue tracker on GitHub.

Documentation

Index

Constants

View Source
const (
	CustomerEventDirectionUnspecified CustomerEventDirection = iota
	CustomerEventDirectionInbound                            = 1
	CustomerEventDirectionOutbound                           = 2
)

CustomerEventDirect constants

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityChannel

type ActivityChannel int32

ActivityChannel is an enum that defines a type of activity channel. it could be a web and mobile

const (
	ActivityChannelUnspecified ActivityChannel = iota
	ActivityChannelWeb
	ActivityChannelMobile
)

ActivityChannel Enums

type ActivityChannelNumber

type ActivityChannelNumber struct {
	Number  string          `json:"number,omitempty"`
	Channel ActivityChannel `json:"activityChannel,omitempty"`
}

ActivityChannelNumber defines an activity channel

type Appdata

type Appdata struct {
	Value      string `json:"value,omitempty"`
	BytesValue []byte `json:"bytesValue,omitempty"`
}

Appdata defines a customer's metadata oneOf value of bytes value should be provided

type BinaryDataValue

type BinaryDataValue []byte

BinaryDataValue implements the DataValue Interface and represents an array of bytes

func (BinaryDataValue) Bytes

func (b BinaryDataValue) Bytes() []byte

Bytes method returns a BinaryDataValue as an array of bytes

func (BinaryDataValue) String

func (b BinaryDataValue) String() string

type Cash

type Cash struct {
	CurrencyCode string  `json:"currencyCode,omitempty"`
	Amount       float64 `json:"amount,omitempty"`
}

Cash defines a cash object

type ChannelCounterParty added in v0.2.0

type ChannelCounterParty struct {
	ChannelNumber *PaymentChannelNumber
	Account       string
	ChannelCode   int32
}

ChannelCounterParty struct

type CheckoutPaymentSimulatorNotification

type CheckoutPaymentSimulatorNotification struct {
	OrgID         string                `json:"orgId,omitempty"`
	AppID         string                `json:"appId,omitempty"`
	TransactionID string                `json:"transactionId,omitempty"`
	CreditParty   *PaymentParty         `json:"creditParty,omitempty"`
	ChannelNumber *PaymentChannelNumber `json:"channelNumber,omitempty"`
	Value         *Cash                 `json:"value,omitempty"`
}

CheckoutPaymentSimulatorNotification struct

type ConnectionOptions

type ConnectionOptions struct {
	LifeTime   time.Duration `json:"lifeTime,omitempty"`
	Keepalive  time.Duration `json:"keepAlive,omitempty"`
	MissedAcks int           `json:"missedAcks,omitempty"`
	Resumable  bool          `json:"resumable,omitempty"`
}

ConnectionOptions RSocket connection options

type CreateCustomer

type CreateCustomer struct {
	ID             string          `json:"id,omitempty"`
	CustomerNumber *CustomerNumber `json:"customerNumber,omitempty"`
}

CreateCustomer to create a customer

type Customer

type Customer struct {
	ID             string          `json:"id,omitempty"`
	CustomerNumber *CustomerNumber `json:"customerNumber,omitempty"`
	SecondaryID    *SecondaryID    `json:"secondaryId,omitempty"`
	// contains filtered or unexported fields
}

Customer struct defines the parameters required to make any command involving a customer. Note: in every scenario either the Id or the phoneNumber is required but not both unless otherwise specified

func (*Customer) AddReminder

func (c *Customer) AddReminder(ctx context.Context, reminder *Reminder) (*UpdateCustomerAppDataReply, error)

AddReminder sets a reminder on elarian for a customer which is triggered on set time. The reminder is push through the notification stream.

func (*Customer) AdoptState

func (c *Customer) AdoptState(ctx context.Context, otherCustomer IsCustomer) (*UpdateCustomerStateReply, error)

AdoptState copies the state of the second customer to this customer

func (*Customer) CancelReminder

func (c *Customer) CancelReminder(ctx context.Context, key string) (*UpdateCustomerAppDataReply, error)

CancelReminder cancels a set reminder

func (*Customer) DeleteAppData

func (c *Customer) DeleteAppData(ctx context.Context) (*UpdateCustomerAppDataReply, error)

DeleteAppData removes a customers metadata

func (*Customer) DeleteMetaData

func (c *Customer) DeleteMetaData(ctx context.Context, keys ...string) (*UpdateCustomerStateReply, error)

DeleteMetaData removes a customers metadata

func (*Customer) DeleteSecondaryID

func (c *Customer) DeleteSecondaryID(ctx context.Context, secondaryIds ...*SecondaryID) (*UpdateCustomerStateReply, error)

DeleteSecondaryID deletes an associated secondary id from a customer

func (*Customer) DeleteTags

func (c *Customer) DeleteTags(ctx context.Context, keys ...string) (*UpdateCustomerStateReply, error)

DeleteTags disaccosiates a tag from a customer

func (*Customer) GetCustomerActivity

func (c *Customer) GetCustomerActivity(ctx context.Context, channelNumber *ActivityChannelNumber, sessionID string) (*CustomerActivityReply, error)

GetCustomerActivity returns a customers activity

func (*Customer) GetMetadata

func (c *Customer) GetMetadata(ctx context.Context) (map[string]*Metadata, error)

GetMetadata returns customer metadata

func (*Customer) GetState

func (c *Customer) GetState(ctx context.Context) (*hera.GetCustomerStateReply, error)

GetState returns a customers state on elarian, the state could me messaging state, metadata, secondaryIds, payments etc.

func (*Customer) LeaseAppData

func (c *Customer) LeaseAppData(ctx context.Context) (*LeaseCustomerAppDataReply, error)

LeaseAppData leases customer metadata

func (*Customer) ReplyToMessage

func (c *Customer) ReplyToMessage(ctx context.Context, messageID string, body IsOutBoundMessageBody) (*SendMessageReply, error)

ReplyToMessage replys to a message sent by the customer

func (*Customer) SendMessage

func (c *Customer) SendMessage(ctx context.Context, channelNumber *MessagingChannelNumber, body IsOutBoundMessageBody) (*SendMessageReply, error)

SendMessage sends a messsage to a customer

func (*Customer) UpdateActivity

func (c *Customer) UpdateActivity(ctx context.Context, channel *ActivityChannelNumber, sessionID, key string, properties map[string]string) (*CustomerActivityReply, error)

UpdateActivity func

func (*Customer) UpdateAppData

func (c *Customer) UpdateAppData(ctx context.Context, appdata *Appdata) (*UpdateCustomerAppDataReply, error)

UpdateAppData adds abitrary or application specific information that you may want to tie to a customer.

func (*Customer) UpdateMesssagingConsent

func (c *Customer) UpdateMesssagingConsent(ctx context.Context, channel *MessagingChannelNumber, action MessagingConsentUpdate) (*UpdateMessagingConsentReply, error)

UpdateMesssagingConsent func

func (*Customer) UpdateMetaData

func (c *Customer) UpdateMetaData(ctx context.Context, metadata ...*Metadata) (*UpdateCustomerStateReply, error)

UpdateMetaData adds abitrary information you want to tie to a customer

func (*Customer) UpdateSecondaryID

func (c *Customer) UpdateSecondaryID(ctx context.Context, secondaryIds ...*SecondaryID) (*UpdateCustomerStateReply, error)

UpdateSecondaryID adds secondary ids to a customer, this could be the id you associate the customer with locally on your application.

func (*Customer) UpdateTags

func (c *Customer) UpdateTags(ctx context.Context, tags ...*Tag) (*UpdateCustomerStateReply, error)

UpdateTags is used to add more tags to a customer

type CustomerActivity

type CustomerActivity struct {
	Key        string            `json:"key,omitempty"`
	CreatedAt  time.Time         `json:"createdAt,omitempty"`
	Properties map[string]string `json:"properties,omitempty"`
}

CustomerActivity struct

type CustomerActivityNotification

type CustomerActivityNotification struct {
	SessionID       string                 `json:"sessionId,omitempty"`
	Activity        *CustomerActivity      `json:"activity,omitempty"`
	CustomerNumber  *CustomerNumber        `json:"customerNumber,omitempty"`
	ActivityChannel *ActivityChannelNumber `json:"activityChannel,omitempty"`
}

CustomerActivityNotification struct

type CustomerActivityReply

type CustomerActivityReply struct {
	Status      bool   `json:"status,omitempty"`
	Description string `json:"description,omitempty"`
	CustomerID  string `json:"customerId,omitempty"`
}

CustomerActivityReply struct

type CustomerEventDirection

type CustomerEventDirection int32

CustomerEventDirection int

type CustomerID

type CustomerID string

CustomerID implements the IsCustomer interface

type CustomerNumber

type CustomerNumber struct {
	Number    string         `json:"number,omitempty"`
	Provider  NumberProvider `json:"provider,omitempty"`
	Partition string         `json:"partition,omitempty"`
}

CustomerNumber struct

type CustomerPaymentParty added in v0.2.0

type CustomerPaymentParty struct {
	CustomerNumber *CustomerNumber
	ChannelNumber  *PaymentChannelNumber
}

CustomerPaymentParty struct

type Elarian

type Elarian interface {
	GenerateAuthToken(ctx context.Context) (*GenerateAuthTokenReply, error)

	// GetCustomerState returns a customers state on elarian, the state could me messaging state, metadata, secondaryIds, payments etc.
	GetCustomerState(ctx context.Context, customer IsCustomer) (*hera.GetCustomerStateReply, error)

	// AdoptCustomerState copies the state of the second customer to the first customer. note for the first customer a customer id is required
	AdoptCustomerState(ctx context.Context, customerID string, otherCustomer IsCustomer) (*UpdateCustomerStateReply, error)

	// AddCustomerReminder sets a reminder on elarian for a customer which is triggered on set time. The reminder is push through the notification stream.
	AddCustomerReminder(ctx context.Context, customer IsCustomer, reminder *Reminder) (*UpdateCustomerAppDataReply, error)

	// AddCustomerReminderByTag sets a reminder on elarian for a group of customers identified by the tag on trigger is pushed through the notification stream.
	AddCustomerReminderByTag(ctx context.Context, tag *Tag, reminder *Reminder) (*TagCommandReply, error)

	// CancelCustomerReminder cancels a set reminder
	CancelCustomerReminder(ctx context.Context, customer IsCustomer, key string) (*UpdateCustomerAppDataReply, error)

	// CancelCustomerReminderByTag cancels a reminder set on a customer tag.
	CancelCustomerReminderByTag(ctx context.Context, tag *Tag, key string) (*TagCommandReply, error)

	// UpdateCustomerTag is used to add more tags to a customer
	UpdateCustomerTag(ctx context.Context, customer IsCustomer, tags ...*Tag) (*UpdateCustomerStateReply, error)

	// DeleteCustomerTag disaccosiates a tag from a customer
	DeleteCustomerTag(ctx context.Context, customer IsCustomer, keys ...string) (*UpdateCustomerStateReply, error)

	// UpdateSecondaryId adds secondary ids to a customer, this could be the id you associate the customer with locally on your application.
	UpdateCustomerSecondaryID(ctx context.Context, customer IsCustomer, secondaryIds ...*SecondaryID) (*UpdateCustomerStateReply, error)

	// DeleteSecondaryId deletes an associated secondary id from a customer
	DeleteCustomerSecondaryID(ctx context.Context, customer IsCustomer, secondaryIds ...*SecondaryID) (*UpdateCustomerStateReply, error)

	// UpdateCustomerMetaData adds abitrary or application specific information that you may want to tie to a customer.
	UpdateCustomerMetaData(ctx context.Context, customer IsCustomer, metadata ...*Metadata) (*UpdateCustomerStateReply, error)

	// DeleteCustomerMetaData removes a customers metadata.
	DeleteCustomerMetaData(ctx context.Context, customer IsCustomer, keys ...string) (*UpdateCustomerStateReply, error)

	// LeaseCustomerMetaData removes a customers metadata.
	LeaseCustomerAppData(ctx context.Context, customer IsCustomer) (*LeaseCustomerAppDataReply, error)

	// UpdateCustomerAppData adds abitrary or application specific information that you may want to tie to a customer.
	UpdateCustomerAppData(ctx context.Context, customer IsCustomer, appdata *Appdata) (*UpdateCustomerAppDataReply, error)

	// DeleteCustomerAppData removes a customers metadata.
	DeleteCustomerAppData(ctx context.Context, customer IsCustomer) (*UpdateCustomerAppDataReply, error)

	// UpdateCustomerActivity func
	UpdateCustomerActivity(ctx context.Context, customerNumber *CustomerNumber, channel *ActivityChannelNumber, sessionID, key string, properties map[string]string) (*CustomerActivityReply, error)

	// GetCustomerActivity func
	GetCustomerActivity(ctx context.Context, customerNumber *CustomerNumber, channelNumber *ActivityChannelNumber, sessionID string) (*CustomerActivityReply, error)

	// SendMessage transmits a message to a customer the message body can be of different types including text, location, media and template
	SendMessage(ctx context.Context, customer *CustomerNumber, channelNumber *MessagingChannelNumber, body IsOutBoundMessageBody) (*SendMessageReply, error)

	// SendMessageByTag transmits a message to customers with the given tag. The message body can be of different types including text, location, media and template
	SendMessageByTag(ctx context.Context, tag *Tag, channelNumber *MessagingChannelNumber, body IsOutBoundMessageBody) (*TagCommandReply, error)

	// ReplyToMessage transmits a message to a customer and creates a link of two way communication with a customer that can act as a conversation history. The message body can be of different types including text, location, media and template
	ReplyToMessage(ctx context.Context, customerID, messageID string, body IsOutBoundMessageBody) (*SendMessageReply, error)

	// MessagingConsent func
	UpdateMessagingConsent(ctx context.Context, customer *CustomerNumber, channelNumber *MessagingChannelNumber, action MessagingConsentUpdate) (*UpdateMessagingConsentReply, error)

	// InitiatePayment requires a wallet setup and involves the transfer of funds to a customer
	InitiatePayment(ctx context.Context, party *PaymentCounterParty, cash *Cash) (*InitiatePaymentReply, error)

	// NewCustomer func creates and Returns a customer instance for functionality consumable from a customer's perspective
	NewCustomer(params *CreateCustomer) *Customer

	// Disconnect closes the elarian connection
	Disconnect() error

	// InitializeNotificationStream starts listening for notifications if notifications are enabled
	InitializeNotificationStream() <-chan error

	// On registers an event to a notification handler
	On(event Notification, handler NotificationHandler)

	// ReceiveMessage is a simulator method that can be used to ReceiveMessage messages from a custom simulator
	ReceiveMessage(ctx context.Context, customerNumber string, channel *MessagingChannelNumber, sessionID string, parts []*InBoundMessageBody) (*SimulatorToServerCommandReply, error)

	// ReceivePayment is a simulator method that can be used to ReceivePayment messages from a custom simulator
	ReceivePayment(ctx context.Context, customerNumber, transactionID string, channel *PaymentChannelNumber, cash *Cash, paymentStatus PaymentStatus) (*SimulatorToServerCommandReply, error)

	// UpdatePaymentStatus is a simulator method that can be used to update a payment's status from a custom simulator
	UpdatePaymentStatus(ctx context.Context, transactionID string, paymentStatus PaymentStatus) (*SimulatorToServerCommandReply, error)
}

Elarian interface exposes high level consumable elarian functionality

func Connect

func Connect(options *Options, connectionOptions *ConnectionOptions) (Elarian, error)

Connect establishes a connection to elarian

func NewService

func NewService(options *Options, connectionOptions *ConnectionOptions) (Elarian, error)

NewService Creates a new Elarian service

type Email

type Email struct {
	Subject     string   `json:"subject,omitempty"`
	Body        string   `json:"body,omitempty"`
	HTML        string   `json:"html,omitempty"`
	CcList      []string `json:"ccList,omitempty"`
	BccList     []string `json:"bccList,omitempty"`
	Attachments []string `json:"attachments,omitempty"`
}

Email defines the email fields you can use as a message

type GenerateAuthTokenReply

type GenerateAuthTokenReply struct {
	LifeTime time.Duration `json:"lifeTime,omitempty"`
	Token    string        `json:"token,omitempty"`
}

GenerateAuthTokenReply struct

type InBoundMessageBody

type InBoundMessageBody struct {
	Text     string                   `json:"text,omitempty"`
	Media    *Media                   `json:"media,omitempty"`
	Location *Location                `json:"location,omitempty"`
	Template *Template                `json:"template,omitempty"`
	Ussd     *UssdSessionNotification `json:"ussd,omitempty"`
	Email    *Email                   `json:"email,omitempty"`
	Voice    *Voice                   `json:"voice,omitempty"`
}

InBoundMessageBody defines how the message body should look like Note all the options are optional and the construction of this struct depends on your needs.

type InitiatePaymentReply

type InitiatePaymentReply struct {
	CreditCustomerID string        `json:"creditCustomerID,omitempty"`
	DebitCustomerID  string        `json:"debitCustomerID,omitempty"`
	Description      string        `json:"description,omitempty"`
	Status           PaymentStatus `json:"status,omitempty"`
	TransactionID    string        `json:"transactionId,omitempty"`
}

InitiatePaymentReply struct

type IsCustomer

type IsCustomer interface {
	// contains filtered or unexported methods
}

IsCustomer interface denotes a customer identifier which can be an id, secondaryID or a customerNumber

type IsNotification

type IsNotification interface {
	// contains filtered or unexported methods
}

IsNotification defines one method notification() that all notifications implement. There are 18 types of notifications relating to messaging, payments and simulator. They are all declared below.

type IsOutBoundMessageBody

type IsOutBoundMessageBody interface {
	// contains filtered or unexported methods
}

IsOutBoundMessageBody interface

type IsPaymentParty added in v0.2.0

type IsPaymentParty interface {
	// contains filtered or unexported methods
}

IsPaymentParty is an interface implemented by a CustomerPaymentParty, WalletCounterParty, PurseCounterParty, ChannelCounterParty

type LeaseCustomerAppDataReply

type LeaseCustomerAppDataReply struct {
	Status      bool     `json:"status,omitempty"`
	Description string   `json:"description,omitempty"`
	CustomerID  string   `json:"customerId,omitempty"`
	Appdata     *Appdata `json:"appdata,omitempty"`
}

LeaseCustomerAppDataReply struct

type Location

type Location struct {
	Latitude  float64 `json:"latitude,omitempty"`
	Longitude float64 `json:"longitude,omitempty"`
	Label     string  `json:"label,omitempty"`
	Address   string  `json:"address,omitempty"`
}

Location defines a set of latitude and longitude that can be communicated as a message

type MakeVoiceCallSimulatorNotification

type MakeVoiceCallSimulatorNotification struct {
	OrgID         string                  `json:"orgId,omitempty"`
	SessionID     string                  `json:"sessionID,omitempty"`
	ChannelNumber *MessagingChannelNumber `json:"channelNumber,omitempty"`
}

MakeVoiceCallSimulatorNotification struct

type Media

type Media struct {
	URL  string    `json:"url,omitempty"`
	Type MediaType `json:"type,omitempty"`
}

Media defines the necessary attributes required to send a file as a message

type MediaType

type MediaType int32

MediaType int

const (
	MediaTypeUnspecified MediaType = iota
	MediaTypeImage
	MediaTypeAudio
	MediaTypeVideo
	MediaTypeDocument
	MediaTypeVoice
	MediaTypeSticker
	MediaTypeContact
)

MediaType constants

type MessageDeliveryStatus

type MessageDeliveryStatus int32

MessageDeliveryStatus int

const (
	MessageDeliveryStatusUnspecified              MessageDeliveryStatus = 0
	MessageDeliveryStatusQueued                   MessageDeliveryStatus = 100
	MessageDeliveryStatusSent                     MessageDeliveryStatus = 101
	MessageDeliveryStatusDelivered                MessageDeliveryStatus = 300
	MessageDeliveryStatusRead                     MessageDeliveryStatus = 301
	MessageDeliveryStatusReceived                 MessageDeliveryStatus = 302
	MessageDeliveryStatusSessionInitiated         MessageDeliveryStatus = 303
	MessageDeliveryStatusFailed                   MessageDeliveryStatus = 400
	MessageDeliveryStatusNoConsent                MessageDeliveryStatus = 401
	MessageDeliveryStatusNoCapability             MessageDeliveryStatus = 402
	MessageDeliveryStatusExpired                  MessageDeliveryStatus = 403
	MessageDeliveryStatusNoSessionInProgress      MessageDeliveryStatus = 404
	MessageDeliveryStatusOtherSessionInProgress   MessageDeliveryStatus = 405
	MessageDeliveryStatusInvalidReplyToken        MessageDeliveryStatus = 406
	MessageDeliveryStatusInvalidChannelNumber     MessageDeliveryStatus = 407
	MessageDeliveryStatusNotSupported             MessageDeliveryStatus = 408
	MessageDeliveryStatusInvalidReplyToMessageID  MessageDeliveryStatus = 409
	MessageDeliveryStatusInvalidCustomerID        MessageDeliveryStatus = 410
	MessageDeliveryStatusDuplicateRequest         MessageDeliveryStatus = 411
	MessageDeliveryStatusTagNotFound              MessageDeliveryStatus = 412
	MessageDeliveryStatusCustomerNumberNotFound   MessageDeliveryStatus = 413
	MessageDeliveryStatusDecommissionedCustomerid MessageDeliveryStatus = 414
	MessageDeliveryStatusRejected                 MessageDeliveryStatus = 415
	MessageDeliveryStatusInvalidRequest           MessageDeliveryStatus = 416
	MessageDeliveryStatusApplicationError         MessageDeliveryStatus = 501
)

MessageDeliveryStatus constants

type MessageReaction

type MessageReaction int32

MessageReaction Enum

const (
	MessageReactionUnspecified  MessageReaction = 0
	MessageReactionClicked      MessageReaction = 100
	MessageReactionUnsubscribed MessageReaction = 200
	MessageReactionComplained   MessageReaction = 201
)

MesageReaction constants

type MessageSessionEndedNotification

type MessageSessionEndedNotification struct {
	Duration       time.Duration             `json:"duration,omitempty"`
	Reason         MessagingSessionEndReason `json:"reason,omitempty"`
	CustomerNumber *CustomerNumber           `json:"customerNumber,omitempty"`
	ChannelNumber  *MessagingChannelNumber   `json:"channelNumber,omitempty"`
	SessionID      string                    `json:"SessionID,omitempty"`
}

MessageSessionEndedNotification struct

type MessageSessionRenewedNotification

type MessageSessionRenewedNotification struct {
	Expiration     int64                   `json:"expiration,omitempty"`
	CustomerNumber *CustomerNumber         `json:"customerNumber,omitempty"`
	ChannelNumber  *MessagingChannelNumber `json:"channelNumber,omitempty"`
	SessionID      string                  `json:"SessionID,omitempty"`
}

MessageSessionRenewedNotification struct

type MessageSessionStartedNotification

type MessageSessionStartedNotification struct {
	CustomerNumber *CustomerNumber         `json:"customerNumber,omitempty"`
	ChannelNumber  *MessagingChannelNumber `json:"channelNumber,omitempty"`
	SessionID      string                  `json:"SessionID,omitempty"`
	Expiration     int64                   `json:"expiration,omitempty"`
}

MessageSessionStartedNotification struct

type MessageStatusNotification

type MessageStatusNotification struct {
	CustomerID string                `json:"customerId,omitempty"`
	Status     MessageDeliveryStatus `json:"status,omitempty"`
	MessageID  string                `json:"messageId,omitempty"`
}

MessageStatusNotification defines a structure for a message status. When a message is sent a message delivery status event is emitted. This is send to the SDK as a notification.

type MessagingChannel

type MessagingChannel int32

MessagingChannel is an enum

const (
	MessagingChannelUnspecified MessagingChannel = iota
	MessagingChannelSms
	MessagingChannelVoice
	MessagingChannelUssd
	MessagingChannelFBMessanger
	MessagingChannelTelegram
	MessagingChannelWhatsapp
	MessagingChannelEmail
)

MessagingChannel constants

type MessagingChannelNumber

type MessagingChannelNumber struct {
	Number  string           `json:"number,omitempty"`
	Channel MessagingChannel `json:"channel,omitempty"`
}

MessagingChannelNumber struct

type MessagingConsentUpdate

type MessagingConsentUpdate int32

MessagingConsentUpdate Enum

const (
	MessagingConsentUpdateUnspecified MessagingConsentUpdate = iota
	MessagingConsentUpdateAllow
	MessagingConsentUpdateBlock
)

MessagingConsent Enums

type MessagingConsentUpdateNotification

type MessagingConsentUpdateNotification struct {
	CustomerID     string                       `json:"customerId,omitempty"`
	CustomerNumber *CustomerNumber              `json:"customerNumber,omitempty"`
	ChannelNumber  *MessagingChannelNumber      `json:"channelNumber,omitempty"`
	Status         MessagingConsentUpdateStatus `json:"status,omitempty"`
}

MessagingConsentUpdateNotification struct

type MessagingConsentUpdateStatus

type MessagingConsentUpdateStatus int32

MessagingConsentUpdateStatus int

const (
	MessagingConsentStatusUnspecified              MessagingConsentUpdateStatus = 0
	MessagingConsentStatusQueued                   MessagingConsentUpdateStatus = 100
	MessagingConsentStatusCompleted                MessagingConsentUpdateStatus = 300
	MessagingConsentStatusInvalidChannelNumber     MessagingConsentUpdateStatus = 401
	MessagingConsentStatusDecommissionedCustomerID MessagingConsentUpdateStatus = 402
	MessagingConsentStatusApplicationError         MessagingConsentUpdateStatus = 501
)

MessagingConsentStatus constants

type MessagingSessionEndReason

type MessagingSessionEndReason int32

MessagingSessionEndReason enum

const (
	MessagingSessionEndReasonUnspecified    MessagingSessionEndReason = 0
	MessagingSessionEndReasonNormalClearing MessagingSessionEndReason = 100
	MessagingSessionEndReasonInactivity     MessagingSessionEndReason = 200
	MessagingSessionEndReasonFailure        MessagingSessionEndReason = 300
)

MessagingSessionEndReason constants

type MessagingSessionStatus

type MessagingSessionStatus int32

MessagingSessionStatus int

const (
	MessagingSessionStatusnUnspecified MessagingSessionStatus = 0
	MessagingSessionStatusnActive      MessagingSessionStatus = 100
	MessagingSessionStatusnExpired     MessagingSessionStatus = 200
)

MessagingSessionStatus constants

type Metadata

type Metadata struct {
	Key        string `json:"key,omitempty"`
	Value      string `json:"value,omitempty"`
	BytesValue []byte `json:"bytesValue,omitempty"`
}

Metadata defines a customer's metadata oneOf value of bytes value should be provided

type Notification

type Notification int32

Notification is a constant that encapsulates all kinds of notifications you can listen for. Its the first argument in the On method defined by the service.

const (
	ElarianReminderNotification Notification = iota
	ElarianMessageStatusNotification
	ElarianMessagingSessionStartedNotification
	ElarianMessagingSessionRenewedNotification
	ElarianMessagingSessionEndedNotification
	ElarianMessagingConsentUpdateNotification
	ElarianReceivedEmailNotification
	ElarianReceivedUssdSessionNotification
	ElarianReceivedVoiceCallNotification
	ElarianReceivedSmsNotification
	ElarianReceivedFbMessengerNotification
	ElarianReceivedTelegramNotification
	ElarianReceivedWhatsappNotification
	ElarianSentMessageReactionNotification
	ElarianReceivedPaymentNotification
	ElarianPaymentStatusNotification
	ElarianWalletPaymentStatusNotification
	ElarianCustomerActivityNotification
	ElarianPaymentPurseNotifiication
	ElarianSendChannelPaymentSimulatorNotification
	ElarianCheckoutPaymentSimulatorNotification
	ElarianSendCustomerPaymentSimulatorNotification
	ElarianMakeVoiceCallSimulatorNotification
	ElarianSendMessageSimulatorNotification
)

Notification constants

type NotificationCallBack

type NotificationCallBack func(message IsOutBoundMessageBody, appData *Appdata)

NotificationCallBack is part of the notification handler and should be called after a notification has been handled. It takes in a message or appData and both can be nil. These are sent back to elarian. if you the callback is not called in 15 seconds an empty reply is sent back to elarian.

type NotificationHandler

type NotificationHandler func(service Elarian, notification IsNotification, appData *Appdata, customer *Customer, cb NotificationCallBack)

NotificationHandler type is a handler function for all notifications. it provides the service, the notification, appdata, customer and the callback handler defined above.

type NotificationPaymentStatus

type NotificationPaymentStatus struct {
	TransactionID string        `json:"transactionId,omitempty"`
	Status        PaymentStatus `json:"status,omitempty"`
}

NotificationPaymentStatus defines a structure for a payment status it has a transaction id and a status which is of type payment status

type NumberProvider

type NumberProvider int32

NumberProvider is an enum that defines a type of customer number provider. it could be a telco, facebook, telegram or unspecified

const (
	CustomerNumberProviderUnspecified NumberProvider = iota
	CustomerNumberProviderFacebook
	CustomerNumberProviderCellular
	CustomerNumberProviderTelegram
)

CustomerNumberProvider Enums

type Options

type Options struct {
	OrgID              string `json:"orgId,omitempty"`
	AppID              string `json:"appId,omitempty"`
	APIKey             string `json:"apiKey,omitempty"`
	AuthToken          string `json:"authToken,omitempty"`
	IsSimulator        bool   `json:"isSimulator,omitempty"`
	AllowNotifications bool   `json:"allowNotifications,omitempty"`
	Log                bool   `json:"log,omitempty"`
}

Options Elarain initialization options

type OutBoundMessage

type OutBoundMessage struct {
	Body        *OutBoundMessageBody        `json:"body,omitempty"`
	Labels      []string                    `json:"labels,omitempty"`
	ProviderTag string                      `json:"providerTag,omitempty"`
	ReplyToken  string                      `json:"replyToken,omitempty"`
	ReplyPrompt *OutboundMessageReplyPrompt `json:"replyPrompt,omitempty"`
}

OutBoundMessage struct

type OutBoundMessageBody

type OutBoundMessageBody struct {
	Entry IsOutBoundMessageBody `json:"entry,omitempty"`
}

OutBoundMessageBody defines how the message body should look like Note all the options are optional and the construction of this struct depends on your needs.

type OutboundMessageReplyPrompt

type OutboundMessageReplyPrompt struct {
	Action PromptMessageReplyAction     `json:"action,omitempty"`
	Menu   []*PromptMessageMenuItemBody `json:"menu,omitempty"`
}

OutboundMessageReplyPrompt struct

type PaymentChannel

type PaymentChannel int32

PaymentChannel type

const (
	PaymentChannelUnspecified PaymentChannel = iota
	PaymentChannelCellular
)

PaymentChannel constants

type PaymentChannelNumber

type PaymentChannelNumber struct {
	Number  string         `json:"number,omitempty"`
	Channel PaymentChannel `json:"channel,omitempty"`
}

PaymentChannelNumber defines a payment channel number

type PaymentCounterParty added in v0.2.0

type PaymentCounterParty struct {
	CreditParty IsPaymentParty `json:"creditparty,omitempty"`
	DebitParty  IsPaymentParty `json:"debitparty,omitempty"`
}

PaymentCounterParty defines arguments required to make a payment request

type PaymentParty

type PaymentParty struct {
	CustomerCounterParty *CustomerPaymentParty `json:"CustomerCounterParty,omitempty"`
	WalletCounterParty   *Wallet               `json:"walletCounterParty,omitempty"`
	PurseCounterParty    *Purse                `json:"purseCounterParty,omitempty"`
	ChannelCounterParty  *ChannelCounterParty  `json:"channelCounterParty,omitempty"`
}

PaymentParty struct

type PaymentStatus

type PaymentStatus int32

PaymentStatus type

const (
	PaymentStatusUnspecified              PaymentStatus = 0
	PaymentStatusQueued                   PaymentStatus = 100
	PaymentStatusPendingConfirmation      PaymentStatus = 101
	PaymentStatusPendingValidation        PaymentStatus = 102
	PaymentStatusValidated                PaymentStatus = 103
	PaymentStatusInvalidRequest           PaymentStatus = 200
	PaymentStatusNotSupported             PaymentStatus = 201
	PaymentStatusInsufficientFunds        PaymentStatus = 202
	PaymentStatusApplicationError         PaymentStatus = 203
	PaymentStatusNotAllowed               PaymentStatus = 204
	PaymentStatusDuplicateRequest         PaymentStatus = 205
	PaymentStatusInvalidPurse             PaymentStatus = 206
	PaymentStatusInvalidWallet            PaymentStatus = 207
	PaymentStatusDecommissionedCustomerID PaymentStatus = 299
	PaymentStatusSuccess                  PaymentStatus = 300
	PaymentStatusPassThrough              PaymentStatus = 301
	PaymentStatusFailed                   PaymentStatus = 400
	PaymentStatusThrottled                PaymentStatus = 401
	PaymentStatusExpired                  PaymentStatus = 402
	PaymentStatusRejected                 PaymentStatus = 403
	PaymentStatusReversed                 PaymentStatus = 500
)

PaymentStatus constants

type PaymentStatusNotification

type PaymentStatusNotification struct {
	TransactionID string        `json:"transactionId,omitempty"`
	Status        PaymentStatus `json:"status,omitempty"`
}

PaymentStatusNotification struct

type Prompt

type Prompt struct {
	Play *VoiceCallActionPlay `json:"voiceCallActionPlay,omitempty"`
	Say  *VoiceCallActionSay  `json:"voiceCallActionSay,omitempty"`
}

Prompt struct

type PromptMessageMenuItemBody

type PromptMessageMenuItemBody struct {
	Text  string `json:"text,omitempty"`
	Media *Media `json:"media,omitempty"`
}

PromptMessageMenuItemBody struct

type PromptMessageReplyAction

type PromptMessageReplyAction int32

PromptMessageReplyAction enum

const (
	PromptMessageReplyActionUnspecified PromptMessageReplyAction = iota
	PromptMessageReplyActionText
	PromptMessageReplyActionPhoneNumber
	PromptMessageReplyActionEmail
	PromptMessageReplyActionLocation
	PromptMessageReplyActionURL
)

PromptMessageReply constants

type Purse

type Purse struct {
	PurseID string `json:"purseId,omitempty"`
}

Purse struct

type PurseNotification

type PurseNotification struct {
	OrgID         string                     `json:"orgId,omitempty"`
	AppID         string                     `json:"appId,omitempty"`
	CreatedAt     time.Time                  `json:"createdAt,omitempty"`
	PurseID       string                     `json:"purseId,omitempty"`
	PaymentStatus *NotificationPaymentStatus `json:"paymentStatus,omitempty"`
}

PurseNotification defines a structure for a purse notification. A purse notification is generated in context of a purse and has a purse ID and a paymentStatus. other fields include an OrgID, AppID and a CreatedAt

type ReceivedPaymentNotification

type ReceivedPaymentNotification struct {
	CustomerNumber *CustomerNumber       `json:"customerNumber,omitempty"`
	ChannelNumber  *PaymentChannelNumber `json:"channelNumber,omitempty"`
	PurseID        string                `json:"purseId,omitempty"`
	TransactionID  string                `json:"transactionId,omitempty"`
	Value          *Cash                 `json:"value,omitempty"`
	Status         PaymentStatus         `json:"status,omitempty"`
}

ReceivedPaymentNotification struct

type RecievedMessageNotification

type RecievedMessageNotification struct {
	MessageID      string                  `json:"messageId,omitempty"`
	SessionID      string                  `json:"sessionId,omitempty"`
	InReplyTo      string                  `json:"inReplyTo,omitempty"`
	Parts          []*InBoundMessageBody   `json:"parts,omitempty"`
	CustomerNumber *CustomerNumber         `json:"customerNumber,omitempty"`
	ChannelNumber  *MessagingChannelNumber `json:"channelNumber,omitempty"`
}

RecievedMessageNotification struct

type Reminder

type Reminder struct {
	Interval time.Duration `json:"interval,omitempty"`
	Key      string        `json:"key,omitempty"`
	Payload  string        `json:"payload,omitempty"`
	RemindAt time.Time     `json:"expiration,omitempty"`
}

Reminder defines the composition of a reminder. The key is an identifier property. The payload is also a string.

type ReminderNotification

type ReminderNotification struct {
	Reminder *Reminder `json:"reminder,omitempty"`
	WorkID   string    `json:"workId,omitempty"`
	Tag      *Tag      `json:"tag,omitempty"`
}

ReminderNotification struct

type SecondaryID

type SecondaryID struct {
	Key        string    `json:"key,omitempty"`
	Value      string    `json:"value,omitempty"`
	Expiration time.Time `json:"expiration,omitempty"`
}

SecondaryID refers to an identifier that can be used on a customer that is unique to a customer and that is provided by you and not the elarian service

type SendChannelPaymentSimulatorNotification

type SendChannelPaymentSimulatorNotification struct {
	OrgID         string                `json:"orgId,omitempty"`
	AppID         string                `json:"appId,omitempty"`
	TransactionID string                `json:"transactionId,omitempty"`
	Account       string                `json:"account,omitempty"`
	DebitParty    *PaymentParty         `json:"debitPart,omitempty"`
	ChannelNumber *PaymentChannelNumber `json:"channelNumber,omitempty"`
	Value         *Cash                 `json:"value,omitempty"`
}

SendChannelPaymentSimulatorNotification struct

type SendCustomerPaymentSimulatorNotification

type SendCustomerPaymentSimulatorNotification struct {
	OrgID         string                `json:"orgId,omitempty"`
	AppID         string                `json:"appId,omitempty"`
	TransactionID string                `json:"transactionId,omitempty"`
	DebitParty    *PaymentParty         `json:"creditParty,omitempty"`
	ChannelNumber *PaymentChannelNumber `json:"channelNumber,omitempty"`
	Value         *Cash                 `json:"value,omitempty"`
}

SendCustomerPaymentSimulatorNotification struct

type SendMessageReply

type SendMessageReply struct {
	CustomerID  string                `json:"customerId,omitempty"`
	Description string                `json:"description,omitempty"`
	MessageID   string                `json:"messageId,omitempty"`
	SessionID   string                `json:"sessionId,omitempty"`
	Status      MessageDeliveryStatus `json:"status,omitempty"`
}

SendMessageReply struct

type SendMessageSimulatorNotification

type SendMessageSimulatorNotification struct {
	OrgID         string                  `json:"orgId,omitempty"`
	MessageID     string                  `json:"messageId,omitempty"`
	Message       *OutBoundMessage        `json:"message,omitempty"`
	ChannelNumber *MessagingChannelNumber `json:"channelNumber,omitempty"`
}

SendMessageSimulatorNotification struct

type SentMessageReaction

type SentMessageReaction struct {
	CustomerNumber *CustomerNumber         `json:"customerNumber,omitempty"`
	ChannelNumber  *MessagingChannelNumber `json:"channelNumber,omitempty"`
	MessageID      string                  `json:"messageId,omitempty"`
	Reaction       MessageReaction         `json:"MessageReaction,omitempty"`
}

SentMessageReaction struct

type SimulatorToServerCommandReply

type SimulatorToServerCommandReply struct {
	Status      bool             `json:"status,omitempty"`
	Message     *OutBoundMessage `json:"message,omitempty"`
	Description string           `json:"description,omitempty"`
}

SimulatorToServerCommandReply struct

type StringDataValue

type StringDataValue string

StringDataValue implements the DataValue interface represents a string

func (StringDataValue) Bytes

func (s StringDataValue) Bytes() []byte

Bytes method returns a string an array of bytes

func (StringDataValue) String

func (s StringDataValue) String() string

type Tag

type Tag struct {
	Key        string    `json:"key,omitempty"`
	Value      string    `json:"value,omitempty"`
	Expiration time.Time `json:"expiration,omitempty"`
}

Tag defines a customer tag

type TagCommandReply

type TagCommandReply struct {
	Status      bool   `json:"status,omitempty"`
	Description string `json:"description,omitempty"`
	WorkID      string `json:"workId,omitempty"`
}

TagCommandReply struct

type Template

type Template struct {
	ID     string            `json:"name,omitempty"`
	Params map[string]string `json:"params,omitempty"`
}

Template This refers to a predefined template for your message, the name of the template is used as the identifier and the params should be added in their logical order

type TextMessage

type TextMessage string

TextMessage implements the IsOutBoundMessageBody interface

type TextToSpeechVoice

type TextToSpeechVoice int32

TextToSpeechVoice int

const (
	TextToSpeechVoiceUnspecified TextToSpeechVoice = 0
	TextToSpeechVoiceMale        TextToSpeechVoice = 1
	TextToSpeechVoiceFemale      TextToSpeechVoice = 2
)

TextToSpeechVoice

type URLMessage

type URLMessage string

URLMessage implements the IsOutBoundMessageBody interface

type UpdateCustomerAppDataReply

type UpdateCustomerAppDataReply struct {
	Status      bool   `json:"status,omitempty"`
	Description string `json:"description,omitempty"`
	CustomerID  string `json:"customerId,omitempty"`
}

UpdateCustomerAppDataReply struct

type UpdateCustomerStateReply

type UpdateCustomerStateReply struct {
	Status      bool   `json:"status,omitempty"`
	Description string `json:"description,omitempty"`
	CustomerID  string `json:"customerId,omitempty"`
}

UpdateCustomerStateReply struct

type UpdateMessagingConsentReply

type UpdateMessagingConsentReply struct {
	Status      MessagingConsentUpdateStatus `json:"status,omitempty"`
	Description string                       `json:"description,omitempty"`
	CustomerID  string                       `json:"customerId,omitempty"`
}

UpdateMessagingConsentReply struct

type UssdChannel

type UssdChannel int32

UssdChannel type

type UssdChannelNumber

type UssdChannelNumber struct {
	Channel UssdChannel `json:"channel,omitempty"`
	Number  string      `json:"number,omitempty"`
}

UssdChannelNumber struct

type UssdMenu

type UssdMenu struct {
	IsTerminal bool   `json:"isTerminal,omitempty"`
	Text       string `json:"text,omitempty"`
}

UssdMenu struct

type UssdOptions

type UssdOptions struct {
	SessionID string    `json:"sessionId,omitempty"`
	UssdMenu  *UssdMenu `json:"UssdMenu,omitempty"`
}

UssdOptions struct

type UssdSessionNotification

type UssdSessionNotification struct {
	SessionID string `json:"sessionId,omitempty"`
	Input     string `json:"input,omitempty"`
}

UssdSessionNotification struct

type Voice

type Voice struct {
	Direction    CustomerEventDirection `json:"direction,omitempty"`
	Status       VoiceCallStatus        `json:"status,omitempty"`
	StartedAt    time.Time              `json:"startedAt,omitempty"`
	HangupCase   VoiceCallHangupCause   `json:"hangupCase,omitempty"`
	DtmfDigits   string                 `json:"dtmfDigits,omitempty"`
	RecordingURL string                 `json:"recordingUrl,omitempty"`
	DailData     *VoiceCallDailInput    `json:"dailData,omitempty"`
	QueueData    *VoiceCallQueueInput   `json:"queueData,omitempty"`
}

Voice struct

type VoiceAction

type VoiceAction interface {
	// contains filtered or unexported methods
}

VoiceAction interface

type VoiceCallActionDail

type VoiceCallActionDail struct {
	CallerID        string            `json:"callerId,omitempty"`
	MaxDuration     int32             `json:"maxDuration,omitempty"`
	Record          bool              `json:"record,omitempty"`
	RingBackTone    string            `json:"ringBackTone,omitempty"`
	Sequential      bool              `json:"sequential,omitempty"`
	CustomerNumbers []*CustomerNumber `json:"customerNumbers,omitempty"`
}

VoiceCallActionDail struct

type VoiceCallActionDequeue

type VoiceCallActionDequeue struct {
	Channel   VoiceChannelNumber `json:"channel,omitempty"`
	QueueName string             `json:"queueName,omitempty"`
	Record    bool               `json:"record,omitempty"`
}

VoiceCallActionDequeue struct

type VoiceCallActionEnqueue

type VoiceCallActionEnqueue struct {
	HoldMusic string `json:"holdMusic,omitempty"`
	QueueName string `json:"queueName,omitempty"`
}

VoiceCallActionEnqueue struct

type VoiceCallActionGetDigits

type VoiceCallActionGetDigits struct {
	FinishOnKey string        `json:"finishOnKey,omitempty"`
	NumDigits   int32         `json:"numDigits,omitempty"`
	Timeout     time.Duration `json:"timeout,omitempty"`
	Prompt      *Prompt       `json:"prompt,omitempty"`
}

VoiceCallActionGetDigits struct

type VoiceCallActionGetRecording

type VoiceCallActionGetRecording struct {
	FinishOnKey string        `json:"finishOnKey,omitempty"`
	MaxLength   time.Duration `json:"maxLength,omitempty"`
	PlayBeep    bool          `json:"playBeep,omitempty"`
	Timeout     time.Duration `json:"timeout,omitempty"`
	TrimSilence bool          `json:"trimSilence,omitempty"`
	Prompt      *Prompt       `json:"prompt,omitempty"`
}

VoiceCallActionGetRecording struct

type VoiceCallActionPlay

type VoiceCallActionPlay struct {
	URL string `json:"url,omitempty"`
}

VoiceCallActionPlay struct

type VoiceCallActionRecordSession

type VoiceCallActionRecordSession struct{}

VoiceCallActionRecordSession struct

type VoiceCallActionRedirect

type VoiceCallActionRedirect struct {
	URL string `json:"url,omitempty"`
}

VoiceCallActionRedirect struct

type VoiceCallActionReject

type VoiceCallActionReject struct{}

VoiceCallActionReject struct

type VoiceCallActionSay

type VoiceCallActionSay struct {
	PlayBeep          bool              `json:"playBeep,omitempty"`
	Text              string            `json:"text,omitempty"`
	TextToSpeechVoice TextToSpeechVoice `json:"textToSpeechVoice,omitempty"`
}

VoiceCallActionSay struct

type VoiceCallActions

type VoiceCallActions []VoiceAction

VoiceCallActions implements the IsOutBoundMessageBody interface

type VoiceCallDailInput

type VoiceCallDailInput struct {
	DestinationNumber string        `json:"destinationNumber,omitempty"`
	Duration          time.Duration `json:"duration,omitempty"`
	StartedAt         time.Time     `json:"startedAt,omitempty"`
}

VoiceCallDailInput struct

type VoiceCallHangupCause

type VoiceCallHangupCause int32

VoiceCallHangupCause int

const (
	VoiceCallHangupCauseUnspecified            VoiceCallHangupCause = 0
	VoiceCallHangupCauseUnallocatedNumber      VoiceCallHangupCause = 1
	VoiceCallHangupCauseUserBusy               VoiceCallHangupCause = 17
	VoiceCallHangupCauseNormalClearing         VoiceCallHangupCause = 16
	VoiceCallHangupCauseNoUserResponse         VoiceCallHangupCause = 18
	VoiceCallHangupCauseNoAnswer               VoiceCallHangupCause = 19
	VoiceCallHangupCauseSubscriberAbsent       VoiceCallHangupCause = 20
	VoiceCallHangupCauseCallRejected           VoiceCallHangupCause = 21
	VoiceCallHangupCauseNormalUnspecified      VoiceCallHangupCause = 31
	VoiceCallHangupCauseNormalTemporaryFailure VoiceCallHangupCause = 41
	VoiceCallHangupCauseServiceUnavailable     VoiceCallHangupCause = 63
	VoiceCallHangupCauseRecoveryOnTimerExpire  VoiceCallHangupCause = 102
	VoiceCallHangupCauseOriginatorCancel       VoiceCallHangupCause = 487
	VoiceCallHangupCauseLoseRace               VoiceCallHangupCause = 502
	VoiceCallHangupCauseUserNotRegistered      VoiceCallHangupCause = 606
)

VoiceCallHangupCause constants

type VoiceCallNotification

type VoiceCallNotification struct {
	Direction    CustomerEventDirection `json:"direction,omitempty"`
	Status       VoiceCallStatus        `json:"status,omitempty"`
	StartedAt    time.Time              `json:"startedAt,omitempty"`
	HangupCase   VoiceCallHangupCause   `json:"hangupCase,omitempty"`
	DtmfDigits   string                 `json:"dtmfDigits,omitempty"`
	RecordingURL string                 `json:"recordingUrl,omitempty"`
	DailData     *VoiceCallDailInput    `json:"dailData,omitempty"`
	QueueData    *VoiceCallQueueInput   `json:"queueData,omitempty"`
}

VoiceCallNotification struct

type VoiceCallQueueInput

type VoiceCallQueueInput struct {
	DequeuedAt          time.Time     `json:"dequeuedAt,omitempty"`
	DequeuedToNumber    string        `json:"dequeuedToNumber,omitempty"`
	DequeuedToSessionID string        `json:"dequeuedToSessionId,omitempty"`
	EnqueuedAt          time.Time     `json:"enqueuedAt,omitempty"`
	QueueDuration       time.Duration `json:"queueDuration,omitempty"`
}

VoiceCallQueueInput struct

type VoiceCallStatus

type VoiceCallStatus int32

VoiceCallStatus int

const (
	VoiceCallStatusUnspecified              VoiceCallStatus = 0
	VoiceCallStatusQueued                   VoiceCallStatus = 100
	VoiceCallStatusAnswered                 VoiceCallStatus = 101
	VoiceCallStatusRinging                  VoiceCallStatus = 102
	VoiceCallStatusActive                   VoiceCallStatus = 200
	VoiceCallStatusDialing                  VoiceCallStatus = 201
	VoiceCallStatusDialCompleted            VoiceCallStatus = 202
	VoiceCallStatusBridged                  VoiceCallStatus = 203
	VoiceCallStatusEnqueued                 VoiceCallStatus = 204
	VoiceCallStatusDequeued                 VoiceCallStatus = 205
	VoiceCallStatusTransferred              VoiceCallStatus = 206
	VoiceCallStatusTransferCompleted        VoiceCallStatus = 207
	VoiceCallStatusCompleted                VoiceCallStatus = 300
	VoiceCallStatusInsufficientCredit       VoiceCallStatus = 400
	VoiceCallStatusNotAnswered              VoiceCallStatus = 401
	VoiceCallStatusInvalidPhoneNumber       VoiceCallStatus = 402
	VoiceCallStatusDestinationNotSupported  VoiceCallStatus = 403
	VoiceCallStatusDecommissionedCustomerid VoiceCallStatus = 404
	VoiceCallStatusExpired                  VoiceCallStatus = 405
	VoiceCallStatusInvalidChannelNumber     VoiceCallStatus = 406
	VoiceCallStatusApplicationError         VoiceCallStatus = 501
)

VoiceCallStatus constants

type VoiceChannel

type VoiceChannel int32

VoiceChannel type

const (
	VoiceChannelUnspecified VoiceChannel = iota
	VoiceChannelTelco
)

VoiceChannel constants

type VoiceChannelNumber

type VoiceChannelNumber struct {
	Channel VoiceChannel `json:"channel,omitempty"`
	Number  string       `json:"number,omitempty"`
}

VoiceChannelNumber struct

type Wallet

type Wallet struct {
	CustomerID string `json:"customerId,omitempty"`
	WalletID   string `json:"walletId,omitempty"`
}

Wallet struct

type WalletPaymentStatusNotification

type WalletPaymentStatusNotification struct {
	CustomerID    string        `json:"customerId,omitempty"`
	TransactionID string        `json:"transactionId,omitempty"`
	WalletID      string        `json:"walletId,omitempty"`
	Status        PaymentStatus `json:"status,omitempty"`
}

WalletPaymentStatusNotification struct

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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