From 6bb5927fa9832fb3b3edd5414df262f2f4a7b9f1 Mon Sep 17 00:00:00 2001 From: holly sparkles Date: Tue, 1 Aug 2023 21:06:20 +0200 Subject: [PATCH] feat: add data structures for bitwarden items --- src/bwutil.rs | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/bwutil.rs b/src/bwutil.rs index 6815858..36597fb 100644 --- a/src/bwutil.rs +++ b/src/bwutil.rs @@ -6,9 +6,34 @@ use anyhow::{anyhow, Result, Context}; #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[serde(rename_all = "camelCase")] pub struct BitwardenFolder { - object: String, - id: String, - name: String + pub id: String, + pub name: String +} + +/// Represents an item in Bitwarden containing an SSH key. +#[derive(Default, Debug, Clone, PartialEq, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct BitwardenItem { + pub id: String, + pub name: String, + pub attachments: Option>, + pub fields: Option> +} + +/// Represents a custom field in Bitwarden. +#[derive(Default, Debug, Clone, PartialEq, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct BitwardenFieldItem { + pub name: String, + pub value: String +} + +/// Represents a file attachment in Bitwarden. +#[derive(Default, Debug, Clone, PartialEq, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct BitwardenAttachment { + pub id: String, + pub file_name: String } /// Gets the user's logged-in status from Bitwarden. -- libgit2 1.7.2