aws_sdk_eventbridge/operation/put_events/
_put_events_output.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// 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 PutEventsOutput {
    /// <p>The number of failed entries.</p>
    pub failed_entry_count: i32,
    /// <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>
    /// <p>For each record, the index of the response element is the same as the index in the request array.</p>
    pub entries: ::std::option::Option<::std::vec::Vec<crate::types::PutEventsResultEntry>>,
    _request_id: Option<String>,
}
impl PutEventsOutput {
    /// <p>The number of failed entries.</p>
    pub fn failed_entry_count(&self) -> i32 {
        self.failed_entry_count
    }
    /// <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>
    /// <p>For each record, the index of the response element is the same as the index in the request array.</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 `.entries.is_none()`.
    pub fn entries(&self) -> &[crate::types::PutEventsResultEntry] {
        self.entries.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for PutEventsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl PutEventsOutput {
    /// Creates a new builder-style object to manufacture [`PutEventsOutput`](crate::operation::put_events::PutEventsOutput).
    pub fn builder() -> crate::operation::put_events::builders::PutEventsOutputBuilder {
        crate::operation::put_events::builders::PutEventsOutputBuilder::default()
    }
}

/// A builder for [`PutEventsOutput`](crate::operation::put_events::PutEventsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutEventsOutputBuilder {
    pub(crate) failed_entry_count: ::std::option::Option<i32>,
    pub(crate) entries: ::std::option::Option<::std::vec::Vec<crate::types::PutEventsResultEntry>>,
    _request_id: Option<String>,
}
impl PutEventsOutputBuilder {
    /// <p>The number of failed entries.</p>
    pub fn failed_entry_count(mut self, input: i32) -> Self {
        self.failed_entry_count = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of failed entries.</p>
    pub fn set_failed_entry_count(mut self, input: ::std::option::Option<i32>) -> Self {
        self.failed_entry_count = input;
        self
    }
    /// <p>The number of failed entries.</p>
    pub fn get_failed_entry_count(&self) -> &::std::option::Option<i32> {
        &self.failed_entry_count
    }
    /// Appends an item to `entries`.
    ///
    /// To override the contents of this collection use [`set_entries`](Self::set_entries).
    ///
    /// <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>
    /// <p>For each record, the index of the response element is the same as the index in the request array.</p>
    pub fn entries(mut self, input: crate::types::PutEventsResultEntry) -> Self {
        let mut v = self.entries.unwrap_or_default();
        v.push(input);
        self.entries = ::std::option::Option::Some(v);
        self
    }
    /// <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>
    /// <p>For each record, the index of the response element is the same as the index in the request array.</p>
    pub fn set_entries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PutEventsResultEntry>>) -> Self {
        self.entries = input;
        self
    }
    /// <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>
    /// <p>For each record, the index of the response element is the same as the index in the request array.</p>
    pub fn get_entries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PutEventsResultEntry>> {
        &self.entries
    }
    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 [`PutEventsOutput`](crate::operation::put_events::PutEventsOutput).
    pub fn build(self) -> crate::operation::put_events::PutEventsOutput {
        crate::operation::put_events::PutEventsOutput {
            failed_entry_count: self.failed_entry_count.unwrap_or_default(),
            entries: self.entries,
            _request_id: self._request_id,
        }
    }
}