com.amazonaws.services.securityhub.model.ConfigurationPolicyAssociationSummary Maven / Gradle / Ivy
Show all versions of aws-java-sdk-securityhub Show documentation
/*
* Copyright 2019-2024 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;
/**
*
* An object that contains the details of a configuration policy association that’s returned in a
* ListConfigurationPolicyAssociations
request.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ConfigurationPolicyAssociationSummary implements Serializable, Cloneable, StructuredPojo {
/**
*
* The universally unique identifier (UUID) of the configuration policy.
*
*/
private String configurationPolicyId;
/**
*
* The identifier of the target account, organizational unit, or the root.
*
*/
private String targetId;
/**
*
* Specifies whether the target is an Amazon Web Services account, organizational unit, or the root.
*
*/
private String targetType;
/**
*
* Indicates whether the association between the specified target and the configuration was directly applied by the
* Security Hub delegated administrator or inherited from a parent.
*
*/
private String associationType;
/**
*
* The date and time, in UTC and ISO 8601 format, that the configuration policy association was last updated.
*
*/
private java.util.Date updatedAt;
/**
*
* The current status of the association between the specified target and the configuration.
*
*/
private String associationStatus;
/**
*
* The explanation for a FAILED
value for AssociationStatus
.
*
*/
private String associationStatusMessage;
/**
*
* The universally unique identifier (UUID) of the configuration policy.
*
*
* @param configurationPolicyId
* The universally unique identifier (UUID) of the configuration policy.
*/
public void setConfigurationPolicyId(String configurationPolicyId) {
this.configurationPolicyId = configurationPolicyId;
}
/**
*
* The universally unique identifier (UUID) of the configuration policy.
*
*
* @return The universally unique identifier (UUID) of the configuration policy.
*/
public String getConfigurationPolicyId() {
return this.configurationPolicyId;
}
/**
*
* The universally unique identifier (UUID) of the configuration policy.
*
*
* @param configurationPolicyId
* The universally unique identifier (UUID) of the configuration policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigurationPolicyAssociationSummary withConfigurationPolicyId(String configurationPolicyId) {
setConfigurationPolicyId(configurationPolicyId);
return this;
}
/**
*
* The identifier of the target account, organizational unit, or the root.
*
*
* @param targetId
* The identifier of the target account, organizational unit, or the root.
*/
public void setTargetId(String targetId) {
this.targetId = targetId;
}
/**
*
* The identifier of the target account, organizational unit, or the root.
*
*
* @return The identifier of the target account, organizational unit, or the root.
*/
public String getTargetId() {
return this.targetId;
}
/**
*
* The identifier of the target account, organizational unit, or the root.
*
*
* @param targetId
* The identifier of the target account, organizational unit, or the root.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigurationPolicyAssociationSummary withTargetId(String targetId) {
setTargetId(targetId);
return this;
}
/**
*
* Specifies whether the target is an Amazon Web Services account, organizational unit, or the root.
*
*
* @param targetType
* Specifies whether the target is an Amazon Web Services account, organizational unit, or the root.
* @see TargetType
*/
public void setTargetType(String targetType) {
this.targetType = targetType;
}
/**
*
* Specifies whether the target is an Amazon Web Services account, organizational unit, or the root.
*
*
* @return Specifies whether the target is an Amazon Web Services account, organizational unit, or the root.
* @see TargetType
*/
public String getTargetType() {
return this.targetType;
}
/**
*
* Specifies whether the target is an Amazon Web Services account, organizational unit, or the root.
*
*
* @param targetType
* Specifies whether the target is an Amazon Web Services account, organizational unit, or the root.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TargetType
*/
public ConfigurationPolicyAssociationSummary withTargetType(String targetType) {
setTargetType(targetType);
return this;
}
/**
*
* Specifies whether the target is an Amazon Web Services account, organizational unit, or the root.
*
*
* @param targetType
* Specifies whether the target is an Amazon Web Services account, organizational unit, or the root.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TargetType
*/
public ConfigurationPolicyAssociationSummary withTargetType(TargetType targetType) {
this.targetType = targetType.toString();
return this;
}
/**
*
* Indicates whether the association between the specified target and the configuration was directly applied by the
* Security Hub delegated administrator or inherited from a parent.
*
*
* @param associationType
* Indicates whether the association between the specified target and the configuration was directly applied
* by the Security Hub delegated administrator or inherited from a parent.
* @see AssociationType
*/
public void setAssociationType(String associationType) {
this.associationType = associationType;
}
/**
*
* Indicates whether the association between the specified target and the configuration was directly applied by the
* Security Hub delegated administrator or inherited from a parent.
*
*
* @return Indicates whether the association between the specified target and the configuration was directly applied
* by the Security Hub delegated administrator or inherited from a parent.
* @see AssociationType
*/
public String getAssociationType() {
return this.associationType;
}
/**
*
* Indicates whether the association between the specified target and the configuration was directly applied by the
* Security Hub delegated administrator or inherited from a parent.
*
*
* @param associationType
* Indicates whether the association between the specified target and the configuration was directly applied
* by the Security Hub delegated administrator or inherited from a parent.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AssociationType
*/
public ConfigurationPolicyAssociationSummary withAssociationType(String associationType) {
setAssociationType(associationType);
return this;
}
/**
*
* Indicates whether the association between the specified target and the configuration was directly applied by the
* Security Hub delegated administrator or inherited from a parent.
*
*
* @param associationType
* Indicates whether the association between the specified target and the configuration was directly applied
* by the Security Hub delegated administrator or inherited from a parent.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AssociationType
*/
public ConfigurationPolicyAssociationSummary withAssociationType(AssociationType associationType) {
this.associationType = associationType.toString();
return this;
}
/**
*
* The date and time, in UTC and ISO 8601 format, that the configuration policy association was last updated.
*
*
* @param updatedAt
* The date and time, in UTC and ISO 8601 format, that the configuration policy association was last updated.
*/
public void setUpdatedAt(java.util.Date updatedAt) {
this.updatedAt = updatedAt;
}
/**
*
* The date and time, in UTC and ISO 8601 format, that the configuration policy association was last updated.
*
*
* @return The date and time, in UTC and ISO 8601 format, that the configuration policy association was last
* updated.
*/
public java.util.Date getUpdatedAt() {
return this.updatedAt;
}
/**
*
* The date and time, in UTC and ISO 8601 format, that the configuration policy association was last updated.
*
*
* @param updatedAt
* The date and time, in UTC and ISO 8601 format, that the configuration policy association was last updated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigurationPolicyAssociationSummary withUpdatedAt(java.util.Date updatedAt) {
setUpdatedAt(updatedAt);
return this;
}
/**
*
* The current status of the association between the specified target and the configuration.
*
*
* @param associationStatus
* The current status of the association between the specified target and the configuration.
* @see ConfigurationPolicyAssociationStatus
*/
public void setAssociationStatus(String associationStatus) {
this.associationStatus = associationStatus;
}
/**
*
* The current status of the association between the specified target and the configuration.
*
*
* @return The current status of the association between the specified target and the configuration.
* @see ConfigurationPolicyAssociationStatus
*/
public String getAssociationStatus() {
return this.associationStatus;
}
/**
*
* The current status of the association between the specified target and the configuration.
*
*
* @param associationStatus
* The current status of the association between the specified target and the configuration.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConfigurationPolicyAssociationStatus
*/
public ConfigurationPolicyAssociationSummary withAssociationStatus(String associationStatus) {
setAssociationStatus(associationStatus);
return this;
}
/**
*
* The current status of the association between the specified target and the configuration.
*
*
* @param associationStatus
* The current status of the association between the specified target and the configuration.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConfigurationPolicyAssociationStatus
*/
public ConfigurationPolicyAssociationSummary withAssociationStatus(ConfigurationPolicyAssociationStatus associationStatus) {
this.associationStatus = associationStatus.toString();
return this;
}
/**
*
* The explanation for a FAILED
value for AssociationStatus
.
*
*
* @param associationStatusMessage
* The explanation for a FAILED
value for AssociationStatus
.
*/
public void setAssociationStatusMessage(String associationStatusMessage) {
this.associationStatusMessage = associationStatusMessage;
}
/**
*
* The explanation for a FAILED
value for AssociationStatus
.
*
*
* @return The explanation for a FAILED
value for AssociationStatus
.
*/
public String getAssociationStatusMessage() {
return this.associationStatusMessage;
}
/**
*
* The explanation for a FAILED
value for AssociationStatus
.
*
*
* @param associationStatusMessage
* The explanation for a FAILED
value for AssociationStatus
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigurationPolicyAssociationSummary withAssociationStatusMessage(String associationStatusMessage) {
setAssociationStatusMessage(associationStatusMessage);
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 (getConfigurationPolicyId() != null)
sb.append("ConfigurationPolicyId: ").append(getConfigurationPolicyId()).append(",");
if (getTargetId() != null)
sb.append("TargetId: ").append(getTargetId()).append(",");
if (getTargetType() != null)
sb.append("TargetType: ").append(getTargetType()).append(",");
if (getAssociationType() != null)
sb.append("AssociationType: ").append(getAssociationType()).append(",");
if (getUpdatedAt() != null)
sb.append("UpdatedAt: ").append(getUpdatedAt()).append(",");
if (getAssociationStatus() != null)
sb.append("AssociationStatus: ").append(getAssociationStatus()).append(",");
if (getAssociationStatusMessage() != null)
sb.append("AssociationStatusMessage: ").append(getAssociationStatusMessage());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ConfigurationPolicyAssociationSummary == false)
return false;
ConfigurationPolicyAssociationSummary other = (ConfigurationPolicyAssociationSummary) obj;
if (other.getConfigurationPolicyId() == null ^ this.getConfigurationPolicyId() == null)
return false;
if (other.getConfigurationPolicyId() != null && other.getConfigurationPolicyId().equals(this.getConfigurationPolicyId()) == false)
return false;
if (other.getTargetId() == null ^ this.getTargetId() == null)
return false;
if (other.getTargetId() != null && other.getTargetId().equals(this.getTargetId()) == false)
return false;
if (other.getTargetType() == null ^ this.getTargetType() == null)
return false;
if (other.getTargetType() != null && other.getTargetType().equals(this.getTargetType()) == false)
return false;
if (other.getAssociationType() == null ^ this.getAssociationType() == null)
return false;
if (other.getAssociationType() != null && other.getAssociationType().equals(this.getAssociationType()) == false)
return false;
if (other.getUpdatedAt() == null ^ this.getUpdatedAt() == null)
return false;
if (other.getUpdatedAt() != null && other.getUpdatedAt().equals(this.getUpdatedAt()) == false)
return false;
if (other.getAssociationStatus() == null ^ this.getAssociationStatus() == null)
return false;
if (other.getAssociationStatus() != null && other.getAssociationStatus().equals(this.getAssociationStatus()) == false)
return false;
if (other.getAssociationStatusMessage() == null ^ this.getAssociationStatusMessage() == null)
return false;
if (other.getAssociationStatusMessage() != null && other.getAssociationStatusMessage().equals(this.getAssociationStatusMessage()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getConfigurationPolicyId() == null) ? 0 : getConfigurationPolicyId().hashCode());
hashCode = prime * hashCode + ((getTargetId() == null) ? 0 : getTargetId().hashCode());
hashCode = prime * hashCode + ((getTargetType() == null) ? 0 : getTargetType().hashCode());
hashCode = prime * hashCode + ((getAssociationType() == null) ? 0 : getAssociationType().hashCode());
hashCode = prime * hashCode + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
hashCode = prime * hashCode + ((getAssociationStatus() == null) ? 0 : getAssociationStatus().hashCode());
hashCode = prime * hashCode + ((getAssociationStatusMessage() == null) ? 0 : getAssociationStatusMessage().hashCode());
return hashCode;
}
@Override
public ConfigurationPolicyAssociationSummary clone() {
try {
return (ConfigurationPolicyAssociationSummary) 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.ConfigurationPolicyAssociationSummaryMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}