#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct CreateSecretRequestInput {
#[serde(rename = "name")]
pub name: String,
#[serde(
rename = "description",
default,
skip_serializing_if = "Option::is_none"
)]
pub description: Option<String>,
#[serde(rename = "tags", default, skip_serializing_if = "Option::is_none")]
pub tags: Option<TagsInput>,
#[serde(rename = "value")]
pub value: String,
#[serde(
rename = "recovery_window_days",
default,
skip_serializing_if = "Option::is_none"
)]
pub recovery_window_days: Option<i64>,
#[serde(rename = "kms_key", default, skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
}
impl CreateSecretRequestInput {
#[allow(clippy::too_many_arguments)]
pub fn new(name: String, value: String) -> Self {
Self {
name,
description: None,
tags: None,
value,
recovery_window_days: None,
kms_key: None,
}
}
}
pub type TagsInput = std::collections::BTreeMap<String, String>;
pub type CreateSecretBody = CreateSecretRequestInput;
#[derive(Clone, serde::Serialize, serde::Deserialize)]
pub struct SecretResponse {
#[serde(rename = "secret")]
pub secret: Secret,
}
impl std::fmt::Debug for SecretResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut d = f.debug_struct("SecretResponse");
d.field("secret", &"[REDACTED]");
d.finish()
}
}
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct Secret {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "name")]
pub name: String,
#[serde(
rename = "description",
default,
skip_serializing_if = "Option::is_none"
)]
pub description: Option<String>,
#[serde(rename = "tags", default, skip_serializing_if = "Option::is_none")]
pub tags: Option<Tags>,
#[serde(rename = "crn")]
pub crn: String,
#[serde(rename = "kms_key", default, skip_serializing_if = "Option::is_none")]
pub kms_key: Option<ResourceRef>,
#[serde(rename = "managed")]
pub managed: bool,
#[serde(
rename = "deleted_at",
default,
skip_serializing_if = "Option::is_none",
deserialize_with = "crate::response::present_nullable"
)]
pub deleted_at: Option<crate::Nullable<String>>,
#[serde(
rename = "scheduled_purge_at",
default,
skip_serializing_if = "Option::is_none",
deserialize_with = "crate::response::present_nullable"
)]
pub scheduled_purge_at: Option<crate::Nullable<String>>,
#[serde(rename = "recovery_window_days")]
pub recovery_window_days: i64,
#[serde(
rename = "current_version",
default,
skip_serializing_if = "Option::is_none"
)]
pub current_version: Option<i64>,
#[serde(rename = "created_at")]
pub created_at: String,
#[serde(rename = "updated_at")]
pub updated_at: String,
}
pub type Tags = std::collections::BTreeMap<String, String>;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct ResourceRef {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "crn")]
pub crn: String,
#[serde(rename = "name", default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
pub type CreateSecretResponse = SecretResponse;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, Default)]
pub struct DeleteSecretRequestInput {
#[serde(
rename = "recovery_window_days",
default,
skip_serializing_if = "Option::is_none"
)]
pub recovery_window_days: Option<i64>,
}
pub type DeleteSecretBody = DeleteSecretRequestInput;
pub type DeleteSecretResponse = SecretResponse;
pub type DescribeSecretResponse = SecretResponse;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, Default)]
pub struct GetSecretValueParameters {
#[serde(rename = "version", default, skip_serializing_if = "Option::is_none")]
pub version: Option<i64>,
}
pub type GetSecretValueQuery = GetSecretValueParameters;
#[derive(Clone, serde::Serialize, serde::Deserialize)]
pub struct SecretValueResponse {
#[serde(rename = "secret")]
pub secret: SecretValue,
}
impl std::fmt::Debug for SecretValueResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut d = f.debug_struct("SecretValueResponse");
d.field("secret", &"[REDACTED]");
d.finish()
}
}
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct SecretValue {
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "version")]
pub version: i64,
#[serde(rename = "value")]
pub value: String,
#[serde(rename = "created_at")]
pub created_at: String,
}
pub type GetSecretValueResponse = SecretValueResponse;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, Default)]
pub struct ListSecretsParameters {
#[serde(rename = "name", default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "crn", default, skip_serializing_if = "Option::is_none")]
pub crn: Option<String>,
#[serde(
rename = "include_deleted",
default,
skip_serializing_if = "Option::is_none"
)]
pub include_deleted: Option<bool>,
#[serde(rename = "marker", default, skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "limit", default, skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
}
pub type ListSecretsQuery = ListSecretsParameters;
#[derive(Clone, serde::Serialize, serde::Deserialize)]
pub struct SecretListResponse {
#[serde(rename = "secrets")]
pub secrets: Vec<Secret>,
#[serde(rename = "meta", default, skip_serializing_if = "Option::is_none")]
pub meta: Option<PaginationMeta>,
}
impl std::fmt::Debug for SecretListResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut d = f.debug_struct("SecretListResponse");
d.field("secrets", &"[REDACTED]");
d.field("meta", &self.meta);
d.finish()
}
}
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, Default)]
pub struct PaginationMeta {
#[serde(rename = "total", default, skip_serializing_if = "Option::is_none")]
pub total: Option<i64>,
#[serde(rename = "limit", default, skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "marker", default, skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "has_more", default, skip_serializing_if = "Option::is_none")]
pub has_more: Option<bool>,
}
pub type ListSecretsResponse = SecretListResponse;
pub type ListSecretsItem = Secret;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, Default)]
pub struct ListVersionsParameters {
#[serde(rename = "crn", default, skip_serializing_if = "Option::is_none")]
pub crn: Option<String>,
#[serde(rename = "marker", default, skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "limit", default, skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
}
pub type ListVersionsQuery = ListVersionsParameters;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct VersionListResponse {
#[serde(rename = "versions")]
pub versions: Vec<SecretVersion>,
#[serde(rename = "meta", default, skip_serializing_if = "Option::is_none")]
pub meta: Option<PaginationMeta>,
}
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct SecretVersion {
#[serde(rename = "crn")]
pub crn: String,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "version")]
pub version: i64,
#[serde(rename = "is_current")]
pub is_current: bool,
#[serde(rename = "created_at")]
pub created_at: String,
}
pub type ListVersionsResponse = VersionListResponse;
pub type ListVersionsItem = SecretVersion;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct PutSecretValueRequestInput {
#[serde(rename = "value")]
pub value: String,
}
impl PutSecretValueRequestInput {
#[allow(clippy::too_many_arguments)]
pub fn new(value: String) -> Self {
Self { value }
}
}
pub type PutSecretValueBody = PutSecretValueRequestInput;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct VersionResponse {
#[serde(rename = "version")]
pub version: SecretVersion,
}
pub type PutSecretValueResponse = VersionResponse;
pub type RestoreSecretResponse = SecretResponse;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, Default)]
pub struct UpdateSecretRequestInput {
#[serde(
rename = "description",
default,
skip_serializing_if = "Option::is_none"
)]
pub description: Option<String>,
#[serde(rename = "tags", default, skip_serializing_if = "Option::is_none")]
pub tags: Option<TagsInput>,
}
pub type UpdateSecretBody = UpdateSecretRequestInput;
pub type UpdateSecretResponse = SecretResponse;