-
Notifications
You must be signed in to change notification settings - Fork 45
/
SignalRGroupAction.cs
49 lines (40 loc) · 1.39 KB
/
SignalRGroupAction.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
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Runtime.Serialization;
using Microsoft.Azure.SignalR;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Microsoft.Azure.WebJobs.Extensions.SignalRService
{
/// <summary>
/// Class that contains parameters needed for group operations.
/// Either the group operation on connectionId or userId is supported.
/// If connectionId and userId are both set, it will be resolved by the following order:
/// 1. ConnectionId
/// 2. UserId
/// </summary>
[JsonObject]
public class SignalRGroupAction
{
[JsonProperty("connectionId")]
public string ConnectionId { get; set; }
[JsonProperty("userId")]
public string UserId { get; set; }
[JsonProperty("groupName")]
public string GroupName { get; set; }
[JsonProperty("action"), JsonRequired]
public GroupAction Action { get; set; }
[JsonProperty("endpoints")]
public ServiceEndpoint[] Endpoints { get; set; }
}
[JsonConverter(typeof(StringEnumConverter))]
public enum GroupAction
{
[EnumMember(Value = "add")]
Add,
[EnumMember(Value = "remove")]
Remove,
[EnumMember(Value = "removeAll")]
RemoveAll
}
}