using AppLimit.CloudComputing.SharpBox.Common.Net.Json;
namespace AppLimit.CloudComputing.SharpBox.StorageProvider.DropBox
{
/*
* {
* “country”: “”,
* “display_name”: “John Q. User”,
* “quota_info”:
* {
* “shared”: 37378890,
* “quota”: 62277025792,
* “normal”: 263758550
* },
* “uid”: “174”
* }
*/
///
/// This class contains information about the dropbox account
///
public class DropBoxAccountInfo
{
///
/// The country where the user comes from
///
public readonly string Country;
///
/// The displayname of the user
///
public readonly string DisplayName;
///
/// The user Id
///
public readonly int UserId;
///
/// Quotainformation of dropbox
///
public readonly DropBoxQuotaInfo QuotaInfo;
internal DropBoxAccountInfo(string jmstext)
{
var jh = new JsonHelper();
if (!jh.ParseJsonMessage(jmstext))
return;
Country = jh.GetProperty("country");
DisplayName = jh.GetProperty("display_name");
UserId = jh.GetPropertyInt("uid");
var quotainfo = jh.GetSubObjectString("quota_info");
if (quotainfo != null)
QuotaInfo = new DropBoxQuotaInfo(quotainfo);
}
}
}