Browse Source

Changed new model fields to properties

pull/147/head
RogueException 9 years ago
parent
commit
a50d6a774f
20 changed files with 52 additions and 52 deletions
  1. +1
    -1
      src/Discord.Net/API/Rest/CreateDMChannelParams.cs
  2. +1
    -1
      src/Discord.Net/API/Rest/CreateGuildBanParams.cs
  3. +3
    -3
      src/Discord.Net/API/Rest/CreateGuildChannelParams.cs
  4. +1
    -1
      src/Discord.Net/API/Rest/CreateGuildParams.cs
  5. +3
    -3
      src/Discord.Net/API/Rest/CreateMessageParams.cs
  6. +1
    -1
      src/Discord.Net/API/Rest/DeleteMessagesParams.cs
  7. +1
    -1
      src/Discord.Net/API/Rest/GetChannelMessagesParams.cs
  8. +2
    -2
      src/Discord.Net/API/Rest/GetGuildMembersParams.cs
  9. +2
    -2
      src/Discord.Net/API/Rest/ModifyCurrentUserParams.cs
  10. +2
    -2
      src/Discord.Net/API/Rest/ModifyGuildChannelParams.cs
  11. +2
    -2
      src/Discord.Net/API/Rest/ModifyGuildEmbedParams.cs
  12. +3
    -3
      src/Discord.Net/API/Rest/ModifyGuildIntegrationParams.cs
  13. +5
    -5
      src/Discord.Net/API/Rest/ModifyGuildMemberParams.cs
  14. +10
    -10
      src/Discord.Net/API/Rest/ModifyGuildParams.cs
  15. +5
    -5
      src/Discord.Net/API/Rest/ModifyGuildRoleParams.cs
  16. +1
    -1
      src/Discord.Net/API/Rest/ModifyMessageParams.cs
  17. +2
    -2
      src/Discord.Net/API/Rest/ModifyPresenceParams.cs
  18. +1
    -1
      src/Discord.Net/API/Rest/ModifyTextChannelParams.cs
  19. +2
    -2
      src/Discord.Net/API/Rest/ModifyVoiceChannelParams.cs
  20. +4
    -4
      src/Discord.Net/API/Rest/UploadFileParams.cs

+ 1
- 1
src/Discord.Net/API/Rest/CreateDMChannelParams.cs View File

@@ -6,7 +6,7 @@ namespace Discord.API.Rest
public class CreateDMChannelParams
{
[JsonProperty("recipient_id")]
internal ulong _recipientId;
internal ulong _recipientId { get; set; }
public ulong RecipientId { set { _recipientId = value; } }
public IUser Recipient { set { _recipientId = value.Id; } }
}


+ 1
- 1
src/Discord.Net/API/Rest/CreateGuildBanParams.cs View File

@@ -6,7 +6,7 @@ namespace Discord.API.Rest
public class CreateGuildBanParams
{
[JsonProperty("delete-message-days")]
internal Optional<int> _deleteMessageDays;
internal Optional<int> _deleteMessageDays { get; set; }
public int DeleteMessageDays { set { _deleteMessageDays = value; } }
}
}

+ 3
- 3
src/Discord.Net/API/Rest/CreateGuildChannelParams.cs View File

@@ -6,15 +6,15 @@ namespace Discord.API.Rest
public class CreateGuildChannelParams
{
[JsonProperty("name")]
internal string _name;
internal string _name { get; set; }
public string Name { set { _name = value; } }

[JsonProperty("type")]
internal ChannelType _type;
internal ChannelType _type { get; set; }
public ChannelType Type { set { _type = value; } }

[JsonProperty("bitrate")]
internal Optional<int> _bitrate;
internal Optional<int> _bitrate { get; set; }
public int Bitrate { set { _bitrate = value; } }
}
}

+ 1
- 1
src/Discord.Net/API/Rest/CreateGuildParams.cs View File

@@ -13,7 +13,7 @@ namespace Discord.API.Rest
public string Region { internal get; set; }

[JsonProperty("icon")]
internal Optional<Image?> _icon;
internal Optional<Image?> _icon { get; set; }
public Stream Icon { set { _icon = value != null ? new Image(value) : (Image?)null; } }
}
}

+ 3
- 3
src/Discord.Net/API/Rest/CreateMessageParams.cs View File

@@ -6,15 +6,15 @@ namespace Discord.API.Rest
public class CreateMessageParams
{
[JsonProperty("content")]
internal string _content;
internal string _content { get; set; }
public string Content { set { _content = value; } }

[JsonProperty("nonce")]
internal Optional<string> _nonce;
internal Optional<string> _nonce { get; set; }
public string Nonce { set { _nonce = value; } }

[JsonProperty("tts")]
internal Optional<bool> _tts;
internal Optional<bool> _tts { get; set; }
public bool IsTTS { set { _tts = value; } }
}
}

+ 1
- 1
src/Discord.Net/API/Rest/DeleteMessagesParams.cs View File

@@ -8,7 +8,7 @@ namespace Discord.API.Rest
public class DeleteMessagesParams
{
[JsonProperty("messages")]
internal ulong[] _messages;
internal ulong[] _messages { get; set; }
public IEnumerable<ulong> MessageIds { set { _messages = value.ToArray(); } }
public IEnumerable<IMessage> Messages { set { _messages = value.Select(x => x.Id).ToArray(); } }
}


+ 1
- 1
src/Discord.Net/API/Rest/GetChannelMessagesParams.cs View File

@@ -6,7 +6,7 @@

public Direction RelativeDirection { internal get; set; } = Direction.Before;

internal Optional<ulong> _relativeMessageId;
internal Optional<ulong> _relativeMessageId { get; set; }
public ulong RelativeMessageId { set { _relativeMessageId = value; } }
public IMessage RelativeMessage { set { _relativeMessageId = value.Id; } }
}


+ 2
- 2
src/Discord.Net/API/Rest/GetGuildMembersParams.cs View File

@@ -2,10 +2,10 @@
{
public class GetGuildMembersParams
{
internal Optional<int> _limit;
internal Optional<int> _limit { get; set; }
public int Limit { set { _limit = value; } }

internal Optional<ulong> _afterUserId;
internal Optional<ulong> _afterUserId { get; set; }
public ulong AfterUserId { set { _afterUserId = value; } }
}
}

+ 2
- 2
src/Discord.Net/API/Rest/ModifyCurrentUserParams.cs View File

@@ -7,11 +7,11 @@ namespace Discord.API.Rest
public class ModifyCurrentUserParams
{
[JsonProperty("username")]
internal Optional<string> _username;
internal Optional<string> _username { get; set; }
public string Username { set { _username = value; } }

[JsonProperty("avatar")]
internal Optional<Image> _avatar;
internal Optional<Image> _avatar { get; set; }
public Stream Avatar { set { _avatar = new Image(value); } }
}
}

+ 2
- 2
src/Discord.Net/API/Rest/ModifyGuildChannelParams.cs View File

@@ -6,11 +6,11 @@ namespace Discord.API.Rest
public class ModifyGuildChannelParams
{
[JsonProperty("name")]
internal Optional<string> _name;
internal Optional<string> _name { get; set; }
public string Name { set { _name = value; } }

[JsonProperty("position")]
internal Optional<int> _position;
internal Optional<int> _position { get; set; }
public int Position { set { _position = value; } }
}
}

+ 2
- 2
src/Discord.Net/API/Rest/ModifyGuildEmbedParams.cs View File

@@ -6,11 +6,11 @@ namespace Discord.API.Rest
public class ModifyGuildEmbedParams
{
[JsonProperty("enabled")]
internal Optional<bool> _enabled;
internal Optional<bool> _enabled { get; set; }
public bool Enabled { set { _enabled = value; } }

[JsonProperty("channel")]
internal Optional<ulong?> _channelId;
internal Optional<ulong?> _channelId { get; set; }
public ulong? ChannelId { set { _channelId = value; } }
public IVoiceChannel Channel { set { _channelId = value != null ? value.Id : (ulong?)null; } }
}


+ 3
- 3
src/Discord.Net/API/Rest/ModifyGuildIntegrationParams.cs View File

@@ -6,15 +6,15 @@ namespace Discord.API.Rest
public class ModifyGuildIntegrationParams
{
[JsonProperty("expire_behavior")]
internal Optional<int> _expireBehavior;
internal Optional<int> _expireBehavior { get; set; }
public int ExpireBehavior { set { _expireBehavior = value; } }

[JsonProperty("expire_grace_period")]
internal Optional<int> _expireGracePeriod;
internal Optional<int> _expireGracePeriod { get; set; }
public int ExpireGracePeriod { set { _expireGracePeriod = value; } }

[JsonProperty("enable_emoticons")]
internal Optional<bool> _enableEmoticons;
internal Optional<bool> _enableEmoticons { get; set; }
public bool EnableEmoticons { set { _enableEmoticons = value; } }
}
}

+ 5
- 5
src/Discord.Net/API/Rest/ModifyGuildMemberParams.cs View File

@@ -8,24 +8,24 @@ namespace Discord.API.Rest
public class ModifyGuildMemberParams
{
[JsonProperty("mute")]
internal Optional<bool> _mute;
internal Optional<bool> _mute { get; set; }
public bool Mute { set { _mute = value; } }

[JsonProperty("deaf")]
internal Optional<bool> _deaf;
internal Optional<bool> _deaf { get; set; }
public bool Deaf { set { _deaf = value; } }

[JsonProperty("nick")]
internal Optional<string> _nickname;
internal Optional<string> _nickname { get; set; }
public string Nickname { set { _nickname = value; } }

[JsonProperty("roles")]
internal Optional<ulong[]> _roleIds;
internal Optional<ulong[]> _roleIds { get; set; }
public IEnumerable<ulong> RoleIds { set { _roleIds = value.ToArray(); } }
public IEnumerable<IRole> Roles { set { _roleIds = value.Select(x => x.Id).ToArray(); } }

[JsonProperty("channel_id")]
internal Optional<ulong> _channelId;
internal Optional<ulong> _channelId { get; set; }
public ulong VoiceChannelId { set { _channelId = value; } }
public IVoiceChannel VoiceChannel { set { _channelId = value.Id; } }
}


+ 10
- 10
src/Discord.Net/API/Rest/ModifyGuildParams.cs View File

@@ -7,44 +7,44 @@ namespace Discord.API.Rest
public class ModifyGuildParams
{
[JsonProperty("username")]
internal Optional<string> _username;
internal Optional<string> _username { get; set; }
public string Username { set { _username = value; } }

[JsonProperty("name")]
internal Optional<string> _name;
internal Optional<string> _name { get; set; }
public string Name { set { _name = value; } }

[JsonProperty("region")]
internal Optional<IVoiceRegion> _region;
internal Optional<IVoiceRegion> _region { get; set; }
public IVoiceRegion Region { set { _region = Optional.Create(value); } }

[JsonProperty("verification_level")]
internal Optional<VerificationLevel> _verificationLevel;
internal Optional<VerificationLevel> _verificationLevel { get; set; }
public VerificationLevel VerificationLevel { set { _verificationLevel = value; } }

[JsonProperty("default_message_notifications")]
internal Optional<DefaultMessageNotifications> _defaultMessageNotifications;
internal Optional<DefaultMessageNotifications> _defaultMessageNotifications { get; set; }
public DefaultMessageNotifications DefaultMessageNotifications { set { _defaultMessageNotifications = value; } }

[JsonProperty("afk_timeout")]
internal Optional<int> _afkTimeout;
internal Optional<int> _afkTimeout { get; set; }
public int AFKTimeout { set { _afkTimeout = value; } }

[JsonProperty("icon")]
internal Optional<Image?> _icon;
internal Optional<Image?> _icon { get; set; }
public Stream Icon { set { _icon = value != null ? new Image(value) : (Image?)null; } }

[JsonProperty("splash")]
internal Optional<Image?> _splash;
internal Optional<Image?> _splash { get; set; }
public Stream Splash { set { _splash = value != null ? new Image(value) : (Image?)null; } }

[JsonProperty("afk_channel_id")]
internal Optional<ulong?> _afkChannelId;
internal Optional<ulong?> _afkChannelId { get; set; }
public ulong? AFKChannelId { set { _afkChannelId = value; } }
public IVoiceChannel AFKChannel { set { _afkChannelId = value?.Id; } }

[JsonProperty("owner_id")]
internal Optional<ulong> _ownerId;
internal Optional<ulong> _ownerId { get; set; }
public ulong OwnerId { set { _ownerId = value; } }
public IGuildUser Owner { set { _ownerId = value.Id; } }
}


+ 5
- 5
src/Discord.Net/API/Rest/ModifyGuildRoleParams.cs View File

@@ -6,23 +6,23 @@ namespace Discord.API.Rest
public class ModifyGuildRoleParams
{
[JsonProperty("name")]
internal Optional<string> _name;
internal Optional<string> _name { get; set; }
public string Name { set { _name = value; } }

[JsonProperty("permissions")]
internal Optional<ulong> _permissions;
internal Optional<ulong> _permissions { get; set; }
public ulong Permissions { set { _permissions = value; } }

[JsonProperty("position")]
internal Optional<int> _position;
internal Optional<int> _position { get; set; }
public int Position { set { _position = value; } }

[JsonProperty("color")]
internal Optional<uint> _color;
internal Optional<uint> _color { get; set; }
public uint Color { set { _color = value; } }

[JsonProperty("hoist")]
internal Optional<bool> _hoist;
internal Optional<bool> _hoist { get; set; }
public bool Hoist { set { _hoist = value; } }
}
}

+ 1
- 1
src/Discord.Net/API/Rest/ModifyMessageParams.cs View File

@@ -6,7 +6,7 @@ namespace Discord.API.Rest
public class ModifyMessageParams
{
[JsonProperty("content")]
internal Optional<string> _content;
internal Optional<string> _content { get; set; }
public string Content { set { _content = value; } }
}
}

+ 2
- 2
src/Discord.Net/API/Rest/ModifyPresenceParams.cs View File

@@ -2,10 +2,10 @@
{
public class ModifyPresenceParams
{
internal Optional<UserStatus> _status;
internal Optional<UserStatus> _status { get; set; }
public UserStatus Status { set { _status = value; } }

internal Optional<Discord.Game> _game;
internal Optional<Discord.Game> _game { get; set; }
public Discord.Game Game { set { _game = value; } }
}
}

+ 1
- 1
src/Discord.Net/API/Rest/ModifyTextChannelParams.cs View File

@@ -6,7 +6,7 @@ namespace Discord.API.Rest
public class ModifyTextChannelParams : ModifyGuildChannelParams
{
[JsonProperty("topic")]
internal Optional<string> _topic;
internal Optional<string> _topic { get; set; }
public string Topic { set { _topic = value; } }
}
}

+ 2
- 2
src/Discord.Net/API/Rest/ModifyVoiceChannelParams.cs View File

@@ -6,11 +6,11 @@ namespace Discord.API.Rest
public class ModifyVoiceChannelParams : ModifyGuildChannelParams
{
[JsonProperty("bitrate")]
internal Optional<int> _bitrate;
internal Optional<int> _bitrate { get; set; }
public int Bitrate { set { _bitrate = value; } }

[JsonProperty("user_limit")]
internal Optional<int> _userLimit;
internal Optional<int> _userLimit { get; set; }
public int UserLimit { set { _userLimit = value; } }
}
}

+ 4
- 4
src/Discord.Net/API/Rest/UploadFileParams.cs View File

@@ -8,16 +8,16 @@ namespace Discord.API.Rest
{
public Stream File { internal get; set; }

internal Optional<string> _filename;
internal Optional<string> _filename { get; set; }
public string Filename { set { _filename = value; } }

internal Optional<string> _content;
internal Optional<string> _content { get; set; }
public string Content { set { _content = value; } }

internal Optional<string> _nonce;
internal Optional<string> _nonce { get; set; }
public string Nonce { set { _nonce = value; } }

internal Optional<bool> _isTTS;
internal Optional<bool> _isTTS { get; set; }
public bool IsTTS { set { _isTTS = value; } }

public UploadFileParams(Stream file)


Loading…
Cancel
Save