aws-sdk-cloudwatch 1.111.0

AWS SDK for Amazon CloudWatch
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 PutDashboardOutput {
    /// <p>If the input for <code>PutDashboard</code> was correct and the dashboard was successfully created or modified, this result is empty.</p>
    /// <p>If this result includes only warning messages, then the input was valid enough for the dashboard to be created or modified, but some elements of the dashboard might not render.</p>
    /// <p>If this result includes error messages, the input was not valid and the operation failed.</p>
    pub dashboard_validation_messages: ::std::option::Option<::std::vec::Vec<crate::types::DashboardValidationMessage>>,
    _request_id: Option<String>,
}
impl PutDashboardOutput {
    /// <p>If the input for <code>PutDashboard</code> was correct and the dashboard was successfully created or modified, this result is empty.</p>
    /// <p>If this result includes only warning messages, then the input was valid enough for the dashboard to be created or modified, but some elements of the dashboard might not render.</p>
    /// <p>If this result includes error messages, the input was not valid and the operation failed.</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 `.dashboard_validation_messages.is_none()`.
    pub fn dashboard_validation_messages(&self) -> &[crate::types::DashboardValidationMessage] {
        self.dashboard_validation_messages.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for PutDashboardOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl PutDashboardOutput {
    /// Creates a new builder-style object to manufacture [`PutDashboardOutput`](crate::operation::put_dashboard::PutDashboardOutput).
    pub fn builder() -> crate::operation::put_dashboard::builders::PutDashboardOutputBuilder {
        crate::operation::put_dashboard::builders::PutDashboardOutputBuilder::default()
    }
}

/// A builder for [`PutDashboardOutput`](crate::operation::put_dashboard::PutDashboardOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutDashboardOutputBuilder {
    pub(crate) dashboard_validation_messages: ::std::option::Option<::std::vec::Vec<crate::types::DashboardValidationMessage>>,
    _request_id: Option<String>,
}
impl PutDashboardOutputBuilder {
    /// Appends an item to `dashboard_validation_messages`.
    ///
    /// To override the contents of this collection use [`set_dashboard_validation_messages`](Self::set_dashboard_validation_messages).
    ///
    /// <p>If the input for <code>PutDashboard</code> was correct and the dashboard was successfully created or modified, this result is empty.</p>
    /// <p>If this result includes only warning messages, then the input was valid enough for the dashboard to be created or modified, but some elements of the dashboard might not render.</p>
    /// <p>If this result includes error messages, the input was not valid and the operation failed.</p>
    pub fn dashboard_validation_messages(mut self, input: crate::types::DashboardValidationMessage) -> Self {
        let mut v = self.dashboard_validation_messages.unwrap_or_default();
        v.push(input);
        self.dashboard_validation_messages = ::std::option::Option::Some(v);
        self
    }
    /// <p>If the input for <code>PutDashboard</code> was correct and the dashboard was successfully created or modified, this result is empty.</p>
    /// <p>If this result includes only warning messages, then the input was valid enough for the dashboard to be created or modified, but some elements of the dashboard might not render.</p>
    /// <p>If this result includes error messages, the input was not valid and the operation failed.</p>
    pub fn set_dashboard_validation_messages(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::DashboardValidationMessage>>,
    ) -> Self {
        self.dashboard_validation_messages = input;
        self
    }
    /// <p>If the input for <code>PutDashboard</code> was correct and the dashboard was successfully created or modified, this result is empty.</p>
    /// <p>If this result includes only warning messages, then the input was valid enough for the dashboard to be created or modified, but some elements of the dashboard might not render.</p>
    /// <p>If this result includes error messages, the input was not valid and the operation failed.</p>
    pub fn get_dashboard_validation_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DashboardValidationMessage>> {
        &self.dashboard_validation_messages
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`PutDashboardOutput`](crate::operation::put_dashboard::PutDashboardOutput).
    pub fn build(self) -> crate::operation::put_dashboard::PutDashboardOutput {
        crate::operation::put_dashboard::PutDashboardOutput {
            dashboard_validation_messages: self.dashboard_validation_messages,
            _request_id: self._request_id,
        }
    }
}