aws_sdk_bedrockruntime/operation/invoke_model/
_invoke_model_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct InvokeModelOutput {
6 pub body: ::aws_smithy_types::Blob,
8 pub content_type: ::std::string::String,
10 pub performance_config_latency: ::std::option::Option<crate::types::PerformanceConfigLatency>,
12 _request_id: Option<String>,
13}
14impl InvokeModelOutput {
15 pub fn body(&self) -> &::aws_smithy_types::Blob {
17 &self.body
18 }
19 pub fn content_type(&self) -> &str {
21 use std::ops::Deref;
22 self.content_type.deref()
23 }
24 pub fn performance_config_latency(&self) -> ::std::option::Option<&crate::types::PerformanceConfigLatency> {
26 self.performance_config_latency.as_ref()
27 }
28}
29impl ::std::fmt::Debug for InvokeModelOutput {
30 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
31 let mut formatter = f.debug_struct("InvokeModelOutput");
32 formatter.field("body", &"*** Sensitive Data Redacted ***");
33 formatter.field("content_type", &self.content_type);
34 formatter.field("performance_config_latency", &self.performance_config_latency);
35 formatter.field("_request_id", &self._request_id);
36 formatter.finish()
37 }
38}
39impl ::aws_types::request_id::RequestId for InvokeModelOutput {
40 fn request_id(&self) -> Option<&str> {
41 self._request_id.as_deref()
42 }
43}
44impl InvokeModelOutput {
45 pub fn builder() -> crate::operation::invoke_model::builders::InvokeModelOutputBuilder {
47 crate::operation::invoke_model::builders::InvokeModelOutputBuilder::default()
48 }
49}
50
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
53#[non_exhaustive]
54pub struct InvokeModelOutputBuilder {
55 pub(crate) body: ::std::option::Option<::aws_smithy_types::Blob>,
56 pub(crate) content_type: ::std::option::Option<::std::string::String>,
57 pub(crate) performance_config_latency: ::std::option::Option<crate::types::PerformanceConfigLatency>,
58 _request_id: Option<String>,
59}
60impl InvokeModelOutputBuilder {
61 pub fn body(mut self, input: ::aws_smithy_types::Blob) -> Self {
64 self.body = ::std::option::Option::Some(input);
65 self
66 }
67 pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
69 self.body = input;
70 self
71 }
72 pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
74 &self.body
75 }
76 pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79 self.content_type = ::std::option::Option::Some(input.into());
80 self
81 }
82 pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84 self.content_type = input;
85 self
86 }
87 pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
89 &self.content_type
90 }
91 pub fn performance_config_latency(mut self, input: crate::types::PerformanceConfigLatency) -> Self {
93 self.performance_config_latency = ::std::option::Option::Some(input);
94 self
95 }
96 pub fn set_performance_config_latency(mut self, input: ::std::option::Option<crate::types::PerformanceConfigLatency>) -> Self {
98 self.performance_config_latency = input;
99 self
100 }
101 pub fn get_performance_config_latency(&self) -> &::std::option::Option<crate::types::PerformanceConfigLatency> {
103 &self.performance_config_latency
104 }
105 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
106 self._request_id = Some(request_id.into());
107 self
108 }
109
110 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
111 self._request_id = request_id;
112 self
113 }
114 pub fn build(self) -> ::std::result::Result<crate::operation::invoke_model::InvokeModelOutput, ::aws_smithy_types::error::operation::BuildError> {
119 ::std::result::Result::Ok(crate::operation::invoke_model::InvokeModelOutput {
120 body: self.body.ok_or_else(|| {
121 ::aws_smithy_types::error::operation::BuildError::missing_field(
122 "body",
123 "body was not specified but it is required when building InvokeModelOutput",
124 )
125 })?,
126 content_type: self.content_type.ok_or_else(|| {
127 ::aws_smithy_types::error::operation::BuildError::missing_field(
128 "content_type",
129 "content_type was not specified but it is required when building InvokeModelOutput",
130 )
131 })?,
132 performance_config_latency: self.performance_config_latency,
133 _request_id: self._request_id,
134 })
135 }
136}
137impl ::std::fmt::Debug for InvokeModelOutputBuilder {
138 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
139 let mut formatter = f.debug_struct("InvokeModelOutputBuilder");
140 formatter.field("body", &"*** Sensitive Data Redacted ***");
141 formatter.field("content_type", &self.content_type);
142 formatter.field("performance_config_latency", &self.performance_config_latency);
143 formatter.field("_request_id", &self._request_id);
144 formatter.finish()
145 }
146}