aws-sdk-sagemakerinferencerouterruntime 1.2.0

AWS SDK for Amazon SageMaker Inference Router Runtime
Documentation
// 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()
    }
}