/* * Copyright 2018-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 javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateEndpointRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

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

*/ private String endpointName; /** *

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

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

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

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

*/ private String dataAccessRoleArn; /** *

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

*/ private String flywheelArn; /** *

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

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

* * @return This is the descriptive suffix that becomes part of the EndpointArn used for all subsequent * requests to this resource. */ public String getEndpointName() { return this.endpointName; } /** *

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

* * @param endpointName * This is the descriptive suffix that becomes part of the EndpointArn used for all subsequent * requests to this resource. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateEndpointRequest withEndpointName(String endpointName) { setEndpointName(endpointName); return this; } /** *

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

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

* * @return The Amazon Resource Number (ARN) of the model to which the endpoint will be attached. */ public String getModelArn() { return this.modelArn; } /** *

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

* * @param modelArn * The Amazon Resource Number (ARN) of the model to which the endpoint will be attached. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateEndpointRequest withModelArn(String modelArn) { setModelArn(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. *

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

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

* * @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 Returns a reference to this object so that method calls can be chained together. */ public CreateEndpointRequest withDesiredInferenceUnits(Integer desiredInferenceUnits) { setDesiredInferenceUnits(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. *

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

* * @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 this.clientRequestToken; } /** *

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

* * @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 Returns a reference to this object so that method calls can be chained together. */ public CreateEndpointRequest withClientRequestToken(String clientRequestToken) { setClientRequestToken(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. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *

* * @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 Returns a reference to this object so that method calls can be chained together. */ public CreateEndpointRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } 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. *

* * @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 Returns a reference to this 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). *

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

* * @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 this.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). *

* * @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 Returns a reference to this object so that method calls can be chained together. */ public CreateEndpointRequest withDataAccessRoleArn(String dataAccessRoleArn) { setDataAccessRoleArn(dataAccessRoleArn); return this; } /** *

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

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

* * @return The Amazon Resource Number (ARN) of the flywheel to which the endpoint will be attached. */ public String getFlywheelArn() { return this.flywheelArn; } /** *

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

* * @param flywheelArn * The Amazon Resource Number (ARN) of the flywheel to which the endpoint will be attached. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateEndpointRequest withFlywheelArn(String flywheelArn) { setFlywheelArn(flywheelArn); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @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: ").append(getEndpointName()).append(","); if (getModelArn() != null) sb.append("ModelArn: ").append(getModelArn()).append(","); if (getDesiredInferenceUnits() != null) sb.append("DesiredInferenceUnits: ").append(getDesiredInferenceUnits()).append(","); if (getClientRequestToken() != null) sb.append("ClientRequestToken: ").append(getClientRequestToken()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getDataAccessRoleArn() != null) sb.append("DataAccessRoleArn: ").append(getDataAccessRoleArn()).append(","); if (getFlywheelArn() != null) sb.append("FlywheelArn: ").append(getFlywheelArn()); sb.append("}"); return sb.toString(); } @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; } @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 CreateEndpointRequest clone() { return (CreateEndpointRequest) super.clone(); } }