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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
// 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)]
pub struct InvokeInferenceRouterOutput {
/// <p>The inference that the model returned.</p>
pub body: ::std::option::Option<::aws_smithy_types::Blob>,
/// <p>The MIME type of the inference returned in the response body.</p>
pub content_type: ::std::option::Option<::std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the endpoint or inference component that served the request.</p>
pub invoked_routed_resource_arn: ::std::option::Option<::std::string::String>,
/// <p>The reason that the router chose the destination that served the request. Possible values:</p>
/// <ul>
/// <li>
/// <p><code>local-preferred</code> – The destination is a healthy destination in the router's Region.</p></li>
/// <li>
/// <p><code>capacity-available</code> – No destination in the router's Region could take the request, and two or more destinations in other Regions could.</p></li>
/// <li>
/// <p><code>only-healthy</code> – No destination in the router's Region could take the request, and exactly one destination in another Region could.</p></li>
/// <li>
/// <p><code>failover</code> – The router moved the request away from destinations in its Region because they were overloaded or returning errors. You also see this value when the router can't assess destination health, and when no destination is healthy and the router tries one anyway.</p></li>
/// </ul>
pub routing_reason: ::std::option::Option<::std::string::String>,
/// <p>The production variant of the destination endpoint that served the request.</p>
pub invoked_production_variant: ::std::option::Option<::std::string::String>,
/// <p>Provides additional information in the response about the inference. This is the value that the model container of the destination returned, unchanged.</p>
pub custom_attributes: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl InvokeInferenceRouterOutput {
/// <p>The inference that the model returned.</p>
pub fn body(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
self.body.as_ref()
}
/// <p>The MIME type of the inference returned in the response body.</p>
pub fn content_type(&self) -> ::std::option::Option<&str> {
self.content_type.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the endpoint or inference component that served the request.</p>
pub fn invoked_routed_resource_arn(&self) -> ::std::option::Option<&str> {
self.invoked_routed_resource_arn.as_deref()
}
/// <p>The reason that the router chose the destination that served the request. Possible values:</p>
/// <ul>
/// <li>
/// <p><code>local-preferred</code> – The destination is a healthy destination in the router's Region.</p></li>
/// <li>
/// <p><code>capacity-available</code> – No destination in the router's Region could take the request, and two or more destinations in other Regions could.</p></li>
/// <li>
/// <p><code>only-healthy</code> – No destination in the router's Region could take the request, and exactly one destination in another Region could.</p></li>
/// <li>
/// <p><code>failover</code> – The router moved the request away from destinations in its Region because they were overloaded or returning errors. You also see this value when the router can't assess destination health, and when no destination is healthy and the router tries one anyway.</p></li>
/// </ul>
pub fn routing_reason(&self) -> ::std::option::Option<&str> {
self.routing_reason.as_deref()
}
/// <p>The production variant of the destination endpoint that served the request.</p>
pub fn invoked_production_variant(&self) -> ::std::option::Option<&str> {
self.invoked_production_variant.as_deref()
}
/// <p>Provides additional information in the response about the inference. This is the value that the model container of the destination returned, unchanged.</p>
pub fn custom_attributes(&self) -> ::std::option::Option<&str> {
self.custom_attributes.as_deref()
}
}
impl ::std::fmt::Debug for InvokeInferenceRouterOutput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("InvokeInferenceRouterOutput");
formatter.field("body", &"*** Sensitive Data Redacted ***");
formatter.field("content_type", &self.content_type);
formatter.field("invoked_routed_resource_arn", &self.invoked_routed_resource_arn);
formatter.field("routing_reason", &self.routing_reason);
formatter.field("invoked_production_variant", &self.invoked_production_variant);
formatter.field("custom_attributes", &"*** Sensitive Data Redacted ***");
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}
impl ::aws_types::request_id::RequestId for InvokeInferenceRouterOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl InvokeInferenceRouterOutput {
/// Creates a new builder-style object to manufacture [`InvokeInferenceRouterOutput`](crate::operation::invoke_inference_router::InvokeInferenceRouterOutput).
pub fn builder() -> crate::operation::invoke_inference_router::builders::InvokeInferenceRouterOutputBuilder {
crate::operation::invoke_inference_router::builders::InvokeInferenceRouterOutputBuilder::default()
}
}
/// A builder for [`InvokeInferenceRouterOutput`](crate::operation::invoke_inference_router::InvokeInferenceRouterOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct InvokeInferenceRouterOutputBuilder {
pub(crate) body: ::std::option::Option<::aws_smithy_types::Blob>,
pub(crate) content_type: ::std::option::Option<::std::string::String>,
pub(crate) invoked_routed_resource_arn: ::std::option::Option<::std::string::String>,
pub(crate) routing_reason: ::std::option::Option<::std::string::String>,
pub(crate) invoked_production_variant: ::std::option::Option<::std::string::String>,
pub(crate) custom_attributes: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl InvokeInferenceRouterOutputBuilder {
/// <p>The inference that the model returned.</p>
pub fn body(mut self, input: ::aws_smithy_types::Blob) -> Self {
self.body = ::std::option::Option::Some(input);
self
}
/// <p>The inference that the model returned.</p>
pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
self.body = input;
self
}
/// <p>The inference that the model returned.</p>
pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
&self.body
}
/// <p>The MIME type of the inference returned in the response body.</p>
pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.content_type = ::std::option::Option::Some(input.into());
self
}
/// <p>The MIME type of the inference returned in the response body.</p>
pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.content_type = input;
self
}
/// <p>The MIME type of the inference returned in the response body.</p>
pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
&self.content_type
}
/// <p>The Amazon Resource Name (ARN) of the endpoint or inference component that served the request.</p>
pub fn invoked_routed_resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.invoked_routed_resource_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the endpoint or inference component that served the request.</p>
pub fn set_invoked_routed_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.invoked_routed_resource_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the endpoint or inference component that served the request.</p>
pub fn get_invoked_routed_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.invoked_routed_resource_arn
}
/// <p>The reason that the router chose the destination that served the request. Possible values:</p>
/// <ul>
/// <li>
/// <p><code>local-preferred</code> – The destination is a healthy destination in the router's Region.</p></li>
/// <li>
/// <p><code>capacity-available</code> – No destination in the router's Region could take the request, and two or more destinations in other Regions could.</p></li>
/// <li>
/// <p><code>only-healthy</code> – No destination in the router's Region could take the request, and exactly one destination in another Region could.</p></li>
/// <li>
/// <p><code>failover</code> – The router moved the request away from destinations in its Region because they were overloaded or returning errors. You also see this value when the router can't assess destination health, and when no destination is healthy and the router tries one anyway.</p></li>
/// </ul>
pub fn routing_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.routing_reason = ::std::option::Option::Some(input.into());
self
}
/// <p>The reason that the router chose the destination that served the request. Possible values:</p>
/// <ul>
/// <li>
/// <p><code>local-preferred</code> – The destination is a healthy destination in the router's Region.</p></li>
/// <li>
/// <p><code>capacity-available</code> – No destination in the router's Region could take the request, and two or more destinations in other Regions could.</p></li>
/// <li>
/// <p><code>only-healthy</code> – No destination in the router's Region could take the request, and exactly one destination in another Region could.</p></li>
/// <li>
/// <p><code>failover</code> – The router moved the request away from destinations in its Region because they were overloaded or returning errors. You also see this value when the router can't assess destination health, and when no destination is healthy and the router tries one anyway.</p></li>
/// </ul>
pub fn set_routing_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.routing_reason = input;
self
}
/// <p>The reason that the router chose the destination that served the request. Possible values:</p>
/// <ul>
/// <li>
/// <p><code>local-preferred</code> – The destination is a healthy destination in the router's Region.</p></li>
/// <li>
/// <p><code>capacity-available</code> – No destination in the router's Region could take the request, and two or more destinations in other Regions could.</p></li>
/// <li>
/// <p><code>only-healthy</code> – No destination in the router's Region could take the request, and exactly one destination in another Region could.</p></li>
/// <li>
/// <p><code>failover</code> – The router moved the request away from destinations in its Region because they were overloaded or returning errors. You also see this value when the router can't assess destination health, and when no destination is healthy and the router tries one anyway.</p></li>
/// </ul>
pub fn get_routing_reason(&self) -> &::std::option::Option<::std::string::String> {
&self.routing_reason
}
/// <p>The production variant of the destination endpoint that served the request.</p>
pub fn invoked_production_variant(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.invoked_production_variant = ::std::option::Option::Some(input.into());
self
}
/// <p>The production variant of the destination endpoint that served the request.</p>
pub fn set_invoked_production_variant(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.invoked_production_variant = input;
self
}
/// <p>The production variant of the destination endpoint that served the request.</p>
pub fn get_invoked_production_variant(&self) -> &::std::option::Option<::std::string::String> {
&self.invoked_production_variant
}
/// <p>Provides additional information in the response about the inference. This is the value that the model container of the destination returned, unchanged.</p>
pub fn custom_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.custom_attributes = ::std::option::Option::Some(input.into());
self
}
/// <p>Provides additional information in the response about the inference. This is the value that the model container of the destination returned, unchanged.</p>
pub fn set_custom_attributes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.custom_attributes = input;
self
}
/// <p>Provides additional information in the response about the inference. This is the value that the model container of the destination returned, unchanged.</p>
pub fn get_custom_attributes(&self) -> &::std::option::Option<::std::string::String> {
&self.custom_attributes
}
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 [`InvokeInferenceRouterOutput`](crate::operation::invoke_inference_router::InvokeInferenceRouterOutput).
pub fn build(self) -> crate::operation::invoke_inference_router::InvokeInferenceRouterOutput {
crate::operation::invoke_inference_router::InvokeInferenceRouterOutput {
body: self.body,
content_type: self.content_type,
invoked_routed_resource_arn: self.invoked_routed_resource_arn,
routing_reason: self.routing_reason,
invoked_production_variant: self.invoked_production_variant,
custom_attributes: self.custom_attributes,
_request_id: self._request_id,
}
}
}
impl ::std::fmt::Debug for InvokeInferenceRouterOutputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("InvokeInferenceRouterOutputBuilder");
formatter.field("body", &"*** Sensitive Data Redacted ***");
formatter.field("content_type", &self.content_type);
formatter.field("invoked_routed_resource_arn", &self.invoked_routed_resource_arn);
formatter.field("routing_reason", &self.routing_reason);
formatter.field("invoked_production_variant", &self.invoked_production_variant);
formatter.field("custom_attributes", &"*** Sensitive Data Redacted ***");
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}