aws_sdk_eventbridge/operation/put_targets/
_put_targets_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 PutTargetsOutput {
6    /// <p>The number of failed entries.</p>
7    pub failed_entry_count: i32,
8    /// <p>The failed target entries.</p>
9    pub failed_entries: ::std::option::Option<::std::vec::Vec<crate::types::PutTargetsResultEntry>>,
10    _request_id: Option<String>,
11}
12impl PutTargetsOutput {
13    /// <p>The number of failed entries.</p>
14    pub fn failed_entry_count(&self) -> i32 {
15        self.failed_entry_count
16    }
17    /// <p>The failed target entries.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.failed_entries.is_none()`.
20    pub fn failed_entries(&self) -> &[crate::types::PutTargetsResultEntry] {
21        self.failed_entries.as_deref().unwrap_or_default()
22    }
23}
24impl ::aws_types::request_id::RequestId for PutTargetsOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl PutTargetsOutput {
30    /// Creates a new builder-style object to manufacture [`PutTargetsOutput`](crate::operation::put_targets::PutTargetsOutput).
31    pub fn builder() -> crate::operation::put_targets::builders::PutTargetsOutputBuilder {
32        crate::operation::put_targets::builders::PutTargetsOutputBuilder::default()
33    }
34}
35
36/// A builder for [`PutTargetsOutput`](crate::operation::put_targets::PutTargetsOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct PutTargetsOutputBuilder {
40    pub(crate) failed_entry_count: ::std::option::Option<i32>,
41    pub(crate) failed_entries: ::std::option::Option<::std::vec::Vec<crate::types::PutTargetsResultEntry>>,
42    _request_id: Option<String>,
43}
44impl PutTargetsOutputBuilder {
45    /// <p>The number of failed entries.</p>
46    pub fn failed_entry_count(mut self, input: i32) -> Self {
47        self.failed_entry_count = ::std::option::Option::Some(input);
48        self
49    }
50    /// <p>The number of failed entries.</p>
51    pub fn set_failed_entry_count(mut self, input: ::std::option::Option<i32>) -> Self {
52        self.failed_entry_count = input;
53        self
54    }
55    /// <p>The number of failed entries.</p>
56    pub fn get_failed_entry_count(&self) -> &::std::option::Option<i32> {
57        &self.failed_entry_count
58    }
59    /// Appends an item to `failed_entries`.
60    ///
61    /// To override the contents of this collection use [`set_failed_entries`](Self::set_failed_entries).
62    ///
63    /// <p>The failed target entries.</p>
64    pub fn failed_entries(mut self, input: crate::types::PutTargetsResultEntry) -> Self {
65        let mut v = self.failed_entries.unwrap_or_default();
66        v.push(input);
67        self.failed_entries = ::std::option::Option::Some(v);
68        self
69    }
70    /// <p>The failed target entries.</p>
71    pub fn set_failed_entries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PutTargetsResultEntry>>) -> Self {
72        self.failed_entries = input;
73        self
74    }
75    /// <p>The failed target entries.</p>
76    pub fn get_failed_entries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PutTargetsResultEntry>> {
77        &self.failed_entries
78    }
79    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
80        self._request_id = Some(request_id.into());
81        self
82    }
83
84    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
85        self._request_id = request_id;
86        self
87    }
88    /// Consumes the builder and constructs a [`PutTargetsOutput`](crate::operation::put_targets::PutTargetsOutput).
89    pub fn build(self) -> crate::operation::put_targets::PutTargetsOutput {
90        crate::operation::put_targets::PutTargetsOutput {
91            failed_entry_count: self.failed_entry_count.unwrap_or_default(),
92            failed_entries: self.failed_entries,
93            _request_id: self._request_id,
94        }
95    }
96}