/* * 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; /** *
* Copies a version of an Amazon Rekognition Custom Labels model from a source * project to a destination project. The source and destination projects can be * in different AWS accounts but must be in the same AWS Region. You can't copy * a model to another AWS service. *
** To copy a model version to a different AWS account, you need to create a * resource-based policy known as a project policy. You attach the * project policy to the source project by calling PutProjectPolicy. The * project policy gives permission to copy the model version from a trusting AWS * account to a trusted account. *
** For more information creating and attaching a project policy, see Attaching a * project policy (SDK) in the Amazon Rekognition Custom Labels Developer * Guide. *
** If you are copying a model version to a project in the same AWS account, you * don't need to create a project policy. *
** To copy a model, the destination project, source project, and source model * version must already exist. *
*
* Copying a model version takes a while to complete. To get the current status,
* call DescribeProjectVersions and check the value of
* Status
in the ProjectVersionDescription object. The copy
* operation has finished when the value of Status
is
* COPYING_COMPLETED
.
*
* This operation requires permissions to perform the
* rekognition:CopyProjectVersion
action.
*
* The ARN of the source project in the trusting AWS account. *
*
* Constraints:
* Length: 20 - 2048
* Pattern:
* (^arn:[a-z\d-]+:rekognition:[a-z\d-]+:\d{12}:project\/[a-zA
* -Z0-9_.\-]{1,255}\/[0-9]+$)
*/
private String sourceProjectArn;
/**
*
* The ARN of the model version in the source project that you want to copy * to a destination project. *
*
* 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 sourceProjectVersionArn;
/**
*
* The ARN of the project in the trusted AWS account that you want to copy * the model version to. *
*
* Constraints:
* Length: 20 - 2048
* Pattern:
* (^arn:[a-z\d-]+:rekognition:[a-z\d-]+:\d{12}:project\/[a-zA
* -Z0-9_.\-]{1,255}\/[0-9]+$)
*/
private String destinationProjectArn;
/**
*
* A name for the version of the model that's copied to the destination * project. *
*
* Constraints:
* Length: 1 - 255
* Pattern: [a-zA-Z0-9_.\-]+
*/
private String versionName;
/**
*
* The S3 bucket and folder location where the training output for the * source model version is placed. *
*/ private OutputConfig outputConfig; /** ** The key-value tags to assign to the model version. *
*/ private java.util.Map
* The identifier for your AWS Key Management Service key (AWS KMS key). You
* can supply the Amazon Resource Name (ARN) of your KMS key, the ID of your
* KMS key, an alias for your KMS key, or an alias ARN. The key is used to
* encrypt training results and manifest files written to the output Amazon
* S3 bucket (OutputConfig
).
*
* If you choose to use your own KMS key, you need the following permissions * on the KMS key. *
** kms:CreateGrant *
** kms:DescribeKey *
** kms:GenerateDataKey *
** kms:Decrypt *
*
* If you don't specify a value for KmsKeyId
, images copied
* into the service are encrypted using a key that AWS owns and manages.
*
* Constraints:
* Length: 1 - 2048
* Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
*/
private String kmsKeyId;
/**
*
* The ARN of the source project in the trusting AWS account. *
*
* Constraints:
* Length: 20 - 2048
* Pattern:
* (^arn:[a-z\d-]+:rekognition:[a-z\d-]+:\d{12}:project\/[a-zA
* -Z0-9_.\-]{1,255}\/[0-9]+$)
*
* @return
* The ARN of the source project in the trusting AWS account. *
*/ public String getSourceProjectArn() { return sourceProjectArn; } /** ** The ARN of the source project in the trusting AWS account. *
*
* Constraints:
* Length: 20 - 2048
* Pattern:
* (^arn:[a-z\d-]+:rekognition:[a-z\d-]+:\d{12}:project\/[a-zA
* -Z0-9_.\-]{1,255}\/[0-9]+$)
*
* @param sourceProjectArn
* The ARN of the source project in the trusting AWS account. *
*/ public void setSourceProjectArn(String sourceProjectArn) { this.sourceProjectArn = sourceProjectArn; } /** ** The ARN of the source project in the trusting AWS account. *
** 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}\/[0-9]+$)
*
* @param sourceProjectArn
* The ARN of the source project in the trusting AWS account. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CopyProjectVersionRequest withSourceProjectArn(String sourceProjectArn) { this.sourceProjectArn = sourceProjectArn; return this; } /** ** The ARN of the model version in the source project that you want to copy * to a destination project. *
*
* 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 ARN of the model version in the source project that you want * to copy to a destination project. *
*/ public String getSourceProjectVersionArn() { return sourceProjectVersionArn; } /** ** The ARN of the model version in the source project that you want to copy * to a destination project. *
*
* 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 sourceProjectVersionArn
* The ARN of the model version in the source project that you * want to copy to a destination project. *
*/ public void setSourceProjectVersionArn(String sourceProjectVersionArn) { this.sourceProjectVersionArn = sourceProjectVersionArn; } /** ** The ARN of the model version in the source project that you want to copy * to a destination project. *
** 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 sourceProjectVersionArn
* The ARN of the model version in the source project that you * want to copy to a destination project. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CopyProjectVersionRequest withSourceProjectVersionArn(String sourceProjectVersionArn) { this.sourceProjectVersionArn = sourceProjectVersionArn; return this; } /** ** The ARN of the project in the trusted AWS account that you want to copy * the model version to. *
*
* Constraints:
* Length: 20 - 2048
* Pattern:
* (^arn:[a-z\d-]+:rekognition:[a-z\d-]+:\d{12}:project\/[a-zA
* -Z0-9_.\-]{1,255}\/[0-9]+$)
*
* @return
* The ARN of the project in the trusted AWS account that you want * to copy the model version to. *
*/ public String getDestinationProjectArn() { return destinationProjectArn; } /** ** The ARN of the project in the trusted AWS account that you want to copy * the model version to. *
*
* Constraints:
* Length: 20 - 2048
* Pattern:
* (^arn:[a-z\d-]+:rekognition:[a-z\d-]+:\d{12}:project\/[a-zA
* -Z0-9_.\-]{1,255}\/[0-9]+$)
*
* @param destinationProjectArn
* The ARN of the project in the trusted AWS account that you * want to copy the model version to. *
*/ public void setDestinationProjectArn(String destinationProjectArn) { this.destinationProjectArn = destinationProjectArn; } /** ** The ARN of the project in the trusted AWS account that you want to copy * the model version to. *
** 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}\/[0-9]+$)
*
* @param destinationProjectArn
* The ARN of the project in the trusted AWS account that you * want to copy the model version to. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CopyProjectVersionRequest withDestinationProjectArn(String destinationProjectArn) { this.destinationProjectArn = destinationProjectArn; return this; } /** ** A name for the version of the model that's copied to the destination * project. *
*
* Constraints:
* Length: 1 - 255
* Pattern: [a-zA-Z0-9_.\-]+
*
* @return
* A name for the version of the model that's copied to the * destination project. *
*/ public String getVersionName() { return versionName; } /** ** A name for the version of the model that's copied to the destination * project. *
*
* Constraints:
* Length: 1 - 255
* Pattern: [a-zA-Z0-9_.\-]+
*
* @param versionName
* A name for the version of the model that's copied to the * destination project. *
*/ public void setVersionName(String versionName) { this.versionName = versionName; } /** ** A name for the version of the model that's copied to the destination * project. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 255
* Pattern: [a-zA-Z0-9_.\-]+
*
* @param versionName
* A name for the version of the model that's copied to the * destination project. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CopyProjectVersionRequest withVersionName(String versionName) { this.versionName = versionName; return this; } /** ** The S3 bucket and folder location where the training output for the * source model version is placed. *
* * @return* The S3 bucket and folder location where the training output for * the source model version is placed. *
*/ public OutputConfig getOutputConfig() { return outputConfig; } /** ** The S3 bucket and folder location where the training output for the * source model version is placed. *
* * @param outputConfig* The S3 bucket and folder location where the training output * for the source model version is placed. *
*/ public void setOutputConfig(OutputConfig outputConfig) { this.outputConfig = outputConfig; } /** ** The S3 bucket and folder location where the training output for the * source model version is placed. *
** Returns a reference to this object so that method calls can be chained * together. * * @param outputConfig
* The S3 bucket and folder location where the training output * for the source model version is placed. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CopyProjectVersionRequest withOutputConfig(OutputConfig outputConfig) { this.outputConfig = outputConfig; return this; } /** ** The key-value tags to assign to the model version. *
* * @return* The key-value tags to assign to the model version. *
*/ public java.util.Map* The key-value tags to assign to the model version. *
* * @param tags* The key-value tags to assign to the model version. *
*/ public void setTags(java.util.Map* The key-value tags to assign to the model version. *
** Returns a reference to this object so that method calls can be chained * together. * * @param tags
* The key-value tags to assign to the model version. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CopyProjectVersionRequest withTags(java.util.Map* The key-value tags to assign to the model version. *
*
* The method adds a new key-value pair into Tags parameter, and returns a
* reference to this object so that method calls can be chained together.
*
* @param key The key of the entry to be added into Tags.
* @param value The corresponding value of the entry to be added into Tags.
* @return A reference to this updated object so that method calls can be
* chained together.
*/
public CopyProjectVersionRequest addTagsEntry(String key, String value) {
if (null == this.tags) {
this.tags = new java.util.HashMap
* Returns a reference to this object so that method calls can be chained
* together.
*/
public CopyProjectVersionRequest clearTagsEntries() {
this.tags = null;
return this;
}
/**
*
* The identifier for your AWS Key Management Service key (AWS KMS key). You
* can supply the Amazon Resource Name (ARN) of your KMS key, the ID of your
* KMS key, an alias for your KMS key, or an alias ARN. The key is used to
* encrypt training results and manifest files written to the output Amazon
* S3 bucket (
* If you choose to use your own KMS key, you need the following permissions
* on the KMS key.
*
* kms:CreateGrant
*
* kms:DescribeKey
*
* kms:GenerateDataKey
*
* kms:Decrypt
*
* If you don't specify a value for
* Constraints:
* The identifier for your AWS Key Management Service key (AWS KMS
* key). You can supply the Amazon Resource Name (ARN) of your KMS
* key, the ID of your KMS key, an alias for your KMS key, or an
* alias ARN. The key is used to encrypt training results and
* manifest files written to the output Amazon S3 bucket (
*
* If you choose to use your own KMS key, you need the following
* permissions on the KMS key.
*
* kms:CreateGrant
*
* kms:DescribeKey
*
* kms:GenerateDataKey
*
* kms:Decrypt
*
* If you don't specify a value for
* The identifier for your AWS Key Management Service key (AWS KMS key). You
* can supply the Amazon Resource Name (ARN) of your KMS key, the ID of your
* KMS key, an alias for your KMS key, or an alias ARN. The key is used to
* encrypt training results and manifest files written to the output Amazon
* S3 bucket (
* If you choose to use your own KMS key, you need the following permissions
* on the KMS key.
*
* kms:CreateGrant
*
* kms:DescribeKey
*
* kms:GenerateDataKey
*
* kms:Decrypt
*
* If you don't specify a value for
* Constraints:
* The identifier for your AWS Key Management Service key (AWS
* KMS key). You can supply the Amazon Resource Name (ARN) of
* your KMS key, the ID of your KMS key, an alias for your KMS
* key, or an alias ARN. The key is used to encrypt training
* results and manifest files written to the output Amazon S3
* bucket (
* If you choose to use your own KMS key, you need the following
* permissions on the KMS key.
*
* kms:CreateGrant
*
* kms:DescribeKey
*
* kms:GenerateDataKey
*
* kms:Decrypt
*
* If you don't specify a value for
* The identifier for your AWS Key Management Service key (AWS KMS key). You
* can supply the Amazon Resource Name (ARN) of your KMS key, the ID of your
* KMS key, an alias for your KMS key, or an alias ARN. The key is used to
* encrypt training results and manifest files written to the output Amazon
* S3 bucket (
* If you choose to use your own KMS key, you need the following permissions
* on the KMS key.
*
* kms:CreateGrant
*
* kms:DescribeKey
*
* kms:GenerateDataKey
*
* kms:Decrypt
*
* If you don't specify a value for
* Returns a reference to this object so that method calls can be chained
* together.
*
* Constraints:
* The identifier for your AWS Key Management Service key (AWS
* KMS key). You can supply the Amazon Resource Name (ARN) of
* your KMS key, the ID of your KMS key, an alias for your KMS
* key, or an alias ARN. The key is used to encrypt training
* results and manifest files written to the output Amazon S3
* bucket (
* If you choose to use your own KMS key, you need the following
* permissions on the KMS key.
*
* kms:CreateGrant
*
* kms:DescribeKey
*
* kms:GenerateDataKey
*
* kms:Decrypt
*
* If you don't specify a value for OutputConfig
).
*
*
* KmsKeyId
, images copied
* into the service are encrypted using a key that AWS owns and manages.
*
* Length: 1 - 2048
* Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
*
* @return OutputConfig
).
*
*
* KmsKeyId
, images
* copied into the service are encrypted using a key that AWS owns
* and manages.
* OutputConfig
).
*
*
* KmsKeyId
, images copied
* into the service are encrypted using a key that AWS owns and manages.
*
* Length: 1 - 2048
* Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
*
* @param kmsKeyId OutputConfig
).
*
*
* KmsKeyId
, images
* copied into the service are encrypted using a key that AWS
* owns and manages.
* OutputConfig
).
*
*
* KmsKeyId
, images copied
* into the service are encrypted using a key that AWS owns and manages.
*
* Length: 1 - 2048
* Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
*
* @param kmsKeyId OutputConfig
).
*
*
* KmsKeyId
, images
* copied into the service are encrypted using a key that AWS
* owns and manages.
*