improve usability of Account struct
parent
bf0a44fa9f
commit
406ca3be53
|
@ -247,12 +247,29 @@ pub struct CapabilitiesObject {
|
|||
#[derive(Deserialize, Serialize, Debug)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Account {
|
||||
name: String,
|
||||
is_personal: bool,
|
||||
is_read_only: bool,
|
||||
account_capabilities: HashMap<String, Value>,
|
||||
pub name: String,
|
||||
pub is_personal: bool,
|
||||
pub is_read_only: bool,
|
||||
pub account_capabilities: HashMap<String, Value>,
|
||||
#[serde(flatten)]
|
||||
extra_properties: HashMap<String, Value>,
|
||||
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>,
|
||||
) -> Self {
|
||||
Self {
|
||||
name,
|
||||
is_personal,
|
||||
is_read_only,
|
||||
account_capabilities,
|
||||
extra_properties: HashMap::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Object for Account {
|
||||
|
|
Loading…
Reference in New Issue