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