aws-sdk-mediaconnect 0.25.0

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

/// Messages that provide the state of the flow.
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Messages {
    /// A list of errors that might have been generated from processes on this flow.
    #[doc(hidden)]
    pub errors: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Messages {
    /// A list of errors that might have been generated from processes on this flow.
    pub fn errors(&self) -> std::option::Option<&[std::string::String]> {
        self.errors.as_deref()
    }
}
impl Messages {
    /// Creates a new builder-style object to manufacture [`Messages`](crate::types::Messages).
    pub fn builder() -> crate::types::builders::MessagesBuilder {
        crate::types::builders::MessagesBuilder::default()
    }
}

/// A builder for [`Messages`](crate::types::Messages).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct MessagesBuilder {
    pub(crate) errors: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl MessagesBuilder {
    /// Appends an item to `errors`.
    ///
    /// To override the contents of this collection use [`set_errors`](Self::set_errors).
    ///
    /// A list of errors that might have been generated from processes on this flow.
    pub fn errors(mut self, input: impl Into<std::string::String>) -> Self {
        let mut v = self.errors.unwrap_or_default();
        v.push(input.into());
        self.errors = Some(v);
        self
    }
    /// A list of errors that might have been generated from processes on this flow.
    pub fn set_errors(
        mut self,
        input: std::option::Option<std::vec::Vec<std::string::String>>,
    ) -> Self {
        self.errors = input;
        self
    }
    /// Consumes the builder and constructs a [`Messages`](crate::types::Messages).
    pub fn build(self) -> crate::types::Messages {
        crate::types::Messages {
            errors: self.errors,
        }
    }
}