aws_sdk_bedrockruntime/operation/converse_stream/
_converse_stream_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub struct ConverseStreamOutput {
6 pub stream: crate::event_receiver::EventReceiver<crate::types::ConverseStreamOutput, crate::types::error::ConverseStreamOutputError>,
8 _request_id: Option<String>,
9}
10impl ConverseStreamOutput {
11 pub fn stream(
13 &self,
14 ) -> &crate::event_receiver::EventReceiver<crate::types::ConverseStreamOutput, crate::types::error::ConverseStreamOutputError> {
15 &self.stream
16 }
17}
18impl ::aws_types::request_id::RequestId for ConverseStreamOutput {
19 fn request_id(&self) -> Option<&str> {
20 self._request_id.as_deref()
21 }
22}
23impl ConverseStreamOutput {
24 pub fn builder() -> crate::operation::converse_stream::builders::ConverseStreamOutputBuilder {
26 crate::operation::converse_stream::builders::ConverseStreamOutputBuilder::default()
27 }
28}
29
30#[derive(::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct ConverseStreamOutputBuilder {
34 pub(crate) stream: ::std::option::Option<
35 crate::event_receiver::EventReceiver<crate::types::ConverseStreamOutput, crate::types::error::ConverseStreamOutputError>,
36 >,
37 _request_id: Option<String>,
38}
39impl ConverseStreamOutputBuilder {
40 pub fn stream(
42 mut self,
43 input: crate::event_receiver::EventReceiver<crate::types::ConverseStreamOutput, crate::types::error::ConverseStreamOutputError>,
44 ) -> Self {
45 self.stream = ::std::option::Option::Some(input);
46 self
47 }
48 pub fn set_stream(
50 mut self,
51 input: ::std::option::Option<
52 crate::event_receiver::EventReceiver<crate::types::ConverseStreamOutput, crate::types::error::ConverseStreamOutputError>,
53 >,
54 ) -> Self {
55 self.stream = input;
56 self
57 }
58 pub fn get_stream(
60 &self,
61 ) -> &::std::option::Option<
62 crate::event_receiver::EventReceiver<crate::types::ConverseStreamOutput, crate::types::error::ConverseStreamOutputError>,
63 > {
64 &self.stream
65 }
66 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
67 self._request_id = Some(request_id.into());
68 self
69 }
70
71 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
72 self._request_id = request_id;
73 self
74 }
75 pub fn build(
79 self,
80 ) -> ::std::result::Result<crate::operation::converse_stream::ConverseStreamOutput, ::aws_smithy_types::error::operation::BuildError> {
81 ::std::result::Result::Ok(crate::operation::converse_stream::ConverseStreamOutput {
82 stream: self.stream.ok_or_else(|| {
83 ::aws_smithy_types::error::operation::BuildError::missing_field(
84 "stream",
85 "stream was not specified but it is required when building ConverseStreamOutput",
86 )
87 })?,
88 _request_id: self._request_id,
89 })
90 }
91}