-
Notifications
You must be signed in to change notification settings - Fork 298
/
WorkerOptions.cs
326 lines (242 loc) · 12.2 KB
/
WorkerOptions.cs
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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Taskrouter
* This is the public Twilio REST API.
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
using System;
using System.Collections.Generic;
using Twilio.Base;
using Twilio.Converters;
namespace Twilio.Rest.Taskrouter.V1.Workspace
{
/// <summary> create </summary>
public class CreateWorkerOptions : IOptions<WorkerResource>
{
///<summary> The SID of the Workspace that the new Worker belongs to. </summary>
public string PathWorkspaceSid { get; }
///<summary> A descriptive string that you create to describe the new Worker. It can be up to 64 characters long. </summary>
public string FriendlyName { get; }
///<summary> The SID of a valid Activity that will describe the new Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. If not provided, the new Worker's initial state is the `default_activity_sid` configured on the Workspace. </summary>
public string ActivitySid { get; set; }
///<summary> A valid JSON string that describes the new Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. </summary>
public string Attributes { get; set; }
/// <summary> Construct a new CreateWorkerOptions </summary>
/// <param name="pathWorkspaceSid"> The SID of the Workspace that the new Worker belongs to. </param>
/// <param name="friendlyName"> A descriptive string that you create to describe the new Worker. It can be up to 64 characters long. </param>
public CreateWorkerOptions(string pathWorkspaceSid, string friendlyName)
{
PathWorkspaceSid = pathWorkspaceSid;
FriendlyName = friendlyName;
}
/// <summary> Generate the necessary parameters </summary>
public List<KeyValuePair<string, string>> GetParams()
{
var p = new List<KeyValuePair<string, string>>();
if (FriendlyName != null)
{
p.Add(new KeyValuePair<string, string>("FriendlyName", FriendlyName));
}
if (ActivitySid != null)
{
p.Add(new KeyValuePair<string, string>("ActivitySid", ActivitySid));
}
if (Attributes != null)
{
p.Add(new KeyValuePair<string, string>("Attributes", Attributes));
}
return p;
}
}
/// <summary> delete </summary>
public class DeleteWorkerOptions : IOptions<WorkerResource>
{
///<summary> The SID of the Workspace with the Worker to delete. </summary>
public string PathWorkspaceSid { get; }
///<summary> The SID of the Worker resource to delete. </summary>
public string PathSid { get; }
///<summary> The If-Match HTTP request header </summary>
public string IfMatch { get; set; }
/// <summary> Construct a new DeleteWorkerOptions </summary>
/// <param name="pathWorkspaceSid"> The SID of the Workspace with the Worker to delete. </param>
/// <param name="pathSid"> The SID of the Worker resource to delete. </param>
public DeleteWorkerOptions(string pathWorkspaceSid, string pathSid)
{
PathWorkspaceSid = pathWorkspaceSid;
PathSid = pathSid;
}
/// <summary> Generate the necessary parameters </summary>
public List<KeyValuePair<string, string>> GetParams()
{
var p = new List<KeyValuePair<string, string>>();
return p;
}
/// <summary> Generate the necessary header parameters </summary>
public List<KeyValuePair<string, string>> GetHeaderParams()
{
var p = new List<KeyValuePair<string, string>>();
if (IfMatch != null)
{
p.Add(new KeyValuePair<string, string>("If-Match", IfMatch));
}
return p;
}
}
/// <summary> fetch </summary>
public class FetchWorkerOptions : IOptions<WorkerResource>
{
///<summary> The SID of the Workspace with the Worker to fetch. </summary>
public string PathWorkspaceSid { get; }
///<summary> The SID of the Worker resource to fetch. </summary>
public string PathSid { get; }
/// <summary> Construct a new FetchWorkerOptions </summary>
/// <param name="pathWorkspaceSid"> The SID of the Workspace with the Worker to fetch. </param>
/// <param name="pathSid"> The SID of the Worker resource to fetch. </param>
public FetchWorkerOptions(string pathWorkspaceSid, string pathSid)
{
PathWorkspaceSid = pathWorkspaceSid;
PathSid = pathSid;
}
/// <summary> Generate the necessary parameters </summary>
public List<KeyValuePair<string, string>> GetParams()
{
var p = new List<KeyValuePair<string, string>>();
return p;
}
}
/// <summary> read </summary>
public class ReadWorkerOptions : ReadOptions<WorkerResource>
{
///<summary> The SID of the Workspace with the Workers to read. </summary>
public string PathWorkspaceSid { get; }
///<summary> The `activity_name` of the Worker resources to read. </summary>
public string ActivityName { get; set; }
///<summary> The `activity_sid` of the Worker resources to read. </summary>
public string ActivitySid { get; set; }
///<summary> Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. </summary>
public string Available { get; set; }
///<summary> The `friendly_name` of the Worker resources to read. </summary>
public string FriendlyName { get; set; }
///<summary> Filter by Workers that would match an expression. In addition to fields in the workers' attributes, the expression can include the following worker fields: `sid`, `friendly_name`, `activity_sid`, or `activity_name` </summary>
public string TargetWorkersExpression { get; set; }
///<summary> The `friendly_name` of the TaskQueue that the Workers to read are eligible for. </summary>
public string TaskQueueName { get; set; }
///<summary> The SID of the TaskQueue that the Workers to read are eligible for. </summary>
public string TaskQueueSid { get; set; }
///<summary> Sorting parameter for Workers </summary>
public string Ordering { get; set; }
/// <summary> Construct a new ListWorkerOptions </summary>
/// <param name="pathWorkspaceSid"> The SID of the Workspace with the Workers to read. </param>
public ReadWorkerOptions(string pathWorkspaceSid)
{
PathWorkspaceSid = pathWorkspaceSid;
}
/// <summary> Generate the necessary parameters </summary>
public List<KeyValuePair<string, string>> GetParams()
{
var p = new List<KeyValuePair<string, string>>();
if (ActivityName != null)
{
p.Add(new KeyValuePair<string, string>("ActivityName", ActivityName));
}
if (ActivitySid != null)
{
p.Add(new KeyValuePair<string, string>("ActivitySid", ActivitySid));
}
if (Available != null)
{
p.Add(new KeyValuePair<string, string>("Available", Available));
}
if (FriendlyName != null)
{
p.Add(new KeyValuePair<string, string>("FriendlyName", FriendlyName));
}
if (TargetWorkersExpression != null)
{
p.Add(new KeyValuePair<string, string>("TargetWorkersExpression", TargetWorkersExpression));
}
if (TaskQueueName != null)
{
p.Add(new KeyValuePair<string, string>("TaskQueueName", TaskQueueName));
}
if (TaskQueueSid != null)
{
p.Add(new KeyValuePair<string, string>("TaskQueueSid", TaskQueueSid));
}
if (Ordering != null)
{
p.Add(new KeyValuePair<string, string>("Ordering", Ordering));
}
if (PageSize != null)
{
p.Add(new KeyValuePair<string, string>("PageSize", PageSize.ToString()));
}
return p;
}
}
/// <summary> update </summary>
public class UpdateWorkerOptions : IOptions<WorkerResource>
{
///<summary> The SID of the Workspace with the Worker to update. </summary>
public string PathWorkspaceSid { get; }
///<summary> The SID of the Worker resource to update. </summary>
public string PathSid { get; }
///<summary> The If-Match HTTP request header </summary>
public string IfMatch { get; set; }
///<summary> The SID of a valid Activity that will describe the Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. </summary>
public string ActivitySid { get; set; }
///<summary> The JSON string that describes the Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. </summary>
public string Attributes { get; set; }
///<summary> A descriptive string that you create to describe the Worker. It can be up to 64 characters long. </summary>
public string FriendlyName { get; set; }
///<summary> Whether to reject the Worker's pending reservations. This option is only valid if the Worker's new [Activity](https://www.twilio.com/docs/taskrouter/api/activity) resource has its `availability` property set to `False`. </summary>
public bool? RejectPendingReservations { get; set; }
/// <summary> Construct a new UpdateWorkerOptions </summary>
/// <param name="pathWorkspaceSid"> The SID of the Workspace with the Worker to update. </param>
/// <param name="pathSid"> The SID of the Worker resource to update. </param>
public UpdateWorkerOptions(string pathWorkspaceSid, string pathSid)
{
PathWorkspaceSid = pathWorkspaceSid;
PathSid = pathSid;
}
/// <summary> Generate the necessary parameters </summary>
public List<KeyValuePair<string, string>> GetParams()
{
var p = new List<KeyValuePair<string, string>>();
if (ActivitySid != null)
{
p.Add(new KeyValuePair<string, string>("ActivitySid", ActivitySid));
}
if (Attributes != null)
{
p.Add(new KeyValuePair<string, string>("Attributes", Attributes));
}
if (FriendlyName != null)
{
p.Add(new KeyValuePair<string, string>("FriendlyName", FriendlyName));
}
if (RejectPendingReservations != null)
{
p.Add(new KeyValuePair<string, string>("RejectPendingReservations", RejectPendingReservations.Value.ToString().ToLower()));
}
return p;
}
/// <summary> Generate the necessary header parameters </summary>
public List<KeyValuePair<string, string>> GetHeaderParams()
{
var p = new List<KeyValuePair<string, string>>();
if (IfMatch != null)
{
p.Add(new KeyValuePair<string, string>("If-Match", IfMatch));
}
return p;
}
}
}