/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.rekognition.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *

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

*

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

*/ 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; } }