public AccountDetails getAccountDetails(int accountId)
{
var url = apiUrl + "/api/accounts/" + accountId + ".json";
var response = executeRequest(url);
var jo = (JObject)JsonConvert.DeserializeObject(response);
var details = new AccountDetails
{
accountId = String.IsNullOrEmpty(jo["account_id"].ToString()) ? 0 : int.Parse(jo["account_id"].ToString()),
title = (string)jo["title"],
bandwidth = String.IsNullOrEmpty(jo["bandwidth"].ToString()) ? 0 : Int64.Parse(jo["bandwidth"].ToString()),
cost = new AccountCostDetails
{
monthly = String.IsNullOrEmpty(jo["cost"]["monthly"].ToString()) ? 0 : int.Parse(jo["cost"]["monthly"].ToString()),
currency = (string)jo["cost"]["currency"]
},
rights = new AccountRightsDetails
{
borderless = String.IsNullOrEmpty(jo["rights"]["borderless"].ToString()) ? false : bool.Parse(jo["rights"]["borderless"].ToString()),
searchEnhancer = String.IsNullOrEmpty(jo["rights"]["searchEnhancer"].ToString()) ? false : bool.Parse(jo["rights"]["searchEnhancer"].ToString()),
}
};
return details;
}