aws_sdk_s3/operation/select_object_content/
_select_object_content_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::fmt::Debug)]
5pub struct SelectObjectContentOutput {
6    /// <p>The array of results.</p>
7    pub payload:
8        crate::event_receiver::EventReceiver<crate::types::SelectObjectContentEventStream, crate::types::error::SelectObjectContentEventStreamError>,
9    _extended_request_id: Option<String>,
10    _request_id: Option<String>,
11}
12impl SelectObjectContentOutput {
13    /// <p>The array of results.</p>
14    pub fn payload(
15        &self,
16    ) -> &crate::event_receiver::EventReceiver<crate::types::SelectObjectContentEventStream, crate::types::error::SelectObjectContentEventStreamError>
17    {
18        &self.payload
19    }
20}
21impl crate::s3_request_id::RequestIdExt for SelectObjectContentOutput {
22    fn extended_request_id(&self) -> Option<&str> {
23        self._extended_request_id.as_deref()
24    }
25}
26impl ::aws_types::request_id::RequestId for SelectObjectContentOutput {
27    fn request_id(&self) -> Option<&str> {
28        self._request_id.as_deref()
29    }
30}
31impl SelectObjectContentOutput {
32    /// Creates a new builder-style object to manufacture [`SelectObjectContentOutput`](crate::operation::select_object_content::SelectObjectContentOutput).
33    pub fn builder() -> crate::operation::select_object_content::builders::SelectObjectContentOutputBuilder {
34        crate::operation::select_object_content::builders::SelectObjectContentOutputBuilder::default()
35    }
36}
37
38/// A builder for [`SelectObjectContentOutput`](crate::operation::select_object_content::SelectObjectContentOutput).
39#[derive(::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct SelectObjectContentOutputBuilder {
42    pub(crate) payload: ::std::option::Option<
43        crate::event_receiver::EventReceiver<crate::types::SelectObjectContentEventStream, crate::types::error::SelectObjectContentEventStreamError>,
44    >,
45    _extended_request_id: Option<String>,
46    _request_id: Option<String>,
47}
48impl SelectObjectContentOutputBuilder {
49    /// <p>The array of results.</p>
50    pub fn payload(
51        mut self,
52        input: crate::event_receiver::EventReceiver<
53            crate::types::SelectObjectContentEventStream,
54            crate::types::error::SelectObjectContentEventStreamError,
55        >,
56    ) -> Self {
57        self.payload = ::std::option::Option::Some(input);
58        self
59    }
60    /// <p>The array of results.</p>
61    pub fn set_payload(
62        mut self,
63        input: ::std::option::Option<
64            crate::event_receiver::EventReceiver<
65                crate::types::SelectObjectContentEventStream,
66                crate::types::error::SelectObjectContentEventStreamError,
67            >,
68        >,
69    ) -> Self {
70        self.payload = input;
71        self
72    }
73    /// <p>The array of results.</p>
74    pub fn get_payload(
75        &self,
76    ) -> &::std::option::Option<
77        crate::event_receiver::EventReceiver<crate::types::SelectObjectContentEventStream, crate::types::error::SelectObjectContentEventStreamError>,
78    > {
79        &self.payload
80    }
81    pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
82        self._extended_request_id = Some(extended_request_id.into());
83        self
84    }
85
86    pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
87        self._extended_request_id = extended_request_id;
88        self
89    }
90    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
91        self._request_id = Some(request_id.into());
92        self
93    }
94
95    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
96        self._request_id = request_id;
97        self
98    }
99    /// Consumes the builder and constructs a [`SelectObjectContentOutput`](crate::operation::select_object_content::SelectObjectContentOutput).
100    /// This method will fail if any of the following fields are not set:
101    /// - [`payload`](crate::operation::select_object_content::builders::SelectObjectContentOutputBuilder::payload)
102    pub fn build(
103        self,
104    ) -> ::std::result::Result<crate::operation::select_object_content::SelectObjectContentOutput, ::aws_smithy_types::error::operation::BuildError>
105    {
106        ::std::result::Result::Ok(crate::operation::select_object_content::SelectObjectContentOutput {
107            payload: self.payload.ok_or_else(|| {
108                ::aws_smithy_types::error::operation::BuildError::missing_field(
109                    "payload",
110                    "payload was not specified but it is required when building SelectObjectContentOutput",
111                )
112            })?,
113            _extended_request_id: self._extended_request_id,
114            _request_id: self._request_id,
115        })
116    }
117}