
com.amazonaws.services.imagebuilder.model.LifecyclePolicyDetailExclusionRulesAmis Maven / Gradle / Ivy
/*
* 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.imagebuilder.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Defines criteria for AMIs that are excluded from lifecycle actions.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class LifecyclePolicyDetailExclusionRulesAmis implements Serializable, Cloneable, StructuredPojo {
/**
*
* Configures whether public AMIs are excluded from the lifecycle action.
*
*/
private Boolean isPublic;
/**
*
* Configures Amazon Web Services Regions that are excluded from the lifecycle action.
*
*/
private java.util.List regions;
/**
*
* Specifies Amazon Web Services accounts whose resources are excluded from the lifecycle action.
*
*/
private java.util.List sharedAccounts;
/**
*
* Specifies configuration details for Image Builder to exclude the most recent resources from lifecycle actions.
*
*/
private LifecyclePolicyDetailExclusionRulesAmisLastLaunched lastLaunched;
/**
*
* Lists tags that should be excluded from lifecycle actions for the AMIs that have them.
*
*/
private java.util.Map tagMap;
/**
*
* Configures whether public AMIs are excluded from the lifecycle action.
*
*
* @param isPublic
* Configures whether public AMIs are excluded from the lifecycle action.
*/
public void setIsPublic(Boolean isPublic) {
this.isPublic = isPublic;
}
/**
*
* Configures whether public AMIs are excluded from the lifecycle action.
*
*
* @return Configures whether public AMIs are excluded from the lifecycle action.
*/
public Boolean getIsPublic() {
return this.isPublic;
}
/**
*
* Configures whether public AMIs are excluded from the lifecycle action.
*
*
* @param isPublic
* Configures whether public AMIs are excluded from the lifecycle action.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecyclePolicyDetailExclusionRulesAmis withIsPublic(Boolean isPublic) {
setIsPublic(isPublic);
return this;
}
/**
*
* Configures whether public AMIs are excluded from the lifecycle action.
*
*
* @return Configures whether public AMIs are excluded from the lifecycle action.
*/
public Boolean isPublic() {
return this.isPublic;
}
/**
*
* Configures Amazon Web Services Regions that are excluded from the lifecycle action.
*
*
* @return Configures Amazon Web Services Regions that are excluded from the lifecycle action.
*/
public java.util.List getRegions() {
return regions;
}
/**
*
* Configures Amazon Web Services Regions that are excluded from the lifecycle action.
*
*
* @param regions
* Configures Amazon Web Services Regions that are excluded from the lifecycle action.
*/
public void setRegions(java.util.Collection regions) {
if (regions == null) {
this.regions = null;
return;
}
this.regions = new java.util.ArrayList(regions);
}
/**
*
* Configures Amazon Web Services Regions that are excluded from the lifecycle action.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setRegions(java.util.Collection)} or {@link #withRegions(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param regions
* Configures Amazon Web Services Regions that are excluded from the lifecycle action.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecyclePolicyDetailExclusionRulesAmis withRegions(String... regions) {
if (this.regions == null) {
setRegions(new java.util.ArrayList(regions.length));
}
for (String ele : regions) {
this.regions.add(ele);
}
return this;
}
/**
*
* Configures Amazon Web Services Regions that are excluded from the lifecycle action.
*
*
* @param regions
* Configures Amazon Web Services Regions that are excluded from the lifecycle action.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecyclePolicyDetailExclusionRulesAmis withRegions(java.util.Collection regions) {
setRegions(regions);
return this;
}
/**
*
* Specifies Amazon Web Services accounts whose resources are excluded from the lifecycle action.
*
*
* @return Specifies Amazon Web Services accounts whose resources are excluded from the lifecycle action.
*/
public java.util.List getSharedAccounts() {
return sharedAccounts;
}
/**
*
* Specifies Amazon Web Services accounts whose resources are excluded from the lifecycle action.
*
*
* @param sharedAccounts
* Specifies Amazon Web Services accounts whose resources are excluded from the lifecycle action.
*/
public void setSharedAccounts(java.util.Collection sharedAccounts) {
if (sharedAccounts == null) {
this.sharedAccounts = null;
return;
}
this.sharedAccounts = new java.util.ArrayList(sharedAccounts);
}
/**
*
* Specifies Amazon Web Services accounts whose resources are excluded from the lifecycle action.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSharedAccounts(java.util.Collection)} or {@link #withSharedAccounts(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param sharedAccounts
* Specifies Amazon Web Services accounts whose resources are excluded from the lifecycle action.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecyclePolicyDetailExclusionRulesAmis withSharedAccounts(String... sharedAccounts) {
if (this.sharedAccounts == null) {
setSharedAccounts(new java.util.ArrayList(sharedAccounts.length));
}
for (String ele : sharedAccounts) {
this.sharedAccounts.add(ele);
}
return this;
}
/**
*
* Specifies Amazon Web Services accounts whose resources are excluded from the lifecycle action.
*
*
* @param sharedAccounts
* Specifies Amazon Web Services accounts whose resources are excluded from the lifecycle action.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecyclePolicyDetailExclusionRulesAmis withSharedAccounts(java.util.Collection sharedAccounts) {
setSharedAccounts(sharedAccounts);
return this;
}
/**
*
* Specifies configuration details for Image Builder to exclude the most recent resources from lifecycle actions.
*
*
* @param lastLaunched
* Specifies configuration details for Image Builder to exclude the most recent resources from lifecycle
* actions.
*/
public void setLastLaunched(LifecyclePolicyDetailExclusionRulesAmisLastLaunched lastLaunched) {
this.lastLaunched = lastLaunched;
}
/**
*
* Specifies configuration details for Image Builder to exclude the most recent resources from lifecycle actions.
*
*
* @return Specifies configuration details for Image Builder to exclude the most recent resources from lifecycle
* actions.
*/
public LifecyclePolicyDetailExclusionRulesAmisLastLaunched getLastLaunched() {
return this.lastLaunched;
}
/**
*
* Specifies configuration details for Image Builder to exclude the most recent resources from lifecycle actions.
*
*
* @param lastLaunched
* Specifies configuration details for Image Builder to exclude the most recent resources from lifecycle
* actions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecyclePolicyDetailExclusionRulesAmis withLastLaunched(LifecyclePolicyDetailExclusionRulesAmisLastLaunched lastLaunched) {
setLastLaunched(lastLaunched);
return this;
}
/**
*
* Lists tags that should be excluded from lifecycle actions for the AMIs that have them.
*
*
* @return Lists tags that should be excluded from lifecycle actions for the AMIs that have them.
*/
public java.util.Map getTagMap() {
return tagMap;
}
/**
*
* Lists tags that should be excluded from lifecycle actions for the AMIs that have them.
*
*
* @param tagMap
* Lists tags that should be excluded from lifecycle actions for the AMIs that have them.
*/
public void setTagMap(java.util.Map tagMap) {
this.tagMap = tagMap;
}
/**
*
* Lists tags that should be excluded from lifecycle actions for the AMIs that have them.
*
*
* @param tagMap
* Lists tags that should be excluded from lifecycle actions for the AMIs that have them.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecyclePolicyDetailExclusionRulesAmis withTagMap(java.util.Map tagMap) {
setTagMap(tagMap);
return this;
}
/**
* Add a single TagMap entry
*
* @see LifecyclePolicyDetailExclusionRulesAmis#withTagMap
* @returns a reference to this object so that method calls can be chained together.
*/
public LifecyclePolicyDetailExclusionRulesAmis addTagMapEntry(String key, String value) {
if (null == this.tagMap) {
this.tagMap = new java.util.HashMap();
}
if (this.tagMap.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.tagMap.put(key, value);
return this;
}
/**
* Removes all the entries added into TagMap.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecyclePolicyDetailExclusionRulesAmis clearTagMapEntries() {
this.tagMap = null;
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 (getIsPublic() != null)
sb.append("IsPublic: ").append(getIsPublic()).append(",");
if (getRegions() != null)
sb.append("Regions: ").append(getRegions()).append(",");
if (getSharedAccounts() != null)
sb.append("SharedAccounts: ").append(getSharedAccounts()).append(",");
if (getLastLaunched() != null)
sb.append("LastLaunched: ").append(getLastLaunched()).append(",");
if (getTagMap() != null)
sb.append("TagMap: ").append(getTagMap());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof LifecyclePolicyDetailExclusionRulesAmis == false)
return false;
LifecyclePolicyDetailExclusionRulesAmis other = (LifecyclePolicyDetailExclusionRulesAmis) obj;
if (other.getIsPublic() == null ^ this.getIsPublic() == null)
return false;
if (other.getIsPublic() != null && other.getIsPublic().equals(this.getIsPublic()) == false)
return false;
if (other.getRegions() == null ^ this.getRegions() == null)
return false;
if (other.getRegions() != null && other.getRegions().equals(this.getRegions()) == false)
return false;
if (other.getSharedAccounts() == null ^ this.getSharedAccounts() == null)
return false;
if (other.getSharedAccounts() != null && other.getSharedAccounts().equals(this.getSharedAccounts()) == false)
return false;
if (other.getLastLaunched() == null ^ this.getLastLaunched() == null)
return false;
if (other.getLastLaunched() != null && other.getLastLaunched().equals(this.getLastLaunched()) == false)
return false;
if (other.getTagMap() == null ^ this.getTagMap() == null)
return false;
if (other.getTagMap() != null && other.getTagMap().equals(this.getTagMap()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getIsPublic() == null) ? 0 : getIsPublic().hashCode());
hashCode = prime * hashCode + ((getRegions() == null) ? 0 : getRegions().hashCode());
hashCode = prime * hashCode + ((getSharedAccounts() == null) ? 0 : getSharedAccounts().hashCode());
hashCode = prime * hashCode + ((getLastLaunched() == null) ? 0 : getLastLaunched().hashCode());
hashCode = prime * hashCode + ((getTagMap() == null) ? 0 : getTagMap().hashCode());
return hashCode;
}
@Override
public LifecyclePolicyDetailExclusionRulesAmis clone() {
try {
return (LifecyclePolicyDetailExclusionRulesAmis) 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.imagebuilder.model.transform.LifecyclePolicyDetailExclusionRulesAmisMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}