AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

This operation applies only to Amazon Rekognition Custom Labels.

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.

Copying project versions is supported only for Custom Labels models.

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.

Note:

This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginCopyProjectVersion and EndCopyProjectVersion.

Namespace: Amazon.Rekognition
Assembly: AWSSDK.Rekognition.dll
Version: 3.x.y.z

Syntax

C#
public virtual Task<CopyProjectVersionResponse> CopyProjectVersionAsync(
         CopyProjectVersionRequest request,
         CancellationToken cancellationToken
)

Parameters

request
Type: Amazon.Rekognition.Model.CopyProjectVersionRequest

Container for the necessary parameters to execute the CopyProjectVersion service method.

cancellationToken
Type: System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value


The response from the CopyProjectVersion service method, as returned by Rekognition.

Exceptions

ExceptionCondition
AccessDeniedException You are not authorized to perform the action.
InternalServerErrorException Amazon Rekognition experienced a service issue. Try your call again.
InvalidParameterException Input parameter violated a constraint. Validate your parameter before calling the API operation again.
LimitExceededException An Amazon Rekognition service limit was exceeded. For example, if you start too many jobs concurrently, subsequent calls to start operations (ex: StartLabelDetection) will raise a LimitExceededException exception (HTTP status code: 400) until the number of concurrently running jobs is below the Amazon Rekognition service limit.
ProvisionedThroughputExceededException The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.
ResourceInUseException The specified resource is already being used.
ResourceNotFoundException The resource specified in the request cannot be found.
ServiceQuotaExceededException The size of the collection exceeds the allowed limit. For more information, see Guidelines and quotas in Amazon Rekognition in the Amazon Rekognition Developer Guide.
ThrottlingException Amazon Rekognition is temporarily unable to process the request. Try your call again.

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5 and newer

See Also