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

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