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 pub service_tier: ::std::option::Option<crate::types::ServiceTierType>,
14 _request_id: Option<String>,
15}
16impl InvokeModelOutput {
17 pub fn body(&self) -> &::aws_smithy_types::Blob {
19 &self.body
20 }
21 pub fn content_type(&self) -> &str {
23 use std::ops::Deref;
24 self.content_type.deref()
25 }
26 pub fn performance_config_latency(&self) -> ::std::option::Option<&crate::types::PerformanceConfigLatency> {
28 self.performance_config_latency.as_ref()
29 }
30 pub fn service_tier(&self) -> ::std::option::Option<&crate::types::ServiceTierType> {
32 self.service_tier.as_ref()
33 }
34}
35impl ::std::fmt::Debug for InvokeModelOutput {
36 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
37 let mut formatter = f.debug_struct("InvokeModelOutput");
38 formatter.field("body", &"*** Sensitive Data Redacted ***");
39 formatter.field("content_type", &self.content_type);
40 formatter.field("performance_config_latency", &self.performance_config_latency);
41 formatter.field("service_tier", &self.service_tier);
42 formatter.field("_request_id", &self._request_id);
43 formatter.finish()
44 }
45}
46impl ::aws_types::request_id::RequestId for InvokeModelOutput {
47 fn request_id(&self) -> Option<&str> {
48 self._request_id.as_deref()
49 }
50}
51impl InvokeModelOutput {
52 pub fn builder() -> crate::operation::invoke_model::builders::InvokeModelOutputBuilder {
54 crate::operation::invoke_model::builders::InvokeModelOutputBuilder::default()
55 }
56}
57
58#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
60#[non_exhaustive]
61pub struct InvokeModelOutputBuilder {
62 pub(crate) body: ::std::option::Option<::aws_smithy_types::Blob>,
63 pub(crate) content_type: ::std::option::Option<::std::string::String>,
64 pub(crate) performance_config_latency: ::std::option::Option<crate::types::PerformanceConfigLatency>,
65 pub(crate) service_tier: ::std::option::Option<crate::types::ServiceTierType>,
66 _request_id: Option<String>,
67}
68impl InvokeModelOutputBuilder {
69 pub fn body(mut self, input: ::aws_smithy_types::Blob) -> Self {
72 self.body = ::std::option::Option::Some(input);
73 self
74 }
75 pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
77 self.body = input;
78 self
79 }
80 pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
82 &self.body
83 }
84 pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87 self.content_type = ::std::option::Option::Some(input.into());
88 self
89 }
90 pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92 self.content_type = input;
93 self
94 }
95 pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
97 &self.content_type
98 }
99 pub fn performance_config_latency(mut self, input: crate::types::PerformanceConfigLatency) -> Self {
101 self.performance_config_latency = ::std::option::Option::Some(input);
102 self
103 }
104 pub fn set_performance_config_latency(mut self, input: ::std::option::Option<crate::types::PerformanceConfigLatency>) -> Self {
106 self.performance_config_latency = input;
107 self
108 }
109 pub fn get_performance_config_latency(&self) -> &::std::option::Option<crate::types::PerformanceConfigLatency> {
111 &self.performance_config_latency
112 }
113 pub fn service_tier(mut self, input: crate::types::ServiceTierType) -> Self {
115 self.service_tier = ::std::option::Option::Some(input);
116 self
117 }
118 pub fn set_service_tier(mut self, input: ::std::option::Option<crate::types::ServiceTierType>) -> Self {
120 self.service_tier = input;
121 self
122 }
123 pub fn get_service_tier(&self) -> &::std::option::Option<crate::types::ServiceTierType> {
125 &self.service_tier
126 }
127 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
128 self._request_id = Some(request_id.into());
129 self
130 }
131
132 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
133 self._request_id = request_id;
134 self
135 }
136 pub fn build(self) -> ::std::result::Result<crate::operation::invoke_model::InvokeModelOutput, ::aws_smithy_types::error::operation::BuildError> {
141 ::std::result::Result::Ok(crate::operation::invoke_model::InvokeModelOutput {
142 body: self.body.ok_or_else(|| {
143 ::aws_smithy_types::error::operation::BuildError::missing_field(
144 "body",
145 "body was not specified but it is required when building InvokeModelOutput",
146 )
147 })?,
148 content_type: self.content_type.ok_or_else(|| {
149 ::aws_smithy_types::error::operation::BuildError::missing_field(
150 "content_type",
151 "content_type was not specified but it is required when building InvokeModelOutput",
152 )
153 })?,
154 performance_config_latency: self.performance_config_latency,
155 service_tier: self.service_tier,
156 _request_id: self._request_id,
157 })
158 }
159}
160impl ::std::fmt::Debug for InvokeModelOutputBuilder {
161 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
162 let mut formatter = f.debug_struct("InvokeModelOutputBuilder");
163 formatter.field("body", &"*** Sensitive Data Redacted ***");
164 formatter.field("content_type", &self.content_type);
165 formatter.field("performance_config_latency", &self.performance_config_latency);
166 formatter.field("service_tier", &self.service_tier);
167 formatter.field("_request_id", &self._request_id);
168 formatter.finish()
169 }
170}