bitwarden_sm/secrets/
get_by_ids.rs1use bitwarden_api_api::models::GetSecretsRequestModel;
2use bitwarden_core::client::Client;
3use schemars::JsonSchema;
4use serde::{Deserialize, Serialize};
5use uuid::Uuid;
6
7use crate::{error::SecretsManagerError, secrets::SecretsResponse};
8
9#[allow(missing_docs)]
10#[derive(Serialize, Deserialize, Debug, JsonSchema)]
11#[serde(rename_all = "camelCase", deny_unknown_fields)]
12pub struct SecretsGetRequest {
13 pub ids: Vec<Uuid>,
15}
16
17pub(crate) async fn get_secrets_by_ids(
18 client: &Client,
19 input: SecretsGetRequest,
20) -> Result<SecretsResponse, SecretsManagerError> {
21 let request = Some(GetSecretsRequestModel { ids: input.ids });
22
23 let config = client.internal.get_api_configurations().await;
24
25 let res =
26 bitwarden_api_api::apis::secrets_api::secrets_get_by_ids_post(&config.api, request).await?;
27
28 let key_store = client.internal.get_key_store();
29
30 SecretsResponse::process_response(res, &mut key_store.context())
31}