aws_sdk_sagemakerruntime/operation/invoke_endpoint/
_invoke_endpoint_input.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::clone::Clone, ::std::cmp::PartialEq)]
5pub struct InvokeEndpointInput {
6    /// <p>The name of the endpoint that you specified when you created the endpoint using the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html">CreateEndpoint</a> API.</p>
7    pub endpoint_name: ::std::option::Option<::std::string::String>,
8    /// <p>Provides input data, in the format specified in the <code>ContentType</code> request header. Amazon SageMaker AI passes all of the data in the body to the model.</p>
9    /// <p>For information about the format of the request body, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data Formats-Inference</a>.</p>
10    pub body: ::std::option::Option<::aws_smithy_types::Blob>,
11    /// <p>The MIME type of the input data in the request body.</p>
12    pub content_type: ::std::option::Option<::std::string::String>,
13    /// <p>The desired MIME type of the inference response from the model container.</p>
14    pub accept: ::std::option::Option<::std::string::String>,
15    /// <p>Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker AI endpoint. The information is an opaque value that is forwarded verbatim. You could use this value, for example, to provide an ID that you can use to track a request or to provide other metadata that a service endpoint was programmed to process. The value must consist of no more than 1024 visible US-ASCII characters as specified in <a href="https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value Components</a> of the Hypertext Transfer Protocol (HTTP/1.1).</p>
16    /// <p>The code in your model is responsible for setting or updating any custom attributes in the response. If your code does not set this value in the response, an empty value is returned. For example, if a custom attribute represents the trace ID, your model can prepend the custom attribute with <code>Trace ID:</code> in your post-processing function.</p>
17    /// <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker AI Python SDK.</p>
18    pub custom_attributes: ::std::option::Option<::std::string::String>,
19    /// <p>The model to request for inference when invoking a multi-model endpoint.</p>
20    pub target_model: ::std::option::Option<::std::string::String>,
21    /// <p>Specify the production variant to send the inference request to when invoking an endpoint that is running two or more variants. Note that this parameter overrides the default behavior for the endpoint, which is to distribute the invocation traffic based on the variant weights.</p>
22    /// <p>For information about how to use variant targeting to perform a/b testing, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html">Test models in production</a></p>
23    pub target_variant: ::std::option::Option<::std::string::String>,
24    /// <p>If the endpoint hosts multiple containers and is configured to use direct invocation, this parameter specifies the host name of the container to invoke.</p>
25    pub target_container_hostname: ::std::option::Option<::std::string::String>,
26    /// <p>If you provide a value, it is added to the captured data when you enable data capture on the endpoint. For information about data capture, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-data-capture.html">Capture Data</a>.</p>
27    pub inference_id: ::std::option::Option<::std::string::String>,
28    /// <p>An optional JMESPath expression used to override the <code>EnableExplanations</code> parameter of the <code>ClarifyExplainerConfig</code> API. See the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-create-endpoint.html#clarify-online-explainability-create-endpoint-enable">EnableExplanations</a> section in the developer guide for more information.</p>
29    pub enable_explanations: ::std::option::Option<::std::string::String>,
30    /// <p>If the endpoint hosts one or more inference components, this parameter specifies the name of inference component to invoke.</p>
31    pub inference_component_name: ::std::option::Option<::std::string::String>,
32    /// <p>Creates a stateful session or identifies an existing one. You can do one of the following:</p>
33    /// <ul>
34    /// <li>
35    /// <p>Create a stateful session by specifying the value <code>NEW_SESSION</code>.</p></li>
36    /// <li>
37    /// <p>Send your request to an existing stateful session by specifying the ID of that session.</p></li>
38    /// </ul>
39    /// <p>With a stateful session, you can send multiple requests to a stateful model. When you create a session with a stateful model, the model must create the session ID and set the expiration time. The model must also provide that information in the response to your request. You can get the ID and timestamp from the <code>NewSessionId</code> response parameter. For any subsequent request where you specify that session ID, SageMaker AI routes the request to the same instance that supports the session.</p>
40    pub session_id: ::std::option::Option<::std::string::String>,
41}
42impl InvokeEndpointInput {
43    /// <p>The name of the endpoint that you specified when you created the endpoint using the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html">CreateEndpoint</a> API.</p>
44    pub fn endpoint_name(&self) -> ::std::option::Option<&str> {
45        self.endpoint_name.as_deref()
46    }
47    /// <p>Provides input data, in the format specified in the <code>ContentType</code> request header. Amazon SageMaker AI passes all of the data in the body to the model.</p>
48    /// <p>For information about the format of the request body, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data Formats-Inference</a>.</p>
49    pub fn body(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
50        self.body.as_ref()
51    }
52    /// <p>The MIME type of the input data in the request body.</p>
53    pub fn content_type(&self) -> ::std::option::Option<&str> {
54        self.content_type.as_deref()
55    }
56    /// <p>The desired MIME type of the inference response from the model container.</p>
57    pub fn accept(&self) -> ::std::option::Option<&str> {
58        self.accept.as_deref()
59    }
60    /// <p>Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker AI endpoint. The information is an opaque value that is forwarded verbatim. You could use this value, for example, to provide an ID that you can use to track a request or to provide other metadata that a service endpoint was programmed to process. The value must consist of no more than 1024 visible US-ASCII characters as specified in <a href="https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value Components</a> of the Hypertext Transfer Protocol (HTTP/1.1).</p>
61    /// <p>The code in your model is responsible for setting or updating any custom attributes in the response. If your code does not set this value in the response, an empty value is returned. For example, if a custom attribute represents the trace ID, your model can prepend the custom attribute with <code>Trace ID:</code> in your post-processing function.</p>
62    /// <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker AI Python SDK.</p>
63    pub fn custom_attributes(&self) -> ::std::option::Option<&str> {
64        self.custom_attributes.as_deref()
65    }
66    /// <p>The model to request for inference when invoking a multi-model endpoint.</p>
67    pub fn target_model(&self) -> ::std::option::Option<&str> {
68        self.target_model.as_deref()
69    }
70    /// <p>Specify the production variant to send the inference request to when invoking an endpoint that is running two or more variants. Note that this parameter overrides the default behavior for the endpoint, which is to distribute the invocation traffic based on the variant weights.</p>
71    /// <p>For information about how to use variant targeting to perform a/b testing, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html">Test models in production</a></p>
72    pub fn target_variant(&self) -> ::std::option::Option<&str> {
73        self.target_variant.as_deref()
74    }
75    /// <p>If the endpoint hosts multiple containers and is configured to use direct invocation, this parameter specifies the host name of the container to invoke.</p>
76    pub fn target_container_hostname(&self) -> ::std::option::Option<&str> {
77        self.target_container_hostname.as_deref()
78    }
79    /// <p>If you provide a value, it is added to the captured data when you enable data capture on the endpoint. For information about data capture, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-data-capture.html">Capture Data</a>.</p>
80    pub fn inference_id(&self) -> ::std::option::Option<&str> {
81        self.inference_id.as_deref()
82    }
83    /// <p>An optional JMESPath expression used to override the <code>EnableExplanations</code> parameter of the <code>ClarifyExplainerConfig</code> API. See the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-create-endpoint.html#clarify-online-explainability-create-endpoint-enable">EnableExplanations</a> section in the developer guide for more information.</p>
84    pub fn enable_explanations(&self) -> ::std::option::Option<&str> {
85        self.enable_explanations.as_deref()
86    }
87    /// <p>If the endpoint hosts one or more inference components, this parameter specifies the name of inference component to invoke.</p>
88    pub fn inference_component_name(&self) -> ::std::option::Option<&str> {
89        self.inference_component_name.as_deref()
90    }
91    /// <p>Creates a stateful session or identifies an existing one. You can do one of the following:</p>
92    /// <ul>
93    /// <li>
94    /// <p>Create a stateful session by specifying the value <code>NEW_SESSION</code>.</p></li>
95    /// <li>
96    /// <p>Send your request to an existing stateful session by specifying the ID of that session.</p></li>
97    /// </ul>
98    /// <p>With a stateful session, you can send multiple requests to a stateful model. When you create a session with a stateful model, the model must create the session ID and set the expiration time. The model must also provide that information in the response to your request. You can get the ID and timestamp from the <code>NewSessionId</code> response parameter. For any subsequent request where you specify that session ID, SageMaker AI routes the request to the same instance that supports the session.</p>
99    pub fn session_id(&self) -> ::std::option::Option<&str> {
100        self.session_id.as_deref()
101    }
102}
103impl ::std::fmt::Debug for InvokeEndpointInput {
104    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
105        let mut formatter = f.debug_struct("InvokeEndpointInput");
106        formatter.field("endpoint_name", &self.endpoint_name);
107        formatter.field("body", &"*** Sensitive Data Redacted ***");
108        formatter.field("content_type", &self.content_type);
109        formatter.field("accept", &self.accept);
110        formatter.field("custom_attributes", &"*** Sensitive Data Redacted ***");
111        formatter.field("target_model", &self.target_model);
112        formatter.field("target_variant", &self.target_variant);
113        formatter.field("target_container_hostname", &self.target_container_hostname);
114        formatter.field("inference_id", &self.inference_id);
115        formatter.field("enable_explanations", &self.enable_explanations);
116        formatter.field("inference_component_name", &self.inference_component_name);
117        formatter.field("session_id", &self.session_id);
118        formatter.finish()
119    }
120}
121impl InvokeEndpointInput {
122    /// Creates a new builder-style object to manufacture [`InvokeEndpointInput`](crate::operation::invoke_endpoint::InvokeEndpointInput).
123    pub fn builder() -> crate::operation::invoke_endpoint::builders::InvokeEndpointInputBuilder {
124        crate::operation::invoke_endpoint::builders::InvokeEndpointInputBuilder::default()
125    }
126}
127
128/// A builder for [`InvokeEndpointInput`](crate::operation::invoke_endpoint::InvokeEndpointInput).
129#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
130#[non_exhaustive]
131pub struct InvokeEndpointInputBuilder {
132    pub(crate) endpoint_name: ::std::option::Option<::std::string::String>,
133    pub(crate) body: ::std::option::Option<::aws_smithy_types::Blob>,
134    pub(crate) content_type: ::std::option::Option<::std::string::String>,
135    pub(crate) accept: ::std::option::Option<::std::string::String>,
136    pub(crate) custom_attributes: ::std::option::Option<::std::string::String>,
137    pub(crate) target_model: ::std::option::Option<::std::string::String>,
138    pub(crate) target_variant: ::std::option::Option<::std::string::String>,
139    pub(crate) target_container_hostname: ::std::option::Option<::std::string::String>,
140    pub(crate) inference_id: ::std::option::Option<::std::string::String>,
141    pub(crate) enable_explanations: ::std::option::Option<::std::string::String>,
142    pub(crate) inference_component_name: ::std::option::Option<::std::string::String>,
143    pub(crate) session_id: ::std::option::Option<::std::string::String>,
144}
145impl InvokeEndpointInputBuilder {
146    /// <p>The name of the endpoint that you specified when you created the endpoint using the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html">CreateEndpoint</a> API.</p>
147    /// This field is required.
148    pub fn endpoint_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.endpoint_name = ::std::option::Option::Some(input.into());
150        self
151    }
152    /// <p>The name of the endpoint that you specified when you created the endpoint using the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html">CreateEndpoint</a> API.</p>
153    pub fn set_endpoint_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.endpoint_name = input;
155        self
156    }
157    /// <p>The name of the endpoint that you specified when you created the endpoint using the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html">CreateEndpoint</a> API.</p>
158    pub fn get_endpoint_name(&self) -> &::std::option::Option<::std::string::String> {
159        &self.endpoint_name
160    }
161    /// <p>Provides input data, in the format specified in the <code>ContentType</code> request header. Amazon SageMaker AI passes all of the data in the body to the model.</p>
162    /// <p>For information about the format of the request body, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data Formats-Inference</a>.</p>
163    /// This field is required.
164    pub fn body(mut self, input: ::aws_smithy_types::Blob) -> Self {
165        self.body = ::std::option::Option::Some(input);
166        self
167    }
168    /// <p>Provides input data, in the format specified in the <code>ContentType</code> request header. Amazon SageMaker AI passes all of the data in the body to the model.</p>
169    /// <p>For information about the format of the request body, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data Formats-Inference</a>.</p>
170    pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
171        self.body = input;
172        self
173    }
174    /// <p>Provides input data, in the format specified in the <code>ContentType</code> request header. Amazon SageMaker AI passes all of the data in the body to the model.</p>
175    /// <p>For information about the format of the request body, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data Formats-Inference</a>.</p>
176    pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
177        &self.body
178    }
179    /// <p>The MIME type of the input data in the request body.</p>
180    pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181        self.content_type = ::std::option::Option::Some(input.into());
182        self
183    }
184    /// <p>The MIME type of the input data in the request body.</p>
185    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186        self.content_type = input;
187        self
188    }
189    /// <p>The MIME type of the input data in the request body.</p>
190    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
191        &self.content_type
192    }
193    /// <p>The desired MIME type of the inference response from the model container.</p>
194    pub fn accept(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
195        self.accept = ::std::option::Option::Some(input.into());
196        self
197    }
198    /// <p>The desired MIME type of the inference response from the model container.</p>
199    pub fn set_accept(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
200        self.accept = input;
201        self
202    }
203    /// <p>The desired MIME type of the inference response from the model container.</p>
204    pub fn get_accept(&self) -> &::std::option::Option<::std::string::String> {
205        &self.accept
206    }
207    /// <p>Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker AI endpoint. The information is an opaque value that is forwarded verbatim. You could use this value, for example, to provide an ID that you can use to track a request or to provide other metadata that a service endpoint was programmed to process. The value must consist of no more than 1024 visible US-ASCII characters as specified in <a href="https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value Components</a> of the Hypertext Transfer Protocol (HTTP/1.1).</p>
208    /// <p>The code in your model is responsible for setting or updating any custom attributes in the response. If your code does not set this value in the response, an empty value is returned. For example, if a custom attribute represents the trace ID, your model can prepend the custom attribute with <code>Trace ID:</code> in your post-processing function.</p>
209    /// <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker AI Python SDK.</p>
210    pub fn custom_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211        self.custom_attributes = ::std::option::Option::Some(input.into());
212        self
213    }
214    /// <p>Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker AI endpoint. The information is an opaque value that is forwarded verbatim. You could use this value, for example, to provide an ID that you can use to track a request or to provide other metadata that a service endpoint was programmed to process. The value must consist of no more than 1024 visible US-ASCII characters as specified in <a href="https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value Components</a> of the Hypertext Transfer Protocol (HTTP/1.1).</p>
215    /// <p>The code in your model is responsible for setting or updating any custom attributes in the response. If your code does not set this value in the response, an empty value is returned. For example, if a custom attribute represents the trace ID, your model can prepend the custom attribute with <code>Trace ID:</code> in your post-processing function.</p>
216    /// <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker AI Python SDK.</p>
217    pub fn set_custom_attributes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.custom_attributes = input;
219        self
220    }
221    /// <p>Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker AI endpoint. The information is an opaque value that is forwarded verbatim. You could use this value, for example, to provide an ID that you can use to track a request or to provide other metadata that a service endpoint was programmed to process. The value must consist of no more than 1024 visible US-ASCII characters as specified in <a href="https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value Components</a> of the Hypertext Transfer Protocol (HTTP/1.1).</p>
222    /// <p>The code in your model is responsible for setting or updating any custom attributes in the response. If your code does not set this value in the response, an empty value is returned. For example, if a custom attribute represents the trace ID, your model can prepend the custom attribute with <code>Trace ID:</code> in your post-processing function.</p>
223    /// <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker AI Python SDK.</p>
224    pub fn get_custom_attributes(&self) -> &::std::option::Option<::std::string::String> {
225        &self.custom_attributes
226    }
227    /// <p>The model to request for inference when invoking a multi-model endpoint.</p>
228    pub fn target_model(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
229        self.target_model = ::std::option::Option::Some(input.into());
230        self
231    }
232    /// <p>The model to request for inference when invoking a multi-model endpoint.</p>
233    pub fn set_target_model(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
234        self.target_model = input;
235        self
236    }
237    /// <p>The model to request for inference when invoking a multi-model endpoint.</p>
238    pub fn get_target_model(&self) -> &::std::option::Option<::std::string::String> {
239        &self.target_model
240    }
241    /// <p>Specify the production variant to send the inference request to when invoking an endpoint that is running two or more variants. Note that this parameter overrides the default behavior for the endpoint, which is to distribute the invocation traffic based on the variant weights.</p>
242    /// <p>For information about how to use variant targeting to perform a/b testing, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html">Test models in production</a></p>
243    pub fn target_variant(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
244        self.target_variant = ::std::option::Option::Some(input.into());
245        self
246    }
247    /// <p>Specify the production variant to send the inference request to when invoking an endpoint that is running two or more variants. Note that this parameter overrides the default behavior for the endpoint, which is to distribute the invocation traffic based on the variant weights.</p>
248    /// <p>For information about how to use variant targeting to perform a/b testing, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html">Test models in production</a></p>
249    pub fn set_target_variant(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250        self.target_variant = input;
251        self
252    }
253    /// <p>Specify the production variant to send the inference request to when invoking an endpoint that is running two or more variants. Note that this parameter overrides the default behavior for the endpoint, which is to distribute the invocation traffic based on the variant weights.</p>
254    /// <p>For information about how to use variant targeting to perform a/b testing, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html">Test models in production</a></p>
255    pub fn get_target_variant(&self) -> &::std::option::Option<::std::string::String> {
256        &self.target_variant
257    }
258    /// <p>If the endpoint hosts multiple containers and is configured to use direct invocation, this parameter specifies the host name of the container to invoke.</p>
259    pub fn target_container_hostname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
260        self.target_container_hostname = ::std::option::Option::Some(input.into());
261        self
262    }
263    /// <p>If the endpoint hosts multiple containers and is configured to use direct invocation, this parameter specifies the host name of the container to invoke.</p>
264    pub fn set_target_container_hostname(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
265        self.target_container_hostname = input;
266        self
267    }
268    /// <p>If the endpoint hosts multiple containers and is configured to use direct invocation, this parameter specifies the host name of the container to invoke.</p>
269    pub fn get_target_container_hostname(&self) -> &::std::option::Option<::std::string::String> {
270        &self.target_container_hostname
271    }
272    /// <p>If you provide a value, it is added to the captured data when you enable data capture on the endpoint. For information about data capture, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-data-capture.html">Capture Data</a>.</p>
273    pub fn inference_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
274        self.inference_id = ::std::option::Option::Some(input.into());
275        self
276    }
277    /// <p>If you provide a value, it is added to the captured data when you enable data capture on the endpoint. For information about data capture, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-data-capture.html">Capture Data</a>.</p>
278    pub fn set_inference_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
279        self.inference_id = input;
280        self
281    }
282    /// <p>If you provide a value, it is added to the captured data when you enable data capture on the endpoint. For information about data capture, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-data-capture.html">Capture Data</a>.</p>
283    pub fn get_inference_id(&self) -> &::std::option::Option<::std::string::String> {
284        &self.inference_id
285    }
286    /// <p>An optional JMESPath expression used to override the <code>EnableExplanations</code> parameter of the <code>ClarifyExplainerConfig</code> API. See the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-create-endpoint.html#clarify-online-explainability-create-endpoint-enable">EnableExplanations</a> section in the developer guide for more information.</p>
287    pub fn enable_explanations(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
288        self.enable_explanations = ::std::option::Option::Some(input.into());
289        self
290    }
291    /// <p>An optional JMESPath expression used to override the <code>EnableExplanations</code> parameter of the <code>ClarifyExplainerConfig</code> API. See the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-create-endpoint.html#clarify-online-explainability-create-endpoint-enable">EnableExplanations</a> section in the developer guide for more information.</p>
292    pub fn set_enable_explanations(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
293        self.enable_explanations = input;
294        self
295    }
296    /// <p>An optional JMESPath expression used to override the <code>EnableExplanations</code> parameter of the <code>ClarifyExplainerConfig</code> API. See the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-create-endpoint.html#clarify-online-explainability-create-endpoint-enable">EnableExplanations</a> section in the developer guide for more information.</p>
297    pub fn get_enable_explanations(&self) -> &::std::option::Option<::std::string::String> {
298        &self.enable_explanations
299    }
300    /// <p>If the endpoint hosts one or more inference components, this parameter specifies the name of inference component to invoke.</p>
301    pub fn inference_component_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
302        self.inference_component_name = ::std::option::Option::Some(input.into());
303        self
304    }
305    /// <p>If the endpoint hosts one or more inference components, this parameter specifies the name of inference component to invoke.</p>
306    pub fn set_inference_component_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
307        self.inference_component_name = input;
308        self
309    }
310    /// <p>If the endpoint hosts one or more inference components, this parameter specifies the name of inference component to invoke.</p>
311    pub fn get_inference_component_name(&self) -> &::std::option::Option<::std::string::String> {
312        &self.inference_component_name
313    }
314    /// <p>Creates a stateful session or identifies an existing one. You can do one of the following:</p>
315    /// <ul>
316    /// <li>
317    /// <p>Create a stateful session by specifying the value <code>NEW_SESSION</code>.</p></li>
318    /// <li>
319    /// <p>Send your request to an existing stateful session by specifying the ID of that session.</p></li>
320    /// </ul>
321    /// <p>With a stateful session, you can send multiple requests to a stateful model. When you create a session with a stateful model, the model must create the session ID and set the expiration time. The model must also provide that information in the response to your request. You can get the ID and timestamp from the <code>NewSessionId</code> response parameter. For any subsequent request where you specify that session ID, SageMaker AI routes the request to the same instance that supports the session.</p>
322    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
323        self.session_id = ::std::option::Option::Some(input.into());
324        self
325    }
326    /// <p>Creates a stateful session or identifies an existing one. You can do one of the following:</p>
327    /// <ul>
328    /// <li>
329    /// <p>Create a stateful session by specifying the value <code>NEW_SESSION</code>.</p></li>
330    /// <li>
331    /// <p>Send your request to an existing stateful session by specifying the ID of that session.</p></li>
332    /// </ul>
333    /// <p>With a stateful session, you can send multiple requests to a stateful model. When you create a session with a stateful model, the model must create the session ID and set the expiration time. The model must also provide that information in the response to your request. You can get the ID and timestamp from the <code>NewSessionId</code> response parameter. For any subsequent request where you specify that session ID, SageMaker AI routes the request to the same instance that supports the session.</p>
334    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
335        self.session_id = input;
336        self
337    }
338    /// <p>Creates a stateful session or identifies an existing one. You can do one of the following:</p>
339    /// <ul>
340    /// <li>
341    /// <p>Create a stateful session by specifying the value <code>NEW_SESSION</code>.</p></li>
342    /// <li>
343    /// <p>Send your request to an existing stateful session by specifying the ID of that session.</p></li>
344    /// </ul>
345    /// <p>With a stateful session, you can send multiple requests to a stateful model. When you create a session with a stateful model, the model must create the session ID and set the expiration time. The model must also provide that information in the response to your request. You can get the ID and timestamp from the <code>NewSessionId</code> response parameter. For any subsequent request where you specify that session ID, SageMaker AI routes the request to the same instance that supports the session.</p>
346    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
347        &self.session_id
348    }
349    /// Consumes the builder and constructs a [`InvokeEndpointInput`](crate::operation::invoke_endpoint::InvokeEndpointInput).
350    pub fn build(
351        self,
352    ) -> ::std::result::Result<crate::operation::invoke_endpoint::InvokeEndpointInput, ::aws_smithy_types::error::operation::BuildError> {
353        ::std::result::Result::Ok(crate::operation::invoke_endpoint::InvokeEndpointInput {
354            endpoint_name: self.endpoint_name,
355            body: self.body,
356            content_type: self.content_type,
357            accept: self.accept,
358            custom_attributes: self.custom_attributes,
359            target_model: self.target_model,
360            target_variant: self.target_variant,
361            target_container_hostname: self.target_container_hostname,
362            inference_id: self.inference_id,
363            enable_explanations: self.enable_explanations,
364            inference_component_name: self.inference_component_name,
365            session_id: self.session_id,
366        })
367    }
368}
369impl ::std::fmt::Debug for InvokeEndpointInputBuilder {
370    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
371        let mut formatter = f.debug_struct("InvokeEndpointInputBuilder");
372        formatter.field("endpoint_name", &self.endpoint_name);
373        formatter.field("body", &"*** Sensitive Data Redacted ***");
374        formatter.field("content_type", &self.content_type);
375        formatter.field("accept", &self.accept);
376        formatter.field("custom_attributes", &"*** Sensitive Data Redacted ***");
377        formatter.field("target_model", &self.target_model);
378        formatter.field("target_variant", &self.target_variant);
379        formatter.field("target_container_hostname", &self.target_container_hostname);
380        formatter.field("inference_id", &self.inference_id);
381        formatter.field("enable_explanations", &self.enable_explanations);
382        formatter.field("inference_component_name", &self.inference_component_name);
383        formatter.field("session_id", &self.session_id);
384        formatter.finish()
385    }
386}