com.amazonaws.services.securityhub.model.AwsIamPolicyDetails Maven / Gradle / Ivy
Show all versions of aws-java-sdk-securityhub Show documentation
/*
* 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.securityhub.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Represents an IAM permissions policy.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AwsIamPolicyDetails implements Serializable, Cloneable, StructuredPojo {
/**
*
* The number of users, groups, and roles that the policy is attached to.
*
*/
private Integer attachmentCount;
/**
*
* When the policy was created.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces, and date and time should be
* separated by T
. For example, 2020-03-22T13:22:13.933Z
.
*
*/
private String createDate;
/**
*
* The identifier of the default version of the policy.
*
*/
private String defaultVersionId;
/**
*
* A description of the policy.
*
*/
private String description;
/**
*
* Whether the policy can be attached to a user, group, or role.
*
*/
private Boolean isAttachable;
/**
*
* The path to the policy.
*
*/
private String path;
/**
*
* The number of users and roles that use the policy to set the permissions boundary.
*
*/
private Integer permissionsBoundaryUsageCount;
/**
*
* The unique identifier of the policy.
*
*/
private String policyId;
/**
*
* The name of the policy.
*
*/
private String policyName;
/**
*
* List of versions of the policy.
*
*/
private java.util.List policyVersionList;
/**
*
* When the policy was most recently updated.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces, and date and time should be
* separated by T
. For example, 2020-03-22T13:22:13.933Z
.
*
*/
private String updateDate;
/**
*
* The number of users, groups, and roles that the policy is attached to.
*
*
* @param attachmentCount
* The number of users, groups, and roles that the policy is attached to.
*/
public void setAttachmentCount(Integer attachmentCount) {
this.attachmentCount = attachmentCount;
}
/**
*
* The number of users, groups, and roles that the policy is attached to.
*
*
* @return The number of users, groups, and roles that the policy is attached to.
*/
public Integer getAttachmentCount() {
return this.attachmentCount;
}
/**
*
* The number of users, groups, and roles that the policy is attached to.
*
*
* @param attachmentCount
* The number of users, groups, and roles that the policy is attached to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamPolicyDetails withAttachmentCount(Integer attachmentCount) {
setAttachmentCount(attachmentCount);
return this;
}
/**
*
* When the policy was created.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces, and date and time should be
* separated by T
. For example, 2020-03-22T13:22:13.933Z
.
*
*
* @param createDate
* When the policy was created.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces, and date and time should be separated by T
. For
* example, 2020-03-22T13:22:13.933Z
.
*/
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
/**
*
* When the policy was created.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces, and date and time should be
* separated by T
. For example, 2020-03-22T13:22:13.933Z
.
*
*
* @return When the policy was created.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces, and date and time should be separated by T
. For
* example, 2020-03-22T13:22:13.933Z
.
*/
public String getCreateDate() {
return this.createDate;
}
/**
*
* When the policy was created.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces, and date and time should be
* separated by T
. For example, 2020-03-22T13:22:13.933Z
.
*
*
* @param createDate
* When the policy was created.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces, and date and time should be separated by T
. For
* example, 2020-03-22T13:22:13.933Z
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamPolicyDetails withCreateDate(String createDate) {
setCreateDate(createDate);
return this;
}
/**
*
* The identifier of the default version of the policy.
*
*
* @param defaultVersionId
* The identifier of the default version of the policy.
*/
public void setDefaultVersionId(String defaultVersionId) {
this.defaultVersionId = defaultVersionId;
}
/**
*
* The identifier of the default version of the policy.
*
*
* @return The identifier of the default version of the policy.
*/
public String getDefaultVersionId() {
return this.defaultVersionId;
}
/**
*
* The identifier of the default version of the policy.
*
*
* @param defaultVersionId
* The identifier of the default version of the policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamPolicyDetails withDefaultVersionId(String defaultVersionId) {
setDefaultVersionId(defaultVersionId);
return this;
}
/**
*
* A description of the policy.
*
*
* @param description
* A description of the policy.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* A description of the policy.
*
*
* @return A description of the policy.
*/
public String getDescription() {
return this.description;
}
/**
*
* A description of the policy.
*
*
* @param description
* A description of the policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamPolicyDetails withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* Whether the policy can be attached to a user, group, or role.
*
*
* @param isAttachable
* Whether the policy can be attached to a user, group, or role.
*/
public void setIsAttachable(Boolean isAttachable) {
this.isAttachable = isAttachable;
}
/**
*
* Whether the policy can be attached to a user, group, or role.
*
*
* @return Whether the policy can be attached to a user, group, or role.
*/
public Boolean getIsAttachable() {
return this.isAttachable;
}
/**
*
* Whether the policy can be attached to a user, group, or role.
*
*
* @param isAttachable
* Whether the policy can be attached to a user, group, or role.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamPolicyDetails withIsAttachable(Boolean isAttachable) {
setIsAttachable(isAttachable);
return this;
}
/**
*
* Whether the policy can be attached to a user, group, or role.
*
*
* @return Whether the policy can be attached to a user, group, or role.
*/
public Boolean isAttachable() {
return this.isAttachable;
}
/**
*
* The path to the policy.
*
*
* @param path
* The path to the policy.
*/
public void setPath(String path) {
this.path = path;
}
/**
*
* The path to the policy.
*
*
* @return The path to the policy.
*/
public String getPath() {
return this.path;
}
/**
*
* The path to the policy.
*
*
* @param path
* The path to the policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamPolicyDetails withPath(String path) {
setPath(path);
return this;
}
/**
*
* The number of users and roles that use the policy to set the permissions boundary.
*
*
* @param permissionsBoundaryUsageCount
* The number of users and roles that use the policy to set the permissions boundary.
*/
public void setPermissionsBoundaryUsageCount(Integer permissionsBoundaryUsageCount) {
this.permissionsBoundaryUsageCount = permissionsBoundaryUsageCount;
}
/**
*
* The number of users and roles that use the policy to set the permissions boundary.
*
*
* @return The number of users and roles that use the policy to set the permissions boundary.
*/
public Integer getPermissionsBoundaryUsageCount() {
return this.permissionsBoundaryUsageCount;
}
/**
*
* The number of users and roles that use the policy to set the permissions boundary.
*
*
* @param permissionsBoundaryUsageCount
* The number of users and roles that use the policy to set the permissions boundary.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamPolicyDetails withPermissionsBoundaryUsageCount(Integer permissionsBoundaryUsageCount) {
setPermissionsBoundaryUsageCount(permissionsBoundaryUsageCount);
return this;
}
/**
*
* The unique identifier of the policy.
*
*
* @param policyId
* The unique identifier of the policy.
*/
public void setPolicyId(String policyId) {
this.policyId = policyId;
}
/**
*
* The unique identifier of the policy.
*
*
* @return The unique identifier of the policy.
*/
public String getPolicyId() {
return this.policyId;
}
/**
*
* The unique identifier of the policy.
*
*
* @param policyId
* The unique identifier of the policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamPolicyDetails withPolicyId(String policyId) {
setPolicyId(policyId);
return this;
}
/**
*
* The name of the policy.
*
*
* @param policyName
* The name of the policy.
*/
public void setPolicyName(String policyName) {
this.policyName = policyName;
}
/**
*
* The name of the policy.
*
*
* @return The name of the policy.
*/
public String getPolicyName() {
return this.policyName;
}
/**
*
* The name of the policy.
*
*
* @param policyName
* The name of the policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamPolicyDetails withPolicyName(String policyName) {
setPolicyName(policyName);
return this;
}
/**
*
* List of versions of the policy.
*
*
* @return List of versions of the policy.
*/
public java.util.List getPolicyVersionList() {
return policyVersionList;
}
/**
*
* List of versions of the policy.
*
*
* @param policyVersionList
* List of versions of the policy.
*/
public void setPolicyVersionList(java.util.Collection policyVersionList) {
if (policyVersionList == null) {
this.policyVersionList = null;
return;
}
this.policyVersionList = new java.util.ArrayList(policyVersionList);
}
/**
*
* List of versions of the policy.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPolicyVersionList(java.util.Collection)} or {@link #withPolicyVersionList(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param policyVersionList
* List of versions of the policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamPolicyDetails withPolicyVersionList(AwsIamPolicyVersion... policyVersionList) {
if (this.policyVersionList == null) {
setPolicyVersionList(new java.util.ArrayList(policyVersionList.length));
}
for (AwsIamPolicyVersion ele : policyVersionList) {
this.policyVersionList.add(ele);
}
return this;
}
/**
*
* List of versions of the policy.
*
*
* @param policyVersionList
* List of versions of the policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamPolicyDetails withPolicyVersionList(java.util.Collection policyVersionList) {
setPolicyVersionList(policyVersionList);
return this;
}
/**
*
* When the policy was most recently updated.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces, and date and time should be
* separated by T
. For example, 2020-03-22T13:22:13.933Z
.
*
*
* @param updateDate
* When the policy was most recently updated.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces, and date and time should be separated by T
. For
* example, 2020-03-22T13:22:13.933Z
.
*/
public void setUpdateDate(String updateDate) {
this.updateDate = updateDate;
}
/**
*
* When the policy was most recently updated.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces, and date and time should be
* separated by T
. For example, 2020-03-22T13:22:13.933Z
.
*
*
* @return When the policy was most recently updated.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces, and date and time should be separated by T
. For
* example, 2020-03-22T13:22:13.933Z
.
*/
public String getUpdateDate() {
return this.updateDate;
}
/**
*
* When the policy was most recently updated.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces, and date and time should be
* separated by T
. For example, 2020-03-22T13:22:13.933Z
.
*
*
* @param updateDate
* When the policy was most recently updated.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces, and date and time should be separated by T
. For
* example, 2020-03-22T13:22:13.933Z
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamPolicyDetails withUpdateDate(String updateDate) {
setUpdateDate(updateDate);
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 (getAttachmentCount() != null)
sb.append("AttachmentCount: ").append(getAttachmentCount()).append(",");
if (getCreateDate() != null)
sb.append("CreateDate: ").append(getCreateDate()).append(",");
if (getDefaultVersionId() != null)
sb.append("DefaultVersionId: ").append(getDefaultVersionId()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getIsAttachable() != null)
sb.append("IsAttachable: ").append(getIsAttachable()).append(",");
if (getPath() != null)
sb.append("Path: ").append(getPath()).append(",");
if (getPermissionsBoundaryUsageCount() != null)
sb.append("PermissionsBoundaryUsageCount: ").append(getPermissionsBoundaryUsageCount()).append(",");
if (getPolicyId() != null)
sb.append("PolicyId: ").append(getPolicyId()).append(",");
if (getPolicyName() != null)
sb.append("PolicyName: ").append(getPolicyName()).append(",");
if (getPolicyVersionList() != null)
sb.append("PolicyVersionList: ").append(getPolicyVersionList()).append(",");
if (getUpdateDate() != null)
sb.append("UpdateDate: ").append(getUpdateDate());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AwsIamPolicyDetails == false)
return false;
AwsIamPolicyDetails other = (AwsIamPolicyDetails) obj;
if (other.getAttachmentCount() == null ^ this.getAttachmentCount() == null)
return false;
if (other.getAttachmentCount() != null && other.getAttachmentCount().equals(this.getAttachmentCount()) == false)
return false;
if (other.getCreateDate() == null ^ this.getCreateDate() == null)
return false;
if (other.getCreateDate() != null && other.getCreateDate().equals(this.getCreateDate()) == false)
return false;
if (other.getDefaultVersionId() == null ^ this.getDefaultVersionId() == null)
return false;
if (other.getDefaultVersionId() != null && other.getDefaultVersionId().equals(this.getDefaultVersionId()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getIsAttachable() == null ^ this.getIsAttachable() == null)
return false;
if (other.getIsAttachable() != null && other.getIsAttachable().equals(this.getIsAttachable()) == false)
return false;
if (other.getPath() == null ^ this.getPath() == null)
return false;
if (other.getPath() != null && other.getPath().equals(this.getPath()) == false)
return false;
if (other.getPermissionsBoundaryUsageCount() == null ^ this.getPermissionsBoundaryUsageCount() == null)
return false;
if (other.getPermissionsBoundaryUsageCount() != null
&& other.getPermissionsBoundaryUsageCount().equals(this.getPermissionsBoundaryUsageCount()) == false)
return false;
if (other.getPolicyId() == null ^ this.getPolicyId() == null)
return false;
if (other.getPolicyId() != null && other.getPolicyId().equals(this.getPolicyId()) == 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.getPolicyVersionList() == null ^ this.getPolicyVersionList() == null)
return false;
if (other.getPolicyVersionList() != null && other.getPolicyVersionList().equals(this.getPolicyVersionList()) == false)
return false;
if (other.getUpdateDate() == null ^ this.getUpdateDate() == null)
return false;
if (other.getUpdateDate() != null && other.getUpdateDate().equals(this.getUpdateDate()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAttachmentCount() == null) ? 0 : getAttachmentCount().hashCode());
hashCode = prime * hashCode + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
hashCode = prime * hashCode + ((getDefaultVersionId() == null) ? 0 : getDefaultVersionId().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getIsAttachable() == null) ? 0 : getIsAttachable().hashCode());
hashCode = prime * hashCode + ((getPath() == null) ? 0 : getPath().hashCode());
hashCode = prime * hashCode + ((getPermissionsBoundaryUsageCount() == null) ? 0 : getPermissionsBoundaryUsageCount().hashCode());
hashCode = prime * hashCode + ((getPolicyId() == null) ? 0 : getPolicyId().hashCode());
hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode());
hashCode = prime * hashCode + ((getPolicyVersionList() == null) ? 0 : getPolicyVersionList().hashCode());
hashCode = prime * hashCode + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode());
return hashCode;
}
@Override
public AwsIamPolicyDetails clone() {
try {
return (AwsIamPolicyDetails) 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.securityhub.model.transform.AwsIamPolicyDetailsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}