Documentation ¶
Index ¶
- type AccessToken
- type CallbackData
- type EMailMessage
- type Email
- type Feedback
- type FeedbackInput
- type FirebaseAPNSConfig
- type FirebaseAndroidConfig
- type FirebaseSimpleNotification
- type FirebaseWebpushConfig
- type GenerateRetryOTP
- type MailgunEvent
- type MailgunEventOutput
- type Message
- type Msisdn
- type NPSInput
- type NPSResponse
- type NotificationEnvelope
- type OKResp
- type OTP
- type OutgoingEmailsLog
- type Recipient
- type RetrieveUserProfileInput
- type Room
- type SMS
- type SMSPayload
- type SavedNotification
- type SendMessageResponse
- type SendSMSPayload
- type TemporaryPIN
- type UIDPayload
- type VerifyOTP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type AccessToken struct { JWT string `json:"jwt,omitempty"` UniqueName string `json:"uniqueName,omitempty"` SID string `json:"sid,omitempty"` DateUpdated time.Time `json:"dateUpdated,omitempty"` Status string `json:"status,omitempty"` Type string `json:"type,omitempty"` MaxParticipants int `json:"maxParticipants,omitempty"` Duration *int `json:"duration,omitempty"` }
AccessToken is used to return the results of requesting an access token.
In addition to the JWT, this includes the details that are needed in order to connect to the room on the client side
type CallbackData ¶
type CallbackData struct {
Values map[string][]string `json:"values,omitempty" firestore:"values,omitempty"`
}
CallbackData records data sent back from the Twilio API to our HTTP callback URL
type EMailMessage ¶
type EMailMessage struct { Subject string `json:"subject,omitempty"` Text string `json:"text,omitempty"` To []string `json:"to,omitempty"` }
EMailMessage holds data required to send emails
type Email ¶ added in v0.0.36
type Email struct {
Email string `json:"email"`
}
Email is an input struct for a user's email
type Feedback ¶
type Feedback struct { Question string `json:"question" firestore:"question"` Answer string `json:"answer" firestore:"answer"` }
Feedback is reason a user gave a certain NPS score Its stored as question answer in plain text
type FeedbackInput ¶
type FeedbackInput struct { Question string `json:"question" firestore:"question"` Answer string `json:"answer" firestore:"answer"` }
FeedbackInput is reason a user gave a certain NPS score Its stored as question answer in plain text
type FirebaseAPNSConfig ¶
type FirebaseAPNSConfig struct {
Headers map[string]interface{} `json:"headers"`
}
FirebaseAPNSConfig is a mirror of Firebase messaging.APNSConfig
type FirebaseAndroidConfig ¶
type FirebaseAndroidConfig struct { Priority string `json:"priority"` // one of "normal" or "high" CollapseKey *string `json:"collapseKey"` RestrictedPackageName *string `json:"restrictedPackageName"` Data map[string]interface{} `json:"data"` // if specified, overrides the Data field on Message type }
FirebaseAndroidConfig is a mirror of Firebase messaging.AndroidConfig
type FirebaseSimpleNotification ¶
type FirebaseSimpleNotification struct { Title string `json:"title"` Body string `json:"body"` ImageURL *string `json:"imageURL"` Data map[string]interface{} `json:"data"` }
FirebaseSimpleNotification is used to serialize simple FCM notification. It is a mirror of Firebase messaging.Notification
type FirebaseWebpushConfig ¶
type FirebaseWebpushConfig struct { Headers map[string]interface{} `json:"headers"` Data map[string]interface{} `json:"data"` }
FirebaseWebpushConfig is a mirror of Firebase messaging.WebpushConfig
type GenerateRetryOTP ¶
type GenerateRetryOTP struct { Msisdn *string `json:"msisdn"` RetryStep int `json:"retryStep"` AppID *string `json:"appId"` }
GenerateRetryOTP is an input struct for generating and sending fallback otp
type MailgunEvent ¶
type MailgunEvent struct { EventName string `json:"event" firestore:"event"` DeliveredOn string `json:"timestamp" firestore:"deliveredOn"` // MessageID is a unique identifier of mailgun's message MessageID string `json:"message-id" firestore:"messageID"` }
MailgunEvent represents mailgun event input e.g delivered, rejected etc
type MailgunEventOutput ¶
type MailgunEventOutput struct { // EventName is the name of every event that happens to your emails e.g delivered, rejected etc EventName string `json:"event" firestore:"event"` DeliveredOn time.Time `json:"timestamp" firestore:"deliveredOn"` }
MailgunEventOutput represents the MailGun's event name and delivery time in standardized time since mailgun gives us time as unixtimestamp
type Message ¶
type Message struct { ID string `json:"id" firestore:"id"` AccountSID string `json:"account_sid" firestore:"account_sid"` APIVersion string `json:"api_version" firestore:"api_version"` Body string `json:"body" firestore:"body"` DateCreated string `json:"date_created" firestore:"date_created"` DateSent string `json:"date_sent" firestore:"date_sent"` DateUpdated string `json:"date_updated" firestore:"date_updated"` Direction string `json:"direction" firestore:"direction"` ErrorCode *string `json:"error_code" firestore:"error_code"` ErrorMessage *string `json:"error_message" firestore:"error_message"` From string `json:"from" firestore:"from"` MessagingServiceSID string `json:"messaging_service_sid" firestore:"messaging_service_sid"` NumMedia string `json:"num_media" firestore:"num_media"` NumSegments string `json:"num_segments" firestore:"num_segments"` Price *string `json:"price" firestore:"price"` PriceUnit *string `json:"price_unit" firestore:"price_unit"` SID string `json:"sid" firestore:"sid"` Status string `json:"status" firestore:"status"` SubresourceURLs map[string]string `json:"subresource_uris" firestore:"subresource_uris"` To string `json:"to" firestore:"to"` URI string `json:"uri" firestore:"uri"` }
Message is a Twilio WhatsApp or SMS message
func (*Message) GetID ¶
func (c *Message) GetID() firebasetools.ID
GetID returns the struct's ID value
type NPSInput ¶
type NPSInput struct { Name string `json:"name"` Score int `json:"score"` SladeCode string `json:"sladeCode"` Email *string `json:"email"` PhoneNumber *string `json:"phoneNumber"` Feedback []*FeedbackInput `json:"feedback"` }
NPSInput is the input for a survey
type NPSResponse ¶
type NPSResponse struct { ID string `json:"id" firestore:"id"` Name string `json:"name" firestore:"name"` Score int `json:"score" firestore:"score"` SladeCode string `json:"sladeCode" firestore:"sladeCode"` Email *string `json:"email" firestore:"email"` MSISDN *string `json:"msisdn" firestore:"msisdn"` Feedback []Feedback `json:"feedback" firestore:"feedback"` Timestamp time.Time `json:"timestamp,omitempty" firestore:"timestamp,omitempty"` }
NPSResponse represents a single user feedback
func (*NPSResponse) GetID ¶
func (e *NPSResponse) GetID() firebasetools.ID
GetID returns the struct's ID value
func (*NPSResponse) IsNode ¶
func (e *NPSResponse) IsNode()
IsNode is a "label" that marks this struct (and those that embed it) as implementations of the "Base" interface defined in our GraphQL schema.
type NotificationEnvelope ¶
type NotificationEnvelope struct { UID string `json:"uid"` Flavour feedlib.Flavour `json:"flavour"` Payload []byte `json:"payload"` Metadata map[string]interface{} `json:"metadata"` }
NotificationEnvelope is used to "wrap" elements with context and metadata before they are sent as notifications.
This context and metadata allows the recipients of the notifications to process them intelligently.
type OKResp ¶
type OKResp struct { Status string `json:"status,omitempty"` Response interface{} `json:"response,omitempty"` }
OKResp is used to return OK responses in inter-service calls
type OTP ¶
type OTP struct { MSISDN string `json:"msisdn,omitempty" firestore:"msisdn"` Message string `json:"message,omitempty" firestore:"message"` AuthorizationCode string `json:"authorizationCode,omitempty" firestore:"authorizationCode"` Timestamp time.Time `json:"timestamp,omitempty" firestore:"timestamp"` IsValid bool `json:"isValid,omitempty" firestore:"isValid"` Email string `json:"email,omitempty" firestore:"email"` }
OTP is used to persist and verify authorization codes (single use 'One Time PIN's)
type OutgoingEmailsLog ¶
type OutgoingEmailsLog struct { UUID string `json:"uuid" firestore:"uuid"` To []string `json:"to" firestore:"to"` From string `json:"from" firestore:"from"` Subject string `json:"subject" firestore:"subject"` Text string `json:"text" firestore:"text"` // MessageID is a unique identifier of mailgun's message MessageID string `json:"message-id" firestore:"messageID"` EmailSentOn time.Time `json:"emailSentOn" firestore:"emailSentOn"` Event *MailgunEventOutput `json:"mailgunEvent" firestore:"mailgunEvent"` }
OutgoingEmailsLog contains the content of the sent email message sent via MailGun
type Recipient ¶
type Recipient struct { Number string `json:"number"` Cost string `json:"cost"` Status string `json:"status"` MessageID string `json:"messageID"` }
Recipient returns the details of a message recipient
type RetrieveUserProfileInput ¶
type RetrieveUserProfileInput struct { PhoneNumber *string `json:"phone"` EmailAddress *string `json:"email"` }
RetrieveUserProfileInput used to retrieve user profile info using either email address or phone
type Room ¶
type Room struct { SID string `json:"sid"` Status string `json:"status"` DateCreated time.Time `json:"date_created"` DateUpdated time.Time `json:"date_updated"` AccountSID string `json:"account_sid"` EnableTurn bool `json:"enable_turn"` UniqueName string `json:"unique_name"` StatusCallbackMethod string `json:"status_callback_method"` Type string `json:"type"` MaxParticipants int `json:"max_participants"` RecordParticipantsOnConnect bool `json:"record_participants_on_connect"` VideoCodecs []string `json:"video_codecs"` MediaRegion string `json:"media_region"` URL string `json:"url"` Links map[string]string `json:"links"` StatusCallback *string `json:"status_callback,omitempty"` Duration *int `json:"duration,omitempty"` EndTime *time.Time `json:"end_time,omitempty"` }
Room is used to serialize details of Twilio meeting rooms that are created via the Twilio Video REST API
type SMS ¶
type SMS struct {
Recipients []Recipient `json:"Recipients"`
}
SMS returns the message details of a recipient
type SMSPayload ¶
SMSPayload is used to serialise an SMS sent through the twilio service REST API
type SavedNotification ¶
type SavedNotification struct { ID string `json:"id,omitempty"` RegistrationToken string `json:"registrationToken,omitempty"` MessageID string `json:"messageID,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` Data map[string]interface{} `json:"data,omitempty"` Notification *FirebaseSimpleNotification `json:"notification,omitempty"` AndroidConfig *FirebaseAndroidConfig `json:"androidConfig,omitempty"` WebpushConfig *FirebaseWebpushConfig `json:"webpushConfig,omitempty"` APNSConfig *FirebaseAPNSConfig `json:"apnsConfig,omitempty"` }
SavedNotification is used to serialize and save successful FCM notifications.
It's the basis for a primitive "inbox" - a mechanism by which an app can request it's messages in bulk.
type SendMessageResponse ¶
type SendMessageResponse struct {
SMSMessageData *SMS `json:"SMSMessageData"`
}
SendMessageResponse returns a message response with the recipient's details
type SendSMSPayload ¶
type SendSMSPayload struct { To []string `json:"to"` Message string `json:"message"` Sender enumutils.SenderID `json:"sender"` Segment *string `json:"segment"` }
SendSMSPayload is used to serialise an SMS sent through the AIT service REST API
type TemporaryPIN ¶
type TemporaryPIN struct { PhoneNumber string `json:"phoneNumber,omitempty"` FirstName string `json:"firstName,omitempty"` PIN string `json:"pin,omitempty"` Channel int `json:"channel,omitempty"` }
TemporaryPIN input used to send temporary PIN message
type UIDPayload ¶
type UIDPayload struct {
UID *string `json:"uid"`
}
UIDPayload is the user ID used in some inter-service requests