aws-sdk-ecs 1.124.0

AWS SDK for Amazon EC2 Container Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A failed resource. For a list of common causes, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html">API failure reasons</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Failure {
    /// <p>The Amazon Resource Name (ARN) of the failed resource.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The reason for the failure.</p>
    pub reason: ::std::option::Option<::std::string::String>,
    /// <p>The details of the failure.</p>
    pub detail: ::std::option::Option<::std::string::String>,
}
impl Failure {
    /// <p>The Amazon Resource Name (ARN) of the failed resource.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The reason for the failure.</p>
    pub fn reason(&self) -> ::std::option::Option<&str> {
        self.reason.as_deref()
    }
    /// <p>The details of the failure.</p>
    pub fn detail(&self) -> ::std::option::Option<&str> {
        self.detail.as_deref()
    }
}
impl Failure {
    /// Creates a new builder-style object to manufacture [`Failure`](crate::types::Failure).
    pub fn builder() -> crate::types::builders::FailureBuilder {
        crate::types::builders::FailureBuilder::default()
    }
}

/// A builder for [`Failure`](crate::types::Failure).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct FailureBuilder {
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) reason: ::std::option::Option<::std::string::String>,
    pub(crate) detail: ::std::option::Option<::std::string::String>,
}
impl FailureBuilder {
    /// <p>The Amazon Resource Name (ARN) of the failed resource.</p>
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the failed resource.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the failed resource.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The reason for the failure.</p>
    pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.reason = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The reason for the failure.</p>
    pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.reason = input;
        self
    }
    /// <p>The reason for the failure.</p>
    pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.reason
    }
    /// <p>The details of the failure.</p>
    pub fn detail(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.detail = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The details of the failure.</p>
    pub fn set_detail(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.detail = input;
        self
    }
    /// <p>The details of the failure.</p>
    pub fn get_detail(&self) -> &::std::option::Option<::std::string::String> {
        &self.detail
    }
    /// Consumes the builder and constructs a [`Failure`](crate::types::Failure).
    pub fn build(self) -> crate::types::Failure {
        crate::types::Failure {
            arn: self.arn,
            reason: self.reason,
            detail: self.detail,
        }
    }
}