/* * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.sagemakerruntime.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *

* 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. *

*

* Cals to InvokeEndpoint are authenticated by using AWS Signature * Version 4. For information, see Authenticating Requests (AWS Signature Version 4) in the Amazon S3 * API Reference. *

* *

* Endpoints are scoped to an individual account, and are not public. The URL * does not contain the account ID, but Amazon SageMaker determines the account * ID from the authentication token that is supplied by the caller. *

*
*/ public class InvokeEndpointRequest extends AmazonWebServiceRequest implements Serializable { /** *

* The name of the endpoint that you specified when you created the endpoint * using the CreateEndpoint API. *

*

* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*
*/ private String endpointName; /** *

* Provides input data, in the format specified in the * ContentType request header. Amazon SageMaker passes all of * the data in the body to the model. *

*

* For information about the format of the request body, see Common Data Formats—Inference. *

*

* Constraints:
* Length: - 5242880
*/ private java.nio.ByteBuffer body; /** *

* The MIME type of the input data in the request body. *

*

* Constraints:
* Length: - 1024
*/ private String contentType; /** *

* The desired MIME type of the inference in the response. *

*

* Constraints:
* Length: - 1024
*/ private String accept; /** *

*

* Constraints:
* Length: - 1024
*/ private String customAttributes; /** *

* The name of the endpoint that you specified when you created the endpoint * using the CreateEndpoint API. *

*

* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*
* * @return

* The name of the endpoint that you specified when you created the * endpoint using the CreateEndpoint API. *

*/ public String getEndpointName() { return endpointName; } /** *

* The name of the endpoint that you specified when you created the endpoint * using the CreateEndpoint API. *

*

* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*
* * @param endpointName

* The name of the endpoint that you specified when you created * the endpoint using the CreateEndpoint API. *

*/ public void setEndpointName(String endpointName) { this.endpointName = endpointName; } /** *

* The name of the endpoint that you specified when you created the endpoint * using the CreateEndpoint API. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*
* * @param endpointName

* The name of the endpoint that you specified when you created * the endpoint using the CreateEndpoint API. *

* @return A reference to this updated object so that method calls can be * chained together. */ public InvokeEndpointRequest withEndpointName(String endpointName) { this.endpointName = endpointName; return this; } /** *

* Provides input data, in the format specified in the * ContentType request header. Amazon SageMaker passes all of * the data in the body to the model. *

*

* For information about the format of the request body, see Common Data Formats—Inference. *

*

* Constraints:
* Length: - 5242880
* * @return

* Provides input data, in the format specified in the * ContentType request header. Amazon SageMaker passes * all of the data in the body to the model. *

*

* For information about the format of the request body, see Common Data Formats—Inference. *

*/ public java.nio.ByteBuffer getBody() { return body; } /** *

* Provides input data, in the format specified in the * ContentType request header. Amazon SageMaker passes all of * the data in the body to the model. *

*

* For information about the format of the request body, see Common Data Formats—Inference. *

*

* Constraints:
* Length: - 5242880
* * @param body

* Provides input data, in the format specified in the * ContentType request header. Amazon SageMaker * passes all of the data in the body to the model. *

*

* For information about the format of the request body, see Common Data Formats—Inference. *

*/ public void setBody(java.nio.ByteBuffer body) { this.body = body; } /** *

* Provides input data, in the format specified in the * ContentType request header. Amazon SageMaker passes all of * the data in the body to the model. *

*

* For information about the format of the request body, see Common Data Formats—Inference. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: - 5242880
* * @param body

* Provides input data, in the format specified in the * ContentType request header. Amazon SageMaker * passes all of the data in the body to the model. *

*

* For information about the format of the request body, see Common Data Formats—Inference. *

* @return A reference to this updated object so that method calls can be * chained together. */ public InvokeEndpointRequest withBody(java.nio.ByteBuffer body) { this.body = body; return this; } /** *

* The MIME type of the input data in the request body. *

*

* Constraints:
* Length: - 1024
* * @return

* The MIME type of the input data in the request body. *

*/ public String getContentType() { return contentType; } /** *

* The MIME type of the input data in the request body. *

*

* Constraints:
* Length: - 1024
* * @param contentType

* The MIME type of the input data in the request body. *

*/ public void setContentType(String contentType) { this.contentType = contentType; } /** *

* The MIME type of the input data in the request body. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: - 1024
* * @param contentType

* The MIME type of the input data in the request body. *

* @return A reference to this updated object so that method calls can be * chained together. */ public InvokeEndpointRequest withContentType(String contentType) { this.contentType = contentType; return this; } /** *

* The desired MIME type of the inference in the response. *

*

* Constraints:
* Length: - 1024
* * @return

* The desired MIME type of the inference in the response. *

*/ public String getAccept() { return accept; } /** *

* The desired MIME type of the inference in the response. *

*

* Constraints:
* Length: - 1024
* * @param accept

* The desired MIME type of the inference in the response. *

*/ public void setAccept(String accept) { this.accept = accept; } /** *

* The desired MIME type of the inference in the response. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: - 1024
* * @param accept

* The desired MIME type of the inference in the response. *

* @return A reference to this updated object so that method calls can be * chained together. */ public InvokeEndpointRequest withAccept(String accept) { this.accept = accept; return this; } /** *

*

* Constraints:
* Length: - 1024
* * @return

*/ public String getCustomAttributes() { return customAttributes; } /** *

*

* Constraints:
* Length: - 1024
* * @param customAttributes

*/ public void setCustomAttributes(String customAttributes) { this.customAttributes = customAttributes; } /** *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: - 1024
* * @param customAttributes

* @return A reference to this updated object so that method calls can be * chained together. */ public InvokeEndpointRequest withCustomAttributes(String customAttributes) { this.customAttributes = customAttributes; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getEndpointName() != null) sb.append("EndpointName: " + getEndpointName() + ","); if (getBody() != null) sb.append("Body: " + getBody() + ","); if (getContentType() != null) sb.append("ContentType: " + getContentType() + ","); if (getAccept() != null) sb.append("Accept: " + getAccept() + ","); if (getCustomAttributes() != null) sb.append("CustomAttributes: " + getCustomAttributes()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEndpointName() == null) ? 0 : getEndpointName().hashCode()); hashCode = prime * hashCode + ((getBody() == null) ? 0 : getBody().hashCode()); hashCode = prime * hashCode + ((getContentType() == null) ? 0 : getContentType().hashCode()); hashCode = prime * hashCode + ((getAccept() == null) ? 0 : getAccept().hashCode()); hashCode = prime * hashCode + ((getCustomAttributes() == null) ? 0 : getCustomAttributes().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof InvokeEndpointRequest == false) return false; InvokeEndpointRequest other = (InvokeEndpointRequest) obj; if (other.getEndpointName() == null ^ this.getEndpointName() == null) return false; if (other.getEndpointName() != null && other.getEndpointName().equals(this.getEndpointName()) == false) return false; if (other.getBody() == null ^ this.getBody() == null) return false; if (other.getBody() != null && other.getBody().equals(this.getBody()) == false) return false; if (other.getContentType() == null ^ this.getContentType() == null) return false; if (other.getContentType() != null && other.getContentType().equals(this.getContentType()) == false) return false; if (other.getAccept() == null ^ this.getAccept() == null) return false; if (other.getAccept() != null && other.getAccept().equals(this.getAccept()) == false) return false; if (other.getCustomAttributes() == null ^ this.getCustomAttributes() == null) return false; if (other.getCustomAttributes() != null && other.getCustomAttributes().equals(this.getCustomAttributes()) == false) return false; return true; } }