aws_sdk_eventbridge/operation/put_events/_put_events_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 PutEventsOutput {
6 /// <p>The number of failed entries.</p>
7 pub failed_entry_count: i32,
8 /// <p>The successfully and unsuccessfully ingested events results. If the ingestion was successful, the entry has the event ID in it. Otherwise, you can use the error code and error message to identify the problem with the entry.</p>
9 /// <p>For each record, the index of the response element is the same as the index in the request array.</p>
10 pub entries: ::std::option::Option<::std::vec::Vec<crate::types::PutEventsResultEntry>>,
11 _request_id: Option<String>,
12}
13impl PutEventsOutput {
14 /// <p>The number of failed entries.</p>
15 pub fn failed_entry_count(&self) -> i32 {
16 self.failed_entry_count
17 }
18 /// <p>The successfully and unsuccessfully ingested events results. If the ingestion was successful, the entry has the event ID in it. Otherwise, you can use the error code and error message to identify the problem with the entry.</p>
19 /// <p>For each record, the index of the response element is the same as the index in the request array.</p>
20 ///
21 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.entries.is_none()`.
22 pub fn entries(&self) -> &[crate::types::PutEventsResultEntry] {
23 self.entries.as_deref().unwrap_or_default()
24 }
25}
26impl ::aws_types::request_id::RequestId for PutEventsOutput {
27 fn request_id(&self) -> Option<&str> {
28 self._request_id.as_deref()
29 }
30}
31impl PutEventsOutput {
32 /// Creates a new builder-style object to manufacture [`PutEventsOutput`](crate::operation::put_events::PutEventsOutput).
33 pub fn builder() -> crate::operation::put_events::builders::PutEventsOutputBuilder {
34 crate::operation::put_events::builders::PutEventsOutputBuilder::default()
35 }
36}
37
38/// A builder for [`PutEventsOutput`](crate::operation::put_events::PutEventsOutput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct PutEventsOutputBuilder {
42 pub(crate) failed_entry_count: ::std::option::Option<i32>,
43 pub(crate) entries: ::std::option::Option<::std::vec::Vec<crate::types::PutEventsResultEntry>>,
44 _request_id: Option<String>,
45}
46impl PutEventsOutputBuilder {
47 /// <p>The number of failed entries.</p>
48 pub fn failed_entry_count(mut self, input: i32) -> Self {
49 self.failed_entry_count = ::std::option::Option::Some(input);
50 self
51 }
52 /// <p>The number of failed entries.</p>
53 pub fn set_failed_entry_count(mut self, input: ::std::option::Option<i32>) -> Self {
54 self.failed_entry_count = input;
55 self
56 }
57 /// <p>The number of failed entries.</p>
58 pub fn get_failed_entry_count(&self) -> &::std::option::Option<i32> {
59 &self.failed_entry_count
60 }
61 /// Appends an item to `entries`.
62 ///
63 /// To override the contents of this collection use [`set_entries`](Self::set_entries).
64 ///
65 /// <p>The successfully and unsuccessfully ingested events results. If the ingestion was successful, the entry has the event ID in it. Otherwise, you can use the error code and error message to identify the problem with the entry.</p>
66 /// <p>For each record, the index of the response element is the same as the index in the request array.</p>
67 pub fn entries(mut self, input: crate::types::PutEventsResultEntry) -> Self {
68 let mut v = self.entries.unwrap_or_default();
69 v.push(input);
70 self.entries = ::std::option::Option::Some(v);
71 self
72 }
73 /// <p>The successfully and unsuccessfully ingested events results. If the ingestion was successful, the entry has the event ID in it. Otherwise, you can use the error code and error message to identify the problem with the entry.</p>
74 /// <p>For each record, the index of the response element is the same as the index in the request array.</p>
75 pub fn set_entries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PutEventsResultEntry>>) -> Self {
76 self.entries = input;
77 self
78 }
79 /// <p>The successfully and unsuccessfully ingested events results. If the ingestion was successful, the entry has the event ID in it. Otherwise, you can use the error code and error message to identify the problem with the entry.</p>
80 /// <p>For each record, the index of the response element is the same as the index in the request array.</p>
81 pub fn get_entries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PutEventsResultEntry>> {
82 &self.entries
83 }
84 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
85 self._request_id = Some(request_id.into());
86 self
87 }
88
89 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
90 self._request_id = request_id;
91 self
92 }
93 /// Consumes the builder and constructs a [`PutEventsOutput`](crate::operation::put_events::PutEventsOutput).
94 pub fn build(self) -> crate::operation::put_events::PutEventsOutput {
95 crate::operation::put_events::PutEventsOutput {
96 failed_entry_count: self.failed_entry_count.unwrap_or_default(),
97 entries: self.entries,
98 _request_id: self._request_id,
99 }
100 }
101}