Browse Source

improve usability of Account struct

proxy-updates
Ujjwal Sharma 4 months ago
parent
commit
406ca3be53
No known key found for this signature in database GPG Key ID: 460B292812C67D9F
  1. 27
      src/rfc8620.rs

27
src/rfc8620.rs

@ -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…
Cancel
Save