#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct CreateSecretRequest {
    #[builder(into)]
    #[serde(rename = "name")]
    name: String,
    #[builder(into)]
    #[serde(rename = "description")]
    description: String,
    #[builder(into)]
    #[serde(rename = "decryptedValue")]
    decrypted_value: String,
    #[builder(default, map(key(type = String, into), value(type = String, into)))]
    #[serde(
        rename = "properties",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    properties: std::collections::BTreeMap<String, String>,
    #[builder(default, set(item(type = String, into)))]
    #[serde(
        rename = "labels",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    labels: std::collections::BTreeSet<String>,
    #[builder(default, into)]
    #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
    workspace: Option<conjure_object::ResourceIdentifier>,
}
impl CreateSecretRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        name: impl Into<String>,
        description: impl Into<String>,
        decrypted_value: impl Into<String>,
    ) -> Self {
        Self::builder()
            .name(name)
            .description(description)
            .decrypted_value(decrypted_value)
            .build()
    }
    #[inline]
    pub fn name(&self) -> &str {
        &*self.name
    }
    #[inline]
    pub fn description(&self) -> &str {
        &*self.description
    }
    #[inline]
    pub fn decrypted_value(&self) -> &str {
        &*self.decrypted_value
    }
    #[inline]
    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
        &self.properties
    }
    #[inline]
    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
        &self.labels
    }
    /// The workspace in which to create the secret. If not provided, the secret will be created in
    /// the default workspace for the user's organization, if the default workspace for the
    /// organization is configured.
    #[inline]
    pub fn workspace(&self) -> Option<&conjure_object::ResourceIdentifier> {
        self.workspace.as_ref().map(|o| &*o)
    }
}
