aws_sdk_grafana/operation/update_permissions/
_update_permissions_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 UpdatePermissionsOutput {
6    /// <p>An array of structures that contain the errors from the operation, if any.</p>
7    pub errors: ::std::vec::Vec<crate::types::UpdateError>,
8    _request_id: Option<String>,
9}
10impl UpdatePermissionsOutput {
11    /// <p>An array of structures that contain the errors from the operation, if any.</p>
12    pub fn errors(&self) -> &[crate::types::UpdateError] {
13        use std::ops::Deref;
14        self.errors.deref()
15    }
16}
17impl ::aws_types::request_id::RequestId for UpdatePermissionsOutput {
18    fn request_id(&self) -> Option<&str> {
19        self._request_id.as_deref()
20    }
21}
22impl UpdatePermissionsOutput {
23    /// Creates a new builder-style object to manufacture [`UpdatePermissionsOutput`](crate::operation::update_permissions::UpdatePermissionsOutput).
24    pub fn builder() -> crate::operation::update_permissions::builders::UpdatePermissionsOutputBuilder {
25        crate::operation::update_permissions::builders::UpdatePermissionsOutputBuilder::default()
26    }
27}
28
29/// A builder for [`UpdatePermissionsOutput`](crate::operation::update_permissions::UpdatePermissionsOutput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct UpdatePermissionsOutputBuilder {
33    pub(crate) errors: ::std::option::Option<::std::vec::Vec<crate::types::UpdateError>>,
34    _request_id: Option<String>,
35}
36impl UpdatePermissionsOutputBuilder {
37    /// Appends an item to `errors`.
38    ///
39    /// To override the contents of this collection use [`set_errors`](Self::set_errors).
40    ///
41    /// <p>An array of structures that contain the errors from the operation, if any.</p>
42    pub fn errors(mut self, input: crate::types::UpdateError) -> Self {
43        let mut v = self.errors.unwrap_or_default();
44        v.push(input);
45        self.errors = ::std::option::Option::Some(v);
46        self
47    }
48    /// <p>An array of structures that contain the errors from the operation, if any.</p>
49    pub fn set_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UpdateError>>) -> Self {
50        self.errors = input;
51        self
52    }
53    /// <p>An array of structures that contain the errors from the operation, if any.</p>
54    pub fn get_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UpdateError>> {
55        &self.errors
56    }
57    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
58        self._request_id = Some(request_id.into());
59        self
60    }
61
62    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
63        self._request_id = request_id;
64        self
65    }
66    /// Consumes the builder and constructs a [`UpdatePermissionsOutput`](crate::operation::update_permissions::UpdatePermissionsOutput).
67    /// This method will fail if any of the following fields are not set:
68    /// - [`errors`](crate::operation::update_permissions::builders::UpdatePermissionsOutputBuilder::errors)
69    pub fn build(
70        self,
71    ) -> ::std::result::Result<crate::operation::update_permissions::UpdatePermissionsOutput, ::aws_smithy_types::error::operation::BuildError> {
72        ::std::result::Result::Ok(crate::operation::update_permissions::UpdatePermissionsOutput {
73            errors: self.errors.ok_or_else(|| {
74                ::aws_smithy_types::error::operation::BuildError::missing_field(
75                    "errors",
76                    "errors was not specified but it is required when building UpdatePermissionsOutput",
77                )
78            })?,
79            _request_id: self._request_id,
80        })
81    }
82}