-
Notifications
You must be signed in to change notification settings - Fork 177
/
Copy pathWebexMessageRequest.cs
92 lines (83 loc) · 3.04 KB
/
WebexMessageRequest.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
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Bot.Builder.Community.Adapters.Webex
{
/// <summary>
/// Represents the payload received when a Webex Message is sent to the bot.
/// </summary>
public class WebexMessageRequest
{
/// <summary>
/// Initializes a new instance of the <see cref="WebexMessageRequest"/> class.
/// Represents the request needed to create a message with attachments.
/// </summary>
public WebexMessageRequest()
{
}
/// <summary>
/// Gets or sets the room ID of the message.
/// </summary>
/// <value>
/// The room ID of the message.
/// </value>
[JsonProperty(PropertyName = "roomId")]
public string RoomId { get; set; }
/// <summary>
/// Gets or sets the person ID of the recipient when sending a private 1:1 message.
/// </summary>
/// <value>
/// The person ID of the recipient when sending a private 1:1 message.
/// </value>
[JsonProperty(PropertyName = "toPersonId")]
public string ToPersonId { get; set; }
/// <summary>
/// Gets or sets the email address of the recipient when sending a private 1:1 message.
/// </summary>
/// <value>
/// The email address of the recipient when sending a private 1:1 message.
/// </value>
[JsonProperty(PropertyName = "toPersonEmail")]
public string ToPersonEmail { get; set; }
/// <summary>
/// Gets or sets the text of the message.
/// </summary>
/// <value>
/// The text of the message.
/// </value>
[JsonProperty(PropertyName = "text")]
public string Text { get; set; }
/// <summary>
/// Gets or sets the message in Markdown format.
/// </summary>
/// <value>
/// The message, in Markdown format.
/// </value>
[JsonProperty(PropertyName = "markdown")]
public string Markdown { get; set; }
/// <summary>
/// Gets the URI to a binary file to be posted into the room. Only one file is allowed per message.
/// </summary>
/// <value>
/// The URI to a binary file to be posted into the room.
/// </value>
[JsonProperty(PropertyName = "files")]
public IList<Uri> Files { get; } = new List<Uri>();
/// <summary>
/// Gets or sets the content attachments to attach to the message.
/// </summary>
/// <value>
/// The content attachments to attach to the message.
/// </value>
[JsonProperty(PropertyName = "attachments")]
public object Attachments { get; set; }
/// <summary>
/// Checks if Files property should be serialized or not.
/// </summary>
/// <returns>True if there are files in the array to be serialized, false if there aren't.</returns>
public bool ShouldSerializeFiles()
{
return Files.Count > 0;
}
}
}