aws-sdk-drs 1.101.0

AWS SDK for Elastic Disaster Recovery Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct StartRecoveryInput {
    /// <p>The Source Servers that we want to start a Recovery Job for.</p>
    pub source_servers: ::std::option::Option<::std::vec::Vec<crate::types::StartRecoveryRequestSourceServer>>,
    /// <p>Whether this Source Server Recovery operation is a drill or not.</p>
    pub is_drill: ::std::option::Option<bool>,
    /// <p>The tags to be associated with the Recovery Job.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl StartRecoveryInput {
    /// <p>The Source Servers that we want to start a Recovery Job for.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.source_servers.is_none()`.
    pub fn source_servers(&self) -> &[crate::types::StartRecoveryRequestSourceServer] {
        self.source_servers.as_deref().unwrap_or_default()
    }
    /// <p>Whether this Source Server Recovery operation is a drill or not.</p>
    pub fn is_drill(&self) -> ::std::option::Option<bool> {
        self.is_drill
    }
    /// <p>The tags to be associated with the Recovery Job.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl ::std::fmt::Debug for StartRecoveryInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("StartRecoveryInput");
        formatter.field("source_servers", &self.source_servers);
        formatter.field("is_drill", &self.is_drill);
        formatter.field("tags", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl StartRecoveryInput {
    /// Creates a new builder-style object to manufacture [`StartRecoveryInput`](crate::operation::start_recovery::StartRecoveryInput).
    pub fn builder() -> crate::operation::start_recovery::builders::StartRecoveryInputBuilder {
        crate::operation::start_recovery::builders::StartRecoveryInputBuilder::default()
    }
}

/// A builder for [`StartRecoveryInput`](crate::operation::start_recovery::StartRecoveryInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct StartRecoveryInputBuilder {
    pub(crate) source_servers: ::std::option::Option<::std::vec::Vec<crate::types::StartRecoveryRequestSourceServer>>,
    pub(crate) is_drill: ::std::option::Option<bool>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl StartRecoveryInputBuilder {
    /// Appends an item to `source_servers`.
    ///
    /// To override the contents of this collection use [`set_source_servers`](Self::set_source_servers).
    ///
    /// <p>The Source Servers that we want to start a Recovery Job for.</p>
    pub fn source_servers(mut self, input: crate::types::StartRecoveryRequestSourceServer) -> Self {
        let mut v = self.source_servers.unwrap_or_default();
        v.push(input);
        self.source_servers = ::std::option::Option::Some(v);
        self
    }
    /// <p>The Source Servers that we want to start a Recovery Job for.</p>
    pub fn set_source_servers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StartRecoveryRequestSourceServer>>) -> Self {
        self.source_servers = input;
        self
    }
    /// <p>The Source Servers that we want to start a Recovery Job for.</p>
    pub fn get_source_servers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StartRecoveryRequestSourceServer>> {
        &self.source_servers
    }
    /// <p>Whether this Source Server Recovery operation is a drill or not.</p>
    pub fn is_drill(mut self, input: bool) -> Self {
        self.is_drill = ::std::option::Option::Some(input);
        self
    }
    /// <p>Whether this Source Server Recovery operation is a drill or not.</p>
    pub fn set_is_drill(mut self, input: ::std::option::Option<bool>) -> Self {
        self.is_drill = input;
        self
    }
    /// <p>Whether this Source Server Recovery operation is a drill or not.</p>
    pub fn get_is_drill(&self) -> &::std::option::Option<bool> {
        &self.is_drill
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags to be associated with the Recovery Job.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The tags to be associated with the Recovery Job.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags to be associated with the Recovery Job.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`StartRecoveryInput`](crate::operation::start_recovery::StartRecoveryInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::start_recovery::StartRecoveryInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::start_recovery::StartRecoveryInput {
            source_servers: self.source_servers,
            is_drill: self.is_drill,
            tags: self.tags,
        })
    }
}
impl ::std::fmt::Debug for StartRecoveryInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("StartRecoveryInputBuilder");
        formatter.field("source_servers", &self.source_servers);
        formatter.field("is_drill", &self.is_drill);
        formatter.field("tags", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}