aws-sdk-mediaconnect 1.82.0

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

/// <p>Messages that provide the state of the flow.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Messages {
    /// <p>A list of errors that might have been generated from processes on this flow.</p>
    pub errors: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Messages {
    /// <p>A list of errors that might have been generated from processes on this flow.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.errors.is_none()`.
    pub fn errors(&self) -> &[::std::string::String] {
        self.errors.as_deref().unwrap_or_default()
    }
}
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).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
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).
    ///
    /// <p>A list of errors that might have been generated from processes on this flow.</p>
    pub fn errors(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.errors.unwrap_or_default();
        v.push(input.into());
        self.errors = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of errors that might have been generated from processes on this flow.</p>
    pub fn set_errors(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.errors = input;
        self
    }
    /// <p>A list of errors that might have been generated from processes on this flow.</p>
    pub fn get_errors(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.errors
    }
    /// Consumes the builder and constructs a [`Messages`](crate::types::Messages).
    pub fn build(self) -> crate::types::Messages {
        crate::types::Messages { errors: self.errors }
    }
}