aws-sdk-lightsail 1.107.0

AWS SDK for Amazon Lightsail
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 StopInstanceInput {
    /// <p>The name of the instance (a virtual private server) to stop.</p>
    pub instance_name: ::std::option::Option<::std::string::String>,
    /// <p>When set to <code>True</code>, forces a Lightsail instance that is stuck in a <code>stopping</code> state to stop.</p><important>
    /// <p>Only use the <code>force</code> parameter if your instance is stuck in the <code>stopping</code> state. In any other state, your instance should stop normally without adding this parameter to your API request.</p>
    /// </important>
    pub force: ::std::option::Option<bool>,
}
impl StopInstanceInput {
    /// <p>The name of the instance (a virtual private server) to stop.</p>
    pub fn instance_name(&self) -> ::std::option::Option<&str> {
        self.instance_name.as_deref()
    }
    /// <p>When set to <code>True</code>, forces a Lightsail instance that is stuck in a <code>stopping</code> state to stop.</p><important>
    /// <p>Only use the <code>force</code> parameter if your instance is stuck in the <code>stopping</code> state. In any other state, your instance should stop normally without adding this parameter to your API request.</p>
    /// </important>
    pub fn force(&self) -> ::std::option::Option<bool> {
        self.force
    }
}
impl StopInstanceInput {
    /// Creates a new builder-style object to manufacture [`StopInstanceInput`](crate::operation::stop_instance::StopInstanceInput).
    pub fn builder() -> crate::operation::stop_instance::builders::StopInstanceInputBuilder {
        crate::operation::stop_instance::builders::StopInstanceInputBuilder::default()
    }
}

/// A builder for [`StopInstanceInput`](crate::operation::stop_instance::StopInstanceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StopInstanceInputBuilder {
    pub(crate) instance_name: ::std::option::Option<::std::string::String>,
    pub(crate) force: ::std::option::Option<bool>,
}
impl StopInstanceInputBuilder {
    /// <p>The name of the instance (a virtual private server) to stop.</p>
    /// This field is required.
    pub fn instance_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the instance (a virtual private server) to stop.</p>
    pub fn set_instance_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_name = input;
        self
    }
    /// <p>The name of the instance (a virtual private server) to stop.</p>
    pub fn get_instance_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_name
    }
    /// <p>When set to <code>True</code>, forces a Lightsail instance that is stuck in a <code>stopping</code> state to stop.</p><important>
    /// <p>Only use the <code>force</code> parameter if your instance is stuck in the <code>stopping</code> state. In any other state, your instance should stop normally without adding this parameter to your API request.</p>
    /// </important>
    pub fn force(mut self, input: bool) -> Self {
        self.force = ::std::option::Option::Some(input);
        self
    }
    /// <p>When set to <code>True</code>, forces a Lightsail instance that is stuck in a <code>stopping</code> state to stop.</p><important>
    /// <p>Only use the <code>force</code> parameter if your instance is stuck in the <code>stopping</code> state. In any other state, your instance should stop normally without adding this parameter to your API request.</p>
    /// </important>
    pub fn set_force(mut self, input: ::std::option::Option<bool>) -> Self {
        self.force = input;
        self
    }
    /// <p>When set to <code>True</code>, forces a Lightsail instance that is stuck in a <code>stopping</code> state to stop.</p><important>
    /// <p>Only use the <code>force</code> parameter if your instance is stuck in the <code>stopping</code> state. In any other state, your instance should stop normally without adding this parameter to your API request.</p>
    /// </important>
    pub fn get_force(&self) -> &::std::option::Option<bool> {
        &self.force
    }
    /// Consumes the builder and constructs a [`StopInstanceInput`](crate::operation::stop_instance::StopInstanceInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::stop_instance::StopInstanceInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::stop_instance::StopInstanceInput {
            instance_name: self.instance_name,
            force: self.force,
        })
    }
}