/* * Copyright 2018-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.accessanalyzer.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Contains the generated policy details. *

* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GeneratedPolicyProperties implements Serializable, Cloneable, StructuredPojo { /** *

* This value is set to true if the generated policy contains all possible actions for a service that * IAM Access Analyzer identified from the CloudTrail trail that you specified, and false otherwise. *

*/ private Boolean isComplete; /** *

* The ARN of the IAM entity (user or role) for which you are generating a policy. *

*/ private String principalArn; /** *

* Lists details about the Trail used to generated policy. *

*/ private CloudTrailProperties cloudTrailProperties; /** *

* This value is set to true if the generated policy contains all possible actions for a service that * IAM Access Analyzer identified from the CloudTrail trail that you specified, and false otherwise. *

* * @param isComplete * This value is set to true if the generated policy contains all possible actions for a service * that IAM Access Analyzer identified from the CloudTrail trail that you specified, and false * otherwise. */ public void setIsComplete(Boolean isComplete) { this.isComplete = isComplete; } /** *

* This value is set to true if the generated policy contains all possible actions for a service that * IAM Access Analyzer identified from the CloudTrail trail that you specified, and false otherwise. *

* * @return This value is set to true if the generated policy contains all possible actions for a * service that IAM Access Analyzer identified from the CloudTrail trail that you specified, and * false otherwise. */ public Boolean getIsComplete() { return this.isComplete; } /** *

* This value is set to true if the generated policy contains all possible actions for a service that * IAM Access Analyzer identified from the CloudTrail trail that you specified, and false otherwise. *

* * @param isComplete * This value is set to true if the generated policy contains all possible actions for a service * that IAM Access Analyzer identified from the CloudTrail trail that you specified, and false * otherwise. * @return Returns a reference to this object so that method calls can be chained together. */ public GeneratedPolicyProperties withIsComplete(Boolean isComplete) { setIsComplete(isComplete); return this; } /** *

* This value is set to true if the generated policy contains all possible actions for a service that * IAM Access Analyzer identified from the CloudTrail trail that you specified, and false otherwise. *

* * @return This value is set to true if the generated policy contains all possible actions for a * service that IAM Access Analyzer identified from the CloudTrail trail that you specified, and * false otherwise. */ public Boolean isComplete() { return this.isComplete; } /** *

* The ARN of the IAM entity (user or role) for which you are generating a policy. *

* * @param principalArn * The ARN of the IAM entity (user or role) for which you are generating a policy. */ public void setPrincipalArn(String principalArn) { this.principalArn = principalArn; } /** *

* The ARN of the IAM entity (user or role) for which you are generating a policy. *

* * @return The ARN of the IAM entity (user or role) for which you are generating a policy. */ public String getPrincipalArn() { return this.principalArn; } /** *

* The ARN of the IAM entity (user or role) for which you are generating a policy. *

* * @param principalArn * The ARN of the IAM entity (user or role) for which you are generating a policy. * @return Returns a reference to this object so that method calls can be chained together. */ public GeneratedPolicyProperties withPrincipalArn(String principalArn) { setPrincipalArn(principalArn); return this; } /** *

* Lists details about the Trail used to generated policy. *

* * @param cloudTrailProperties * Lists details about the Trail used to generated policy. */ public void setCloudTrailProperties(CloudTrailProperties cloudTrailProperties) { this.cloudTrailProperties = cloudTrailProperties; } /** *

* Lists details about the Trail used to generated policy. *

* * @return Lists details about the Trail used to generated policy. */ public CloudTrailProperties getCloudTrailProperties() { return this.cloudTrailProperties; } /** *

* Lists details about the Trail used to generated policy. *

* * @param cloudTrailProperties * Lists details about the Trail used to generated policy. * @return Returns a reference to this object so that method calls can be chained together. */ public GeneratedPolicyProperties withCloudTrailProperties(CloudTrailProperties cloudTrailProperties) { setCloudTrailProperties(cloudTrailProperties); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getIsComplete() != null) sb.append("IsComplete: ").append(getIsComplete()).append(","); if (getPrincipalArn() != null) sb.append("PrincipalArn: ").append(getPrincipalArn()).append(","); if (getCloudTrailProperties() != null) sb.append("CloudTrailProperties: ").append(getCloudTrailProperties()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GeneratedPolicyProperties == false) return false; GeneratedPolicyProperties other = (GeneratedPolicyProperties) obj; if (other.getIsComplete() == null ^ this.getIsComplete() == null) return false; if (other.getIsComplete() != null && other.getIsComplete().equals(this.getIsComplete()) == false) return false; if (other.getPrincipalArn() == null ^ this.getPrincipalArn() == null) return false; if (other.getPrincipalArn() != null && other.getPrincipalArn().equals(this.getPrincipalArn()) == false) return false; if (other.getCloudTrailProperties() == null ^ this.getCloudTrailProperties() == null) return false; if (other.getCloudTrailProperties() != null && other.getCloudTrailProperties().equals(this.getCloudTrailProperties()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getIsComplete() == null) ? 0 : getIsComplete().hashCode()); hashCode = prime * hashCode + ((getPrincipalArn() == null) ? 0 : getPrincipalArn().hashCode()); hashCode = prime * hashCode + ((getCloudTrailProperties() == null) ? 0 : getCloudTrailProperties().hashCode()); return hashCode; } @Override public GeneratedPolicyProperties clone() { try { return (GeneratedPolicyProperties) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.accessanalyzer.model.transform.GeneratedPolicyPropertiesMarshaller.getInstance().marshall(this, protocolMarshaller); } }