From b282995e594d7360790387274af58f6349932366 Mon Sep 17 00:00:00 2001 From: AWS Mobile SDK Bot <46607340+awsmobilesdk@users.noreply.github.com> Date: Fri, 19 Aug 2022 15:26:18 -0400 Subject: [PATCH 1/3] feat(aws-android-sdk-rekognition): update models to latest (#2980) --- .../rekognition/AmazonRekognition.java | 217 +++- .../rekognition/AmazonRekognitionClient.java | 327 +++++- .../model/CopyProjectVersionRequest.java | 933 ++++++++++++++++++ .../model/CopyProjectVersionResult.java | 144 +++ .../model/DeleteProjectPolicyRequest.java | 313 ++++++ .../model/DeleteProjectPolicyResult.java | 57 ++ .../model/DeleteProjectRequest.java | 4 +- .../model/DeleteProjectVersionResult.java | 18 +- .../InvalidPolicyRevisionIdException.java | 37 + .../model/ListProjectPoliciesRequest.java | 337 +++++++ .../model/ListProjectPoliciesResult.java | 234 +++++ .../MalformedPolicyDocumentException.java | 38 + .../rekognition/model/ProjectPolicy.java | 509 ++++++++++ .../model/ProjectVersionDescription.java | 121 ++- .../model/ProjectVersionStatus.java | 8 +- .../model/PutProjectPolicyRequest.java | 467 +++++++++ .../model/PutProjectPolicyResult.java | 134 +++ .../model/StartProjectVersionResult.java | 18 +- .../model/StopProjectVersionResult.java | 18 +- .../CopyProjectVersionRequestMarshaller.java | 127 +++ ...yProjectVersionResultJsonUnmarshaller.java | 55 ++ .../DeleteProjectPolicyRequestMarshaller.java | 98 ++ ...teProjectPolicyResultJsonUnmarshaller.java | 42 + ...PolicyRevisionIdExceptionUnmarshaller.java | 43 + .../ListProjectPoliciesRequestMarshaller.java | 98 ++ ...ProjectPoliciesResultJsonUnmarshaller.java | 60 ++ ...edPolicyDocumentExceptionUnmarshaller.java | 43 + .../ProjectPolicyJsonMarshaller.java | 69 ++ .../ProjectPolicyJsonUnmarshaller.java | 71 ++ ...ojectVersionDescriptionJsonMarshaller.java | 5 + ...ectVersionDescriptionJsonUnmarshaller.java | 4 + .../PutProjectPolicyRequestMarshaller.java | 102 ++ ...utProjectPolicyResultJsonUnmarshaller.java | 55 ++ .../services/rekognition/package-info.java | 2 +- 34 files changed, 4778 insertions(+), 30 deletions(-) create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CopyProjectVersionRequest.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CopyProjectVersionResult.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectPolicyRequest.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectPolicyResult.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/InvalidPolicyRevisionIdException.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListProjectPoliciesRequest.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListProjectPoliciesResult.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/MalformedPolicyDocumentException.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ProjectPolicy.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/PutProjectPolicyRequest.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/PutProjectPolicyResult.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/CopyProjectVersionRequestMarshaller.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/CopyProjectVersionResultJsonUnmarshaller.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteProjectPolicyRequestMarshaller.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteProjectPolicyResultJsonUnmarshaller.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/InvalidPolicyRevisionIdExceptionUnmarshaller.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListProjectPoliciesRequestMarshaller.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListProjectPoliciesResultJsonUnmarshaller.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/MalformedPolicyDocumentExceptionUnmarshaller.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectPolicyJsonMarshaller.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectPolicyJsonUnmarshaller.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/PutProjectPolicyRequestMarshaller.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/PutProjectPolicyResultJsonUnmarshaller.java diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognition.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognition.java index b72c5a842a..722e7f54fd 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognition.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognition.java @@ -164,6 +164,13 @@ *
  • *

    * CopyProjectVersion + *

    + *
  • + *
  • + *

    + * CreateDataset *

    @@ -199,6 +206,13 @@ *
  • *

    * DeleteProjectPolicy + *

    + *
  • + *
  • + *

    + * DeleteProjectVersion *

    @@ -255,6 +269,20 @@ *
  • *

    * ListProjectPolicies + *

    + *
  • + *
  • + *

    + * PutProjectPolicy + *

    + *
  • + *
  • + *

    + * StartProjectVersion *

    @@ -437,6 +465,13 @@ * >StopStreamProcessor *

    *
  • + *
  • + *

    + * UpdateStreamProcessor + *

    + *
  • * **/ public interface AmazonRekognition { @@ -605,6 +640,66 @@ public interface AmazonRekognition { CompareFacesResult compareFaces(CompareFacesRequest compareFacesRequest) throws AmazonClientException, AmazonServiceException; + /** + *

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

    + * + * @param copyProjectVersionRequest + * @return copyProjectVersionResult The response from the CopyProjectVersion + * service method, as returned by Amazon Rekognition. + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws InvalidParameterException + * @throws LimitExceededException + * @throws ResourceNotFoundException + * @throws ThrottlingException + * @throws ServiceQuotaExceededException + * @throws ProvisionedThroughputExceededException + * @throws ResourceInUseException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + CopyProjectVersionResult copyProjectVersion(CopyProjectVersionRequest copyProjectVersionRequest) + throws AmazonClientException, AmazonServiceException; + /** *

    * Creates a collection in an AWS Region. You can add faces to the @@ -1018,7 +1113,9 @@ DeleteFacesResult deleteFaces(DeleteFacesRequest deleteFacesRequest) *

    * DeleteProject is an asynchronous operation. To check if the * project is deleted, call DescribeProjects. The project is deleted - * when the project no longer appears in the response. + * when the project no longer appears in the response. Be aware that + * deleting a given project will also delete any + * ProjectPolicies associated with that project. *

    *

    * This operation requires permissions to perform the @@ -1046,6 +1143,39 @@ DeleteFacesResult deleteFaces(DeleteFacesRequest deleteFacesRequest) DeleteProjectResult deleteProject(DeleteProjectRequest deleteProjectRequest) throws AmazonClientException, AmazonServiceException; + /** + *

    + * Deletes an existing project policy. + *

    + *

    + * To get a list of project policies attached to a project, call + * ListProjectPolicies. To attach a project policy to a project, call + * PutProjectPolicy. + *

    + * + * @param deleteProjectPolicyRequest + * @return deleteProjectPolicyResult The response from the + * DeleteProjectPolicy service method, as returned by Amazon + * Rekognition. + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws InvalidParameterException + * @throws ResourceNotFoundException + * @throws ThrottlingException + * @throws ProvisionedThroughputExceededException + * @throws InvalidPolicyRevisionIdException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + DeleteProjectPolicyResult deleteProjectPolicy( + DeleteProjectPolicyRequest deleteProjectPolicyRequest) throws AmazonClientException, + AmazonServiceException; + /** *

    * Deletes an Amazon Rekognition Custom Labels model. @@ -2736,6 +2866,38 @@ ListDatasetLabelsResult listDatasetLabels(ListDatasetLabelsRequest listDatasetLa ListFacesResult listFaces(ListFacesRequest listFacesRequest) throws AmazonClientException, AmazonServiceException; + /** + *

    + * Gets a list of the project policies attached to a project. + *

    + *

    + * To attach a project policy to a project, call PutProjectPolicy. To + * remove a project policy from a project, call DeleteProjectPolicy. + *

    + * + * @param listProjectPoliciesRequest + * @return listProjectPoliciesResult The response from the + * ListProjectPolicies service method, as returned by Amazon + * Rekognition. + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws InvalidParameterException + * @throws ResourceNotFoundException + * @throws ThrottlingException + * @throws ProvisionedThroughputExceededException + * @throws InvalidPaginationTokenException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + ListProjectPoliciesResult listProjectPolicies( + ListProjectPoliciesRequest listProjectPoliciesRequest) throws AmazonClientException, + AmazonServiceException; + /** *

    * Gets a list of stream processors that you have created with @@ -2796,6 +2958,59 @@ ListTagsForResourceResult listTagsForResource( ListTagsForResourceRequest listTagsForResourceRequest) throws AmazonClientException, AmazonServiceException; + /** + *

    + * Attaches a project policy to a Amazon Rekognition Custom Labels project + * in a trusting AWS account. A project policy specifies that a trusted AWS + * account can copy a model version from a trusting AWS account to a project + * in the trusted AWS account. To copy a model version you use the + * CopyProjectVersion operation. + *

    + *

    + * For more information about the format of a project policy document, see + * Attaching a project policy (SDK) in the Amazon Rekognition Custom + * Labels Developer Guide. + *

    + *

    + * The response from PutProjectPolicy is a revision ID for the + * project policy. You can attach multiple project policies to a project. + * You can also update an existing project policy by specifying the policy + * revision ID of the existing policy. + *

    + *

    + * To remove a project policy from a project, call + * DeleteProjectPolicy. To get a list of project policies attached to + * a project, call ListProjectPolicies. + *

    + *

    + * You copy a model version by calling CopyProjectVersion. + *

    + * + * @param putProjectPolicyRequest + * @return putProjectPolicyResult The response from the PutProjectPolicy + * service method, as returned by Amazon Rekognition. + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws InvalidParameterException + * @throws InvalidPolicyRevisionIdException + * @throws MalformedPolicyDocumentException + * @throws ResourceNotFoundException + * @throws ResourceAlreadyExistsException + * @throws ThrottlingException + * @throws ServiceQuotaExceededException + * @throws ProvisionedThroughputExceededException + * @throws LimitExceededException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + PutProjectPolicyResult putProjectPolicy(PutProjectPolicyRequest putProjectPolicyRequest) + throws AmazonClientException, AmazonServiceException; + /** *

    * Returns an array of celebrities recognized in the input image. For more diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java index 6e2f62dbdd..62ca572dc9 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java @@ -177,6 +177,13 @@ *

  • *

    * CopyProjectVersion + *

    + *
  • + *
  • + *

    + * CreateDataset *

    @@ -212,6 +219,13 @@ *
  • *

    * DeleteProjectPolicy + *

    + *
  • + *
  • + *

    + * DeleteProjectVersion *

    @@ -268,6 +282,20 @@ *
  • *

    * ListProjectPolicies + *

    + *
  • + *
  • + *

    + * PutProjectPolicy + *

    + *
  • + *
  • + *

    + * StartProjectVersion *

    @@ -450,6 +478,13 @@ * >StopStreamProcessor *

    *
  • + *
  • + *

    + * UpdateStreamProcessor + *

    + *
  • * */ public class AmazonRekognitionClient extends AmazonWebServiceClient implements AmazonRekognition { @@ -746,8 +781,10 @@ private void init() { jsonErrorUnmarshallers.add(new InvalidImageFormatExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InvalidPaginationTokenExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InvalidParameterExceptionUnmarshaller()); + jsonErrorUnmarshallers.add(new InvalidPolicyRevisionIdExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InvalidS3ObjectExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new LimitExceededExceptionUnmarshaller()); + jsonErrorUnmarshallers.add(new MalformedPolicyDocumentExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new ProvisionedThroughputExceededExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new ResourceAlreadyExistsExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new ResourceInUseExceptionUnmarshaller()); @@ -907,6 +944,94 @@ public CompareFacesResult compareFaces(CompareFacesRequest compareFacesRequest) } } + /** + *

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

    + * + * @param copyProjectVersionRequest + * @return copyProjectVersionResult The response from the CopyProjectVersion + * service method, as returned by Amazon Rekognition. + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws InvalidParameterException + * @throws LimitExceededException + * @throws ResourceNotFoundException + * @throws ThrottlingException + * @throws ServiceQuotaExceededException + * @throws ProvisionedThroughputExceededException + * @throws ResourceInUseException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + public CopyProjectVersionResult copyProjectVersion( + CopyProjectVersionRequest copyProjectVersionRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(copyProjectVersionRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new CopyProjectVersionRequestMarshaller() + .marshall(copyProjectVersionRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new CopyProjectVersionResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

    * Creates a collection in an AWS Region. You can add faces to the @@ -1530,7 +1655,9 @@ public DeleteFacesResult deleteFaces(DeleteFacesRequest deleteFacesRequest) *

    * DeleteProject is an asynchronous operation. To check if the * project is deleted, call DescribeProjects. The project is deleted - * when the project no longer appears in the response. + * when the project no longer appears in the response. Be aware that + * deleting a given project will also delete any + * ProjectPolicies associated with that project. *

    *

    * This operation requires permissions to perform the @@ -1584,6 +1711,66 @@ public DeleteProjectResult deleteProject(DeleteProjectRequest deleteProjectReque } } + /** + *

    + * Deletes an existing project policy. + *

    + *

    + * To get a list of project policies attached to a project, call + * ListProjectPolicies. To attach a project policy to a project, call + * PutProjectPolicy. + *

    + * + * @param deleteProjectPolicyRequest + * @return deleteProjectPolicyResult The response from the + * DeleteProjectPolicy service method, as returned by Amazon + * Rekognition. + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws InvalidParameterException + * @throws ResourceNotFoundException + * @throws ThrottlingException + * @throws ProvisionedThroughputExceededException + * @throws InvalidPolicyRevisionIdException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + public DeleteProjectPolicyResult deleteProjectPolicy( + DeleteProjectPolicyRequest deleteProjectPolicyRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(deleteProjectPolicyRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new DeleteProjectPolicyRequestMarshaller() + .marshall(deleteProjectPolicyRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new DeleteProjectPolicyResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

    * Deletes an Amazon Rekognition Custom Labels model. @@ -4024,6 +4211,65 @@ public ListFacesResult listFaces(ListFacesRequest listFacesRequest) } } + /** + *

    + * Gets a list of the project policies attached to a project. + *

    + *

    + * To attach a project policy to a project, call PutProjectPolicy. To + * remove a project policy from a project, call DeleteProjectPolicy. + *

    + * + * @param listProjectPoliciesRequest + * @return listProjectPoliciesResult The response from the + * ListProjectPolicies service method, as returned by Amazon + * Rekognition. + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws InvalidParameterException + * @throws ResourceNotFoundException + * @throws ThrottlingException + * @throws ProvisionedThroughputExceededException + * @throws InvalidPaginationTokenException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + public ListProjectPoliciesResult listProjectPolicies( + ListProjectPoliciesRequest listProjectPoliciesRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(listProjectPoliciesRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new ListProjectPoliciesRequestMarshaller() + .marshall(listProjectPoliciesRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new ListProjectPoliciesResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

    * Gets a list of stream processors that you have created with @@ -4138,6 +4384,85 @@ public ListTagsForResourceResult listTagsForResource( } } + /** + *

    + * Attaches a project policy to a Amazon Rekognition Custom Labels project + * in a trusting AWS account. A project policy specifies that a trusted AWS + * account can copy a model version from a trusting AWS account to a project + * in the trusted AWS account. To copy a model version you use the + * CopyProjectVersion operation. + *

    + *

    + * For more information about the format of a project policy document, see + * Attaching a project policy (SDK) in the Amazon Rekognition Custom + * Labels Developer Guide. + *

    + *

    + * The response from PutProjectPolicy is a revision ID for the + * project policy. You can attach multiple project policies to a project. + * You can also update an existing project policy by specifying the policy + * revision ID of the existing policy. + *

    + *

    + * To remove a project policy from a project, call + * DeleteProjectPolicy. To get a list of project policies attached to + * a project, call ListProjectPolicies. + *

    + *

    + * You copy a model version by calling CopyProjectVersion. + *

    + * + * @param putProjectPolicyRequest + * @return putProjectPolicyResult The response from the PutProjectPolicy + * service method, as returned by Amazon Rekognition. + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws InvalidParameterException + * @throws InvalidPolicyRevisionIdException + * @throws MalformedPolicyDocumentException + * @throws ResourceNotFoundException + * @throws ResourceAlreadyExistsException + * @throws ThrottlingException + * @throws ServiceQuotaExceededException + * @throws ProvisionedThroughputExceededException + * @throws LimitExceededException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + public PutProjectPolicyResult putProjectPolicy(PutProjectPolicyRequest putProjectPolicyRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(putProjectPolicyRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new PutProjectPolicyRequestMarshaller().marshall(putProjectPolicyRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new PutProjectPolicyResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

    * Returns an array of celebrities recognized in the input image. For more diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CopyProjectVersionRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CopyProjectVersionRequest.java new file mode 100644 index 0000000000..d584ceaa95 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CopyProjectVersionRequest.java @@ -0,0 +1,933 @@ +/* + * Copyright 2010-2022 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. + *

    + */ +public class CopyProjectVersionRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * 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 tags; + + /** + *

    + * 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 getTags() { + return tags; + } + + /** + *

    + * 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 tags) { + this.tags = tags; + } + + /** + *

    + * 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 tags) { + this.tags = tags; + return this; + } + + /** + *

    + * 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(); + } + if (this.tags.containsKey(key)) + throw new IllegalArgumentException("Duplicated keys (" + key.toString() + + ") are provided."); + this.tags.put(key, value); + return this; + } + + /** + * Removes all the entries added into Tags. + *

    + * 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 (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}$
    + * + * @return

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

    + */ + public String getKmsKeyId() { + return kmsKeyId; + } + + /** + *

    + * 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}$
    + * + * @param kmsKeyId

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

    + */ + public void setKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + } + + /** + *

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

    + *

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

    + * Constraints:
    + * Length: 1 - 2048
    + * Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
    + * + * @param kmsKeyId

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

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CopyProjectVersionRequest withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + 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 (getSourceProjectArn() != null) + sb.append("SourceProjectArn: " + getSourceProjectArn() + ","); + if (getSourceProjectVersionArn() != null) + sb.append("SourceProjectVersionArn: " + getSourceProjectVersionArn() + ","); + if (getDestinationProjectArn() != null) + sb.append("DestinationProjectArn: " + getDestinationProjectArn() + ","); + if (getVersionName() != null) + sb.append("VersionName: " + getVersionName() + ","); + if (getOutputConfig() != null) + sb.append("OutputConfig: " + getOutputConfig() + ","); + if (getTags() != null) + sb.append("Tags: " + getTags() + ","); + if (getKmsKeyId() != null) + sb.append("KmsKeyId: " + getKmsKeyId()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getSourceProjectArn() == null) ? 0 : getSourceProjectArn().hashCode()); + hashCode = prime + * hashCode + + ((getSourceProjectVersionArn() == null) ? 0 : getSourceProjectVersionArn() + .hashCode()); + hashCode = prime + * hashCode + + ((getDestinationProjectArn() == null) ? 0 : getDestinationProjectArn().hashCode()); + hashCode = prime * hashCode + + ((getVersionName() == null) ? 0 : getVersionName().hashCode()); + hashCode = prime * hashCode + + ((getOutputConfig() == null) ? 0 : getOutputConfig().hashCode()); + hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); + hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof CopyProjectVersionRequest == false) + return false; + CopyProjectVersionRequest other = (CopyProjectVersionRequest) obj; + + if (other.getSourceProjectArn() == null ^ this.getSourceProjectArn() == null) + return false; + if (other.getSourceProjectArn() != null + && other.getSourceProjectArn().equals(this.getSourceProjectArn()) == false) + return false; + if (other.getSourceProjectVersionArn() == null ^ this.getSourceProjectVersionArn() == null) + return false; + if (other.getSourceProjectVersionArn() != null + && other.getSourceProjectVersionArn().equals(this.getSourceProjectVersionArn()) == false) + return false; + if (other.getDestinationProjectArn() == null ^ this.getDestinationProjectArn() == null) + return false; + if (other.getDestinationProjectArn() != null + && other.getDestinationProjectArn().equals(this.getDestinationProjectArn()) == false) + return false; + if (other.getVersionName() == null ^ this.getVersionName() == null) + return false; + if (other.getVersionName() != null + && other.getVersionName().equals(this.getVersionName()) == false) + return false; + if (other.getOutputConfig() == null ^ this.getOutputConfig() == null) + return false; + if (other.getOutputConfig() != null + && other.getOutputConfig().equals(this.getOutputConfig()) == 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.getKmsKeyId() == null ^ this.getKmsKeyId() == null) + return false; + if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CopyProjectVersionResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CopyProjectVersionResult.java new file mode 100644 index 0000000000..225ec94f95 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CopyProjectVersionResult.java @@ -0,0 +1,144 @@ +/* + * Copyright 2010-2022 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; + +public class CopyProjectVersionResult implements Serializable { + /** + *

    + * The ARN of the copied model version in the 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 projectVersionArn; + + /** + *

    + * The ARN of the copied model version in the 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 copied model version in the destination project. + *

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

    + * The ARN of the copied model version in the 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 projectVersionArn

    + * The ARN of the copied model version in the destination + * project. + *

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

    + * The ARN of the copied model version in the 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 projectVersionArn

    + * The ARN of the copied model version in the destination + * project. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CopyProjectVersionResult withProjectVersionArn(String projectVersionArn) { + this.projectVersionArn = projectVersionArn; + 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()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getProjectVersionArn() == null) ? 0 : getProjectVersionArn().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof CopyProjectVersionResult == false) + return false; + CopyProjectVersionResult other = (CopyProjectVersionResult) obj; + + if (other.getProjectVersionArn() == null ^ this.getProjectVersionArn() == null) + return false; + if (other.getProjectVersionArn() != null + && other.getProjectVersionArn().equals(this.getProjectVersionArn()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectPolicyRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectPolicyRequest.java new file mode 100644 index 0000000000..0f9cb03867 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectPolicyRequest.java @@ -0,0 +1,313 @@ +/* + * Copyright 2010-2022 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; + +/** + *

    + * Deletes an existing project policy. + *

    + *

    + * To get a list of project policies attached to a project, call + * ListProjectPolicies. To attach a project policy to a project, call + * PutProjectPolicy. + *

    + */ +public class DeleteProjectPolicyRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * The Amazon Resource Name (ARN) of the project that the project policy you + * want to delete is attached 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 projectArn; + + /** + *

    + * The name of the policy that you want to delete. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-]+
    + */ + private String policyName; + + /** + *

    + * The ID of the project policy revision that you want to delete. + *

    + *

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + */ + private String policyRevisionId; + + /** + *

    + * The Amazon Resource Name (ARN) of the project that the project policy you + * want to delete is attached 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 Amazon Resource Name (ARN) of the project that the project + * policy you want to delete is attached to. + *

    + */ + public String getProjectArn() { + return projectArn; + } + + /** + *

    + * The Amazon Resource Name (ARN) of the project that the project policy you + * want to delete is attached 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 projectArn

    + * The Amazon Resource Name (ARN) of the project that the project + * policy you want to delete is attached to. + *

    + */ + public void setProjectArn(String projectArn) { + this.projectArn = projectArn; + } + + /** + *

    + * The Amazon Resource Name (ARN) of the project that the project policy you + * want to delete is attached 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 projectArn

    + * The Amazon Resource Name (ARN) of the project that the project + * policy you want to delete is attached to. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeleteProjectPolicyRequest withProjectArn(String projectArn) { + this.projectArn = projectArn; + return this; + } + + /** + *

    + * The name of the policy that you want to delete. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @return

    + * The name of the policy that you want to delete. + *

    + */ + public String getPolicyName() { + return policyName; + } + + /** + *

    + * The name of the policy that you want to delete. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param policyName

    + * The name of the policy that you want to delete. + *

    + */ + public void setPolicyName(String policyName) { + this.policyName = policyName; + } + + /** + *

    + * The name of the policy that you want to delete. + *

    + *

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

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param policyName

    + * The name of the policy that you want to delete. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeleteProjectPolicyRequest withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + *

    + * The ID of the project policy revision that you want to delete. + *

    + *

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + * + * @return

    + * The ID of the project policy revision that you want to delete. + *

    + */ + public String getPolicyRevisionId() { + return policyRevisionId; + } + + /** + *

    + * The ID of the project policy revision that you want to delete. + *

    + *

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + * + * @param policyRevisionId

    + * The ID of the project policy revision that you want to delete. + *

    + */ + public void setPolicyRevisionId(String policyRevisionId) { + this.policyRevisionId = policyRevisionId; + } + + /** + *

    + * The ID of the project policy revision that you want to delete. + *

    + *

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

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + * + * @param policyRevisionId

    + * The ID of the project policy revision that you want to delete. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeleteProjectPolicyRequest withPolicyRevisionId(String policyRevisionId) { + this.policyRevisionId = policyRevisionId; + 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 (getProjectArn() != null) + sb.append("ProjectArn: " + getProjectArn() + ","); + if (getPolicyName() != null) + sb.append("PolicyName: " + getPolicyName() + ","); + if (getPolicyRevisionId() != null) + sb.append("PolicyRevisionId: " + getPolicyRevisionId()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getProjectArn() == null) ? 0 : getProjectArn().hashCode()); + hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); + hashCode = prime * hashCode + + ((getPolicyRevisionId() == null) ? 0 : getPolicyRevisionId().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DeleteProjectPolicyRequest == false) + return false; + DeleteProjectPolicyRequest other = (DeleteProjectPolicyRequest) obj; + + if (other.getProjectArn() == null ^ this.getProjectArn() == null) + return false; + if (other.getProjectArn() != null + && other.getProjectArn().equals(this.getProjectArn()) == false) + return false; + if (other.getPolicyName() == null ^ this.getPolicyName() == null) + return false; + if (other.getPolicyName() != null + && other.getPolicyName().equals(this.getPolicyName()) == false) + return false; + if (other.getPolicyRevisionId() == null ^ this.getPolicyRevisionId() == null) + return false; + if (other.getPolicyRevisionId() != null + && other.getPolicyRevisionId().equals(this.getPolicyRevisionId()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectPolicyResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectPolicyResult.java new file mode 100644 index 0000000000..1c443a1591 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectPolicyResult.java @@ -0,0 +1,57 @@ +/* + * Copyright 2010-2022 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; + +public class DeleteProjectPolicyResult implements Serializable { + /** + * 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("{"); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DeleteProjectPolicyResult == false) + return false; + DeleteProjectPolicyResult other = (DeleteProjectPolicyResult) obj; + + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectRequest.java index d6be0fe062..2ee467e023 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectRequest.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectRequest.java @@ -28,7 +28,9 @@ *

    * DeleteProject is an asynchronous operation. To check if the * project is deleted, call DescribeProjects. The project is deleted when - * the project no longer appears in the response. + * the project no longer appears in the response. Be aware that deleting a given + * project will also delete any ProjectPolicies associated with + * that project. *

    *

    * This operation requires permissions to perform the diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectVersionResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectVersionResult.java index 9cba300752..65a4d32646 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectVersionResult.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteProjectVersionResult.java @@ -25,7 +25,8 @@ public class DeleteProjectVersionResult implements Serializable { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED */ private String status; @@ -36,7 +37,8 @@ public class DeleteProjectVersionResult implements Serializable { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @return

    * The status of the deletion operation. @@ -54,7 +56,8 @@ public String getStatus() { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The status of the deletion operation. @@ -75,7 +78,8 @@ public void setStatus(String status) { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The status of the deletion operation. @@ -96,7 +100,8 @@ public DeleteProjectVersionResult withStatus(String status) { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The status of the deletion operation. @@ -117,7 +122,8 @@ public void setStatus(ProjectVersionStatus status) { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The status of the deletion operation. diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/InvalidPolicyRevisionIdException.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/InvalidPolicyRevisionIdException.java new file mode 100644 index 0000000000..f32b24964f --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/InvalidPolicyRevisionIdException.java @@ -0,0 +1,37 @@ +/* + * Copyright 2010-2022 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 com.amazonaws.AmazonServiceException; + +/** + *

    + * The supplied revision id for the project policy is invalid. + *

    + */ +public class InvalidPolicyRevisionIdException extends AmazonServiceException { + private static final long serialVersionUID = 1L; + + /** + * Constructs a new InvalidPolicyRevisionIdException with the specified + * error message. + * + * @param message Describes the error encountered. + */ + public InvalidPolicyRevisionIdException(String message) { + super(message); + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListProjectPoliciesRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListProjectPoliciesRequest.java new file mode 100644 index 0000000000..04f7503e50 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListProjectPoliciesRequest.java @@ -0,0 +1,337 @@ +/* + * Copyright 2010-2022 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; + +/** + *

    + * Gets a list of the project policies attached to a project. + *

    + *

    + * To attach a project policy to a project, call PutProjectPolicy. To + * remove a project policy from a project, call DeleteProjectPolicy. + *

    + */ +public class ListProjectPoliciesRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * The ARN of the project for which you want to list the project policies. + *

    + *

    + * 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 projectArn; + + /** + *

    + * If the previous response was incomplete (because there is more results to + * retrieve), Amazon Rekognition Custom Labels returns a pagination token in + * the response. You can use this pagination token to retrieve the next set + * of results. + *

    + *

    + * Constraints:
    + * Length: - 1024
    + */ + private String nextToken; + + /** + *

    + * The maximum number of results to return per paginated call. The largest + * value you can specify is 5. If you specify a value greater than 5, a + * ValidationException error occurs. The default value is 5. + *

    + *

    + * Constraints:
    + * Range: 1 - 5
    + */ + private Integer maxResults; + + /** + *

    + * The ARN of the project for which you want to list the project policies. + *

    + *

    + * 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 for which you want to list the project + * policies. + *

    + */ + public String getProjectArn() { + return projectArn; + } + + /** + *

    + * The ARN of the project for which you want to list the project policies. + *

    + *

    + * 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 projectArn

    + * The ARN of the project for which you want to list the project + * policies. + *

    + */ + public void setProjectArn(String projectArn) { + this.projectArn = projectArn; + } + + /** + *

    + * The ARN of the project for which you want to list the project policies. + *

    + *

    + * 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 projectArn

    + * The ARN of the project for which you want to list the project + * policies. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListProjectPoliciesRequest withProjectArn(String projectArn) { + this.projectArn = projectArn; + return this; + } + + /** + *

    + * If the previous response was incomplete (because there is more results to + * retrieve), Amazon Rekognition Custom Labels returns a pagination token in + * the response. You can use this pagination token to retrieve the next set + * of results. + *

    + *

    + * Constraints:
    + * Length: - 1024
    + * + * @return

    + * If the previous response was incomplete (because there is more + * results to retrieve), Amazon Rekognition Custom Labels returns a + * pagination token in the response. You can use this pagination + * token to retrieve the next set of results. + *

    + */ + public String getNextToken() { + return nextToken; + } + + /** + *

    + * If the previous response was incomplete (because there is more results to + * retrieve), Amazon Rekognition Custom Labels returns a pagination token in + * the response. You can use this pagination token to retrieve the next set + * of results. + *

    + *

    + * Constraints:
    + * Length: - 1024
    + * + * @param nextToken

    + * If the previous response was incomplete (because there is more + * results to retrieve), Amazon Rekognition Custom Labels returns + * a pagination token in the response. You can use this + * pagination token to retrieve the next set of results. + *

    + */ + public void setNextToken(String nextToken) { + this.nextToken = nextToken; + } + + /** + *

    + * If the previous response was incomplete (because there is more results to + * retrieve), Amazon Rekognition Custom Labels returns a pagination token in + * the response. You can use this pagination token to retrieve the next set + * of results. + *

    + *

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

    + * Constraints:
    + * Length: - 1024
    + * + * @param nextToken

    + * If the previous response was incomplete (because there is more + * results to retrieve), Amazon Rekognition Custom Labels returns + * a pagination token in the response. You can use this + * pagination token to retrieve the next set of results. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListProjectPoliciesRequest withNextToken(String nextToken) { + this.nextToken = nextToken; + return this; + } + + /** + *

    + * The maximum number of results to return per paginated call. The largest + * value you can specify is 5. If you specify a value greater than 5, a + * ValidationException error occurs. The default value is 5. + *

    + *

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

    + * The maximum number of results to return per paginated call. The + * largest value you can specify is 5. If you specify a value + * greater than 5, a ValidationException error occurs. The default + * value is 5. + *

    + */ + public Integer getMaxResults() { + return maxResults; + } + + /** + *

    + * The maximum number of results to return per paginated call. The largest + * value you can specify is 5. If you specify a value greater than 5, a + * ValidationException error occurs. The default value is 5. + *

    + *

    + * Constraints:
    + * Range: 1 - 5
    + * + * @param maxResults

    + * The maximum number of results to return per paginated call. + * The largest value you can specify is 5. If you specify a value + * greater than 5, a ValidationException error occurs. The + * default value is 5. + *

    + */ + public void setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + } + + /** + *

    + * The maximum number of results to return per paginated call. The largest + * value you can specify is 5. If you specify a value greater than 5, a + * ValidationException error occurs. The default value is 5. + *

    + *

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

    + * Constraints:
    + * Range: 1 - 5
    + * + * @param maxResults

    + * The maximum number of results to return per paginated call. + * The largest value you can specify is 5. If you specify a value + * greater than 5, a ValidationException error occurs. The + * default value is 5. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListProjectPoliciesRequest withMaxResults(Integer maxResults) { + this.maxResults = maxResults; + 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 (getProjectArn() != null) + sb.append("ProjectArn: " + getProjectArn() + ","); + if (getNextToken() != null) + sb.append("NextToken: " + getNextToken() + ","); + if (getMaxResults() != null) + sb.append("MaxResults: " + getMaxResults()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getProjectArn() == null) ? 0 : getProjectArn().hashCode()); + hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); + hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ListProjectPoliciesRequest == false) + return false; + ListProjectPoliciesRequest other = (ListProjectPoliciesRequest) obj; + + if (other.getProjectArn() == null ^ this.getProjectArn() == null) + return false; + if (other.getProjectArn() != null + && other.getProjectArn().equals(this.getProjectArn()) == false) + return false; + if (other.getNextToken() == null ^ this.getNextToken() == null) + return false; + if (other.getNextToken() != null + && other.getNextToken().equals(this.getNextToken()) == false) + return false; + if (other.getMaxResults() == null ^ this.getMaxResults() == null) + return false; + if (other.getMaxResults() != null + && other.getMaxResults().equals(this.getMaxResults()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListProjectPoliciesResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListProjectPoliciesResult.java new file mode 100644 index 0000000000..7af910e071 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListProjectPoliciesResult.java @@ -0,0 +1,234 @@ +/* + * Copyright 2010-2022 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; + +public class ListProjectPoliciesResult implements Serializable { + /** + *

    + * A list of project policies attached to the project. + *

    + */ + private java.util.List projectPolicies; + + /** + *

    + * If the response is truncated, Amazon Rekognition returns this token that + * you can use in the subsequent request to retrieve the next set of project + * policies. + *

    + *

    + * Constraints:
    + * Length: - 1024
    + */ + private String nextToken; + + /** + *

    + * A list of project policies attached to the project. + *

    + * + * @return

    + * A list of project policies attached to the project. + *

    + */ + public java.util.List getProjectPolicies() { + return projectPolicies; + } + + /** + *

    + * A list of project policies attached to the project. + *

    + * + * @param projectPolicies

    + * A list of project policies attached to the project. + *

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

    + * A list of project policies attached to the project. + *

    + *

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

    + * A list of project policies attached to the project. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListProjectPoliciesResult withProjectPolicies(ProjectPolicy... projectPolicies) { + if (getProjectPolicies() == null) { + this.projectPolicies = new java.util.ArrayList(projectPolicies.length); + } + for (ProjectPolicy value : projectPolicies) { + this.projectPolicies.add(value); + } + return this; + } + + /** + *

    + * A list of project policies attached to the project. + *

    + *

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

    + * A list of project policies attached to the project. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListProjectPoliciesResult withProjectPolicies( + java.util.Collection projectPolicies) { + setProjectPolicies(projectPolicies); + return this; + } + + /** + *

    + * If the response is truncated, Amazon Rekognition returns this token that + * you can use in the subsequent request to retrieve the next set of project + * policies. + *

    + *

    + * Constraints:
    + * Length: - 1024
    + * + * @return

    + * If the response is truncated, Amazon Rekognition returns this + * token that you can use in the subsequent request to retrieve the + * next set of project policies. + *

    + */ + public String getNextToken() { + return nextToken; + } + + /** + *

    + * If the response is truncated, Amazon Rekognition returns this token that + * you can use in the subsequent request to retrieve the next set of project + * policies. + *

    + *

    + * Constraints:
    + * Length: - 1024
    + * + * @param nextToken

    + * If the response is truncated, Amazon Rekognition returns this + * token that you can use in the subsequent request to retrieve + * the next set of project policies. + *

    + */ + public void setNextToken(String nextToken) { + this.nextToken = nextToken; + } + + /** + *

    + * If the response is truncated, Amazon Rekognition returns this token that + * you can use in the subsequent request to retrieve the next set of project + * policies. + *

    + *

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

    + * Constraints:
    + * Length: - 1024
    + * + * @param nextToken

    + * If the response is truncated, Amazon Rekognition returns this + * token that you can use in the subsequent request to retrieve + * the next set of project policies. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListProjectPoliciesResult withNextToken(String nextToken) { + this.nextToken = nextToken; + 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 (getProjectPolicies() != null) + sb.append("ProjectPolicies: " + getProjectPolicies() + ","); + if (getNextToken() != null) + sb.append("NextToken: " + getNextToken()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getProjectPolicies() == null) ? 0 : getProjectPolicies().hashCode()); + hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ListProjectPoliciesResult == false) + return false; + ListProjectPoliciesResult other = (ListProjectPoliciesResult) obj; + + if (other.getProjectPolicies() == null ^ this.getProjectPolicies() == null) + return false; + if (other.getProjectPolicies() != null + && other.getProjectPolicies().equals(this.getProjectPolicies()) == false) + return false; + if (other.getNextToken() == null ^ this.getNextToken() == null) + return false; + if (other.getNextToken() != null + && other.getNextToken().equals(this.getNextToken()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/MalformedPolicyDocumentException.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/MalformedPolicyDocumentException.java new file mode 100644 index 0000000000..73f2b5cd33 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/MalformedPolicyDocumentException.java @@ -0,0 +1,38 @@ +/* + * Copyright 2010-2022 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 com.amazonaws.AmazonServiceException; + +/** + *

    + * The format of the project policy document that you supplied to + * PutProjectPolicy is incorrect. + *

    + */ +public class MalformedPolicyDocumentException extends AmazonServiceException { + private static final long serialVersionUID = 1L; + + /** + * Constructs a new MalformedPolicyDocumentException with the specified + * error message. + * + * @param message Describes the error encountered. + */ + public MalformedPolicyDocumentException(String message) { + super(message); + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ProjectPolicy.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ProjectPolicy.java new file mode 100644 index 0000000000..01b3b3488e --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ProjectPolicy.java @@ -0,0 +1,509 @@ +/* + * Copyright 2010-2022 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; + +/** + *

    + * Describes a project policy in the response from ListProjectPolicies. + *

    + *

    + *

    + */ +public class ProjectPolicy implements Serializable { + /** + *

    + * The Amazon Resource Name (ARN) of the project to which the project policy + * is attached. + *

    + *

    + * 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 projectArn; + + /** + *

    + * The name of the project policy. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-]+
    + */ + private String policyName; + + /** + *

    + * The revision ID of the project policy. + *

    + *

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + */ + private String policyRevisionId; + + /** + *

    + * The JSON document for the project policy. + *

    + *

    + * Constraints:
    + * Length: 1 - 2000
    + * Pattern: [ -\u00FF]+
    + */ + private String policyDocument; + + /** + *

    + * The Unix datetime for the creation of the project policy. + *

    + */ + private java.util.Date creationTimestamp; + + /** + *

    + * The Unix datetime for when the project policy was last updated. + *

    + */ + private java.util.Date lastUpdatedTimestamp; + + /** + *

    + * The Amazon Resource Name (ARN) of the project to which the project policy + * is attached. + *

    + *

    + * 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 Amazon Resource Name (ARN) of the project to which the + * project policy is attached. + *

    + */ + public String getProjectArn() { + return projectArn; + } + + /** + *

    + * The Amazon Resource Name (ARN) of the project to which the project policy + * is attached. + *

    + *

    + * 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 projectArn

    + * The Amazon Resource Name (ARN) of the project to which the + * project policy is attached. + *

    + */ + public void setProjectArn(String projectArn) { + this.projectArn = projectArn; + } + + /** + *

    + * The Amazon Resource Name (ARN) of the project to which the project policy + * is attached. + *

    + *

    + * 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 projectArn

    + * The Amazon Resource Name (ARN) of the project to which the + * project policy is attached. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ProjectPolicy withProjectArn(String projectArn) { + this.projectArn = projectArn; + return this; + } + + /** + *

    + * The name of the project policy. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @return

    + * The name of the project policy. + *

    + */ + public String getPolicyName() { + return policyName; + } + + /** + *

    + * The name of the project policy. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param policyName

    + * The name of the project policy. + *

    + */ + public void setPolicyName(String policyName) { + this.policyName = policyName; + } + + /** + *

    + * The name of the project policy. + *

    + *

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

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param policyName

    + * The name of the project policy. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ProjectPolicy withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + *

    + * The revision ID of the project policy. + *

    + *

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + * + * @return

    + * The revision ID of the project policy. + *

    + */ + public String getPolicyRevisionId() { + return policyRevisionId; + } + + /** + *

    + * The revision ID of the project policy. + *

    + *

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + * + * @param policyRevisionId

    + * The revision ID of the project policy. + *

    + */ + public void setPolicyRevisionId(String policyRevisionId) { + this.policyRevisionId = policyRevisionId; + } + + /** + *

    + * The revision ID of the project policy. + *

    + *

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

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + * + * @param policyRevisionId

    + * The revision ID of the project policy. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ProjectPolicy withPolicyRevisionId(String policyRevisionId) { + this.policyRevisionId = policyRevisionId; + return this; + } + + /** + *

    + * The JSON document for the project policy. + *

    + *

    + * Constraints:
    + * Length: 1 - 2000
    + * Pattern: [ -\u00FF]+
    + * + * @return

    + * The JSON document for the project policy. + *

    + */ + public String getPolicyDocument() { + return policyDocument; + } + + /** + *

    + * The JSON document for the project policy. + *

    + *

    + * Constraints:
    + * Length: 1 - 2000
    + * Pattern: [ -\u00FF]+
    + * + * @param policyDocument

    + * The JSON document for the project policy. + *

    + */ + public void setPolicyDocument(String policyDocument) { + this.policyDocument = policyDocument; + } + + /** + *

    + * The JSON document for the project policy. + *

    + *

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

    + * Constraints:
    + * Length: 1 - 2000
    + * Pattern: [ -\u00FF]+
    + * + * @param policyDocument

    + * The JSON document for the project policy. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ProjectPolicy withPolicyDocument(String policyDocument) { + this.policyDocument = policyDocument; + return this; + } + + /** + *

    + * The Unix datetime for the creation of the project policy. + *

    + * + * @return

    + * The Unix datetime for the creation of the project policy. + *

    + */ + public java.util.Date getCreationTimestamp() { + return creationTimestamp; + } + + /** + *

    + * The Unix datetime for the creation of the project policy. + *

    + * + * @param creationTimestamp

    + * The Unix datetime for the creation of the project policy. + *

    + */ + public void setCreationTimestamp(java.util.Date creationTimestamp) { + this.creationTimestamp = creationTimestamp; + } + + /** + *

    + * The Unix datetime for the creation of the project policy. + *

    + *

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

    + * The Unix datetime for the creation of the project policy. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ProjectPolicy withCreationTimestamp(java.util.Date creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + /** + *

    + * The Unix datetime for when the project policy was last updated. + *

    + * + * @return

    + * The Unix datetime for when the project policy was last updated. + *

    + */ + public java.util.Date getLastUpdatedTimestamp() { + return lastUpdatedTimestamp; + } + + /** + *

    + * The Unix datetime for when the project policy was last updated. + *

    + * + * @param lastUpdatedTimestamp

    + * The Unix datetime for when the project policy was last + * updated. + *

    + */ + public void setLastUpdatedTimestamp(java.util.Date lastUpdatedTimestamp) { + this.lastUpdatedTimestamp = lastUpdatedTimestamp; + } + + /** + *

    + * The Unix datetime for when the project policy was last updated. + *

    + *

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

    + * The Unix datetime for when the project policy was last + * updated. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ProjectPolicy withLastUpdatedTimestamp(java.util.Date lastUpdatedTimestamp) { + this.lastUpdatedTimestamp = lastUpdatedTimestamp; + 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 (getProjectArn() != null) + sb.append("ProjectArn: " + getProjectArn() + ","); + if (getPolicyName() != null) + sb.append("PolicyName: " + getPolicyName() + ","); + if (getPolicyRevisionId() != null) + sb.append("PolicyRevisionId: " + getPolicyRevisionId() + ","); + if (getPolicyDocument() != null) + sb.append("PolicyDocument: " + getPolicyDocument() + ","); + if (getCreationTimestamp() != null) + sb.append("CreationTimestamp: " + getCreationTimestamp() + ","); + if (getLastUpdatedTimestamp() != null) + sb.append("LastUpdatedTimestamp: " + getLastUpdatedTimestamp()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getProjectArn() == null) ? 0 : getProjectArn().hashCode()); + hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); + hashCode = prime * hashCode + + ((getPolicyRevisionId() == null) ? 0 : getPolicyRevisionId().hashCode()); + hashCode = prime * hashCode + + ((getPolicyDocument() == null) ? 0 : getPolicyDocument().hashCode()); + hashCode = prime * hashCode + + ((getCreationTimestamp() == null) ? 0 : getCreationTimestamp().hashCode()); + hashCode = prime * hashCode + + ((getLastUpdatedTimestamp() == null) ? 0 : getLastUpdatedTimestamp().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ProjectPolicy == false) + return false; + ProjectPolicy other = (ProjectPolicy) obj; + + if (other.getProjectArn() == null ^ this.getProjectArn() == null) + return false; + if (other.getProjectArn() != null + && other.getProjectArn().equals(this.getProjectArn()) == false) + return false; + if (other.getPolicyName() == null ^ this.getPolicyName() == null) + return false; + if (other.getPolicyName() != null + && other.getPolicyName().equals(this.getPolicyName()) == false) + return false; + if (other.getPolicyRevisionId() == null ^ this.getPolicyRevisionId() == null) + return false; + if (other.getPolicyRevisionId() != null + && other.getPolicyRevisionId().equals(this.getPolicyRevisionId()) == false) + return false; + if (other.getPolicyDocument() == null ^ this.getPolicyDocument() == null) + return false; + if (other.getPolicyDocument() != null + && other.getPolicyDocument().equals(this.getPolicyDocument()) == false) + return false; + if (other.getCreationTimestamp() == null ^ this.getCreationTimestamp() == null) + return false; + if (other.getCreationTimestamp() != null + && other.getCreationTimestamp().equals(this.getCreationTimestamp()) == false) + return false; + if (other.getLastUpdatedTimestamp() == null ^ this.getLastUpdatedTimestamp() == null) + return false; + if (other.getLastUpdatedTimestamp() != null + && other.getLastUpdatedTimestamp().equals(this.getLastUpdatedTimestamp()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ProjectVersionDescription.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ProjectVersionDescription.java index 5888fac90e..46a0f5d724 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ProjectVersionDescription.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ProjectVersionDescription.java @@ -61,7 +61,8 @@ public class ProjectVersionDescription implements Serializable { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED */ private String status; @@ -152,6 +153,21 @@ public class ProjectVersionDescription implements Serializable { */ private Integer maxInferenceUnits; + /** + *

    + * If the model version was copied from a different project, + * SourceProjectVersionArn contains the ARN of the source model + * version. + *

    + *

    + * 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 Amazon Resource Name (ARN) of the model version. @@ -327,7 +343,8 @@ public ProjectVersionDescription withMinInferenceUnits(Integer minInferenceUnits *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @return

    * The current status of the model version. @@ -345,7 +362,8 @@ public String getStatus() { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The current status of the model version. @@ -366,7 +384,8 @@ public void setStatus(String status) { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The current status of the model version. @@ -387,7 +406,8 @@ public ProjectVersionDescription withStatus(String status) { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The current status of the model version. @@ -408,7 +428,8 @@ public void setStatus(ProjectVersionStatus status) { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The current status of the model version. @@ -948,6 +969,81 @@ public ProjectVersionDescription withMaxInferenceUnits(Integer maxInferenceUnits return this; } + /** + *

    + * If the model version was copied from a different project, + * SourceProjectVersionArn contains the ARN of the source model + * version. + *

    + *

    + * 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

    + * If the model version was copied from a different project, + * SourceProjectVersionArn contains the ARN of the + * source model version. + *

    + */ + public String getSourceProjectVersionArn() { + return sourceProjectVersionArn; + } + + /** + *

    + * If the model version was copied from a different project, + * SourceProjectVersionArn contains the ARN of the source model + * version. + *

    + *

    + * 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

    + * If the model version was copied from a different project, + * SourceProjectVersionArn contains the ARN of the + * source model version. + *

    + */ + public void setSourceProjectVersionArn(String sourceProjectVersionArn) { + this.sourceProjectVersionArn = sourceProjectVersionArn; + } + + /** + *

    + * If the model version was copied from a different project, + * SourceProjectVersionArn contains the ARN of the source model + * version. + *

    + *

    + * 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

    + * If the model version was copied from a different project, + * SourceProjectVersionArn contains the ARN of the + * source model version. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ProjectVersionDescription withSourceProjectVersionArn(String sourceProjectVersionArn) { + this.sourceProjectVersionArn = sourceProjectVersionArn; + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -986,7 +1082,9 @@ public String toString() { if (getKmsKeyId() != null) sb.append("KmsKeyId: " + getKmsKeyId() + ","); if (getMaxInferenceUnits() != null) - sb.append("MaxInferenceUnits: " + getMaxInferenceUnits()); + sb.append("MaxInferenceUnits: " + getMaxInferenceUnits() + ","); + if (getSourceProjectVersionArn() != null) + sb.append("SourceProjectVersionArn: " + getSourceProjectVersionArn()); sb.append("}"); return sb.toString(); } @@ -1024,6 +1122,10 @@ public int hashCode() { hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode()); hashCode = prime * hashCode + ((getMaxInferenceUnits() == null) ? 0 : getMaxInferenceUnits().hashCode()); + hashCode = prime + * hashCode + + ((getSourceProjectVersionArn() == null) ? 0 : getSourceProjectVersionArn() + .hashCode()); return hashCode; } @@ -1108,6 +1210,11 @@ public boolean equals(Object obj) { if (other.getMaxInferenceUnits() != null && other.getMaxInferenceUnits().equals(this.getMaxInferenceUnits()) == false) return false; + if (other.getSourceProjectVersionArn() == null ^ this.getSourceProjectVersionArn() == null) + return false; + if (other.getSourceProjectVersionArn() != null + && other.getSourceProjectVersionArn().equals(this.getSourceProjectVersionArn()) == false) + return false; return true; } } diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ProjectVersionStatus.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ProjectVersionStatus.java index 9ff22a71a1..150cb2fd72 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ProjectVersionStatus.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ProjectVersionStatus.java @@ -31,7 +31,10 @@ public enum ProjectVersionStatus { FAILED("FAILED"), STOPPING("STOPPING"), STOPPED("STOPPED"), - DELETING("DELETING"); + DELETING("DELETING"), + COPYING_IN_PROGRESS("COPYING_IN_PROGRESS"), + COPYING_COMPLETED("COPYING_COMPLETED"), + COPYING_FAILED("COPYING_FAILED"); private String value; @@ -56,6 +59,9 @@ public String toString() { enumMap.put("STOPPING", STOPPING); enumMap.put("STOPPED", STOPPED); enumMap.put("DELETING", DELETING); + enumMap.put("COPYING_IN_PROGRESS", COPYING_IN_PROGRESS); + enumMap.put("COPYING_COMPLETED", COPYING_COMPLETED); + enumMap.put("COPYING_FAILED", COPYING_FAILED); } /** diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/PutProjectPolicyRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/PutProjectPolicyRequest.java new file mode 100644 index 0000000000..12a0681335 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/PutProjectPolicyRequest.java @@ -0,0 +1,467 @@ +/* + * Copyright 2010-2022 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; + +/** + *

    + * Attaches a project policy to a Amazon Rekognition Custom Labels project in a + * trusting AWS account. A project policy specifies that a trusted AWS account + * can copy a model version from a trusting AWS account to a project in the + * trusted AWS account. To copy a model version you use the + * CopyProjectVersion operation. + *

    + *

    + * For more information about the format of a project policy document, see + * Attaching a project policy (SDK) in the Amazon Rekognition Custom Labels + * Developer Guide. + *

    + *

    + * The response from PutProjectPolicy is a revision ID for the + * project policy. You can attach multiple project policies to a project. You + * can also update an existing project policy by specifying the policy revision + * ID of the existing policy. + *

    + *

    + * To remove a project policy from a project, call DeleteProjectPolicy. + * To get a list of project policies attached to a project, call + * ListProjectPolicies. + *

    + *

    + * You copy a model version by calling CopyProjectVersion. + *

    + */ +public class PutProjectPolicyRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * The Amazon Resource Name (ARN) of the project that the project policy is + * attached 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 projectArn; + + /** + *

    + * A name for the policy. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-]+
    + */ + private String policyName; + + /** + *

    + * The revision ID for the Project Policy. Each time you modify a policy, + * Amazon Rekognition Custom Labels generates and assigns a new + * PolicyRevisionId and then deletes the previous version of + * the policy. + *

    + *

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + */ + private String policyRevisionId; + + /** + *

    + * A resource policy to add to the model. The policy is a JSON structure + * that contains one or more statements that define the policy. The policy + * must follow the IAM syntax. For more information about the contents of a + * JSON policy document, see IAM JSON policy reference. + *

    + *

    + * Constraints:
    + * Length: 1 - 2000
    + * Pattern: [ -\u00FF]+
    + */ + private String policyDocument; + + /** + *

    + * The Amazon Resource Name (ARN) of the project that the project policy is + * attached 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 Amazon Resource Name (ARN) of the project that the project + * policy is attached to. + *

    + */ + public String getProjectArn() { + return projectArn; + } + + /** + *

    + * The Amazon Resource Name (ARN) of the project that the project policy is + * attached 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 projectArn

    + * The Amazon Resource Name (ARN) of the project that the project + * policy is attached to. + *

    + */ + public void setProjectArn(String projectArn) { + this.projectArn = projectArn; + } + + /** + *

    + * The Amazon Resource Name (ARN) of the project that the project policy is + * attached 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 projectArn

    + * The Amazon Resource Name (ARN) of the project that the project + * policy is attached to. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public PutProjectPolicyRequest withProjectArn(String projectArn) { + this.projectArn = projectArn; + return this; + } + + /** + *

    + * A name for the policy. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @return

    + * A name for the policy. + *

    + */ + public String getPolicyName() { + return policyName; + } + + /** + *

    + * A name for the policy. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param policyName

    + * A name for the policy. + *

    + */ + public void setPolicyName(String policyName) { + this.policyName = policyName; + } + + /** + *

    + * A name for the policy. + *

    + *

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

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param policyName

    + * A name for the policy. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public PutProjectPolicyRequest withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + *

    + * The revision ID for the Project Policy. Each time you modify a policy, + * Amazon Rekognition Custom Labels generates and assigns a new + * PolicyRevisionId and then deletes the previous version of + * the policy. + *

    + *

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + * + * @return

    + * The revision ID for the Project Policy. Each time you modify a + * policy, Amazon Rekognition Custom Labels generates and assigns a + * new PolicyRevisionId and then deletes the previous + * version of the policy. + *

    + */ + public String getPolicyRevisionId() { + return policyRevisionId; + } + + /** + *

    + * The revision ID for the Project Policy. Each time you modify a policy, + * Amazon Rekognition Custom Labels generates and assigns a new + * PolicyRevisionId and then deletes the previous version of + * the policy. + *

    + *

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + * + * @param policyRevisionId

    + * The revision ID for the Project Policy. Each time you modify a + * policy, Amazon Rekognition Custom Labels generates and assigns + * a new PolicyRevisionId and then deletes the + * previous version of the policy. + *

    + */ + public void setPolicyRevisionId(String policyRevisionId) { + this.policyRevisionId = policyRevisionId; + } + + /** + *

    + * The revision ID for the Project Policy. Each time you modify a policy, + * Amazon Rekognition Custom Labels generates and assigns a new + * PolicyRevisionId and then deletes the previous version of + * the policy. + *

    + *

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

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + * + * @param policyRevisionId

    + * The revision ID for the Project Policy. Each time you modify a + * policy, Amazon Rekognition Custom Labels generates and assigns + * a new PolicyRevisionId and then deletes the + * previous version of the policy. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public PutProjectPolicyRequest withPolicyRevisionId(String policyRevisionId) { + this.policyRevisionId = policyRevisionId; + return this; + } + + /** + *

    + * A resource policy to add to the model. The policy is a JSON structure + * that contains one or more statements that define the policy. The policy + * must follow the IAM syntax. For more information about the contents of a + * JSON policy document, see IAM JSON policy reference. + *

    + *

    + * Constraints:
    + * Length: 1 - 2000
    + * Pattern: [ -\u00FF]+
    + * + * @return

    + * A resource policy to add to the model. The policy is a JSON + * structure that contains one or more statements that define the + * policy. The policy must follow the IAM syntax. For more + * information about the contents of a JSON policy document, see IAM JSON policy reference. + *

    + */ + public String getPolicyDocument() { + return policyDocument; + } + + /** + *

    + * A resource policy to add to the model. The policy is a JSON structure + * that contains one or more statements that define the policy. The policy + * must follow the IAM syntax. For more information about the contents of a + * JSON policy document, see IAM JSON policy reference. + *

    + *

    + * Constraints:
    + * Length: 1 - 2000
    + * Pattern: [ -\u00FF]+
    + * + * @param policyDocument

    + * A resource policy to add to the model. The policy is a JSON + * structure that contains one or more statements that define the + * policy. The policy must follow the IAM syntax. For more + * information about the contents of a JSON policy document, see + * IAM JSON policy reference. + *

    + */ + public void setPolicyDocument(String policyDocument) { + this.policyDocument = policyDocument; + } + + /** + *

    + * A resource policy to add to the model. The policy is a JSON structure + * that contains one or more statements that define the policy. The policy + * must follow the IAM syntax. For more information about the contents of a + * JSON policy document, see IAM JSON policy reference. + *

    + *

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

    + * Constraints:
    + * Length: 1 - 2000
    + * Pattern: [ -\u00FF]+
    + * + * @param policyDocument

    + * A resource policy to add to the model. The policy is a JSON + * structure that contains one or more statements that define the + * policy. The policy must follow the IAM syntax. For more + * information about the contents of a JSON policy document, see + * IAM JSON policy reference. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public PutProjectPolicyRequest withPolicyDocument(String policyDocument) { + this.policyDocument = policyDocument; + 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 (getProjectArn() != null) + sb.append("ProjectArn: " + getProjectArn() + ","); + if (getPolicyName() != null) + sb.append("PolicyName: " + getPolicyName() + ","); + if (getPolicyRevisionId() != null) + sb.append("PolicyRevisionId: " + getPolicyRevisionId() + ","); + if (getPolicyDocument() != null) + sb.append("PolicyDocument: " + getPolicyDocument()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getProjectArn() == null) ? 0 : getProjectArn().hashCode()); + hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); + hashCode = prime * hashCode + + ((getPolicyRevisionId() == null) ? 0 : getPolicyRevisionId().hashCode()); + hashCode = prime * hashCode + + ((getPolicyDocument() == null) ? 0 : getPolicyDocument().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof PutProjectPolicyRequest == false) + return false; + PutProjectPolicyRequest other = (PutProjectPolicyRequest) obj; + + if (other.getProjectArn() == null ^ this.getProjectArn() == null) + return false; + if (other.getProjectArn() != null + && other.getProjectArn().equals(this.getProjectArn()) == false) + return false; + if (other.getPolicyName() == null ^ this.getPolicyName() == null) + return false; + if (other.getPolicyName() != null + && other.getPolicyName().equals(this.getPolicyName()) == false) + return false; + if (other.getPolicyRevisionId() == null ^ this.getPolicyRevisionId() == null) + return false; + if (other.getPolicyRevisionId() != null + && other.getPolicyRevisionId().equals(this.getPolicyRevisionId()) == false) + return false; + if (other.getPolicyDocument() == null ^ this.getPolicyDocument() == null) + return false; + if (other.getPolicyDocument() != null + && other.getPolicyDocument().equals(this.getPolicyDocument()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/PutProjectPolicyResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/PutProjectPolicyResult.java new file mode 100644 index 0000000000..83a2a7d41d --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/PutProjectPolicyResult.java @@ -0,0 +1,134 @@ +/* + * Copyright 2010-2022 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; + +public class PutProjectPolicyResult implements Serializable { + /** + *

    + * The ID of the project policy. + *

    + *

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + */ + private String policyRevisionId; + + /** + *

    + * The ID of the project policy. + *

    + *

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + * + * @return

    + * The ID of the project policy. + *

    + */ + public String getPolicyRevisionId() { + return policyRevisionId; + } + + /** + *

    + * The ID of the project policy. + *

    + *

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + * + * @param policyRevisionId

    + * The ID of the project policy. + *

    + */ + public void setPolicyRevisionId(String policyRevisionId) { + this.policyRevisionId = policyRevisionId; + } + + /** + *

    + * The ID of the project policy. + *

    + *

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

    + * Constraints:
    + * Length: - 64
    + * Pattern: [0-9A-Fa-f]+
    + * + * @param policyRevisionId

    + * The ID of the project policy. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public PutProjectPolicyResult withPolicyRevisionId(String policyRevisionId) { + this.policyRevisionId = policyRevisionId; + 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 (getPolicyRevisionId() != null) + sb.append("PolicyRevisionId: " + getPolicyRevisionId()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getPolicyRevisionId() == null) ? 0 : getPolicyRevisionId().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof PutProjectPolicyResult == false) + return false; + PutProjectPolicyResult other = (PutProjectPolicyResult) obj; + + if (other.getPolicyRevisionId() == null ^ this.getPolicyRevisionId() == null) + return false; + if (other.getPolicyRevisionId() != null + && other.getPolicyRevisionId().equals(this.getPolicyRevisionId()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/StartProjectVersionResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/StartProjectVersionResult.java index e5d31bd904..d101d718ea 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/StartProjectVersionResult.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/StartProjectVersionResult.java @@ -25,7 +25,8 @@ public class StartProjectVersionResult implements Serializable { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED */ private String status; @@ -36,7 +37,8 @@ public class StartProjectVersionResult implements Serializable { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @return

    * The current running status of the model. @@ -54,7 +56,8 @@ public String getStatus() { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The current running status of the model. @@ -75,7 +78,8 @@ public void setStatus(String status) { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The current running status of the model. @@ -96,7 +100,8 @@ public StartProjectVersionResult withStatus(String status) { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The current running status of the model. @@ -117,7 +122,8 @@ public void setStatus(ProjectVersionStatus status) { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The current running status of the model. diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/StopProjectVersionResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/StopProjectVersionResult.java index 9d5047d3e2..9cfce18919 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/StopProjectVersionResult.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/StopProjectVersionResult.java @@ -25,7 +25,8 @@ public class StopProjectVersionResult implements Serializable { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED */ private String status; @@ -36,7 +37,8 @@ public class StopProjectVersionResult implements Serializable { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @return

    * The current status of the stop operation. @@ -54,7 +56,8 @@ public String getStatus() { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The current status of the stop operation. @@ -75,7 +78,8 @@ public void setStatus(String status) { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The current status of the stop operation. @@ -96,7 +100,8 @@ public StopProjectVersionResult withStatus(String status) { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The current status of the stop operation. @@ -117,7 +122,8 @@ public void setStatus(ProjectVersionStatus status) { *

    * Constraints:
    * Allowed Values: TRAINING_IN_PROGRESS, TRAINING_COMPLETED, - * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING + * TRAINING_FAILED, STARTING, RUNNING, FAILED, STOPPING, STOPPED, DELETING, + * COPYING_IN_PROGRESS, COPYING_COMPLETED, COPYING_FAILED * * @param status

    * The current status of the stop operation. diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/CopyProjectVersionRequestMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/CopyProjectVersionRequestMarshaller.java new file mode 100644 index 0000000000..1687b726fa --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/CopyProjectVersionRequestMarshaller.java @@ -0,0 +1,127 @@ +/* + * Copyright 2010-2022 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.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for CopyProjectVersionRequest + */ +public class CopyProjectVersionRequestMarshaller implements + Marshaller, CopyProjectVersionRequest> { + + public Request marshall( + CopyProjectVersionRequest copyProjectVersionRequest) { + if (copyProjectVersionRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(CopyProjectVersionRequest)"); + } + + Request request = new DefaultRequest( + copyProjectVersionRequest, "AmazonRekognition"); + String target = "RekognitionService.CopyProjectVersion"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (copyProjectVersionRequest.getSourceProjectArn() != null) { + String sourceProjectArn = copyProjectVersionRequest.getSourceProjectArn(); + jsonWriter.name("SourceProjectArn"); + jsonWriter.value(sourceProjectArn); + } + if (copyProjectVersionRequest.getSourceProjectVersionArn() != null) { + String sourceProjectVersionArn = copyProjectVersionRequest + .getSourceProjectVersionArn(); + jsonWriter.name("SourceProjectVersionArn"); + jsonWriter.value(sourceProjectVersionArn); + } + if (copyProjectVersionRequest.getDestinationProjectArn() != null) { + String destinationProjectArn = copyProjectVersionRequest.getDestinationProjectArn(); + jsonWriter.name("DestinationProjectArn"); + jsonWriter.value(destinationProjectArn); + } + if (copyProjectVersionRequest.getVersionName() != null) { + String versionName = copyProjectVersionRequest.getVersionName(); + jsonWriter.name("VersionName"); + jsonWriter.value(versionName); + } + if (copyProjectVersionRequest.getOutputConfig() != null) { + OutputConfig outputConfig = copyProjectVersionRequest.getOutputConfig(); + jsonWriter.name("OutputConfig"); + OutputConfigJsonMarshaller.getInstance().marshall(outputConfig, jsonWriter); + } + if (copyProjectVersionRequest.getTags() != null) { + java.util.Map tags = copyProjectVersionRequest.getTags(); + jsonWriter.name("Tags"); + jsonWriter.beginObject(); + for (java.util.Map.Entry tagsEntry : tags.entrySet()) { + String tagsValue = tagsEntry.getValue(); + if (tagsValue != null) { + jsonWriter.name(tagsEntry.getKey()); + jsonWriter.value(tagsValue); + } + } + jsonWriter.endObject(); + } + if (copyProjectVersionRequest.getKmsKeyId() != null) { + String kmsKeyId = copyProjectVersionRequest.getKmsKeyId(); + jsonWriter.name("KmsKeyId"); + jsonWriter.value(kmsKeyId); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/CopyProjectVersionResultJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/CopyProjectVersionResultJsonUnmarshaller.java new file mode 100644 index 0000000000..81fce882b1 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/CopyProjectVersionResultJsonUnmarshaller.java @@ -0,0 +1,55 @@ +/* + * Copyright 2010-2022 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.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response CopyProjectVersionResult + */ +public class CopyProjectVersionResultJsonUnmarshaller implements + Unmarshaller { + + public CopyProjectVersionResult unmarshall(JsonUnmarshallerContext context) throws Exception { + CopyProjectVersionResult copyProjectVersionResult = new CopyProjectVersionResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("ProjectVersionArn")) { + copyProjectVersionResult.setProjectVersionArn(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return copyProjectVersionResult; + } + + private static CopyProjectVersionResultJsonUnmarshaller instance; + + public static CopyProjectVersionResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new CopyProjectVersionResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteProjectPolicyRequestMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteProjectPolicyRequestMarshaller.java new file mode 100644 index 0000000000..802e704ee3 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteProjectPolicyRequestMarshaller.java @@ -0,0 +1,98 @@ +/* + * Copyright 2010-2022 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.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for DeleteProjectPolicyRequest + */ +public class DeleteProjectPolicyRequestMarshaller implements + Marshaller, DeleteProjectPolicyRequest> { + + public Request marshall( + DeleteProjectPolicyRequest deleteProjectPolicyRequest) { + if (deleteProjectPolicyRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(DeleteProjectPolicyRequest)"); + } + + Request request = new DefaultRequest( + deleteProjectPolicyRequest, "AmazonRekognition"); + String target = "RekognitionService.DeleteProjectPolicy"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (deleteProjectPolicyRequest.getProjectArn() != null) { + String projectArn = deleteProjectPolicyRequest.getProjectArn(); + jsonWriter.name("ProjectArn"); + jsonWriter.value(projectArn); + } + if (deleteProjectPolicyRequest.getPolicyName() != null) { + String policyName = deleteProjectPolicyRequest.getPolicyName(); + jsonWriter.name("PolicyName"); + jsonWriter.value(policyName); + } + if (deleteProjectPolicyRequest.getPolicyRevisionId() != null) { + String policyRevisionId = deleteProjectPolicyRequest.getPolicyRevisionId(); + jsonWriter.name("PolicyRevisionId"); + jsonWriter.value(policyRevisionId); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteProjectPolicyResultJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteProjectPolicyResultJsonUnmarshaller.java new file mode 100644 index 0000000000..9d2b6d4f78 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteProjectPolicyResultJsonUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2022 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.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response DeleteProjectPolicyResult + */ +public class DeleteProjectPolicyResultJsonUnmarshaller implements + Unmarshaller { + + public DeleteProjectPolicyResult unmarshall(JsonUnmarshallerContext context) throws Exception { + DeleteProjectPolicyResult deleteProjectPolicyResult = new DeleteProjectPolicyResult(); + + return deleteProjectPolicyResult; + } + + private static DeleteProjectPolicyResultJsonUnmarshaller instance; + + public static DeleteProjectPolicyResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new DeleteProjectPolicyResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/InvalidPolicyRevisionIdExceptionUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/InvalidPolicyRevisionIdExceptionUnmarshaller.java new file mode 100644 index 0000000000..e126e1694d --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/InvalidPolicyRevisionIdExceptionUnmarshaller.java @@ -0,0 +1,43 @@ +/* + * Copyright 2010-2022 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.transform; + +import com.amazonaws.AmazonServiceException; +import com.amazonaws.http.JsonErrorResponseHandler.JsonErrorResponse; +import com.amazonaws.transform.JsonErrorUnmarshaller; +import com.amazonaws.services.rekognition.model.InvalidPolicyRevisionIdException; + +public class InvalidPolicyRevisionIdExceptionUnmarshaller extends JsonErrorUnmarshaller { + + public InvalidPolicyRevisionIdExceptionUnmarshaller() { + super(InvalidPolicyRevisionIdException.class); + } + + @Override + public boolean match(JsonErrorResponse error) throws Exception { + return error.getErrorCode().equals("InvalidPolicyRevisionIdException"); + } + + @Override + public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception { + + InvalidPolicyRevisionIdException e = (InvalidPolicyRevisionIdException) super + .unmarshall(error); + e.setErrorCode("InvalidPolicyRevisionIdException"); + + return e; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListProjectPoliciesRequestMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListProjectPoliciesRequestMarshaller.java new file mode 100644 index 0000000000..f672bf843f --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListProjectPoliciesRequestMarshaller.java @@ -0,0 +1,98 @@ +/* + * Copyright 2010-2022 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.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for ListProjectPoliciesRequest + */ +public class ListProjectPoliciesRequestMarshaller implements + Marshaller, ListProjectPoliciesRequest> { + + public Request marshall( + ListProjectPoliciesRequest listProjectPoliciesRequest) { + if (listProjectPoliciesRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(ListProjectPoliciesRequest)"); + } + + Request request = new DefaultRequest( + listProjectPoliciesRequest, "AmazonRekognition"); + String target = "RekognitionService.ListProjectPolicies"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (listProjectPoliciesRequest.getProjectArn() != null) { + String projectArn = listProjectPoliciesRequest.getProjectArn(); + jsonWriter.name("ProjectArn"); + jsonWriter.value(projectArn); + } + if (listProjectPoliciesRequest.getNextToken() != null) { + String nextToken = listProjectPoliciesRequest.getNextToken(); + jsonWriter.name("NextToken"); + jsonWriter.value(nextToken); + } + if (listProjectPoliciesRequest.getMaxResults() != null) { + Integer maxResults = listProjectPoliciesRequest.getMaxResults(); + jsonWriter.name("MaxResults"); + jsonWriter.value(maxResults); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListProjectPoliciesResultJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListProjectPoliciesResultJsonUnmarshaller.java new file mode 100644 index 0000000000..dc07ff825d --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListProjectPoliciesResultJsonUnmarshaller.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010-2022 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.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response ListProjectPoliciesResult + */ +public class ListProjectPoliciesResultJsonUnmarshaller implements + Unmarshaller { + + public ListProjectPoliciesResult unmarshall(JsonUnmarshallerContext context) throws Exception { + ListProjectPoliciesResult listProjectPoliciesResult = new ListProjectPoliciesResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("ProjectPolicies")) { + listProjectPoliciesResult.setProjectPolicies(new ListUnmarshaller( + ProjectPolicyJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("NextToken")) { + listProjectPoliciesResult.setNextToken(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return listProjectPoliciesResult; + } + + private static ListProjectPoliciesResultJsonUnmarshaller instance; + + public static ListProjectPoliciesResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new ListProjectPoliciesResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/MalformedPolicyDocumentExceptionUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/MalformedPolicyDocumentExceptionUnmarshaller.java new file mode 100644 index 0000000000..32fac38738 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/MalformedPolicyDocumentExceptionUnmarshaller.java @@ -0,0 +1,43 @@ +/* + * Copyright 2010-2022 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.transform; + +import com.amazonaws.AmazonServiceException; +import com.amazonaws.http.JsonErrorResponseHandler.JsonErrorResponse; +import com.amazonaws.transform.JsonErrorUnmarshaller; +import com.amazonaws.services.rekognition.model.MalformedPolicyDocumentException; + +public class MalformedPolicyDocumentExceptionUnmarshaller extends JsonErrorUnmarshaller { + + public MalformedPolicyDocumentExceptionUnmarshaller() { + super(MalformedPolicyDocumentException.class); + } + + @Override + public boolean match(JsonErrorResponse error) throws Exception { + return error.getErrorCode().equals("MalformedPolicyDocumentException"); + } + + @Override + public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception { + + MalformedPolicyDocumentException e = (MalformedPolicyDocumentException) super + .unmarshall(error); + e.setErrorCode("MalformedPolicyDocumentException"); + + return e; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectPolicyJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectPolicyJsonMarshaller.java new file mode 100644 index 0000000000..6b69c8248e --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectPolicyJsonMarshaller.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010-2022 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.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO ProjectPolicy + */ +class ProjectPolicyJsonMarshaller { + + public void marshall(ProjectPolicy projectPolicy, AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (projectPolicy.getProjectArn() != null) { + String projectArn = projectPolicy.getProjectArn(); + jsonWriter.name("ProjectArn"); + jsonWriter.value(projectArn); + } + if (projectPolicy.getPolicyName() != null) { + String policyName = projectPolicy.getPolicyName(); + jsonWriter.name("PolicyName"); + jsonWriter.value(policyName); + } + if (projectPolicy.getPolicyRevisionId() != null) { + String policyRevisionId = projectPolicy.getPolicyRevisionId(); + jsonWriter.name("PolicyRevisionId"); + jsonWriter.value(policyRevisionId); + } + if (projectPolicy.getPolicyDocument() != null) { + String policyDocument = projectPolicy.getPolicyDocument(); + jsonWriter.name("PolicyDocument"); + jsonWriter.value(policyDocument); + } + if (projectPolicy.getCreationTimestamp() != null) { + java.util.Date creationTimestamp = projectPolicy.getCreationTimestamp(); + jsonWriter.name("CreationTimestamp"); + jsonWriter.value(creationTimestamp); + } + if (projectPolicy.getLastUpdatedTimestamp() != null) { + java.util.Date lastUpdatedTimestamp = projectPolicy.getLastUpdatedTimestamp(); + jsonWriter.name("LastUpdatedTimestamp"); + jsonWriter.value(lastUpdatedTimestamp); + } + jsonWriter.endObject(); + } + + private static ProjectPolicyJsonMarshaller instance; + + public static ProjectPolicyJsonMarshaller getInstance() { + if (instance == null) + instance = new ProjectPolicyJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectPolicyJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectPolicyJsonUnmarshaller.java new file mode 100644 index 0000000000..02038e70e8 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectPolicyJsonUnmarshaller.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010-2022 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.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO ProjectPolicy + */ +class ProjectPolicyJsonUnmarshaller implements Unmarshaller { + + public ProjectPolicy unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + ProjectPolicy projectPolicy = new ProjectPolicy(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("ProjectArn")) { + projectPolicy.setProjectArn(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("PolicyName")) { + projectPolicy.setPolicyName(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("PolicyRevisionId")) { + projectPolicy.setPolicyRevisionId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("PolicyDocument")) { + projectPolicy.setPolicyDocument(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("CreationTimestamp")) { + projectPolicy.setCreationTimestamp(DateJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("LastUpdatedTimestamp")) { + projectPolicy.setLastUpdatedTimestamp(DateJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return projectPolicy; + } + + private static ProjectPolicyJsonUnmarshaller instance; + + public static ProjectPolicyJsonUnmarshaller getInstance() { + if (instance == null) + instance = new ProjectPolicyJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectVersionDescriptionJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectVersionDescriptionJsonMarshaller.java index 5660647932..bcb272a24c 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectVersionDescriptionJsonMarshaller.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectVersionDescriptionJsonMarshaller.java @@ -100,6 +100,11 @@ public void marshall(ProjectVersionDescription projectVersionDescription, jsonWriter.name("MaxInferenceUnits"); jsonWriter.value(maxInferenceUnits); } + if (projectVersionDescription.getSourceProjectVersionArn() != null) { + String sourceProjectVersionArn = projectVersionDescription.getSourceProjectVersionArn(); + jsonWriter.name("SourceProjectVersionArn"); + jsonWriter.value(sourceProjectVersionArn); + } jsonWriter.endObject(); } diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectVersionDescriptionJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectVersionDescriptionJsonUnmarshaller.java index 737aa1377e..c2c599a465 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectVersionDescriptionJsonUnmarshaller.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ProjectVersionDescriptionJsonUnmarshaller.java @@ -87,6 +87,10 @@ public ProjectVersionDescription unmarshall(JsonUnmarshallerContext context) thr projectVersionDescription.setMaxInferenceUnits(IntegerJsonUnmarshaller .getInstance() .unmarshall(context)); + } else if (name.equals("SourceProjectVersionArn")) { + projectVersionDescription.setSourceProjectVersionArn(StringJsonUnmarshaller + .getInstance() + .unmarshall(context)); } else { reader.skipValue(); } diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/PutProjectPolicyRequestMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/PutProjectPolicyRequestMarshaller.java new file mode 100644 index 0000000000..6c014fb84a --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/PutProjectPolicyRequestMarshaller.java @@ -0,0 +1,102 @@ +/* + * Copyright 2010-2022 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.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for PutProjectPolicyRequest + */ +public class PutProjectPolicyRequestMarshaller implements + Marshaller, PutProjectPolicyRequest> { + + public Request marshall(PutProjectPolicyRequest putProjectPolicyRequest) { + if (putProjectPolicyRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(PutProjectPolicyRequest)"); + } + + Request request = new DefaultRequest( + putProjectPolicyRequest, "AmazonRekognition"); + String target = "RekognitionService.PutProjectPolicy"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (putProjectPolicyRequest.getProjectArn() != null) { + String projectArn = putProjectPolicyRequest.getProjectArn(); + jsonWriter.name("ProjectArn"); + jsonWriter.value(projectArn); + } + if (putProjectPolicyRequest.getPolicyName() != null) { + String policyName = putProjectPolicyRequest.getPolicyName(); + jsonWriter.name("PolicyName"); + jsonWriter.value(policyName); + } + if (putProjectPolicyRequest.getPolicyRevisionId() != null) { + String policyRevisionId = putProjectPolicyRequest.getPolicyRevisionId(); + jsonWriter.name("PolicyRevisionId"); + jsonWriter.value(policyRevisionId); + } + if (putProjectPolicyRequest.getPolicyDocument() != null) { + String policyDocument = putProjectPolicyRequest.getPolicyDocument(); + jsonWriter.name("PolicyDocument"); + jsonWriter.value(policyDocument); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/PutProjectPolicyResultJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/PutProjectPolicyResultJsonUnmarshaller.java new file mode 100644 index 0000000000..e895996fd8 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/PutProjectPolicyResultJsonUnmarshaller.java @@ -0,0 +1,55 @@ +/* + * Copyright 2010-2022 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.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response PutProjectPolicyResult + */ +public class PutProjectPolicyResultJsonUnmarshaller implements + Unmarshaller { + + public PutProjectPolicyResult unmarshall(JsonUnmarshallerContext context) throws Exception { + PutProjectPolicyResult putProjectPolicyResult = new PutProjectPolicyResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("PolicyRevisionId")) { + putProjectPolicyResult.setPolicyRevisionId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return putProjectPolicyResult; + } + + private static PutProjectPolicyResultJsonUnmarshaller instance; + + public static PutProjectPolicyResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new PutProjectPolicyResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/package-info.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/package-info.java index 3d8598d550..ad4a72d792 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/package-info.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/package-info.java @@ -1,5 +1,5 @@ /** - *

    This is the API Reference for Amazon Rekognition Image, Amazon Rekognition Custom Labels, Amazon Rekognition Stored Video, Amazon Rekognition Streaming Video. It provides descriptions of actions, data types, common parameters, and common errors.

    Amazon Rekognition Image

    Amazon Rekognition Custom Labels

    Amazon Rekognition Video Stored Video

    Amazon Rekognition Video Streaming Video

    + *

    This is the API Reference for Amazon Rekognition Image, Amazon Rekognition Custom Labels, Amazon Rekognition Stored Video, Amazon Rekognition Streaming Video. It provides descriptions of actions, data types, common parameters, and common errors.

    Amazon Rekognition Image

    Amazon Rekognition Custom Labels

    Amazon Rekognition Video Stored Video

    Amazon Rekognition Video Streaming Video

    */ package com.amazonaws.services.rekognition; From f94bed12403c350058e78febdfe3f215cc391d17 Mon Sep 17 00:00:00 2001 From: AWS Mobile SDK Bot <46607340+awsmobilesdk@users.noreply.github.com> Date: Fri, 19 Aug 2022 15:41:23 -0400 Subject: [PATCH 2/3] feat(aws-android-sdk-lambda): update models to latest (#2982) Co-authored-by: Tyler Roach --- .../main/java/com/amazonaws/services/lambda/AWSLambda.java | 5 ++++- .../java/com/amazonaws/services/lambda/AWSLambdaClient.java | 5 ++++- .../com/amazonaws/services/lambda/model/InvokeRequest.java | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/AWSLambda.java b/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/AWSLambda.java index 2c5b7b0576..7a279f546a 100644 --- a/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/AWSLambda.java +++ b/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/AWSLambda.java @@ -252,7 +252,10 @@ public interface AWSLambda { *

    * This operation requires permission for the lambda:InvokeFunction action. + * >lambda:InvokeFunction action. For details on how to set up + * permissions for cross-account invocations, see Granting function access to other accounts. *

    * * @param invokeRequest diff --git a/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/AWSLambdaClient.java b/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/AWSLambdaClient.java index b460190810..97fc5ef557 100644 --- a/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/AWSLambdaClient.java +++ b/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/AWSLambdaClient.java @@ -535,7 +535,10 @@ private static ClientConfiguration adjustClientConfiguration(ClientConfiguration *

    * This operation requires permission for the lambda:InvokeFunction action. + * >lambda:InvokeFunction action. For details on how to set up + * permissions for cross-account invocations, see Granting function access to other accounts. *

    * * @param invokeRequest diff --git a/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/model/InvokeRequest.java b/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/model/InvokeRequest.java index 37de8708db..e2ccdfeff9 100644 --- a/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/model/InvokeRequest.java +++ b/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/model/InvokeRequest.java @@ -76,7 +76,10 @@ *

    * This operation requires permission for the lambda:InvokeFunction action. + * >lambda:InvokeFunction action. For details on how to set up permissions + * for cross-account invocations, see Granting function access to other accounts. *

    */ public class InvokeRequest extends AmazonWebServiceRequest implements Serializable { From 157fd45b0949df083c2d844f1a4c05ecffbc047f Mon Sep 17 00:00:00 2001 From: AWS Mobile SDK Bot <46607340+awsmobilesdk@users.noreply.github.com> Date: Fri, 19 Aug 2022 15:54:42 -0400 Subject: [PATCH 3/3] feat(aws-android-sdk-cognitoidentityprovider): update models to latest (#2984) Co-authored-by: Tyler Roach --- .../model/AuthEventType.java | 30 +++++++++++-------- .../model/EventResponseType.java | 10 ++++--- .../model/EventType.java | 6 +++- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/model/AuthEventType.java b/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/model/AuthEventType.java index 5e539f3843..079dd52d5a 100644 --- a/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/model/AuthEventType.java +++ b/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/model/AuthEventType.java @@ -36,7 +36,8 @@ public class AuthEventType implements Serializable { *

    *

    * Constraints:
    - * Allowed Values: SignIn, SignUp, ForgotPassword + * Allowed Values: SignIn, SignUp, ForgotPassword, PasswordChange, + * ResendCode */ private String eventType; @@ -53,7 +54,7 @@ public class AuthEventType implements Serializable { *

    *

    * Constraints:
    - * Allowed Values: Success, Failure + * Allowed Values: Pass, Fail, InProgress */ private String eventResponse; @@ -139,7 +140,8 @@ public AuthEventType withEventId(String eventId) { *

    *

    * Constraints:
    - * Allowed Values: SignIn, SignUp, ForgotPassword + * Allowed Values: SignIn, SignUp, ForgotPassword, PasswordChange, + * ResendCode * * @return

    * The event type. @@ -156,7 +158,8 @@ public String getEventType() { *

    *

    * Constraints:
    - * Allowed Values: SignIn, SignUp, ForgotPassword + * Allowed Values: SignIn, SignUp, ForgotPassword, PasswordChange, + * ResendCode * * @param eventType

    * The event type. @@ -176,7 +179,8 @@ public void setEventType(String eventType) { * together. *

    * Constraints:
    - * Allowed Values: SignIn, SignUp, ForgotPassword + * Allowed Values: SignIn, SignUp, ForgotPassword, PasswordChange, + * ResendCode * * @param eventType

    * The event type. @@ -196,7 +200,8 @@ public AuthEventType withEventType(String eventType) { *

    *

    * Constraints:
    - * Allowed Values: SignIn, SignUp, ForgotPassword + * Allowed Values: SignIn, SignUp, ForgotPassword, PasswordChange, + * ResendCode * * @param eventType

    * The event type. @@ -216,7 +221,8 @@ public void setEventType(EventType eventType) { * together. *

    * Constraints:
    - * Allowed Values: SignIn, SignUp, ForgotPassword + * Allowed Values: SignIn, SignUp, ForgotPassword, PasswordChange, + * ResendCode * * @param eventType

    * The event type. @@ -281,7 +287,7 @@ public AuthEventType withCreationDate(java.util.Date creationDate) { *

    *

    * Constraints:
    - * Allowed Values: Success, Failure + * Allowed Values: Pass, Fail, InProgress * * @return

    * The event response. @@ -298,7 +304,7 @@ public String getEventResponse() { *

    *

    * Constraints:
    - * Allowed Values: Success, Failure + * Allowed Values: Pass, Fail, InProgress * * @param eventResponse

    * The event response. @@ -318,7 +324,7 @@ public void setEventResponse(String eventResponse) { * together. *

    * Constraints:
    - * Allowed Values: Success, Failure + * Allowed Values: Pass, Fail, InProgress * * @param eventResponse

    * The event response. @@ -338,7 +344,7 @@ public AuthEventType withEventResponse(String eventResponse) { *

    *

    * Constraints:
    - * Allowed Values: Success, Failure + * Allowed Values: Pass, Fail, InProgress * * @param eventResponse

    * The event response. @@ -358,7 +364,7 @@ public void setEventResponse(EventResponseType eventResponse) { * together. *

    * Constraints:
    - * Allowed Values: Success, Failure + * Allowed Values: Pass, Fail, InProgress * * @param eventResponse

    * The event response. diff --git a/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/model/EventResponseType.java b/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/model/EventResponseType.java index 3f14d591c4..0a791477e7 100644 --- a/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/model/EventResponseType.java +++ b/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/model/EventResponseType.java @@ -23,8 +23,9 @@ */ public enum EventResponseType { - Success("Success"), - Failure("Failure"); + Pass("Pass"), + Fail("Fail"), + InProgress("InProgress"); private String value; @@ -40,8 +41,9 @@ public String toString() { private static final Map enumMap; static { enumMap = new HashMap(); - enumMap.put("Success", Success); - enumMap.put("Failure", Failure); + enumMap.put("Pass", Pass); + enumMap.put("Fail", Fail); + enumMap.put("InProgress", InProgress); } /** diff --git a/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/model/EventType.java b/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/model/EventType.java index 340492b813..086958dfc2 100644 --- a/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/model/EventType.java +++ b/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/model/EventType.java @@ -25,7 +25,9 @@ public enum EventType { SignIn("SignIn"), SignUp("SignUp"), - ForgotPassword("ForgotPassword"); + ForgotPassword("ForgotPassword"), + PasswordChange("PasswordChange"), + ResendCode("ResendCode"); private String value; @@ -44,6 +46,8 @@ public String toString() { enumMap.put("SignIn", SignIn); enumMap.put("SignUp", SignUp); enumMap.put("ForgotPassword", ForgotPassword); + enumMap.put("PasswordChange", PasswordChange); + enumMap.put("ResendCode", ResendCode); } /**