aws_sdk_cloudwatch/operation/put_dashboard/
_put_dashboard_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct PutDashboardOutput {
6    /// <p>If the input for <code>PutDashboard</code> was correct and the dashboard was successfully created or modified, this result is empty.</p>
7    /// <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>
8    /// <p>If this result includes error messages, the input was not valid and the operation failed.</p>
9    pub dashboard_validation_messages: ::std::option::Option<::std::vec::Vec<crate::types::DashboardValidationMessage>>,
10    _request_id: Option<String>,
11}
12impl PutDashboardOutput {
13    /// <p>If the input for <code>PutDashboard</code> was correct and the dashboard was successfully created or modified, this result is empty.</p>
14    /// <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>
15    /// <p>If this result includes error messages, the input was not valid and the operation failed.</p>
16    ///
17    /// 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()`.
18    pub fn dashboard_validation_messages(&self) -> &[crate::types::DashboardValidationMessage] {
19        self.dashboard_validation_messages.as_deref().unwrap_or_default()
20    }
21}
22impl ::aws_types::request_id::RequestId for PutDashboardOutput {
23    fn request_id(&self) -> Option<&str> {
24        self._request_id.as_deref()
25    }
26}
27impl PutDashboardOutput {
28    /// Creates a new builder-style object to manufacture [`PutDashboardOutput`](crate::operation::put_dashboard::PutDashboardOutput).
29    pub fn builder() -> crate::operation::put_dashboard::builders::PutDashboardOutputBuilder {
30        crate::operation::put_dashboard::builders::PutDashboardOutputBuilder::default()
31    }
32}
33
34/// A builder for [`PutDashboardOutput`](crate::operation::put_dashboard::PutDashboardOutput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct PutDashboardOutputBuilder {
38    pub(crate) dashboard_validation_messages: ::std::option::Option<::std::vec::Vec<crate::types::DashboardValidationMessage>>,
39    _request_id: Option<String>,
40}
41impl PutDashboardOutputBuilder {
42    /// Appends an item to `dashboard_validation_messages`.
43    ///
44    /// To override the contents of this collection use [`set_dashboard_validation_messages`](Self::set_dashboard_validation_messages).
45    ///
46    /// <p>If the input for <code>PutDashboard</code> was correct and the dashboard was successfully created or modified, this result is empty.</p>
47    /// <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>
48    /// <p>If this result includes error messages, the input was not valid and the operation failed.</p>
49    pub fn dashboard_validation_messages(mut self, input: crate::types::DashboardValidationMessage) -> Self {
50        let mut v = self.dashboard_validation_messages.unwrap_or_default();
51        v.push(input);
52        self.dashboard_validation_messages = ::std::option::Option::Some(v);
53        self
54    }
55    /// <p>If the input for <code>PutDashboard</code> was correct and the dashboard was successfully created or modified, this result is empty.</p>
56    /// <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>
57    /// <p>If this result includes error messages, the input was not valid and the operation failed.</p>
58    pub fn set_dashboard_validation_messages(
59        mut self,
60        input: ::std::option::Option<::std::vec::Vec<crate::types::DashboardValidationMessage>>,
61    ) -> Self {
62        self.dashboard_validation_messages = input;
63        self
64    }
65    /// <p>If the input for <code>PutDashboard</code> was correct and the dashboard was successfully created or modified, this result is empty.</p>
66    /// <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>
67    /// <p>If this result includes error messages, the input was not valid and the operation failed.</p>
68    pub fn get_dashboard_validation_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DashboardValidationMessage>> {
69        &self.dashboard_validation_messages
70    }
71    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
72        self._request_id = Some(request_id.into());
73        self
74    }
75
76    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
77        self._request_id = request_id;
78        self
79    }
80    /// Consumes the builder and constructs a [`PutDashboardOutput`](crate::operation::put_dashboard::PutDashboardOutput).
81    pub fn build(self) -> crate::operation::put_dashboard::PutDashboardOutput {
82        crate::operation::put_dashboard::PutDashboardOutput {
83            dashboard_validation_messages: self.dashboard_validation_messages,
84            _request_id: self._request_id,
85        }
86    }
87}