-
Notifications
You must be signed in to change notification settings - Fork 0
/
request.go
executable file
·296 lines (260 loc) · 7.75 KB
/
request.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
package twirest
// uri URI resource
// Used for the request resource, NOTE: only the tag is used
type uri struct {
}
// Request a list of the account resources
type Accounts struct {
FriendlyName string `FriendlyName=`
Status string `Status=`
}
// Account resource information for a single account
type Account struct {
Sid string
}
// Request list of calls made to and from account
type Calls struct {
resource uri `/Calls`
To string `To=`
From string `From=`
Status string `Status=`
StartTime string `StartTime=`
StartTimeBefore string `StartTime<=`
StartTimeAfter string `StartTime>=`
ParentCallSid string `ParentCallSid=`
}
// Request call information about a single call
type Call struct {
resource uri `/Calls`
Sid string // CallSid
Recordings bool
Notifications bool
}
// Request to make a phone call
type MakeCall struct {
resource uri `/Calls`
From string `From=`
To string `To=`
Url string `Url=`
ApplicationSid string `ApplicationSid=`
Method string `Method=`
FallbackUrl string `FallbackUrl=`
FallbackMethod string `FallbackMethod=`
StatusCallback string `StatusCallback=`
StatusCallbackMethod string `StatusCallbackMethod=`
SendDigits string `SendDigits=`
IfMachine string `IfMachine=`
Timeout string `Timeout=`
Record string `Record=`
SipAuthUsername string `SipAuthUsername=`
SipAuthPassword string `SipAuthPassword=`
}
// Request to modify call in queue/progress
type ModifyCall struct {
resource uri `/Calls`
Sid string
Url string `Url=`
Method string `Method=`
Status string `Status=`
FallbackUrl string `FallbackUrl=`
FallbackMethod string `FallbackMethod=`
StatusCallback string `StatusCallback=`
StatusCallbackMethod string `StatusCallbackMethod=`
}
// List conferences within an account
type Conferences struct {
resource uri `/Conferences`
Status string `Status=`
FriendlyName string `FriendlyName=`
DateCreated string `DateCreated=`
DateCreatedBefore string `DateCreated<=`
DateCreatedAfter string `DateCreated>=`
DateUpdated string `DateUpdated=`
DateUpdatedBefore string `DateUpdated<=`
DateUpdatedAfter string `DateUpdated>=`
}
// Resource for individual conference instance
type Conference struct {
resource uri `/Conferences`
Sid string
}
// Request list of participants in a conference
type Participants struct {
resource uri `/Conferences`
subresource uri `/Participants`
Sid string // Conference Sid
Muted string `Muted=`
}
// Resource about single conference participant
type Participant struct {
resource uri `/Conferences`
subresource uri `/Participants`
Sid string // Conference Sid
CallSid string // required field
}
// Remove a participant from a conference
type DeleteParticipant struct {
resource uri `/Conferences`
subresource uri `/Participants`
Sid string // Conference Sid
CallSid string // required field
}
// Request to change the status of a participant
type UpdateParticipant struct {
resource uri `/Conferences`
subresource uri `/Participants`
Sid string // Conference Sid
CallSid string // required field
Muted string `Muted=`
}
// Messages struct for request of list of messages
type Messages struct {
resource uri `/Messages`
To string `To=`
From string `From=`
DateSent string `DateSent=`
DateSentBefore string `DateSent<=`
DateSentAfter string `DateSent>=`
}
// Message struct for request of single message
type Message struct {
resource uri `/Messages`
Sid string // MessageSid
Media bool
MediaSid string
}
// Message struct for request to send a message
type SendMessage struct {
resource uri `/Messages`
Text string `Body=`
MediaUrl string `MediaUrl=`
From string `From=`
To string `To=`
MessagingServiceSid string `MessagingServiceSid=`
ApplicationSid string `ApplicationSid=`
StatusCallback string `StatusCallback=`
}
// Notifications struct for request of a possible list of notifications
type Notifications struct {
resource uri `/Notifications`
Log string `Log=`
MsgDate string `MessageDate=`
MsgDateBefore string `MessageDate<=`
MsgDateAfter string `MessageDate>=`
}
// Notification struct for request of a specific notification
type Notification struct {
resource uri `/Notifications`
Sid string
}
// DeleteNotification struct for removal of a notification
type DeleteNotification struct {
resource uri `/Notifications`
Sid string
}
// Get outgoing caller IDs
type OutgoingCallerIds struct {
resource uri `/OutgoingCallerIds`
PhoneNumber string `PhoneNumber=`
FriendlyName string `FriendlyName=`
}
// Get outgoing caller ID
type OutgoingCallerId struct {
resource uri `/OutgoingCallerIds`
Sid string
}
type UpdateOutgoingCallerId struct {
resource uri `/OutgoingCallerIds`
Sid string
FriendlyName string `FriendlyName=`
}
type DeleteOutgoingCallerId struct {
resource uri `/OutgoingCallerIds`
Sid string
}
type AddOutgoingCallerId struct {
resource uri `/OutgoingCallerIds`
PhoneNumber string `PhoneNumber=`
FriendlyName string `FriendlyName=`
CallDelay string `CallDelay=`
Extension string `Extension=`
StatusCallback string `StatusCallback=`
StatusCallbackMethod string `StatusCallbackMethod=`
}
// List recordings resource
type Recordings struct {
resource uri `/Recordings`
CallSid string `CallSid=`
DateCreated string `DateCreated=`
DateCreatedBefore string `DateCreated<=`
DateCreatedAfter string `DateCreated>=`
}
// Request resource for an individual recording
type Recording struct {
resource uri `/Recordings`
Sid string // RecordingSid
}
// Delete a recording
type DeleteRecording struct {
resource uri `/Recordings`
Sid string // RecordingSid
}
// Request usage by the account
type UsageRecords struct {
resource uri `/Usage/Records`
SubResource string
Category string `Category=`
StartDate string `StartDate=`
EndDate string `EndDate=`
}
// List queues within an account
type Queues struct {
resource uri `/Queues`
}
// Get resource for an individual Queue instance
type Queue struct {
resource uri `/Queues`
Sid string // QueueSid
}
// Create a new queue
type CreateQueue struct {
resource uri `/Queues`
FriendlyName string `FriendlyName=`
MaxSize string `MaxSize=`
}
// Request to change queue properties
type ChangeQueue struct {
resource uri `/Queues`
Sid string
FriendlyName string `FriendlyName=`
MaxSize string `MaxSize=`
}
// Remove a queue
type DeleteQueue struct {
resource uri `/Queues`
Sid string // QueueSid
}
// List members of a queue
type QueueMembers struct {
resource uri `/Queues`
subresource uri `/Members`
Sid string // QueueSid
}
// Request resource for a queue member
type QueueMember struct {
resource uri `/Queues`
subresource uri `/Members`
Sid string // QueueSid
CallSid string // either this field or Front is required
Front bool
}
// Remove a member from a queue and redirect the member's call to a TwiML site
type DeQueue struct {
resource uri `/Queues`
subresource uri `/Members`
Sid string // Queue Sid
CallSid string // either this field or Front is required
Front bool
Url string `Url=`
Method string `Method=`
}