com.amazonaws.services.inspector2.model.CisTargets Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-inspector2 Show documentation
Show all versions of aws-java-sdk-inspector2 Show documentation
The AWS Java SDK for Inspector2 module holds the client classes that are used for communicating with Inspector2 Service
/*
* 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.inspector2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The CIS targets.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CisTargets implements Serializable, Cloneable, StructuredPojo {
/**
*
* The CIS target account ids.
*
*/
private java.util.List accountIds;
/**
*
* The CIS target resource tags.
*
*/
private java.util.Map> targetResourceTags;
/**
*
* The CIS target account ids.
*
*
* @return The CIS target account ids.
*/
public java.util.List getAccountIds() {
return accountIds;
}
/**
*
* The CIS target account ids.
*
*
* @param accountIds
* The CIS target account ids.
*/
public void setAccountIds(java.util.Collection accountIds) {
if (accountIds == null) {
this.accountIds = null;
return;
}
this.accountIds = new java.util.ArrayList(accountIds);
}
/**
*
* The CIS target account ids.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAccountIds(java.util.Collection)} or {@link #withAccountIds(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param accountIds
* The CIS target account ids.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CisTargets withAccountIds(String... accountIds) {
if (this.accountIds == null) {
setAccountIds(new java.util.ArrayList(accountIds.length));
}
for (String ele : accountIds) {
this.accountIds.add(ele);
}
return this;
}
/**
*
* The CIS target account ids.
*
*
* @param accountIds
* The CIS target account ids.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CisTargets withAccountIds(java.util.Collection accountIds) {
setAccountIds(accountIds);
return this;
}
/**
*
* The CIS target resource tags.
*
*
* @return The CIS target resource tags.
*/
public java.util.Map> getTargetResourceTags() {
return targetResourceTags;
}
/**
*
* The CIS target resource tags.
*
*
* @param targetResourceTags
* The CIS target resource tags.
*/
public void setTargetResourceTags(java.util.Map> targetResourceTags) {
this.targetResourceTags = targetResourceTags;
}
/**
*
* The CIS target resource tags.
*
*
* @param targetResourceTags
* The CIS target resource tags.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CisTargets withTargetResourceTags(java.util.Map> targetResourceTags) {
setTargetResourceTags(targetResourceTags);
return this;
}
/**
* Add a single TargetResourceTags entry
*
* @see CisTargets#withTargetResourceTags
* @returns a reference to this object so that method calls can be chained together.
*/
public CisTargets addTargetResourceTagsEntry(String key, java.util.List value) {
if (null == this.targetResourceTags) {
this.targetResourceTags = new java.util.HashMap>();
}
if (this.targetResourceTags.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.targetResourceTags.put(key, value);
return this;
}
/**
* Removes all the entries added into TargetResourceTags.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CisTargets clearTargetResourceTagsEntries() {
this.targetResourceTags = 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 (getAccountIds() != null)
sb.append("AccountIds: ").append(getAccountIds()).append(",");
if (getTargetResourceTags() != null)
sb.append("TargetResourceTags: ").append(getTargetResourceTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CisTargets == false)
return false;
CisTargets other = (CisTargets) obj;
if (other.getAccountIds() == null ^ this.getAccountIds() == null)
return false;
if (other.getAccountIds() != null && other.getAccountIds().equals(this.getAccountIds()) == false)
return false;
if (other.getTargetResourceTags() == null ^ this.getTargetResourceTags() == null)
return false;
if (other.getTargetResourceTags() != null && other.getTargetResourceTags().equals(this.getTargetResourceTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAccountIds() == null) ? 0 : getAccountIds().hashCode());
hashCode = prime * hashCode + ((getTargetResourceTags() == null) ? 0 : getTargetResourceTags().hashCode());
return hashCode;
}
@Override
public CisTargets clone() {
try {
return (CisTargets) 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.inspector2.model.transform.CisTargetsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}