···11package notella
2233+import "time"
44+35type Event string
4657const (
···1113)
12141315type Message struct {
1616+ // Unique ID for the notification scheduling request.
1417 Id string `json:"id"`
1515- // IMPORTANT: Keep this up to date!!!
1818+ // When to push the notification
1919+ SendAt time.Time `json:"send_at"`
2020+ // Type of event that triggered the notification
1621 Event Event `json:"event" jsonschema:"enum=new_ticket,enum=new_post,enum=godchild_request,enum=new_comment,enum=comment_reply"`
2222+ // Churros ID of the ressource (the ticket, the post, the comment, etc)
2323+ // Used to determine to whom the notification should be sent
2424+ // For godchild_request, this is not a user id, but a godparent request id.
2525+ ChurrosObjectId string `json:"object_id"`
2626+ // Notification title
2727+ Title string `json:"title"`
2828+ // Notification body
2929+ Body string `json:"body"`
3030+ // URL to go to when the notification is clicked
3131+ Action string `json:"action"`
3232+ // Additional action buttons
3333+ Actions []struct {
3434+ // Label of the action button
3535+ Label string `json:"label"`
3636+ // URL to go to when the action button is clicked
3737+ Action string `json:"action"`
3838+ } `json:"actions"`
3939+ // URL to an image to display in the notification
4040+ Image string `json:"image"`
1741}
···11export interface Message {
22+ /**
33+ * URL to go to when the action button is clicked
44+ */
55+ action: string;
66+ /**
77+ * Additional action buttons
88+ */
99+ actions: Action[];
1010+ /**
1111+ * Notification body
1212+ */
1313+ body: string;
1414+ /**
1515+ * Type of event that triggered the notification
1616+ */
217 event: Event;
33- id: string;
1818+ /**
1919+ * Unique ID for the notification scheduling request.
2020+ */
2121+ id: string;
2222+ /**
2323+ * URL to an image to display in the notification
2424+ */
2525+ image: string;
2626+ /**
2727+ * Churros ID of the ressource (the ticket, the post, the comment, etc)
2828+ * Used to determine to whom the notification should be sent
2929+ * For godchild_request, this is not a user id, but a godparent request id.
3030+ */
3131+ object_id: string;
3232+ /**
3333+ * When to push the notification
3434+ */
3535+ send_at: Date;
3636+ /**
3737+ * Notification title
3838+ */
3939+ title: string;
440}
5414242+export interface Action {
4343+ action: string;
4444+ label: string;
4545+}
4646+4747+/**
4848+ * Type of event that triggered the notification
4949+ */
650export enum Event {
751 CommentReply = "comment_reply",
852 GodchildRequest = "godchild_request",