fn invoke_endpoint(
        &self,
        input: InvokeEndpointInput,
    ) -> RusotoFuture<InvokeEndpointOutput, InvokeEndpointError> {
        let request_uri = format!(
            "/endpoints/{endpoint_name}/invocations",
            endpoint_name = input.endpoint_name
        );

        let mut request = SignedRequest::new("POST", "sagemaker", &self.region, &request_uri);
        if input.content_type.is_none() {
            request.set_content_type("application/x-amz-json-1.1".to_owned());
        }

        request.set_endpoint_prefix("runtime.sagemaker".to_string());
        let encoded = Some(input.body.to_owned());
        request.set_payload(encoded);

        if let Some(ref accept) = input.accept {
            request.add_header("Accept", &accept.to_string());
        }

        if let Some(ref content_type) = input.content_type {
            request.add_header("Content-Type", &content_type.to_string());
        }

        self.client.sign_and_dispatch(request, |response| {
            if response.status.is_success() {
                Box::new(response.buffer().from_err().map(|response| {
                    let mut result = InvokeEndpointOutput::default();
                    result.body = response.body;

                    if let Some(content_type) = response.headers.get("Content-Type") {
                        let value = content_type.to_owned();
                        result.content_type = Some(value)
                    };
                    if let Some(invoked_production_variant) =
                        response.headers.get("x-Amzn-Invoked-Production-Variant")
                    {
                        let value = invoked_production_variant.to_owned();
                        result.invoked_production_variant = Some(value)
                    };

                    result
                }))
            } else {
                Box::new(
                    response
                        .buffer()
                        .from_err()
                        .and_then(|response| Err(InvokeEndpointError::from_response(response))),
                )
            }
        })
    }
/// <p>After you deploy a model into production using Amazon SageMaker hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint. </p> <p>For an overview of Amazon SageMaker, see <a href="http://docs.aws.amazon.com/sagemaker/latest/dg/how-it-works.html">How It Works</a> </p> <p> Amazon SageMaker strips all POST headers except those supported by the API. Amazon SageMaker might add additional headers. You should not rely on the behavior of headers outside those enumerated in the request syntax. </p>
After you deploy a model into production using Amazon SageMaker hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint.  For an overview of Amazon SageMaker, see How It Works   Amazon SageMaker strips all POST headers except those supported by the API. Amazon SageMaker might add additional headers. You should not rely on the behavior of headers outside those enumerated in the request syntax.
After you deploy a model into production using Amazon SageMaker hosting services your client applications use this API to get inferences from the model hosted at the specified endpoint . For an overview of Amazon SageMaker see How It Works Amazon SageMaker strips all POST headers except those supported by the API . Amazon SageMaker might add additional headers . You should not rely on the behavior of headers outside those enumerated in the request syntax .
fn invoke_endpoint(
        &self,
        input: InvokeEndpointInput,
    ) -> RusotoFuture<InvokeEndpointOutput, InvokeEndpointError> {
        let request_uri = format!(
            "/endpoints/{endpoint_name}/invocations",
            endpoint_name = input.endpoint_name
        );
        let mut request = SignedRequest::new("POST", "sagemaker", &self.region, &request_uri);
        if input.content_type.is_none() {
            request.set_content_type("application/x-amz-json-1.1".to_owned());
        }
        request.set_endpoint_prefix("runtime.sagemaker".to_string());
        let encoded = Some(input.body.to_owned());
        request.set_payload(encoded);
        if let Some(ref accept) = input.accept {
            request.add_header("Accept", &accept.to_string());
        }
        if let Some(ref content_type) = input.content_type {
            request.add_header("Content-Type", &content_type.to_string());
        }
        self.client.sign_and_dispatch(request, |response| {
            if response.status.is_success() {
                Box::new(response.buffer().from_err().map(|response| {
                    let mut result = InvokeEndpointOutput::default();
                    result.body = response.body;
                    if let Some(content_type) = response.headers.get("Content-Type") {
                        let value = content_type.to_owned();
                        result.content_type = Some(value)
                    };
                    if let Some(invoked_production_variant) =
                        response.headers.get("x-Amzn-Invoked-Production-Variant")
                    {
                        let value = invoked_production_variant.to_owned();
                        result.invoked_production_variant = Some(value)
                    };
                    result
                }))
            } else {
                Box::new(
                    response
                        .buffer()
                        .from_err()
                        .and_then(|response| Err(InvokeEndpointError::from_response(response))),
                )
            }
        })
    }
fn invoke_endpoint ( & self , input : InvokeEndpointInput , ) -> RusotoFuture < InvokeEndpointOutput , InvokeEndpointError > { let request_uri = format ! ( " " endpoint_name input endpoint_name ) ; let mut request = SignedRequest :: new ( " " , " " , & self . region , & request_uri ) ; if input . content_type . is_none ( ) { request . set_content_type ( " " . to_owned ( ) ) ; } request . set_endpoint_prefix ( " " . to_string ( ) ) ; let encoded = Some ( input . body . to_owned ( ) ) ; request . set_payload ( encoded ) ; if let Some ( ref accept ) = input . accept { request . add_header ( " " , & accept . to_string ( ) ) ; } if let Some ( ref content_type ) = input . content_type { request . add_header ( " " , & content_type . to_string ( ) ) ; } self . client . sign_and_dispatch ( request , | response | { if response . status . is_success ( ) { Box :: new ( response . buffer ( ) . from_err ( ) . map ( | response | { let mut result = InvokeEndpointOutput :: default ( ) ; result . body = response . body ; if let Some ( content_type ) = response . headers . get ( " " ) { let value = content_type . to_owned ( ) ; result . content_type = Some ( value ) } ; if let Some ( invoked_production_variant ) = response . headers . get ( " " ) { let value = invoked_production_variant . to_owned ( ) ; result . invoked_production_variant = Some ( value ) } ; result } ) ) } else { Box :: new ( response . buffer ( ) . from_err ( ) . and_then ( | response | Err ( InvokeEndpointError :: from_response ( response ) ) ) , ) } } ) }
<p>After you deploy a model into production using Amazon SageMaker hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint.
<p > After you deploy a model into production using Amazon SageMaker hosting services your client applications use this API to get inferences from the model hosted at the specified endpoint .
&self
input
InvokeEndpointInput
&self
input
InvokeEndpointInput