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.
pub use crate::operation::put_launch_action::_put_launch_action_input::PutLaunchActionInputBuilder;

pub use crate::operation::put_launch_action::_put_launch_action_output::PutLaunchActionOutputBuilder;

impl crate::operation::put_launch_action::builders::PutLaunchActionInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::put_launch_action::PutLaunchActionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_launch_action::PutLaunchActionError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.put_launch_action();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `PutLaunchAction`.
///
/// <p>Puts a resource launch action.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct PutLaunchActionFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::put_launch_action::builders::PutLaunchActionInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::put_launch_action::PutLaunchActionOutput,
        crate::operation::put_launch_action::PutLaunchActionError,
    > for PutLaunchActionFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::put_launch_action::PutLaunchActionOutput,
            crate::operation::put_launch_action::PutLaunchActionError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl PutLaunchActionFluentBuilder {
    /// Creates a new `PutLaunchActionFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the PutLaunchAction as a reference.
    pub fn as_input(&self) -> &crate::operation::put_launch_action::builders::PutLaunchActionInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::put_launch_action::PutLaunchActionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_launch_action::PutLaunchActionError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::put_launch_action::PutLaunchAction::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::put_launch_action::PutLaunchAction::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::put_launch_action::PutLaunchActionOutput,
        crate::operation::put_launch_action::PutLaunchActionError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>Launch configuration template Id or Source Server Id</p>
    pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.resource_id(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.inner = self.inner.set_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.inner.get_resource_id()
    }
    /// <p>Launch action code.</p>
    pub fn action_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.action_code(input.into());
        self
    }
    /// <p>Launch action code.</p>
    pub fn set_action_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_action_code(input);
        self
    }
    /// <p>Launch action code.</p>
    pub fn get_action_code(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_action_code()
    }
    /// <p>Launch action order.</p>
    pub fn order(mut self, input: i32) -> Self {
        self.inner = self.inner.order(input);
        self
    }
    /// <p>Launch action order.</p>
    pub fn set_order(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_order(input);
        self
    }
    /// <p>Launch action order.</p>
    pub fn get_order(&self) -> &::std::option::Option<i32> {
        self.inner.get_order()
    }
    /// <p>Launch action Id.</p>
    pub fn action_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.action_id(input.into());
        self
    }
    /// <p>Launch action Id.</p>
    pub fn set_action_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_action_id(input);
        self
    }
    /// <p>Launch action Id.</p>
    pub fn get_action_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_action_id()
    }
    /// <p>Whether the launch will not be marked as failed if this action fails.</p>
    pub fn optional(mut self, input: bool) -> Self {
        self.inner = self.inner.optional(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.inner = self.inner.set_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.inner.get_optional()
    }
    /// <p>Whether the launch action is active.</p>
    pub fn active(mut self, input: bool) -> Self {
        self.inner = self.inner.active(input);
        self
    }
    /// <p>Whether the launch action is active.</p>
    pub fn set_active(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_active(input);
        self
    }
    /// <p>Whether the launch action is active.</p>
    pub fn get_active(&self) -> &::std::option::Option<bool> {
        self.inner.get_active()
    }
    /// <p>Launch action name.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// <p>Launch action name.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// <p>Launch action name.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>Launch action version.</p>
    pub fn action_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.action_version(input.into());
        self
    }
    /// <p>Launch action version.</p>
    pub fn set_action_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_action_version(input);
        self
    }
    /// <p>Launch action version.</p>
    pub fn get_action_version(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_action_version()
    }
    /// <p>Launch action category.</p>
    pub fn category(mut self, input: crate::types::LaunchActionCategory) -> Self {
        self.inner = self.inner.category(input);
        self
    }
    /// <p>Launch action category.</p>
    pub fn set_category(mut self, input: ::std::option::Option<crate::types::LaunchActionCategory>) -> Self {
        self.inner = self.inner.set_category(input);
        self
    }
    /// <p>Launch action category.</p>
    pub fn get_category(&self) -> &::std::option::Option<crate::types::LaunchActionCategory> {
        self.inner.get_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 {
        self.inner = self.inner.parameters(k.into(), v);
        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.inner = self.inner.set_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.inner.get_parameters()
    }
    /// <p>Launch action description.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>Launch action description.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>Launch action description.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
}