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

* Starts the running of the version of a model. Starting a model takes a while * to complete. To check the current state of the model, use * DescribeProjectVersions. *

*

* Once the model is running, you can detect custom labels in new images by * calling DetectCustomLabels. *

* *

* You are charged for the amount of time that the model is running. To stop a * running model, call StopProjectVersion. *

*
*

* For more information, see Running a trained Amazon Rekognition Custom * Labels model in the Amazon Rekognition Custom Labels Guide. *

*

* This operation requires permissions to perform the * rekognition:StartProjectVersion action. *

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

* The Amazon Resource Name(ARN) of the model version that you want to * start. *

*

* Constraints:
* Length: 20 - 2048
* Pattern: * (^arn:[a-z\d-]+:rekognition:[a-z\d-]+:\d{12}:project\/[a-zA * -Z0-9_.\-]{1,255}\/version\/[a-zA-Z0-9_.\-]{1,255}\/[0-9]+$)
*/ private String projectVersionArn; /** *

* The minimum number of inference units to use. A single inference unit * represents 1 hour of processing. *

*

* For information about the number of transactions per second (TPS) that an * inference unit can support, see Running a trained Amazon Rekognition * Custom Labels model in the Amazon Rekognition Custom Labels Guide. *

*

* Use a higher number to increase the TPS throughput of your model. You are * charged for the number of inference units that you use. *

*

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

* The maximum number of inference units to use for auto-scaling the model. * If you don't specify a value, Amazon Rekognition Custom Labels doesn't * auto-scale the model. *

*

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

* The Amazon Resource Name(ARN) of the model version that you want to * start. *

*

* Constraints:
* Length: 20 - 2048
* Pattern: * (^arn:[a-z\d-]+:rekognition:[a-z\d-]+:\d{12}:project\/[a-zA * -Z0-9_.\-]{1,255}\/version\/[a-zA-Z0-9_.\-]{1,255}\/[0-9]+$)
* * @return

* The Amazon Resource Name(ARN) of the model version that you want * to start. *

*/ public String getProjectVersionArn() { return projectVersionArn; } /** *

* The Amazon Resource Name(ARN) of the model version that you want to * start. *

*

* Constraints:
* Length: 20 - 2048
* Pattern: * (^arn:[a-z\d-]+:rekognition:[a-z\d-]+:\d{12}:project\/[a-zA * -Z0-9_.\-]{1,255}\/version\/[a-zA-Z0-9_.\-]{1,255}\/[0-9]+$)
* * @param projectVersionArn

* The Amazon Resource Name(ARN) of the model version that you * want to start. *

*/ public void setProjectVersionArn(String projectVersionArn) { this.projectVersionArn = projectVersionArn; } /** *

* The Amazon Resource Name(ARN) of the model version that you want to * start. *

*

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

* Constraints:
* Length: 20 - 2048
* Pattern: * (^arn:[a-z\d-]+:rekognition:[a-z\d-]+:\d{12}:project\/[a-zA * -Z0-9_.\-]{1,255}\/version\/[a-zA-Z0-9_.\-]{1,255}\/[0-9]+$)
* * @param projectVersionArn

* The Amazon Resource Name(ARN) of the model version that you * want to start. *

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

* The minimum number of inference units to use. A single inference unit * represents 1 hour of processing. *

*

* For information about the number of transactions per second (TPS) that an * inference unit can support, see Running a trained Amazon Rekognition * Custom Labels model in the Amazon Rekognition Custom Labels Guide. *

*

* Use a higher number to increase the TPS throughput of your model. You are * charged for the number of inference units that you use. *

*

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

* The minimum number of inference units to use. A single inference * unit represents 1 hour of processing. *

*

* For information about the number of transactions per second (TPS) * that an inference unit can support, see Running a trained * Amazon Rekognition Custom Labels model in the Amazon * Rekognition Custom Labels Guide. *

*

* Use a higher number to increase the TPS throughput of your model. * You are charged for the number of inference units that you use. *

*/ public Integer getMinInferenceUnits() { return minInferenceUnits; } /** *

* The minimum number of inference units to use. A single inference unit * represents 1 hour of processing. *

*

* For information about the number of transactions per second (TPS) that an * inference unit can support, see Running a trained Amazon Rekognition * Custom Labels model in the Amazon Rekognition Custom Labels Guide. *

*

* Use a higher number to increase the TPS throughput of your model. You are * charged for the number of inference units that you use. *

*

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

* The minimum number of inference units to use. A single * inference unit represents 1 hour of processing. *

*

* For information about the number of transactions per second * (TPS) that an inference unit can support, see Running a * trained Amazon Rekognition Custom Labels model in the * Amazon Rekognition Custom Labels Guide. *

*

* Use a higher number to increase the TPS throughput of your * model. You are charged for the number of inference units that * you use. *

*/ public void setMinInferenceUnits(Integer minInferenceUnits) { this.minInferenceUnits = minInferenceUnits; } /** *

* The minimum number of inference units to use. A single inference unit * represents 1 hour of processing. *

*

* For information about the number of transactions per second (TPS) that an * inference unit can support, see Running a trained Amazon Rekognition * Custom Labels model in the Amazon Rekognition Custom Labels Guide. *

*

* Use a higher number to increase the TPS throughput of your model. You are * charged for the number of inference units that you use. *

*

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

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

* The minimum number of inference units to use. A single * inference unit represents 1 hour of processing. *

*

* For information about the number of transactions per second * (TPS) that an inference unit can support, see Running a * trained Amazon Rekognition Custom Labels model in the * Amazon Rekognition Custom Labels Guide. *

*

* Use a higher number to increase the TPS throughput of your * model. You are charged for the number of inference units that * you use. *

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

* The maximum number of inference units to use for auto-scaling the model. * If you don't specify a value, Amazon Rekognition Custom Labels doesn't * auto-scale the model. *

*

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

* The maximum number of inference units to use for auto-scaling the * model. If you don't specify a value, Amazon Rekognition Custom * Labels doesn't auto-scale the model. *

*/ public Integer getMaxInferenceUnits() { return maxInferenceUnits; } /** *

* The maximum number of inference units to use for auto-scaling the model. * If you don't specify a value, Amazon Rekognition Custom Labels doesn't * auto-scale the model. *

*

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

* The maximum number of inference units to use for auto-scaling * the model. If you don't specify a value, Amazon Rekognition * Custom Labels doesn't auto-scale the model. *

*/ public void setMaxInferenceUnits(Integer maxInferenceUnits) { this.maxInferenceUnits = maxInferenceUnits; } /** *

* The maximum number of inference units to use for auto-scaling the model. * If you don't specify a value, Amazon Rekognition Custom Labels doesn't * auto-scale the model. *

*

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

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

* The maximum number of inference units to use for auto-scaling * the model. If you don't specify a value, Amazon Rekognition * Custom Labels doesn't auto-scale the model. *

* @return A reference to this updated object so that method calls can be * chained together. */ public StartProjectVersionRequest withMaxInferenceUnits(Integer maxInferenceUnits) { this.maxInferenceUnits = maxInferenceUnits; 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 (getProjectVersionArn() != null) sb.append("ProjectVersionArn: " + getProjectVersionArn() + ","); if (getMinInferenceUnits() != null) sb.append("MinInferenceUnits: " + getMinInferenceUnits() + ","); if (getMaxInferenceUnits() != null) sb.append("MaxInferenceUnits: " + getMaxInferenceUnits()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getProjectVersionArn() == null) ? 0 : getProjectVersionArn().hashCode()); hashCode = prime * hashCode + ((getMinInferenceUnits() == null) ? 0 : getMinInferenceUnits().hashCode()); hashCode = prime * hashCode + ((getMaxInferenceUnits() == null) ? 0 : getMaxInferenceUnits().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof StartProjectVersionRequest == false) return false; StartProjectVersionRequest other = (StartProjectVersionRequest) obj; if (other.getProjectVersionArn() == null ^ this.getProjectVersionArn() == null) return false; if (other.getProjectVersionArn() != null && other.getProjectVersionArn().equals(this.getProjectVersionArn()) == false) return false; if (other.getMinInferenceUnits() == null ^ this.getMinInferenceUnits() == null) return false; if (other.getMinInferenceUnits() != null && other.getMinInferenceUnits().equals(this.getMinInferenceUnits()) == false) return false; if (other.getMaxInferenceUnits() == null ^ this.getMaxInferenceUnits() == null) return false; if (other.getMaxInferenceUnits() != null && other.getMaxInferenceUnits().equals(this.getMaxInferenceUnits()) == false) return false; return true; } }