/// Rename one or more source property keys to a single target key.
/// Existing values are preserved under the new key.
/// The rename should be skipped in the service for resources w/ conflicting keys.
#[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 RenamePropertyKey {
    #[builder(default, set(item(type = String, into)))]
    #[serde(
        rename = "source",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    source: std::collections::BTreeSet<String>,
    #[builder(into)]
    #[serde(rename = "target")]
    target: String,
    #[builder(custom(type = super::ConflictBehavior, convert = Box::new))]
    #[serde(rename = "onConflict")]
    on_conflict: Box<super::ConflictBehavior>,
}
impl RenamePropertyKey {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(target: impl Into<String>, on_conflict: super::ConflictBehavior) -> Self {
        Self::builder().target(target).on_conflict(on_conflict).build()
    }
    #[inline]
    pub fn source(&self) -> &std::collections::BTreeSet<String> {
        &self.source
    }
    #[inline]
    pub fn target(&self) -> &str {
        &*self.target
    }
    #[inline]
    pub fn on_conflict(&self) -> &super::ConflictBehavior {
        &*self.on_conflict
    }
}
