aws-sdk-drs 1.102.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, ::std::fmt::Debug)]
pub struct PutLaunchActionInput {
    /// <p>Launch configuration template Id or Source Server Id</p>
    pub resource_id: ::std::option::Option<::std::string::String>,
    /// <p>Launch action code.</p>
    pub action_code: ::std::option::Option<::std::string::String>,
    /// <p>Launch action order.</p>
    pub order: ::std::option::Option<i32>,
    /// <p>Launch action Id.</p>
    pub action_id: ::std::option::Option<::std::string::String>,
    /// <p>Whether the launch will not be marked as failed if this action fails.</p>
    pub optional: ::std::option::Option<bool>,
    /// <p>Whether the launch action is active.</p>
    pub active: ::std::option::Option<bool>,
    /// <p>Launch action name.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>Launch action version.</p>
    pub action_version: ::std::option::Option<::std::string::String>,
    /// <p>Launch action category.</p>
    pub category: ::std::option::Option<crate::types::LaunchActionCategory>,
    /// <p>Launch action parameters.</p>
    pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::LaunchActionParameter>>,
    /// <p>Launch action description.</p>
    pub description: ::std::option::Option<::std::string::String>,
}
impl PutLaunchActionInput {
    /// <p>Launch configuration template Id or Source Server Id</p>
    pub fn resource_id(&self) -> ::std::option::Option<&str> {
        self.resource_id.as_deref()
    }
    /// <p>Launch action code.</p>
    pub fn action_code(&self) -> ::std::option::Option<&str> {
        self.action_code.as_deref()
    }
    /// <p>Launch action order.</p>
    pub fn order(&self) -> ::std::option::Option<i32> {
        self.order
    }
    /// <p>Launch action Id.</p>
    pub fn action_id(&self) -> ::std::option::Option<&str> {
        self.action_id.as_deref()
    }
    /// <p>Whether the launch will not be marked as failed if this action fails.</p>
    pub fn optional(&self) -> ::std::option::Option<bool> {
        self.optional
    }
    /// <p>Whether the launch action is active.</p>
    pub fn active(&self) -> ::std::option::Option<bool> {
        self.active
    }
    /// <p>Launch action name.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>Launch action version.</p>
    pub fn action_version(&self) -> ::std::option::Option<&str> {
        self.action_version.as_deref()
    }
    /// <p>Launch action category.</p>
    pub fn category(&self) -> ::std::option::Option<&crate::types::LaunchActionCategory> {
        self.category.as_ref()
    }
    /// <p>Launch action parameters.</p>
    pub fn parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::LaunchActionParameter>> {
        self.parameters.as_ref()
    }
    /// <p>Launch action description.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
}
impl PutLaunchActionInput {
    /// Creates a new builder-style object to manufacture [`PutLaunchActionInput`](crate::operation::put_launch_action::PutLaunchActionInput).
    pub fn builder() -> crate::operation::put_launch_action::builders::PutLaunchActionInputBuilder {
        crate::operation::put_launch_action::builders::PutLaunchActionInputBuilder::default()
    }
}

/// A builder for [`PutLaunchActionInput`](crate::operation::put_launch_action::PutLaunchActionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutLaunchActionInputBuilder {
    pub(crate) resource_id: ::std::option::Option<::std::string::String>,
    pub(crate) action_code: ::std::option::Option<::std::string::String>,
    pub(crate) order: ::std::option::Option<i32>,
    pub(crate) action_id: ::std::option::Option<::std::string::String>,
    pub(crate) optional: ::std::option::Option<bool>,
    pub(crate) active: ::std::option::Option<bool>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) action_version: ::std::option::Option<::std::string::String>,
    pub(crate) category: ::std::option::Option<crate::types::LaunchActionCategory>,
    pub(crate) parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::LaunchActionParameter>>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
}
impl PutLaunchActionInputBuilder {
    /// <p>Launch configuration template Id or Source Server Id</p>
    /// This field is required.
    pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Launch configuration template Id or Source Server Id</p>
    pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_id = input;
        self
    }
    /// <p>Launch configuration template Id or Source Server Id</p>
    pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_id
    }
    /// <p>Launch action code.</p>
    /// This field is required.
    pub fn action_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.action_code = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Launch action code.</p>
    pub fn set_action_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.action_code = input;
        self
    }
    /// <p>Launch action code.</p>
    pub fn get_action_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.action_code
    }
    /// <p>Launch action order.</p>
    /// This field is required.
    pub fn order(mut self, input: i32) -> Self {
        self.order = ::std::option::Option::Some(input);
        self
    }
    /// <p>Launch action order.</p>
    pub fn set_order(mut self, input: ::std::option::Option<i32>) -> Self {
        self.order = input;
        self
    }
    /// <p>Launch action order.</p>
    pub fn get_order(&self) -> &::std::option::Option<i32> {
        &self.order
    }
    /// <p>Launch action Id.</p>
    /// This field is required.
    pub fn action_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.action_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Launch action Id.</p>
    pub fn set_action_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.action_id = input;
        self
    }
    /// <p>Launch action Id.</p>
    pub fn get_action_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.action_id
    }
    /// <p>Whether the launch will not be marked as failed if this action fails.</p>
    /// This field is required.
    pub fn optional(mut self, input: bool) -> Self {
        self.optional = ::std::option::Option::Some(input);
        self
    }
    /// <p>Whether the launch will not be marked as failed if this action fails.</p>
    pub fn set_optional(mut self, input: ::std::option::Option<bool>) -> Self {
        self.optional = input;
        self
    }
    /// <p>Whether the launch will not be marked as failed if this action fails.</p>
    pub fn get_optional(&self) -> &::std::option::Option<bool> {
        &self.optional
    }
    /// <p>Whether the launch action is active.</p>
    /// This field is required.
    pub fn active(mut self, input: bool) -> Self {
        self.active = ::std::option::Option::Some(input);
        self
    }
    /// <p>Whether the launch action is active.</p>
    pub fn set_active(mut self, input: ::std::option::Option<bool>) -> Self {
        self.active = input;
        self
    }
    /// <p>Whether the launch action is active.</p>
    pub fn get_active(&self) -> &::std::option::Option<bool> {
        &self.active
    }
    /// <p>Launch action name.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Launch action name.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>Launch action name.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>Launch action version.</p>
    /// This field is required.
    pub fn action_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.action_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Launch action version.</p>
    pub fn set_action_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.action_version = input;
        self
    }
    /// <p>Launch action version.</p>
    pub fn get_action_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.action_version
    }
    /// <p>Launch action category.</p>
    /// This field is required.
    pub fn category(mut self, input: crate::types::LaunchActionCategory) -> Self {
        self.category = ::std::option::Option::Some(input);
        self
    }
    /// <p>Launch action category.</p>
    pub fn set_category(mut self, input: ::std::option::Option<crate::types::LaunchActionCategory>) -> Self {
        self.category = input;
        self
    }
    /// <p>Launch action category.</p>
    pub fn get_category(&self) -> &::std::option::Option<crate::types::LaunchActionCategory> {
        &self.category
    }
    /// Adds a key-value pair to `parameters`.
    ///
    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
    ///
    /// <p>Launch action parameters.</p>
    pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::LaunchActionParameter) -> Self {
        let mut hash_map = self.parameters.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.parameters = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Launch action parameters.</p>
    pub fn set_parameters(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::LaunchActionParameter>>,
    ) -> Self {
        self.parameters = input;
        self
    }
    /// <p>Launch action parameters.</p>
    pub fn get_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::LaunchActionParameter>> {
        &self.parameters
    }
    /// <p>Launch action description.</p>
    /// This field is required.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Launch action description.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>Launch action description.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Consumes the builder and constructs a [`PutLaunchActionInput`](crate::operation::put_launch_action::PutLaunchActionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::put_launch_action::PutLaunchActionInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::put_launch_action::PutLaunchActionInput {
            resource_id: self.resource_id,
            action_code: self.action_code,
            order: self.order,
            action_id: self.action_id,
            optional: self.optional,
            active: self.active,
            name: self.name,
            action_version: self.action_version,
            category: self.category,
            parameters: self.parameters,
            description: self.description,
        })
    }
}