diff --git a/crates/bitwarden-api-api/src/models/base_secret_response_model.rs b/crates/bitwarden-api-api/src/models/base_secret_response_model.rs index 2b486020f..1067ebe24 100644 --- a/crates/bitwarden-api-api/src/models/base_secret_response_model.rs +++ b/crates/bitwarden-api-api/src/models/base_secret_response_model.rs @@ -12,35 +12,40 @@ pub struct BaseSecretResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "organizationId", skip_serializing_if = "Option::is_none")] - pub organization_id: Option, + #[serde(rename = "id")] + pub id: uuid::Uuid, + #[serde(rename = "organizationId")] + pub organization_id: uuid::Uuid, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, #[serde(rename = "value", skip_serializing_if = "Option::is_none")] pub value: Option, #[serde(rename = "note", skip_serializing_if = "Option::is_none")] pub note: Option, - #[serde(rename = "creationDate", skip_serializing_if = "Option::is_none")] - pub creation_date: Option, - #[serde(rename = "revisionDate", skip_serializing_if = "Option::is_none")] - pub revision_date: Option, + #[serde(rename = "creationDate")] + pub creation_date: String, + #[serde(rename = "revisionDate")] + pub revision_date: String, #[serde(rename = "projects", skip_serializing_if = "Option::is_none")] pub projects: Option>, } impl BaseSecretResponseModel { - pub fn new() -> BaseSecretResponseModel { + pub fn new( + id: uuid::Uuid, + organization_id: uuid::Uuid, + creation_date: String, + revision_date: String, + ) -> BaseSecretResponseModel { BaseSecretResponseModel { object: None, - id: None, - organization_id: None, + id, + organization_id, key: None, value: None, note: None, - creation_date: None, - revision_date: None, + creation_date, + revision_date, projects: None, } } diff --git a/crates/bitwarden-api-api/src/models/secret_response_model.rs b/crates/bitwarden-api-api/src/models/secret_response_model.rs index dffea3122..cd58d0eca 100644 --- a/crates/bitwarden-api-api/src/models/secret_response_model.rs +++ b/crates/bitwarden-api-api/src/models/secret_response_model.rs @@ -12,20 +12,20 @@ pub struct SecretResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "organizationId", skip_serializing_if = "Option::is_none")] - pub organization_id: Option, + #[serde(rename = "id")] + pub id: uuid::Uuid, + #[serde(rename = "organizationId")] + pub organization_id: uuid::Uuid, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, #[serde(rename = "value", skip_serializing_if = "Option::is_none")] pub value: Option, #[serde(rename = "note", skip_serializing_if = "Option::is_none")] pub note: Option, - #[serde(rename = "creationDate", skip_serializing_if = "Option::is_none")] - pub creation_date: Option, - #[serde(rename = "revisionDate", skip_serializing_if = "Option::is_none")] - pub revision_date: Option, + #[serde(rename = "creationDate")] + pub creation_date: String, + #[serde(rename = "revisionDate")] + pub revision_date: String, #[serde(rename = "projects", skip_serializing_if = "Option::is_none")] pub projects: Option>, #[serde(rename = "read", skip_serializing_if = "Option::is_none")] @@ -35,16 +35,21 @@ pub struct SecretResponseModel { } impl SecretResponseModel { - pub fn new() -> SecretResponseModel { + pub fn new( + id: uuid::Uuid, + organization_id: uuid::Uuid, + creation_date: String, + revision_date: String, + ) -> SecretResponseModel { SecretResponseModel { object: None, - id: None, - organization_id: None, + id, + organization_id, key: None, value: None, note: None, - creation_date: None, - revision_date: None, + creation_date, + revision_date, projects: None, read: None, write: None,