/* * Copyright 2010-2023 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.comprehend.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *

* Creates a model-specific endpoint for synchronous inference for a previously * trained custom model For information about endpoints, see Managing endpoints. *

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

* This is the descriptive suffix that becomes part of the * EndpointArn used for all subsequent requests to this * resource. *

*

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

* The Amazon Resource Number (ARN) of the model to which the endpoint will * be attached. *

*

* Constraints:
* Length: - 256
* Pattern: * arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:(document * -classifier * |entity-recognizer)/[a-zA-Z0-9](-*[a-zA-Z0-9])*(/version/[a-zA- * Z0-9](-*[a-zA-Z0-9])*)?
*/ private String modelArn; /** *

* The desired number of inference units to be used by the model using this * endpoint. Each inference unit represents of a throughput of 100 * characters per second. *

*

* Constraints:
* Range: 1 -
*/ private Integer desiredInferenceUnits; /** *

* An idempotency token provided by the customer. If this token matches a * previous endpoint creation request, Amazon Comprehend will not return a * ResourceInUseException. *

*

* Constraints:
* Length: 1 - 64
* Pattern: ^[a-zA-Z0-9-]+$
*/ private String clientRequestToken; /** *

* Tags to associate with the endpoint. A tag is a key-value pair that adds * metadata to the endpoint. For example, a tag with "Sales" as the key * might be added to an endpoint to indicate its use by the sales * department. *

*/ private java.util.List tags; /** *

* The Amazon Resource Name (ARN) of the IAM role that grants Amazon * Comprehend read access to trained custom models encrypted with a customer * managed key (ModelKmsKeyId). *

*

* Constraints:
* Length: 20 - 2048
* Pattern: arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+
*/ private String dataAccessRoleArn; /** *

* The Amazon Resource Number (ARN) of the flywheel to which the endpoint * will be attached. *

*

* Constraints:
* Length: - 256
* Pattern: * arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:flywheel * /[a-zA-Z0-9](-*[a-zA-Z0-9])*
*/ private String flywheelArn; /** *

* This is the descriptive suffix that becomes part of the * EndpointArn used for all subsequent requests to this * resource. *

*

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

* This is the descriptive suffix that becomes part of the * EndpointArn used for all subsequent requests to this * resource. *

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

* This is the descriptive suffix that becomes part of the * EndpointArn used for all subsequent requests to this * resource. *

*

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

* This is the descriptive suffix that becomes part of the * EndpointArn used for all subsequent requests to * this resource. *

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

* This is the descriptive suffix that becomes part of the * EndpointArn used for all subsequent requests to this * resource. *

*

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

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

* This is the descriptive suffix that becomes part of the * EndpointArn used for all subsequent requests to * this resource. *

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

* The Amazon Resource Number (ARN) of the model to which the endpoint will * be attached. *

*

* Constraints:
* Length: - 256
* Pattern: * arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:(document * -classifier * |entity-recognizer)/[a-zA-Z0-9](-*[a-zA-Z0-9])*(/version/[a-zA- * Z0-9](-*[a-zA-Z0-9])*)?
* * @return

* The Amazon Resource Number (ARN) of the model to which the * endpoint will be attached. *

*/ public String getModelArn() { return modelArn; } /** *

* The Amazon Resource Number (ARN) of the model to which the endpoint will * be attached. *

*

* Constraints:
* Length: - 256
* Pattern: * arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:(document * -classifier * |entity-recognizer)/[a-zA-Z0-9](-*[a-zA-Z0-9])*(/version/[a-zA- * Z0-9](-*[a-zA-Z0-9])*)?
* * @param modelArn

* The Amazon Resource Number (ARN) of the model to which the * endpoint will be attached. *

*/ public void setModelArn(String modelArn) { this.modelArn = modelArn; } /** *

* The Amazon Resource Number (ARN) of the model to which the endpoint will * be attached. *

*

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

* Constraints:
* Length: - 256
* Pattern: * arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:(document * -classifier * |entity-recognizer)/[a-zA-Z0-9](-*[a-zA-Z0-9])*(/version/[a-zA- * Z0-9](-*[a-zA-Z0-9])*)?
* * @param modelArn

* The Amazon Resource Number (ARN) of the model to which the * endpoint will be attached. *

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

* The desired number of inference units to be used by the model using this * endpoint. Each inference unit represents of a throughput of 100 * characters per second. *

*

* Constraints:
* Range: 1 -
* * @return

* The desired number of inference units to be used by the model * using this endpoint. Each inference unit represents of a * throughput of 100 characters per second. *

*/ public Integer getDesiredInferenceUnits() { return desiredInferenceUnits; } /** *

* The desired number of inference units to be used by the model using this * endpoint. Each inference unit represents of a throughput of 100 * characters per second. *

*

* Constraints:
* Range: 1 -
* * @param desiredInferenceUnits

* The desired number of inference units to be used by the model * using this endpoint. Each inference unit represents of a * throughput of 100 characters per second. *

*/ public void setDesiredInferenceUnits(Integer desiredInferenceUnits) { this.desiredInferenceUnits = desiredInferenceUnits; } /** *

* The desired number of inference units to be used by the model using this * endpoint. Each inference unit represents of a throughput of 100 * characters per second. *

*

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

* Constraints:
* Range: 1 -
* * @param desiredInferenceUnits

* The desired number of inference units to be used by the model * using this endpoint. Each inference unit represents of a * throughput of 100 characters per second. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateEndpointRequest withDesiredInferenceUnits(Integer desiredInferenceUnits) { this.desiredInferenceUnits = desiredInferenceUnits; return this; } /** *

* An idempotency token provided by the customer. If this token matches a * previous endpoint creation request, Amazon Comprehend will not return a * ResourceInUseException. *

*

* Constraints:
* Length: 1 - 64
* Pattern: ^[a-zA-Z0-9-]+$
* * @return

* An idempotency token provided by the customer. If this token * matches a previous endpoint creation request, Amazon Comprehend * will not return a ResourceInUseException. *

*/ public String getClientRequestToken() { return clientRequestToken; } /** *

* An idempotency token provided by the customer. If this token matches a * previous endpoint creation request, Amazon Comprehend will not return a * ResourceInUseException. *

*

* Constraints:
* Length: 1 - 64
* Pattern: ^[a-zA-Z0-9-]+$
* * @param clientRequestToken

* An idempotency token provided by the customer. If this token * matches a previous endpoint creation request, Amazon * Comprehend will not return a * ResourceInUseException. *

*/ public void setClientRequestToken(String clientRequestToken) { this.clientRequestToken = clientRequestToken; } /** *

* An idempotency token provided by the customer. If this token matches a * previous endpoint creation request, Amazon Comprehend will not return a * ResourceInUseException. *

*

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

* Constraints:
* Length: 1 - 64
* Pattern: ^[a-zA-Z0-9-]+$
* * @param clientRequestToken

* An idempotency token provided by the customer. If this token * matches a previous endpoint creation request, Amazon * Comprehend will not return a * ResourceInUseException. *

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

* Tags to associate with the endpoint. A tag is a key-value pair that adds * metadata to the endpoint. For example, a tag with "Sales" as the key * might be added to an endpoint to indicate its use by the sales * department. *

* * @return

* Tags to associate with the endpoint. A tag is a key-value pair * that adds metadata to the endpoint. For example, a tag with * "Sales" as the key might be added to an endpoint to indicate its * use by the sales department. *

*/ public java.util.List getTags() { return tags; } /** *

* Tags to associate with the endpoint. A tag is a key-value pair that adds * metadata to the endpoint. For example, a tag with "Sales" as the key * might be added to an endpoint to indicate its use by the sales * department. *

* * @param tags

* Tags to associate with the endpoint. A tag is a key-value pair * that adds metadata to the endpoint. For example, a tag with * "Sales" as the key might be added to an endpoint to indicate * its use by the sales department. *

*/ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

* Tags to associate with the endpoint. A tag is a key-value pair that adds * metadata to the endpoint. For example, a tag with "Sales" as the key * might be added to an endpoint to indicate its use by the sales * department. *

*

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

* Tags to associate with the endpoint. A tag is a key-value pair * that adds metadata to the endpoint. For example, a tag with * "Sales" as the key might be added to an endpoint to indicate * its use by the sales department. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateEndpointRequest withTags(Tag... tags) { if (getTags() == null) { this.tags = new java.util.ArrayList(tags.length); } for (Tag value : tags) { this.tags.add(value); } return this; } /** *

* Tags to associate with the endpoint. A tag is a key-value pair that adds * metadata to the endpoint. For example, a tag with "Sales" as the key * might be added to an endpoint to indicate its use by the sales * department. *

*

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

* Tags to associate with the endpoint. A tag is a key-value pair * that adds metadata to the endpoint. For example, a tag with * "Sales" as the key might be added to an endpoint to indicate * its use by the sales department. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateEndpointRequest withTags(java.util.Collection tags) { setTags(tags); return this; } /** *

* The Amazon Resource Name (ARN) of the IAM role that grants Amazon * Comprehend read access to trained custom models encrypted with a customer * managed key (ModelKmsKeyId). *

*

* Constraints:
* Length: 20 - 2048
* Pattern: arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+
* * @return

* The Amazon Resource Name (ARN) of the IAM role that grants Amazon * Comprehend read access to trained custom models encrypted with a * customer managed key (ModelKmsKeyId). *

*/ public String getDataAccessRoleArn() { return dataAccessRoleArn; } /** *

* The Amazon Resource Name (ARN) of the IAM role that grants Amazon * Comprehend read access to trained custom models encrypted with a customer * managed key (ModelKmsKeyId). *

*

* Constraints:
* Length: 20 - 2048
* Pattern: arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+
* * @param dataAccessRoleArn

* The Amazon Resource Name (ARN) of the IAM role that grants * Amazon Comprehend read access to trained custom models * encrypted with a customer managed key (ModelKmsKeyId). *

*/ public void setDataAccessRoleArn(String dataAccessRoleArn) { this.dataAccessRoleArn = dataAccessRoleArn; } /** *

* The Amazon Resource Name (ARN) of the IAM role that grants Amazon * Comprehend read access to trained custom models encrypted with a customer * managed key (ModelKmsKeyId). *

*

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

* Constraints:
* Length: 20 - 2048
* Pattern: arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+
* * @param dataAccessRoleArn

* The Amazon Resource Name (ARN) of the IAM role that grants * Amazon Comprehend read access to trained custom models * encrypted with a customer managed key (ModelKmsKeyId). *

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

* The Amazon Resource Number (ARN) of the flywheel to which the endpoint * will be attached. *

*

* Constraints:
* Length: - 256
* Pattern: * arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:flywheel * /[a-zA-Z0-9](-*[a-zA-Z0-9])*
* * @return

* The Amazon Resource Number (ARN) of the flywheel to which the * endpoint will be attached. *

*/ public String getFlywheelArn() { return flywheelArn; } /** *

* The Amazon Resource Number (ARN) of the flywheel to which the endpoint * will be attached. *

*

* Constraints:
* Length: - 256
* Pattern: * arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:flywheel * /[a-zA-Z0-9](-*[a-zA-Z0-9])*
* * @param flywheelArn

* The Amazon Resource Number (ARN) of the flywheel to which the * endpoint will be attached. *

*/ public void setFlywheelArn(String flywheelArn) { this.flywheelArn = flywheelArn; } /** *

* The Amazon Resource Number (ARN) of the flywheel to which the endpoint * will be attached. *

*

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

* Constraints:
* Length: - 256
* Pattern: * arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:flywheel * /[a-zA-Z0-9](-*[a-zA-Z0-9])*
* * @param flywheelArn

* The Amazon Resource Number (ARN) of the flywheel to which the * endpoint will be attached. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateEndpointRequest withFlywheelArn(String flywheelArn) { this.flywheelArn = flywheelArn; 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 (getModelArn() != null) sb.append("ModelArn: " + getModelArn() + ","); if (getDesiredInferenceUnits() != null) sb.append("DesiredInferenceUnits: " + getDesiredInferenceUnits() + ","); if (getClientRequestToken() != null) sb.append("ClientRequestToken: " + getClientRequestToken() + ","); if (getTags() != null) sb.append("Tags: " + getTags() + ","); if (getDataAccessRoleArn() != null) sb.append("DataAccessRoleArn: " + getDataAccessRoleArn() + ","); if (getFlywheelArn() != null) sb.append("FlywheelArn: " + getFlywheelArn()); 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 + ((getModelArn() == null) ? 0 : getModelArn().hashCode()); hashCode = prime * hashCode + ((getDesiredInferenceUnits() == null) ? 0 : getDesiredInferenceUnits().hashCode()); hashCode = prime * hashCode + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getDataAccessRoleArn() == null) ? 0 : getDataAccessRoleArn().hashCode()); hashCode = prime * hashCode + ((getFlywheelArn() == null) ? 0 : getFlywheelArn().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateEndpointRequest == false) return false; CreateEndpointRequest other = (CreateEndpointRequest) obj; if (other.getEndpointName() == null ^ this.getEndpointName() == null) return false; if (other.getEndpointName() != null && other.getEndpointName().equals(this.getEndpointName()) == false) return false; if (other.getModelArn() == null ^ this.getModelArn() == null) return false; if (other.getModelArn() != null && other.getModelArn().equals(this.getModelArn()) == false) return false; if (other.getDesiredInferenceUnits() == null ^ this.getDesiredInferenceUnits() == null) return false; if (other.getDesiredInferenceUnits() != null && other.getDesiredInferenceUnits().equals(this.getDesiredInferenceUnits()) == false) return false; if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null) return false; if (other.getClientRequestToken() != null && other.getClientRequestToken().equals(this.getClientRequestToken()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getDataAccessRoleArn() == null ^ this.getDataAccessRoleArn() == null) return false; if (other.getDataAccessRoleArn() != null && other.getDataAccessRoleArn().equals(this.getDataAccessRoleArn()) == false) return false; if (other.getFlywheelArn() == null ^ this.getFlywheelArn() == null) return false; if (other.getFlywheelArn() != null && other.getFlywheelArn().equals(this.getFlywheelArn()) == false) return false; return true; } }