diff options
Diffstat (limited to 'ipfs-api/src/response/key.rs')
-rw-r--r-- | ipfs-api/src/response/key.rs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/ipfs-api/src/response/key.rs b/ipfs-api/src/response/key.rs index 2eb7de7..2e3cf67 100644 --- a/ipfs-api/src/response/key.rs +++ b/ipfs-api/src/response/key.rs @@ -8,25 +8,37 @@ use response::serde; - #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] -pub struct KeyGenResponse { +pub struct KeyPair { pub name: String, pub id: String, } +#[derive(Debug, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct KeyPairList { + #[serde(deserialize_with = "serde::deserialize_vec")] pub keys: Vec<KeyPair>, +} + +pub type KeyGenResponse = KeyPair; + +pub type KeyListResponse = KeyPairList; #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] -pub struct KeyListResponse { - #[serde(deserialize_with = "serde::deserialize_vec")] - pub keys: Vec<KeyGenResponse>, +pub struct KeyRenameResponse { + pub was: String, + pub now: String, + pub id: String, + pub overwrite: bool, } +pub type KeyRmResponse = KeyPairList; #[cfg(test)] mod tests { deserialize_test!(v0_key_gen_0, KeyGenResponse); deserialize_test!(v0_key_list_0, KeyListResponse); + deserialize_test!(v0_key_rename_0, KeyRenameResponse); } |