bitwarden-sm 3.0.0

Internal crate for the bitwarden crate. Do not use.
Documentation
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use uuid::Uuid;

use crate::{SecretsManagerClient, error::SecretsManagerError, secrets::SecretResponse};

#[allow(missing_docs)]
#[derive(Serialize, Deserialize, Debug, JsonSchema)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
pub struct SecretGetRequest {
    /// ID of the secret to retrieve
    pub id: Uuid,
}

pub(crate) async fn get_secret(
    client: &SecretsManagerClient,
    input: &SecretGetRequest,
) -> Result<SecretResponse, SecretsManagerError> {
    let client = client.client();
    let config = client.internal.get_api_configurations();
    let res = config.api_client.secrets_api().get(input.id).await?;

    let key_store = client.internal.get_key_store();

    SecretResponse::process_response(res, &mut key_store.context())
}