This repository was archived by the owner on Sep 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathWebhookSkeleton.cs
More file actions
59 lines (53 loc) · 2.93 KB
/
Copy pathWebhookSkeleton.cs
File metadata and controls
59 lines (53 loc) · 2.93 KB
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
using System;
using Guilded.Base;
namespace Guilded.Webhook;
/// <summary>
/// Represents the barebones of a <see cref="T:Guilded.Servers.Webhook">webhook</see> that can be executed.
/// </summary>
/// <seealso cref="Webhook" />
public class WebhookSkeleton : IWebhook
{
/// <inheritdoc />
public Uri Url { get; }
#region Constructors
/// <summary>
/// Initializes a new instance of <see cref="WebhookSkeleton" /> from given <paramref name="url" />.
/// </summary>
/// <param name="url">The <see cref="T:Guilded.Servers.Webhook.Url">URL for executing</see> a <see cref="T:Guilded.Servers.Webhook">webhook</see></param>
/// <seealso cref="WebhookSkeleton" />
/// <seealso cref="WebhookSkeleton(string)" />
/// <seealso cref="WebhookSkeleton(Guid, string)" />
/// <seealso cref="WebhookSkeleton(string, string)" />
public WebhookSkeleton(Uri url) =>
Url = url;
/// <summary>
/// Initializes a new instance of <see cref="WebhookSkeleton" /> from given <paramref name="url" />.
/// </summary>
/// <param name="url">The <see cref="T:Guilded.Servers.Webhook.Url">URL for executing</see> a <see cref="T:Guilded.Servers.Webhook">webhook</see></param>
/// <seealso cref="WebhookSkeleton" />
/// <seealso cref="WebhookSkeleton(Uri)" />
/// <seealso cref="WebhookSkeleton(Guid, string)" />
/// <seealso cref="WebhookSkeleton(string, string)" />
public WebhookSkeleton(string url) : this(new Uri(url)) { }
/// <summary>
/// Initializes a new instance of <see cref="WebhookSkeleton" /> from given <paramref name="token" /> and <paramref name="webhook" /> identifier.
/// </summary>
/// <param name="webhook">The ID of the <see cref="T:Guilded.Servers.Webhook">webhook</see> to execute</param>
/// <param name="token">The secret token of the <see cref="T:Guilded.Servers.Webhook">webhook</see> to use for execution</param>
/// <seealso cref="WebhookSkeleton" />
/// <seealso cref="WebhookSkeleton(Uri)" />
/// <seealso cref="WebhookSkeleton(string)" />
/// <seealso cref="WebhookSkeleton(string, string)" />
public WebhookSkeleton(Guid webhook, string token) : this(new Uri(GuildedUrl.Media, $"/webhooks/{webhook}/{token}")) { }
/// <summary>
/// Initializes a new instance of <see cref="WebhookSkeleton" /> from given <paramref name="token" /> and <paramref name="webhook" /> identifier.
/// </summary>
/// <param name="webhook">The ID of the <see cref="T:Guilded.Servers.Webhook">webhook</see> to execute</param>
/// <param name="token">The secret token of the <see cref="T:Guilded.Servers.Webhook">webhook</see> to use for execution</param>
/// <seealso cref="WebhookSkeleton" />
/// <seealso cref="WebhookSkeleton(Uri)" />
/// <seealso cref="WebhookSkeleton(string)" />
/// <seealso cref="WebhookSkeleton(Guid, string)" />
public WebhookSkeleton(string webhook, string token) : this(new Guid(webhook), token) { }
#endregion
}