Made API models internal. Removed Discord.Net.API.
This commit is contained in:
24
src/Discord.Net.Rest/API/Common/Application.cs
Normal file
24
src/Discord.Net.Rest/API/Common/Application.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Application
|
||||
{
|
||||
[JsonProperty("description")]
|
||||
public string Description { get; set; }
|
||||
[JsonProperty("rpc_origins")]
|
||||
public string[] RPCOrigins { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("icon")]
|
||||
public string Icon { get; set; }
|
||||
|
||||
[JsonProperty("flags"), Int53]
|
||||
public Optional<ulong> Flags { get; set; }
|
||||
[JsonProperty("owner")]
|
||||
public Optional<User> Owner { get; set; }
|
||||
}
|
||||
}
|
||||
23
src/Discord.Net.Rest/API/Common/Attachment.cs
Normal file
23
src/Discord.Net.Rest/API/Common/Attachment.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Attachment
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("filename")]
|
||||
public string Filename { get; set; }
|
||||
[JsonProperty("size")]
|
||||
public int Size { get; set; }
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; }
|
||||
[JsonProperty("proxy_url")]
|
||||
public string ProxyUrl { get; set; }
|
||||
[JsonProperty("height")]
|
||||
public Optional<int> Height { get; set; }
|
||||
[JsonProperty("width")]
|
||||
public Optional<int> Width { get; set; }
|
||||
}
|
||||
}
|
||||
13
src/Discord.Net.Rest/API/Common/Ban.cs
Normal file
13
src/Discord.Net.Rest/API/Common/Ban.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Ban
|
||||
{
|
||||
[JsonProperty("user")]
|
||||
public User User { get; set; }
|
||||
[JsonProperty("reason")]
|
||||
public string Reason { get; set; }
|
||||
}
|
||||
}
|
||||
47
src/Discord.Net.Rest/API/Common/Channel.cs
Normal file
47
src/Discord.Net.Rest/API/Common/Channel.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Channel
|
||||
{
|
||||
//Shared
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public ChannelType Type { get; set; }
|
||||
[JsonProperty("last_message_id")]
|
||||
public ulong? LastMessageId { get; set; }
|
||||
|
||||
//GuildChannel
|
||||
[JsonProperty("guild_id")]
|
||||
public Optional<ulong> GuildId { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public Optional<string> Name { get; set; }
|
||||
[JsonProperty("position")]
|
||||
public Optional<int> Position { get; set; }
|
||||
[JsonProperty("permission_overwrites")]
|
||||
public Optional<Overwrite[]> PermissionOverwrites { get; set; }
|
||||
|
||||
//TextChannel
|
||||
[JsonProperty("topic")]
|
||||
public Optional<string> Topic { get; set; }
|
||||
[JsonProperty("last_pin_timestamp")]
|
||||
public Optional<DateTimeOffset?> LastPinTimestamp { get; set; }
|
||||
|
||||
//VoiceChannel
|
||||
[JsonProperty("bitrate")]
|
||||
public Optional<int> Bitrate { get; set; }
|
||||
[JsonProperty("user_limit")]
|
||||
public Optional<int> UserLimit { get; set; }
|
||||
|
||||
//PrivateChannel
|
||||
[JsonProperty("recipients")]
|
||||
public Optional<User[]> Recipients { get; set; }
|
||||
|
||||
//GroupChannel
|
||||
[JsonProperty("icon")]
|
||||
public Optional<string> Icon { get; set; }
|
||||
}
|
||||
}
|
||||
21
src/Discord.Net.Rest/API/Common/Connection.cs
Normal file
21
src/Discord.Net.Rest/API/Common/Connection.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Connection
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public string Id { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("revoked")]
|
||||
public bool Revoked { get; set; }
|
||||
|
||||
[JsonProperty("integrations")]
|
||||
public IReadOnlyCollection<ulong> Integrations { get; set; }
|
||||
}
|
||||
}
|
||||
36
src/Discord.Net.Rest/API/Common/Embed.cs
Normal file
36
src/Discord.Net.Rest/API/Common/Embed.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
#pragma warning disable CS1591
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Embed
|
||||
{
|
||||
[JsonProperty("title")]
|
||||
public string Title { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
[JsonProperty("description")]
|
||||
public string Description { get; set; }
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; }
|
||||
[JsonProperty("color")]
|
||||
public uint? Color { get; set; }
|
||||
[JsonProperty("timestamp")]
|
||||
public DateTimeOffset? Timestamp { get; set; }
|
||||
[JsonProperty("author")]
|
||||
public Optional<EmbedAuthor> Author { get; set; }
|
||||
[JsonProperty("footer")]
|
||||
public Optional<EmbedFooter> Footer { get; set; }
|
||||
[JsonProperty("video")]
|
||||
public Optional<EmbedVideo> Video { get; set; }
|
||||
[JsonProperty("thumbnail")]
|
||||
public Optional<EmbedThumbnail> Thumbnail { get; set; }
|
||||
[JsonProperty("image")]
|
||||
public Optional<EmbedImage> Image { get; set; }
|
||||
[JsonProperty("provider")]
|
||||
public Optional<EmbedProvider> Provider { get; set; }
|
||||
[JsonProperty("fields")]
|
||||
public Optional<EmbedField[]> Fields { get; set; }
|
||||
}
|
||||
}
|
||||
16
src/Discord.Net.Rest/API/Common/EmbedAuthor.cs
Normal file
16
src/Discord.Net.Rest/API/Common/EmbedAuthor.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class EmbedAuthor
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; }
|
||||
[JsonProperty("icon_url")]
|
||||
public string IconUrl { get; set; }
|
||||
[JsonProperty("proxy_icon_url")]
|
||||
public string ProxyIconUrl { get; set; }
|
||||
}
|
||||
}
|
||||
14
src/Discord.Net.Rest/API/Common/EmbedField.cs
Normal file
14
src/Discord.Net.Rest/API/Common/EmbedField.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class EmbedField
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("value")]
|
||||
public string Value { get; set; }
|
||||
[JsonProperty("inline")]
|
||||
public bool Inline { get; set; }
|
||||
}
|
||||
}
|
||||
14
src/Discord.Net.Rest/API/Common/EmbedFooter.cs
Normal file
14
src/Discord.Net.Rest/API/Common/EmbedFooter.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class EmbedFooter
|
||||
{
|
||||
[JsonProperty("text")]
|
||||
public string Text { get; set; }
|
||||
[JsonProperty("icon_url")]
|
||||
public string IconUrl { get; set; }
|
||||
[JsonProperty("proxy_icon_url")]
|
||||
public string ProxyIconUrl { get; set; }
|
||||
}
|
||||
}
|
||||
17
src/Discord.Net.Rest/API/Common/EmbedImage.cs
Normal file
17
src/Discord.Net.Rest/API/Common/EmbedImage.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class EmbedImage
|
||||
{
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; }
|
||||
[JsonProperty("proxy_url")]
|
||||
public string ProxyUrl { get; set; }
|
||||
[JsonProperty("height")]
|
||||
public Optional<int> Height { get; set; }
|
||||
[JsonProperty("width")]
|
||||
public Optional<int> Width { get; set; }
|
||||
}
|
||||
}
|
||||
13
src/Discord.Net.Rest/API/Common/EmbedProvider.cs
Normal file
13
src/Discord.Net.Rest/API/Common/EmbedProvider.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class EmbedProvider
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; }
|
||||
}
|
||||
}
|
||||
17
src/Discord.Net.Rest/API/Common/EmbedThumbnail.cs
Normal file
17
src/Discord.Net.Rest/API/Common/EmbedThumbnail.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class EmbedThumbnail
|
||||
{
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; }
|
||||
[JsonProperty("proxy_url")]
|
||||
public string ProxyUrl { get; set; }
|
||||
[JsonProperty("height")]
|
||||
public Optional<int> Height { get; set; }
|
||||
[JsonProperty("width")]
|
||||
public Optional<int> Width { get; set; }
|
||||
}
|
||||
}
|
||||
15
src/Discord.Net.Rest/API/Common/EmbedVideo.cs
Normal file
15
src/Discord.Net.Rest/API/Common/EmbedVideo.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class EmbedVideo
|
||||
{
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; }
|
||||
[JsonProperty("height")]
|
||||
public Optional<int> Height { get; set; }
|
||||
[JsonProperty("width")]
|
||||
public Optional<int> Width { get; set; }
|
||||
}
|
||||
}
|
||||
19
src/Discord.Net.Rest/API/Common/Emoji.cs
Normal file
19
src/Discord.Net.Rest/API/Common/Emoji.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Emoji
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong? Id { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("roles")]
|
||||
public ulong[] Roles { get; set; }
|
||||
[JsonProperty("require_colons")]
|
||||
public bool RequireColons { get; set; }
|
||||
[JsonProperty("managed")]
|
||||
public bool Managed { get; set; }
|
||||
}
|
||||
}
|
||||
23
src/Discord.Net.Rest/API/Common/Game.cs
Normal file
23
src/Discord.Net.Rest/API/Common/Game.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Game
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("url")]
|
||||
public Optional<string> StreamUrl { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public Optional<StreamType?> StreamType { get; set; }
|
||||
|
||||
[OnError]
|
||||
internal void OnError(StreamingContext context, ErrorContext errorContext)
|
||||
{
|
||||
errorContext.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
43
src/Discord.Net.Rest/API/Common/Guild.cs
Normal file
43
src/Discord.Net.Rest/API/Common/Guild.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Guild
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("icon")]
|
||||
public string Icon { get; set; }
|
||||
[JsonProperty("splash")]
|
||||
public string Splash { get; set; }
|
||||
[JsonProperty("owner_id")]
|
||||
public ulong OwnerId { get; set; }
|
||||
[JsonProperty("region")]
|
||||
public string Region { get; set; }
|
||||
[JsonProperty("afk_channel_id")]
|
||||
public ulong? AFKChannelId { get; set; }
|
||||
[JsonProperty("afk_timeout")]
|
||||
public int AFKTimeout { get; set; }
|
||||
[JsonProperty("embed_enabled")]
|
||||
public bool EmbedEnabled { get; set; }
|
||||
[JsonProperty("embed_channel_id")]
|
||||
public ulong? EmbedChannelId { get; set; }
|
||||
[JsonProperty("verification_level")]
|
||||
public VerificationLevel VerificationLevel { get; set; }
|
||||
[JsonProperty("voice_states")]
|
||||
public VoiceState[] VoiceStates { get; set; }
|
||||
[JsonProperty("roles")]
|
||||
public Role[] Roles { get; set; }
|
||||
[JsonProperty("emojis")]
|
||||
public Emoji[] Emojis { get; set; }
|
||||
[JsonProperty("features")]
|
||||
public string[] Features { get; set; }
|
||||
[JsonProperty("mfa_level")]
|
||||
public MfaLevel MfaLevel { get; set; }
|
||||
[JsonProperty("default_message_notifications")]
|
||||
public DefaultMessageNotifications DefaultMessageNotifications { get; set; }
|
||||
}
|
||||
}
|
||||
13
src/Discord.Net.Rest/API/Common/GuildEmbed.cs
Normal file
13
src/Discord.Net.Rest/API/Common/GuildEmbed.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class GuildEmbed
|
||||
{
|
||||
[JsonProperty("enabled")]
|
||||
public bool Enabled { get; set; }
|
||||
[JsonProperty("channel_id")]
|
||||
public ulong ChannelId { get; set; }
|
||||
}
|
||||
}
|
||||
22
src/Discord.Net.Rest/API/Common/GuildMember.cs
Normal file
22
src/Discord.Net.Rest/API/Common/GuildMember.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class GuildMember
|
||||
{
|
||||
[JsonProperty("user")]
|
||||
public User User { get; set; }
|
||||
[JsonProperty("nick")]
|
||||
public Optional<string> Nick { get; set; }
|
||||
[JsonProperty("roles")]
|
||||
public ulong[] Roles { get; set; }
|
||||
[JsonProperty("joined_at")]
|
||||
public DateTimeOffset JoinedAt { get; set; }
|
||||
[JsonProperty("deaf")]
|
||||
public bool Deaf { get; set; }
|
||||
[JsonProperty("mute")]
|
||||
public bool Mute { get; set; }
|
||||
}
|
||||
}
|
||||
32
src/Discord.Net.Rest/API/Common/Integration.cs
Normal file
32
src/Discord.Net.Rest/API/Common/Integration.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Integration
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
[JsonProperty("enabled")]
|
||||
public bool Enabled { get; set; }
|
||||
[JsonProperty("syncing")]
|
||||
public bool Syncing { get; set; }
|
||||
[JsonProperty("role_id")]
|
||||
public ulong RoleId { get; set; }
|
||||
[JsonProperty("expire_behavior")]
|
||||
public ulong ExpireBehavior { get; set; }
|
||||
[JsonProperty("expire_grace_period")]
|
||||
public ulong ExpireGracePeriod { get; set; }
|
||||
[JsonProperty("user")]
|
||||
public User User { get; set; }
|
||||
[JsonProperty("account")]
|
||||
public IntegrationAccount Account { get; set; }
|
||||
[JsonProperty("synced_at")]
|
||||
public DateTimeOffset SyncedAt { get; set; }
|
||||
}
|
||||
}
|
||||
13
src/Discord.Net.Rest/API/Common/IntegrationAccount.cs
Normal file
13
src/Discord.Net.Rest/API/Common/IntegrationAccount.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class IntegrationAccount
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
15
src/Discord.Net.Rest/API/Common/Invite.cs
Normal file
15
src/Discord.Net.Rest/API/Common/Invite.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Invite
|
||||
{
|
||||
[JsonProperty("code")]
|
||||
public string Code { get; set; }
|
||||
[JsonProperty("guild")]
|
||||
public InviteGuild Guild { get; set; }
|
||||
[JsonProperty("channel")]
|
||||
public InviteChannel Channel { get; set; }
|
||||
}
|
||||
}
|
||||
15
src/Discord.Net.Rest/API/Common/InviteChannel.cs
Normal file
15
src/Discord.Net.Rest/API/Common/InviteChannel.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class InviteChannel
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
}
|
||||
}
|
||||
15
src/Discord.Net.Rest/API/Common/InviteGuild.cs
Normal file
15
src/Discord.Net.Rest/API/Common/InviteGuild.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class InviteGuild
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("splash_hash")]
|
||||
public string SplashHash { get; set; }
|
||||
}
|
||||
}
|
||||
24
src/Discord.Net.Rest/API/Common/InviteMetadata.cs
Normal file
24
src/Discord.Net.Rest/API/Common/InviteMetadata.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class InviteMetadata : Invite
|
||||
{
|
||||
[JsonProperty("inviter")]
|
||||
public User Inviter { get; set; }
|
||||
[JsonProperty("uses")]
|
||||
public int Uses { get; set; }
|
||||
[JsonProperty("max_uses")]
|
||||
public int MaxUses { get; set; }
|
||||
[JsonProperty("max_age")]
|
||||
public int MaxAge { get; set; }
|
||||
[JsonProperty("temporary")]
|
||||
public bool Temporary { get; set; }
|
||||
[JsonProperty("created_at")]
|
||||
public DateTimeOffset CreatedAt { get; set; }
|
||||
[JsonProperty("revoked")]
|
||||
public bool Revoked { get; set; }
|
||||
}
|
||||
}
|
||||
42
src/Discord.Net.Rest/API/Common/Message.cs
Normal file
42
src/Discord.Net.Rest/API/Common/Message.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Message
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public MessageType Type { get; set; }
|
||||
[JsonProperty("channel_id")]
|
||||
public ulong ChannelId { get; set; }
|
||||
[JsonProperty("webhook_id")]
|
||||
public Optional<ulong> WebhookId { get; set; }
|
||||
[JsonProperty("author")]
|
||||
public Optional<User> Author { get; set; }
|
||||
[JsonProperty("content")]
|
||||
public Optional<string> Content { get; set; }
|
||||
[JsonProperty("timestamp")]
|
||||
public Optional<DateTimeOffset> Timestamp { get; set; }
|
||||
[JsonProperty("edited_timestamp")]
|
||||
public Optional<DateTimeOffset?> EditedTimestamp { get; set; }
|
||||
[JsonProperty("tts")]
|
||||
public Optional<bool> IsTextToSpeech { get; set; }
|
||||
[JsonProperty("mention_everyone")]
|
||||
public Optional<bool> MentionEveryone { get; set; }
|
||||
[JsonProperty("mentions")]
|
||||
public Optional<EntityOrId<User>[]> UserMentions { get; set; }
|
||||
[JsonProperty("mention_roles")]
|
||||
public Optional<ulong[]> RoleMentions { get; set; }
|
||||
[JsonProperty("attachments")]
|
||||
public Optional<Attachment[]> Attachments { get; set; }
|
||||
[JsonProperty("embeds")]
|
||||
public Optional<Embed[]> Embeds { get; set; }
|
||||
[JsonProperty("pinned")]
|
||||
public Optional<bool> Pinned { get; set; }
|
||||
[JsonProperty("reactions")]
|
||||
public Optional<Reaction[]> Reactions { get; set; }
|
||||
}
|
||||
}
|
||||
17
src/Discord.Net.Rest/API/Common/Overwrite.cs
Normal file
17
src/Discord.Net.Rest/API/Common/Overwrite.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Overwrite
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong TargetId { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public PermissionTarget TargetType { get; set; }
|
||||
[JsonProperty("deny"), Int53]
|
||||
public ulong Deny { get; set; }
|
||||
[JsonProperty("allow"), Int53]
|
||||
public ulong Allow { get; set; }
|
||||
}
|
||||
}
|
||||
22
src/Discord.Net.Rest/API/Common/Presence.cs
Normal file
22
src/Discord.Net.Rest/API/Common/Presence.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Presence
|
||||
{
|
||||
[JsonProperty("user")]
|
||||
public User User { get; set; }
|
||||
[JsonProperty("guild_id")]
|
||||
public Optional<ulong> GuildId { get; set; }
|
||||
[JsonProperty("status")]
|
||||
public UserStatus Status { get; set; }
|
||||
[JsonProperty("game")]
|
||||
public Game Game { get; set; }
|
||||
|
||||
[JsonProperty("roles")]
|
||||
public Optional<ulong[]> Roles { get; set; }
|
||||
[JsonProperty("nick")]
|
||||
public Optional<string> Nick { get; set; }
|
||||
}
|
||||
}
|
||||
14
src/Discord.Net.Rest/API/Common/Reaction.cs
Normal file
14
src/Discord.Net.Rest/API/Common/Reaction.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Reaction
|
||||
{
|
||||
[JsonProperty("count")]
|
||||
public int Count { get; set; }
|
||||
[JsonProperty("me")]
|
||||
public bool Me { get; set; }
|
||||
[JsonProperty("emoji")]
|
||||
public Emoji Emoji { get; set; }
|
||||
}
|
||||
}
|
||||
15
src/Discord.Net.Rest/API/Common/ReadState.cs
Normal file
15
src/Discord.Net.Rest/API/Common/ReadState.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class ReadState
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("mention_count")]
|
||||
public int MentionCount { get; set; }
|
||||
[JsonProperty("last_message_id")]
|
||||
public Optional<ulong> LastMessageId { get; set; }
|
||||
}
|
||||
}
|
||||
15
src/Discord.Net.Rest/API/Common/Relationship.cs
Normal file
15
src/Discord.Net.Rest/API/Common/Relationship.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Relationship
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("user")]
|
||||
public User User { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public RelationshipType Type { get; set; }
|
||||
}
|
||||
}
|
||||
11
src/Discord.Net.Rest/API/Common/RelationshipType.cs
Normal file
11
src/Discord.Net.Rest/API/Common/RelationshipType.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma warning disable CS1591
|
||||
namespace Discord.API
|
||||
{
|
||||
internal enum RelationshipType
|
||||
{
|
||||
Friend = 1,
|
||||
Blocked = 2,
|
||||
IncomingPending = 3,
|
||||
OutgoingPending = 4
|
||||
}
|
||||
}
|
||||
25
src/Discord.Net.Rest/API/Common/Role.cs
Normal file
25
src/Discord.Net.Rest/API/Common/Role.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class Role
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("color")]
|
||||
public uint Color { get; set; }
|
||||
[JsonProperty("hoist")]
|
||||
public bool Hoist { get; set; }
|
||||
[JsonProperty("mentionable")]
|
||||
public bool Mentionable { get; set; }
|
||||
[JsonProperty("position")]
|
||||
public int Position { get; set; }
|
||||
[JsonProperty("permissions"), Int53]
|
||||
public ulong Permissions { get; set; }
|
||||
[JsonProperty("managed")]
|
||||
public bool Managed { get; set; }
|
||||
}
|
||||
}
|
||||
27
src/Discord.Net.Rest/API/Common/User.cs
Normal file
27
src/Discord.Net.Rest/API/Common/User.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class User
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("username")]
|
||||
public Optional<string> Username { get; set; }
|
||||
[JsonProperty("discriminator")]
|
||||
public Optional<string> Discriminator { get; set; }
|
||||
[JsonProperty("bot")]
|
||||
public Optional<bool> Bot { get; set; }
|
||||
[JsonProperty("avatar")]
|
||||
public Optional<string> Avatar { get; set; }
|
||||
|
||||
//CurrentUser
|
||||
[JsonProperty("verified")]
|
||||
public Optional<bool> Verified { get; set; }
|
||||
[JsonProperty("email")]
|
||||
public Optional<string> Email { get; set; }
|
||||
[JsonProperty("mfa_enabled")]
|
||||
public Optional<bool> MfaEnabled { get; set; }
|
||||
}
|
||||
}
|
||||
19
src/Discord.Net.Rest/API/Common/UserGuild.cs
Normal file
19
src/Discord.Net.Rest/API/Common/UserGuild.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class UserGuild
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("icon")]
|
||||
public string Icon { get; set; }
|
||||
[JsonProperty("owner")]
|
||||
public bool Owner { get; set; }
|
||||
[JsonProperty("permissions"), Int53]
|
||||
public ulong Permissions { get; set; }
|
||||
}
|
||||
}
|
||||
21
src/Discord.Net.Rest/API/Common/VoiceRegion.cs
Normal file
21
src/Discord.Net.Rest/API/Common/VoiceRegion.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class VoiceRegion
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public string Id { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("vip")]
|
||||
public bool IsVip { get; set; }
|
||||
[JsonProperty("optimal")]
|
||||
public bool IsOptimal { get; set; }
|
||||
[JsonProperty("sample_hostname")]
|
||||
public string SampleHostname { get; set; }
|
||||
[JsonProperty("sample_port")]
|
||||
public int SamplePort { get; set; }
|
||||
}
|
||||
}
|
||||
27
src/Discord.Net.Rest/API/Common/VoiceState.cs
Normal file
27
src/Discord.Net.Rest/API/Common/VoiceState.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class VoiceState
|
||||
{
|
||||
[JsonProperty("guild_id")]
|
||||
public ulong? GuildId { get; set; }
|
||||
[JsonProperty("channel_id")]
|
||||
public ulong? ChannelId { get; set; }
|
||||
[JsonProperty("user_id")]
|
||||
public ulong UserId { get; set; }
|
||||
[JsonProperty("session_id")]
|
||||
public string SessionId { get; set; }
|
||||
[JsonProperty("deaf")]
|
||||
public bool Deaf { get; set; }
|
||||
[JsonProperty("mute")]
|
||||
public bool Mute { get; set; }
|
||||
[JsonProperty("self_deaf")]
|
||||
public bool SelfDeaf { get; set; }
|
||||
[JsonProperty("self_mute")]
|
||||
public bool SelfMute { get; set; }
|
||||
[JsonProperty("suppress")]
|
||||
public bool Suppress { get; set; }
|
||||
}
|
||||
}
|
||||
19
src/Discord.Net.Rest/API/EntityOrId.cs
Normal file
19
src/Discord.Net.Rest/API/EntityOrId.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace Discord.API
|
||||
{
|
||||
internal struct EntityOrId<T>
|
||||
{
|
||||
public ulong Id { get; }
|
||||
public T Object { get; }
|
||||
|
||||
public EntityOrId(ulong id)
|
||||
{
|
||||
Id = id;
|
||||
Object = default(T);
|
||||
}
|
||||
public EntityOrId(T obj)
|
||||
{
|
||||
Id = 0;
|
||||
Object = obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
21
src/Discord.Net.Rest/API/Image.cs
Normal file
21
src/Discord.Net.Rest/API/Image.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.IO;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal struct Image
|
||||
{
|
||||
public Stream Stream { get; }
|
||||
public string Hash { get; }
|
||||
|
||||
public Image(Stream stream)
|
||||
{
|
||||
Stream = stream;
|
||||
Hash = null;
|
||||
}
|
||||
public Image(string hash)
|
||||
{
|
||||
Stream = null;
|
||||
Hash = hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
8
src/Discord.Net.Rest/API/Int53Attribute.cs
Normal file
8
src/Discord.Net.Rest/API/Int53Attribute.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma warning disable CS1591
|
||||
using System;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
internal class Int53Attribute : Attribute { }
|
||||
}
|
||||
16
src/Discord.Net.Rest/API/Net/MultipartFile.cs
Normal file
16
src/Discord.Net.Rest/API/Net/MultipartFile.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.IO;
|
||||
|
||||
namespace Discord.Net.Rest
|
||||
{
|
||||
internal struct MultipartFile
|
||||
{
|
||||
public Stream Stream { get; }
|
||||
public string Filename { get; }
|
||||
|
||||
public MultipartFile(Stream stream, string filename)
|
||||
{
|
||||
Stream = stream;
|
||||
Filename = filename;
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/Discord.Net.Rest/API/Rest/CreateChannelInviteParams.cs
Normal file
16
src/Discord.Net.Rest/API/Rest/CreateChannelInviteParams.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class CreateChannelInviteParams
|
||||
{
|
||||
[JsonProperty("max_age")]
|
||||
public Optional<int> MaxAge { get; set; }
|
||||
[JsonProperty("max_uses")]
|
||||
public Optional<int> MaxUses { get; set; }
|
||||
[JsonProperty("temporary")]
|
||||
public Optional<bool> IsTemporary { get; set; }
|
||||
}
|
||||
}
|
||||
17
src/Discord.Net.Rest/API/Rest/CreateDMChannelParams.cs
Normal file
17
src/Discord.Net.Rest/API/Rest/CreateDMChannelParams.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class CreateDMChannelParams
|
||||
{
|
||||
[JsonProperty("recipient_id")]
|
||||
public ulong RecipientId { get; }
|
||||
|
||||
public CreateDMChannelParams(ulong recipientId)
|
||||
{
|
||||
RecipientId = recipientId;
|
||||
}
|
||||
}
|
||||
}
|
||||
8
src/Discord.Net.Rest/API/Rest/CreateGuildBanParams.cs
Normal file
8
src/Discord.Net.Rest/API/Rest/CreateGuildBanParams.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma warning disable CS1591
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class CreateGuildBanParams
|
||||
{
|
||||
public Optional<int> DeleteMessageDays { get; set; }
|
||||
}
|
||||
}
|
||||
23
src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs
Normal file
23
src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class CreateGuildChannelParams
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; }
|
||||
[JsonProperty("type")]
|
||||
public ChannelType Type { get; }
|
||||
|
||||
[JsonProperty("bitrate")]
|
||||
public Optional<int> Bitrate { get; set; }
|
||||
|
||||
public CreateGuildChannelParams(string name, ChannelType type)
|
||||
{
|
||||
Name = name;
|
||||
Type = type;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class CreateGuildIntegrationParams
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; }
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; }
|
||||
|
||||
public CreateGuildIntegrationParams(ulong id, string type)
|
||||
{
|
||||
Id = id;
|
||||
Type = type;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
src/Discord.Net.Rest/API/Rest/CreateGuildParams.cs
Normal file
23
src/Discord.Net.Rest/API/Rest/CreateGuildParams.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class CreateGuildParams
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; }
|
||||
[JsonProperty("region")]
|
||||
public string RegionId { get; }
|
||||
|
||||
[JsonProperty("icon")]
|
||||
public Optional<Image?> Icon { get; set; }
|
||||
|
||||
public CreateGuildParams(string name, string regionId)
|
||||
{
|
||||
Name = name;
|
||||
RegionId = regionId;
|
||||
}
|
||||
}
|
||||
}
|
||||
24
src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs
Normal file
24
src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class CreateMessageParams
|
||||
{
|
||||
[JsonProperty("content")]
|
||||
public string Content { get; }
|
||||
|
||||
[JsonProperty("nonce")]
|
||||
public Optional<string> Nonce { get; set; }
|
||||
[JsonProperty("tts")]
|
||||
public Optional<bool> IsTTS { get; set; }
|
||||
[JsonProperty("embed")]
|
||||
public Optional<Embed> Embed { get; set; }
|
||||
|
||||
public CreateMessageParams(string content)
|
||||
{
|
||||
Content = content;
|
||||
}
|
||||
}
|
||||
}
|
||||
17
src/Discord.Net.Rest/API/Rest/DeleteMessagesParams.cs
Normal file
17
src/Discord.Net.Rest/API/Rest/DeleteMessagesParams.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class DeleteMessagesParams
|
||||
{
|
||||
[JsonProperty("messages")]
|
||||
public ulong[] MessageIds { get; }
|
||||
|
||||
public DeleteMessagesParams(ulong[] messageIds)
|
||||
{
|
||||
MessageIds = messageIds;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
src/Discord.Net.Rest/API/Rest/GetBotGatewayResponse.cs
Normal file
13
src/Discord.Net.Rest/API/Rest/GetBotGatewayResponse.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class GetBotGatewayResponse
|
||||
{
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; }
|
||||
[JsonProperty("shards")]
|
||||
public int Shards { get; set; }
|
||||
}
|
||||
}
|
||||
10
src/Discord.Net.Rest/API/Rest/GetChannelMessagesParams.cs
Normal file
10
src/Discord.Net.Rest/API/Rest/GetChannelMessagesParams.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma warning disable CS1591
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class GetChannelMessagesParams
|
||||
{
|
||||
public Optional<int> Limit { get; set; }
|
||||
public Optional<Direction> RelativeDirection { get; set; }
|
||||
public Optional<ulong> RelativeMessageId { get; set; }
|
||||
}
|
||||
}
|
||||
11
src/Discord.Net.Rest/API/Rest/GetGatewayResponse.cs
Normal file
11
src/Discord.Net.Rest/API/Rest/GetGatewayResponse.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class GetGatewayResponse
|
||||
{
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; }
|
||||
}
|
||||
}
|
||||
9
src/Discord.Net.Rest/API/Rest/GetGuildMembersParams.cs
Normal file
9
src/Discord.Net.Rest/API/Rest/GetGuildMembersParams.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma warning disable CS1591
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class GetGuildMembersParams
|
||||
{
|
||||
public Optional<int> Limit { get; set; }
|
||||
public Optional<ulong> AfterUserId { get; set; }
|
||||
}
|
||||
}
|
||||
11
src/Discord.Net.Rest/API/Rest/GetGuildPruneCountResponse.cs
Normal file
11
src/Discord.Net.Rest/API/Rest/GetGuildPruneCountResponse.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class GetGuildPruneCountResponse
|
||||
{
|
||||
[JsonProperty("pruned")]
|
||||
public int Pruned { get; set; }
|
||||
}
|
||||
}
|
||||
8
src/Discord.Net.Rest/API/Rest/GetReactionUsersParams.cs
Normal file
8
src/Discord.Net.Rest/API/Rest/GetReactionUsersParams.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class GetReactionUsersParams
|
||||
{
|
||||
public Optional<int> Limit { get; set; }
|
||||
public Optional<ulong> AfterUserId { get; set; }
|
||||
}
|
||||
}
|
||||
17
src/Discord.Net.Rest/API/Rest/GuildPruneParams.cs
Normal file
17
src/Discord.Net.Rest/API/Rest/GuildPruneParams.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class GuildPruneParams
|
||||
{
|
||||
[JsonProperty("days")]
|
||||
public int Days { get; }
|
||||
|
||||
public GuildPruneParams(int days)
|
||||
{
|
||||
Days = days;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyChannelPermissionsParams
|
||||
{
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; }
|
||||
[JsonProperty("allow")]
|
||||
public ulong Allow { get; }
|
||||
[JsonProperty("deny")]
|
||||
public ulong Deny { get; }
|
||||
|
||||
public ModifyChannelPermissionsParams(string type, ulong allow, ulong deny)
|
||||
{
|
||||
Type = type;
|
||||
Allow = allow;
|
||||
Deny = deny;
|
||||
}
|
||||
}
|
||||
}
|
||||
17
src/Discord.Net.Rest/API/Rest/ModifyCurrentUserNickParams.cs
Normal file
17
src/Discord.Net.Rest/API/Rest/ModifyCurrentUserNickParams.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyCurrentUserNickParams
|
||||
{
|
||||
[JsonProperty("nick")]
|
||||
public string Nickname { get; }
|
||||
|
||||
public ModifyCurrentUserNickParams(string nickname)
|
||||
{
|
||||
Nickname = nickname;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
src/Discord.Net.Rest/API/Rest/ModifyCurrentUserParams.cs
Normal file
14
src/Discord.Net.Rest/API/Rest/ModifyCurrentUserParams.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyCurrentUserParams
|
||||
{
|
||||
[JsonProperty("username")]
|
||||
public Optional<string> Username { get; set; }
|
||||
[JsonProperty("avatar")]
|
||||
public Optional<Image?> Avatar { get; set; }
|
||||
}
|
||||
}
|
||||
14
src/Discord.Net.Rest/API/Rest/ModifyGuildChannelParams.cs
Normal file
14
src/Discord.Net.Rest/API/Rest/ModifyGuildChannelParams.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildChannelParams
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public Optional<string> Name { get; set; }
|
||||
[JsonProperty("position")]
|
||||
public Optional<int> Position { get; set; }
|
||||
}
|
||||
}
|
||||
20
src/Discord.Net.Rest/API/Rest/ModifyGuildChannelsParams.cs
Normal file
20
src/Discord.Net.Rest/API/Rest/ModifyGuildChannelsParams.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildChannelsParams
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("position")]
|
||||
public int Position { get; set; }
|
||||
|
||||
public ModifyGuildChannelsParams(ulong id, int position)
|
||||
{
|
||||
Id = id;
|
||||
Position = position;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
src/Discord.Net.Rest/API/Rest/ModifyGuildEmbedParams.cs
Normal file
14
src/Discord.Net.Rest/API/Rest/ModifyGuildEmbedParams.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildEmbedParams
|
||||
{
|
||||
[JsonProperty("enabled")]
|
||||
public Optional<bool> Enabled { get; set; }
|
||||
[JsonProperty("channel")]
|
||||
public Optional<ulong?> ChannelId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildIntegrationParams
|
||||
{
|
||||
[JsonProperty("expire_behavior")]
|
||||
public Optional<int> ExpireBehavior { get; set; }
|
||||
[JsonProperty("expire_grace_period")]
|
||||
public Optional<int> ExpireGracePeriod { get; set; }
|
||||
[JsonProperty("enable_emoticons")]
|
||||
public Optional<bool> EnableEmoticons { get; set; }
|
||||
}
|
||||
}
|
||||
20
src/Discord.Net.Rest/API/Rest/ModifyGuildMemberParams.cs
Normal file
20
src/Discord.Net.Rest/API/Rest/ModifyGuildMemberParams.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildMemberParams
|
||||
{
|
||||
[JsonProperty("mute")]
|
||||
public Optional<bool> Mute { get; set; }
|
||||
[JsonProperty("deaf")]
|
||||
public Optional<bool> Deaf { get; set; }
|
||||
[JsonProperty("nick")]
|
||||
public Optional<string> Nickname { get; set; }
|
||||
[JsonProperty("roles")]
|
||||
public Optional<ulong[]> RoleIds { get; set; }
|
||||
[JsonProperty("channel_id")]
|
||||
public Optional<ulong> ChannelId { get; set; }
|
||||
}
|
||||
}
|
||||
30
src/Discord.Net.Rest/API/Rest/ModifyGuildParams.cs
Normal file
30
src/Discord.Net.Rest/API/Rest/ModifyGuildParams.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildParams
|
||||
{
|
||||
[JsonProperty("username")]
|
||||
public Optional<string> Username { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public Optional<string> Name { get; set; }
|
||||
[JsonProperty("region")]
|
||||
public Optional<string> RegionId { get; set; }
|
||||
[JsonProperty("verification_level")]
|
||||
public Optional<VerificationLevel> VerificationLevel { get; set; }
|
||||
[JsonProperty("default_message_notifications")]
|
||||
public Optional<DefaultMessageNotifications> DefaultMessageNotifications { get; set; }
|
||||
[JsonProperty("afk_timeout")]
|
||||
public Optional<int> AfkTimeout { get; set; }
|
||||
[JsonProperty("icon")]
|
||||
public Optional<Image?> Icon { get; set; }
|
||||
[JsonProperty("splash")]
|
||||
public Optional<Image?> Splash { get; set; }
|
||||
[JsonProperty("afk_channel_id")]
|
||||
public Optional<ulong?> AfkChannelId { get; set; }
|
||||
[JsonProperty("owner_id")]
|
||||
public Optional<ulong> OwnerId { get; set; }
|
||||
}
|
||||
}
|
||||
22
src/Discord.Net.Rest/API/Rest/ModifyGuildRoleParams.cs
Normal file
22
src/Discord.Net.Rest/API/Rest/ModifyGuildRoleParams.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildRoleParams
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public Optional<string> Name { get; set; }
|
||||
[JsonProperty("permissions")]
|
||||
public Optional<ulong> Permissions { get; set; }
|
||||
[JsonProperty("position")]
|
||||
public Optional<int> Position { get; set; }
|
||||
[JsonProperty("color")]
|
||||
public Optional<uint> Color { get; set; }
|
||||
[JsonProperty("hoist")]
|
||||
public Optional<bool> Hoist { get; set; }
|
||||
[JsonProperty("mentionable")]
|
||||
public Optional<bool> Mentionable { get; set; }
|
||||
}
|
||||
}
|
||||
17
src/Discord.Net.Rest/API/Rest/ModifyGuildRolesParams.cs
Normal file
17
src/Discord.Net.Rest/API/Rest/ModifyGuildRolesParams.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildRolesParams : ModifyGuildRoleParams
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; }
|
||||
|
||||
public ModifyGuildRolesParams(ulong id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
src/Discord.Net.Rest/API/Rest/ModifyMessageParams.cs
Normal file
14
src/Discord.Net.Rest/API/Rest/ModifyMessageParams.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyMessageParams
|
||||
{
|
||||
[JsonProperty("content")]
|
||||
public Optional<string> Content { get; set; }
|
||||
[JsonProperty("embed")]
|
||||
public Optional<Embed> Embed { get; set; }
|
||||
}
|
||||
}
|
||||
12
src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs
Normal file
12
src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyTextChannelParams : ModifyGuildChannelParams
|
||||
{
|
||||
[JsonProperty("topic")]
|
||||
public Optional<string> Topic { get; set; }
|
||||
}
|
||||
}
|
||||
14
src/Discord.Net.Rest/API/Rest/ModifyVoiceChannelParams.cs
Normal file
14
src/Discord.Net.Rest/API/Rest/ModifyVoiceChannelParams.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyVoiceChannelParams : ModifyGuildChannelParams
|
||||
{
|
||||
[JsonProperty("bitrate")]
|
||||
public Optional<int> Bitrate { get; set; }
|
||||
[JsonProperty("user_limit")]
|
||||
public Optional<int> UserLimit { get; set; }
|
||||
}
|
||||
}
|
||||
35
src/Discord.Net.Rest/API/Rest/UploadFileParams.cs
Normal file
35
src/Discord.Net.Rest/API/Rest/UploadFileParams.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma warning disable CS1591
|
||||
using Discord.Net.Rest;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class UploadFileParams
|
||||
{
|
||||
public Stream File { get; }
|
||||
|
||||
public Optional<string> Filename { get; set; }
|
||||
public Optional<string> Content { get; set; }
|
||||
public Optional<string> Nonce { get; set; }
|
||||
public Optional<bool> IsTTS { get; set; }
|
||||
|
||||
public UploadFileParams(Stream file)
|
||||
{
|
||||
File = file;
|
||||
}
|
||||
|
||||
public IReadOnlyDictionary<string, object> ToDictionary()
|
||||
{
|
||||
var d = new Dictionary<string, object>();
|
||||
d["file"] = new MultipartFile(File, Filename.GetValueOrDefault("unknown.dat"));
|
||||
if (Content.IsSpecified)
|
||||
d["content"] = Content.Value;
|
||||
if (IsTTS.IsSpecified)
|
||||
d["tts"] = IsTTS.Value.ToString();
|
||||
if (Nonce.IsSpecified)
|
||||
d["nonce"] = Nonce.Value;
|
||||
return d;
|
||||
}
|
||||
}
|
||||
}
|
||||
20
src/Discord.Net.Rest/API/RpcFrame.cs
Normal file
20
src/Discord.Net.Rest/API/RpcFrame.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Discord.API.Rpc
|
||||
{
|
||||
internal class RpcFrame
|
||||
{
|
||||
[JsonProperty("cmd")]
|
||||
public string Cmd { get; set; }
|
||||
[JsonProperty("nonce")]
|
||||
public Optional<Guid?> Nonce { get; set; }
|
||||
[JsonProperty("evt")]
|
||||
public Optional<string> Event { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public Optional<object> Data { get; set; }
|
||||
[JsonProperty("args")]
|
||||
public object Args { get; set; }
|
||||
}
|
||||
}
|
||||
17
src/Discord.Net.Rest/API/SocketFrame.cs
Normal file
17
src/Discord.Net.Rest/API/SocketFrame.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
internal class SocketFrame
|
||||
{
|
||||
[JsonProperty("op")]
|
||||
public int Operation { get; set; }
|
||||
[JsonProperty("t", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string Type { get; set; }
|
||||
[JsonProperty("s", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public int? Sequence { get; set; }
|
||||
[JsonProperty("d")]
|
||||
public object Payload { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user