com.amazonaws.services.inspector2.model.DisableRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-inspector2 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.inspector2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DisableRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* An array of account IDs you want to disable Amazon Inspector scans for.
*
*/
private java.util.List accountIds;
/**
*
* The resource scan types you want to disable.
*
*/
private java.util.List resourceTypes;
/**
*
* An array of account IDs you want to disable Amazon Inspector scans for.
*
*
* @return An array of account IDs you want to disable Amazon Inspector scans for.
*/
public java.util.List getAccountIds() {
return accountIds;
}
/**
*
* An array of account IDs you want to disable Amazon Inspector scans for.
*
*
* @param accountIds
* An array of account IDs you want to disable Amazon Inspector scans for.
*/
public void setAccountIds(java.util.Collection accountIds) {
if (accountIds == null) {
this.accountIds = null;
return;
}
this.accountIds = new java.util.ArrayList(accountIds);
}
/**
*
* An array of account IDs you want to disable Amazon Inspector scans for.
*
*
* 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
* An array of account IDs you want to disable Amazon Inspector scans for.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DisableRequest withAccountIds(String... accountIds) {
if (this.accountIds == null) {
setAccountIds(new java.util.ArrayList(accountIds.length));
}
for (String ele : accountIds) {
this.accountIds.add(ele);
}
return this;
}
/**
*
* An array of account IDs you want to disable Amazon Inspector scans for.
*
*
* @param accountIds
* An array of account IDs you want to disable Amazon Inspector scans for.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DisableRequest withAccountIds(java.util.Collection accountIds) {
setAccountIds(accountIds);
return this;
}
/**
*
* The resource scan types you want to disable.
*
*
* @return The resource scan types you want to disable.
* @see ResourceScanType
*/
public java.util.List getResourceTypes() {
return resourceTypes;
}
/**
*
* The resource scan types you want to disable.
*
*
* @param resourceTypes
* The resource scan types you want to disable.
* @see ResourceScanType
*/
public void setResourceTypes(java.util.Collection resourceTypes) {
if (resourceTypes == null) {
this.resourceTypes = null;
return;
}
this.resourceTypes = new java.util.ArrayList(resourceTypes);
}
/**
*
* The resource scan types you want to disable.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setResourceTypes(java.util.Collection)} or {@link #withResourceTypes(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param resourceTypes
* The resource scan types you want to disable.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceScanType
*/
public DisableRequest withResourceTypes(String... resourceTypes) {
if (this.resourceTypes == null) {
setResourceTypes(new java.util.ArrayList(resourceTypes.length));
}
for (String ele : resourceTypes) {
this.resourceTypes.add(ele);
}
return this;
}
/**
*
* The resource scan types you want to disable.
*
*
* @param resourceTypes
* The resource scan types you want to disable.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceScanType
*/
public DisableRequest withResourceTypes(java.util.Collection resourceTypes) {
setResourceTypes(resourceTypes);
return this;
}
/**
*
* The resource scan types you want to disable.
*
*
* @param resourceTypes
* The resource scan types you want to disable.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceScanType
*/
public DisableRequest withResourceTypes(ResourceScanType... resourceTypes) {
java.util.ArrayList resourceTypesCopy = new java.util.ArrayList(resourceTypes.length);
for (ResourceScanType value : resourceTypes) {
resourceTypesCopy.add(value.toString());
}
if (getResourceTypes() == null) {
setResourceTypes(resourceTypesCopy);
} else {
getResourceTypes().addAll(resourceTypesCopy);
}
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 (getResourceTypes() != null)
sb.append("ResourceTypes: ").append(getResourceTypes());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DisableRequest == false)
return false;
DisableRequest other = (DisableRequest) obj;
if (other.getAccountIds() == null ^ this.getAccountIds() == null)
return false;
if (other.getAccountIds() != null && other.getAccountIds().equals(this.getAccountIds()) == false)
return false;
if (other.getResourceTypes() == null ^ this.getResourceTypes() == null)
return false;
if (other.getResourceTypes() != null && other.getResourceTypes().equals(this.getResourceTypes()) == 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 + ((getResourceTypes() == null) ? 0 : getResourceTypes().hashCode());
return hashCode;
}
@Override
public DisableRequest clone() {
return (DisableRequest) super.clone();
}
}