Updated Application model

This commit is contained in:
RogueException
2016-10-07 21:19:04 -03:00
parent e4a3a9e6e2
commit a1fd14fff0
3 changed files with 10 additions and 25 deletions

View File

@@ -11,13 +11,14 @@ namespace Discord.API
public string[] RPCOrigins { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("flags"), Int53]
public ulong Flags { get; set; }
[JsonProperty("owner")]
public User Owner { 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; }
}
}

View File

@@ -34,9 +34,12 @@ namespace Discord.Rest
Description = model.Description;
RPCOrigins = model.RPCOrigins;
Name = model.Name;
Flags = model.Flags;
Owner = RestUser.Create(Discord, model.Owner);
_iconId = model.Icon;
if (model.Flags.IsSpecified)
Flags = model.Flags.Value; //TODO: Do we still need this?
if (model.Owner.IsSpecified)
Owner = RestUser.Create(Discord, model.Owner.Value);
}
public async Task UpdateAsync()

View File

@@ -1,19 +0,0 @@
#pragma warning disable CS1591
using Newtonsoft.Json;
namespace Discord.API.Rpc
{
public class Application
{
[JsonProperty("description")]
public string Description { get; set; }
[JsonProperty("icon")]
public string Icon { get; set; }
[JsonProperty("id")]
public ulong Id { get; set; }
[JsonProperty("rpc_origins")]
public string[] RpcOrigins { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
}
}