aws-sdk-lightsail 1.106.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 AttachStaticIpInput {
    /// <p>The name of the static IP.</p>
    pub static_ip_name: ::std::option::Option<::std::string::String>,
    /// <p>The instance name to which you want to attach the static IP address.</p>
    pub instance_name: ::std::option::Option<::std::string::String>,
}
impl AttachStaticIpInput {
    /// <p>The name of the static IP.</p>
    pub fn static_ip_name(&self) -> ::std::option::Option<&str> {
        self.static_ip_name.as_deref()
    }
    /// <p>The instance name to which you want to attach the static IP address.</p>
    pub fn instance_name(&self) -> ::std::option::Option<&str> {
        self.instance_name.as_deref()
    }
}
impl AttachStaticIpInput {
    /// Creates a new builder-style object to manufacture [`AttachStaticIpInput`](crate::operation::attach_static_ip::AttachStaticIpInput).
    pub fn builder() -> crate::operation::attach_static_ip::builders::AttachStaticIpInputBuilder {
        crate::operation::attach_static_ip::builders::AttachStaticIpInputBuilder::default()
    }
}

/// A builder for [`AttachStaticIpInput`](crate::operation::attach_static_ip::AttachStaticIpInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AttachStaticIpInputBuilder {
    pub(crate) static_ip_name: ::std::option::Option<::std::string::String>,
    pub(crate) instance_name: ::std::option::Option<::std::string::String>,
}
impl AttachStaticIpInputBuilder {
    /// <p>The name of the static IP.</p>
    /// This field is required.
    pub fn static_ip_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.static_ip_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the static IP.</p>
    pub fn set_static_ip_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.static_ip_name = input;
        self
    }
    /// <p>The name of the static IP.</p>
    pub fn get_static_ip_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.static_ip_name
    }
    /// <p>The instance name to which you want to attach the static IP address.</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 instance name to which you want to attach the static IP address.</p>
    pub fn set_instance_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_name = input;
        self
    }
    /// <p>The instance name to which you want to attach the static IP address.</p>
    pub fn get_instance_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_name
    }
    /// Consumes the builder and constructs a [`AttachStaticIpInput`](crate::operation::attach_static_ip::AttachStaticIpInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::attach_static_ip::AttachStaticIpInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::attach_static_ip::AttachStaticIpInput {
            static_ip_name: self.static_ip_name,
            instance_name: self.instance_name,
        })
    }
}