improve usability of Account struct

proxy-updates
Ujjwal Sharma 2021-08-05 14:37:02 +05:30
parent bf0a44fa9f
commit 406ca3be53
Failed to generate hash of commit
1 changed files with 22 additions and 5 deletions

View File

@ -247,12 +247,29 @@ pub struct CapabilitiesObject {
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Account {
pub name: String,
pub is_personal: bool,
pub is_read_only: bool,
pub account_capabilities: HashMap<String, Value>,
#[serde(flatten)]
pub extra_properties: HashMap<String, Value>,
}
impl Account {
pub fn new(
name: String,
is_personal: bool,
is_read_only: bool,
account_capabilities: HashMap<String, Value>,
#[serde(flatten)]
extra_properties: HashMap<String, Value>,
) -> Self {
Self {
name,
is_personal,
is_read_only,
account_capabilities,
extra_properties: HashMap::default(),
}
}
}
impl Object for Account {