-
Notifications
You must be signed in to change notification settings - Fork 251
/
types.go
151 lines (121 loc) · 4.52 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// This source code file is AUTO-GENERATED by github.com/taskcluster/jsonschema2go
package tcnotify
import (
"encoding/json"
)
type (
// Optional link that can be added as a button to the email.
Link struct {
// Where the link should point to.
//
// Min length: 1
// Max length: 1024
Href string `json:"href"`
// Text to display on link.
//
// Min length: 1
// Max length: 40
Text string `json:"text"`
}
// List of notification addresses.
ListOfNotificationAdresses struct {
Addresses []NotificationTypeAndAddress `json:"addresses"`
// A continuation token is returned if there are more results than listed
// here. You can optionally provide the token in the request payload to
// load the additional results.
ContinuationToken string `json:"continuationToken,omitempty"`
}
// Type of notification and its corresponding address.
NotificationTypeAndAddress struct {
NotificationAddress string `json:"notificationAddress"`
// Possible values:
// * "email"
// * "pulse"
// * "matrix-room"
// * "slack-channel"
NotificationType string `json:"notificationType"`
}
// Request to post a message on pulse.
PostPulseMessageRequest struct {
// Pulse message to send as plain text.
//
// Additional properties allowed
Message json.RawMessage `json:"message"`
// Routing-key to use when posting the message.
//
// Max length: 255
RoutingKey string `json:"routingKey"`
}
// Request to send an email
SendEmailRequest struct {
// E-mail address to which the message should be sent
Address string `json:"address"`
// Content of the e-mail as **markdown**, will be rendered to HTML before
// the email is sent. Notice that markdown allows for a few HTML tags, but
// won't allow inclusion of script tags and other unpleasantries.
//
// Min length: 1
// Max length: 102400
Content string `json:"content"`
// Optional link that can be added as a button to the email.
Link Link `json:"link,omitempty"`
// Reply-to e-mail (this property is optional)
ReplyTo string `json:"replyTo,omitempty"`
// Subject line of the e-mail, this is plain-text
//
// Min length: 1
// Max length: 255
Subject string `json:"subject"`
// E-mail html template used to format your content.
//
// Possible values:
// * "simple"
// * "fullscreen"
//
// Default: "simple"
Template string `json:"template,omitempty"`
}
// Request to send a Matrix notice. Many of these fields are better understood by
// checking the matrix spec itself. The precise definitions of these fields is
// beyond the scope of this document.
SendMatrixNoticeRequest struct {
// Unformatted text that will be displayed in the room if you do not
// specify `formattedBody` or if a user's client can not render the format.
Body string `json:"body"`
// The format for `formattedBody`. For instance, `org.matrix.custom.html`
Format string `json:"format,omitempty"`
// Text that will be rendered by matrix clients that support the given
// format in that format. For instance, `<h1>Header Text</h1>`.
FormattedBody string `json:"formattedBody,omitempty"`
// Which of the `m.room.message` msgtypes to use. At the moment only the
// types that take `body`/`format`/`formattedBody` are supported.
//
// Possible values:
// * "m.notice"
// * "m.text"
// * "m.emote"
//
// Default: "m.notice"
Msgtype string `json:"msgtype,omitempty"`
// The fully qualified room name, such as `!whDRjjSmICCgrhFHsQ:mozilla.org`
// If you are using riot, you can find this under the advanced settings for a room.
RoomID string `json:"roomId"`
}
// Request to send a message to a Slack channel. The most interesting field in
// this request is the `blocks` field which allows you to specify advanced
// display layout for messages. This is best understood via the Slack API
// documentation.
SendSlackMessage struct {
// An array of Slack attachments. See https://api.slack.com/messaging/composing/layouts#attachments.
Attachments []interface{} `json:"attachments,omitempty"`
// An array of Slack layout blocks. See https://api.slack.com/reference/block-kit/blocks.
Blocks []interface{} `json:"blocks,omitempty"`
// The unique Slack channel ID, such as `C123456GZ`.
// In the app, this is the last section of the 'copy link' URL for a channel.
ChannelID string `json:"channelId"`
// The main message text. If no blocks are included, this is used as the
// message text, otherwise this is used as alternative text and the blocks
// are used.
Text string `json:"text"`
}
)