com.amazonaws.services.inspector2.model.EnableRequest 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 EnableRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* A list of account IDs you want to enable Amazon Inspector scans for.
*
*/
private java.util.List accountIds;
/**
*
* The idempotency token for the request.
*
*/
private String clientToken;
/**
*
* The resource scan types you want to enable.
*
*/
private java.util.List resourceTypes;
/**
*
* A list of account IDs you want to enable Amazon Inspector scans for.
*
*
* @return A list of account IDs you want to enable Amazon Inspector scans for.
*/
public java.util.List getAccountIds() {
return accountIds;
}
/**
*
* A list of account IDs you want to enable Amazon Inspector scans for.
*
*
* @param accountIds
* A list of account IDs you want to enable 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);
}
/**
*
* A list of account IDs you want to enable 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
* A list of account IDs you want to enable Amazon Inspector scans for.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EnableRequest withAccountIds(String... accountIds) {
if (this.accountIds == null) {
setAccountIds(new java.util.ArrayList(accountIds.length));
}
for (String ele : accountIds) {
this.accountIds.add(ele);
}
return this;
}
/**
*
* A list of account IDs you want to enable Amazon Inspector scans for.
*
*
* @param accountIds
* A list of account IDs you want to enable Amazon Inspector scans for.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EnableRequest withAccountIds(java.util.Collection accountIds) {
setAccountIds(accountIds);
return this;
}
/**
*
* The idempotency token for the request.
*
*
* @param clientToken
* The idempotency token for the request.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* The idempotency token for the request.
*
*
* @return The idempotency token for the request.
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* The idempotency token for the request.
*
*
* @param clientToken
* The idempotency token for the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EnableRequest withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
*
* The resource scan types you want to enable.
*
*
* @return The resource scan types you want to enable.
* @see ResourceScanType
*/
public java.util.List getResourceTypes() {
return resourceTypes;
}
/**
*
* The resource scan types you want to enable.
*
*
* @param resourceTypes
* The resource scan types you want to enable.
* @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 enable.
*
*
* 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 enable.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceScanType
*/
public EnableRequest 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 enable.
*
*
* @param resourceTypes
* The resource scan types you want to enable.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceScanType
*/
public EnableRequest withResourceTypes(java.util.Collection resourceTypes) {
setResourceTypes(resourceTypes);
return this;
}
/**
*
* The resource scan types you want to enable.
*
*
* @param resourceTypes
* The resource scan types you want to enable.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceScanType
*/
public EnableRequest 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 (getClientToken() != null)
sb.append("ClientToken: ").append(getClientToken()).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 EnableRequest == false)
return false;
EnableRequest other = (EnableRequest) obj;
if (other.getAccountIds() == null ^ this.getAccountIds() == null)
return false;
if (other.getAccountIds() != null && other.getAccountIds().equals(this.getAccountIds()) == false)
return false;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == 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 + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
hashCode = prime * hashCode + ((getResourceTypes() == null) ? 0 : getResourceTypes().hashCode());
return hashCode;
}
@Override
public EnableRequest clone() {
return (EnableRequest) super.clone();
}
}