-
Notifications
You must be signed in to change notification settings - Fork 237
Expand file tree
/
Copy pathResponse.cs
More file actions
38 lines (33 loc) · 907 Bytes
/
Copy pathResponse.cs
File metadata and controls
38 lines (33 loc) · 907 Bytes
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SlackAPI
{
public abstract class Response
{
/// <summary>
/// Should always be checked before trying to process a response.
/// </summary>
public bool ok;
/// <summary>
/// if ok is false, then this is the reason-code
/// </summary>
public string error;
public string needed;
public string provided;
public string warning;
public void AssertOk()
{
if (!(ok))
throw new InvalidOperationException(string.Format("An error occurred: {0}", this.error));
}
public ResponseMetaData response_metadata;
}
public class ResponseMetaData
{
public string next_cursor;
public string[] messages;
}
}