aws-sdk-wellarchitected 1.110.0

AWS SDK for AWS Well-Architected Tool
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A return-on-investment estimate with context.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Roi {
    /// <p>A short statistic or key metric. Optional when there is no quantifiable figure.</p>
    pub estimate: ::std::option::Option<::std::string::String>,
    /// <p>A sentence providing context for the estimate.</p>
    pub detail: ::std::string::String,
}
impl Roi {
    /// <p>A short statistic or key metric. Optional when there is no quantifiable figure.</p>
    pub fn estimate(&self) -> ::std::option::Option<&str> {
        self.estimate.as_deref()
    }
    /// <p>A sentence providing context for the estimate.</p>
    pub fn detail(&self) -> &str {
        use std::ops::Deref;
        self.detail.deref()
    }
}
impl Roi {
    /// Creates a new builder-style object to manufacture [`Roi`](crate::types::Roi).
    pub fn builder() -> crate::types::builders::RoiBuilder {
        crate::types::builders::RoiBuilder::default()
    }
}

/// A builder for [`Roi`](crate::types::Roi).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RoiBuilder {
    pub(crate) estimate: ::std::option::Option<::std::string::String>,
    pub(crate) detail: ::std::option::Option<::std::string::String>,
}
impl RoiBuilder {
    /// <p>A short statistic or key metric. Optional when there is no quantifiable figure.</p>
    pub fn estimate(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.estimate = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A short statistic or key metric. Optional when there is no quantifiable figure.</p>
    pub fn set_estimate(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.estimate = input;
        self
    }
    /// <p>A short statistic or key metric. Optional when there is no quantifiable figure.</p>
    pub fn get_estimate(&self) -> &::std::option::Option<::std::string::String> {
        &self.estimate
    }
    /// <p>A sentence providing context for the estimate.</p>
    /// This field is required.
    pub fn detail(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.detail = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A sentence providing context for the estimate.</p>
    pub fn set_detail(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.detail = input;
        self
    }
    /// <p>A sentence providing context for the estimate.</p>
    pub fn get_detail(&self) -> &::std::option::Option<::std::string::String> {
        &self.detail
    }
    /// Consumes the builder and constructs a [`Roi`](crate::types::Roi).
    /// This method will fail if any of the following fields are not set:
    /// - [`detail`](crate::types::builders::RoiBuilder::detail)
    pub fn build(self) -> ::std::result::Result<crate::types::Roi, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Roi {
            estimate: self.estimate,
            detail: self.detail.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "detail",
                    "detail was not specified but it is required when building Roi",
                )
            })?,
        })
    }
}