com.amazonaws.services.securityhub.model.AwsApiCallAction Maven / Gradle / Ivy
Show all versions of aws-java-sdk-securityhub Show documentation
/*
* Copyright 2018-2023 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;
/**
*
* Provided if ActionType
is AWS_API_CALL
. It provides details about the API call that was
* detected.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AwsApiCallAction implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the API method that was issued.
*
*/
private String api;
/**
*
* The name of the Amazon Web Services service that the API method belongs to.
*
*/
private String serviceName;
/**
*
* Indicates whether the API call originated from a remote IP address (remoteip
) or from a DNS domain (
* domain
).
*
*/
private String callerType;
/**
*
* Provided if CallerType
is remoteIp
. Provides information about the remote IP address
* that the API call originated from.
*
*/
private ActionRemoteIpDetails remoteIpDetails;
/**
*
* Provided if CallerType
is domain
. Provides information about the DNS domain that the
* API call originated from.
*
*/
private AwsApiCallActionDomainDetails domainDetails;
/**
*
* Identifies the resources that were affected by the API call.
*
*/
private java.util.Map affectedResources;
/**
*
* An ISO8601-formatted timestamp that indicates when the API call was first observed.
*
*
* A correctly formatted example is 2020-05-21T20:16:34.724Z
. The value cannot contain spaces, and date
* and time should be separated by T
. For more information, see RFC 3339 section 5.6, Internet Date/Time Format.
*
*/
private String firstSeen;
/**
*
* An ISO8601-formatted timestamp that indicates when the API call was most recently observed.
*
*
* A correctly formatted example is 2020-05-21T20:16:34.724Z
. The value cannot contain spaces, and date
* and time should be separated by T
. For more information, see RFC 3339 section 5.6, Internet Date/Time Format.
*
*/
private String lastSeen;
/**
*
* The name of the API method that was issued.
*
*
* @param api
* The name of the API method that was issued.
*/
public void setApi(String api) {
this.api = api;
}
/**
*
* The name of the API method that was issued.
*
*
* @return The name of the API method that was issued.
*/
public String getApi() {
return this.api;
}
/**
*
* The name of the API method that was issued.
*
*
* @param api
* The name of the API method that was issued.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsApiCallAction withApi(String api) {
setApi(api);
return this;
}
/**
*
* The name of the Amazon Web Services service that the API method belongs to.
*
*
* @param serviceName
* The name of the Amazon Web Services service that the API method belongs to.
*/
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
/**
*
* The name of the Amazon Web Services service that the API method belongs to.
*
*
* @return The name of the Amazon Web Services service that the API method belongs to.
*/
public String getServiceName() {
return this.serviceName;
}
/**
*
* The name of the Amazon Web Services service that the API method belongs to.
*
*
* @param serviceName
* The name of the Amazon Web Services service that the API method belongs to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsApiCallAction withServiceName(String serviceName) {
setServiceName(serviceName);
return this;
}
/**
*
* Indicates whether the API call originated from a remote IP address (remoteip
) or from a DNS domain (
* domain
).
*
*
* @param callerType
* Indicates whether the API call originated from a remote IP address (remoteip
) or from a DNS
* domain (domain
).
*/
public void setCallerType(String callerType) {
this.callerType = callerType;
}
/**
*
* Indicates whether the API call originated from a remote IP address (remoteip
) or from a DNS domain (
* domain
).
*
*
* @return Indicates whether the API call originated from a remote IP address (remoteip
) or from a DNS
* domain (domain
).
*/
public String getCallerType() {
return this.callerType;
}
/**
*
* Indicates whether the API call originated from a remote IP address (remoteip
) or from a DNS domain (
* domain
).
*
*
* @param callerType
* Indicates whether the API call originated from a remote IP address (remoteip
) or from a DNS
* domain (domain
).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsApiCallAction withCallerType(String callerType) {
setCallerType(callerType);
return this;
}
/**
*
* Provided if CallerType
is remoteIp
. Provides information about the remote IP address
* that the API call originated from.
*
*
* @param remoteIpDetails
* Provided if CallerType
is remoteIp
. Provides information about the remote IP
* address that the API call originated from.
*/
public void setRemoteIpDetails(ActionRemoteIpDetails remoteIpDetails) {
this.remoteIpDetails = remoteIpDetails;
}
/**
*
* Provided if CallerType
is remoteIp
. Provides information about the remote IP address
* that the API call originated from.
*
*
* @return Provided if CallerType
is remoteIp
. Provides information about the remote IP
* address that the API call originated from.
*/
public ActionRemoteIpDetails getRemoteIpDetails() {
return this.remoteIpDetails;
}
/**
*
* Provided if CallerType
is remoteIp
. Provides information about the remote IP address
* that the API call originated from.
*
*
* @param remoteIpDetails
* Provided if CallerType
is remoteIp
. Provides information about the remote IP
* address that the API call originated from.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsApiCallAction withRemoteIpDetails(ActionRemoteIpDetails remoteIpDetails) {
setRemoteIpDetails(remoteIpDetails);
return this;
}
/**
*
* Provided if CallerType
is domain
. Provides information about the DNS domain that the
* API call originated from.
*
*
* @param domainDetails
* Provided if CallerType
is domain
. Provides information about the DNS domain that
* the API call originated from.
*/
public void setDomainDetails(AwsApiCallActionDomainDetails domainDetails) {
this.domainDetails = domainDetails;
}
/**
*
* Provided if CallerType
is domain
. Provides information about the DNS domain that the
* API call originated from.
*
*
* @return Provided if CallerType
is domain
. Provides information about the DNS domain
* that the API call originated from.
*/
public AwsApiCallActionDomainDetails getDomainDetails() {
return this.domainDetails;
}
/**
*
* Provided if CallerType
is domain
. Provides information about the DNS domain that the
* API call originated from.
*
*
* @param domainDetails
* Provided if CallerType
is domain
. Provides information about the DNS domain that
* the API call originated from.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsApiCallAction withDomainDetails(AwsApiCallActionDomainDetails domainDetails) {
setDomainDetails(domainDetails);
return this;
}
/**
*
* Identifies the resources that were affected by the API call.
*
*
* @return Identifies the resources that were affected by the API call.
*/
public java.util.Map getAffectedResources() {
return affectedResources;
}
/**
*
* Identifies the resources that were affected by the API call.
*
*
* @param affectedResources
* Identifies the resources that were affected by the API call.
*/
public void setAffectedResources(java.util.Map affectedResources) {
this.affectedResources = affectedResources;
}
/**
*
* Identifies the resources that were affected by the API call.
*
*
* @param affectedResources
* Identifies the resources that were affected by the API call.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsApiCallAction withAffectedResources(java.util.Map affectedResources) {
setAffectedResources(affectedResources);
return this;
}
/**
* Add a single AffectedResources entry
*
* @see AwsApiCallAction#withAffectedResources
* @returns a reference to this object so that method calls can be chained together.
*/
public AwsApiCallAction addAffectedResourcesEntry(String key, String value) {
if (null == this.affectedResources) {
this.affectedResources = new java.util.HashMap();
}
if (this.affectedResources.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.affectedResources.put(key, value);
return this;
}
/**
* Removes all the entries added into AffectedResources.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsApiCallAction clearAffectedResourcesEntries() {
this.affectedResources = null;
return this;
}
/**
*
* An ISO8601-formatted timestamp that indicates when the API call was first observed.
*
*
* A correctly formatted example is 2020-05-21T20:16:34.724Z
. The value cannot contain spaces, and date
* and time should be separated by T
. For more information, see RFC 3339 section 5.6, Internet Date/Time Format.
*
*
* @param firstSeen
* An ISO8601-formatted timestamp that indicates when the API call was first observed.
*
* A correctly formatted example is 2020-05-21T20:16:34.724Z
. The value cannot contain spaces,
* and date and time should be separated by T
. For more information, see RFC 3339 section 5.6, Internet Date/Time
* Format.
*/
public void setFirstSeen(String firstSeen) {
this.firstSeen = firstSeen;
}
/**
*
* An ISO8601-formatted timestamp that indicates when the API call was first observed.
*
*
* A correctly formatted example is 2020-05-21T20:16:34.724Z
. The value cannot contain spaces, and date
* and time should be separated by T
. For more information, see RFC 3339 section 5.6, Internet Date/Time Format.
*
*
* @return An ISO8601-formatted timestamp that indicates when the API call was first observed.
*
* A correctly formatted example is 2020-05-21T20:16:34.724Z
. The value cannot contain spaces,
* and date and time should be separated by T
. For more information, see RFC 3339 section 5.6, Internet Date/Time
* Format.
*/
public String getFirstSeen() {
return this.firstSeen;
}
/**
*
* An ISO8601-formatted timestamp that indicates when the API call was first observed.
*
*
* A correctly formatted example is 2020-05-21T20:16:34.724Z
. The value cannot contain spaces, and date
* and time should be separated by T
. For more information, see RFC 3339 section 5.6, Internet Date/Time Format.
*
*
* @param firstSeen
* An ISO8601-formatted timestamp that indicates when the API call was first observed.
*
* A correctly formatted example is 2020-05-21T20:16:34.724Z
. The value cannot contain spaces,
* and date and time should be separated by T
. For more information, see RFC 3339 section 5.6, Internet Date/Time
* Format.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsApiCallAction withFirstSeen(String firstSeen) {
setFirstSeen(firstSeen);
return this;
}
/**
*
* An ISO8601-formatted timestamp that indicates when the API call was most recently observed.
*
*
* A correctly formatted example is 2020-05-21T20:16:34.724Z
. The value cannot contain spaces, and date
* and time should be separated by T
. For more information, see RFC 3339 section 5.6, Internet Date/Time Format.
*
*
* @param lastSeen
* An ISO8601-formatted timestamp that indicates when the API call was most recently observed.
*
* A correctly formatted example is 2020-05-21T20:16:34.724Z
. The value cannot contain spaces,
* and date and time should be separated by T
. For more information, see RFC 3339 section 5.6, Internet Date/Time
* Format.
*/
public void setLastSeen(String lastSeen) {
this.lastSeen = lastSeen;
}
/**
*
* An ISO8601-formatted timestamp that indicates when the API call was most recently observed.
*
*
* A correctly formatted example is 2020-05-21T20:16:34.724Z
. The value cannot contain spaces, and date
* and time should be separated by T
. For more information, see RFC 3339 section 5.6, Internet Date/Time Format.
*
*
* @return An ISO8601-formatted timestamp that indicates when the API call was most recently observed.
*
* A correctly formatted example is 2020-05-21T20:16:34.724Z
. The value cannot contain spaces,
* and date and time should be separated by T
. For more information, see RFC 3339 section 5.6, Internet Date/Time
* Format.
*/
public String getLastSeen() {
return this.lastSeen;
}
/**
*
* An ISO8601-formatted timestamp that indicates when the API call was most recently observed.
*
*
* A correctly formatted example is 2020-05-21T20:16:34.724Z
. The value cannot contain spaces, and date
* and time should be separated by T
. For more information, see RFC 3339 section 5.6, Internet Date/Time Format.
*
*
* @param lastSeen
* An ISO8601-formatted timestamp that indicates when the API call was most recently observed.
*
* A correctly formatted example is 2020-05-21T20:16:34.724Z
. The value cannot contain spaces,
* and date and time should be separated by T
. For more information, see RFC 3339 section 5.6, Internet Date/Time
* Format.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsApiCallAction withLastSeen(String lastSeen) {
setLastSeen(lastSeen);
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 (getApi() != null)
sb.append("Api: ").append(getApi()).append(",");
if (getServiceName() != null)
sb.append("ServiceName: ").append(getServiceName()).append(",");
if (getCallerType() != null)
sb.append("CallerType: ").append(getCallerType()).append(",");
if (getRemoteIpDetails() != null)
sb.append("RemoteIpDetails: ").append(getRemoteIpDetails()).append(",");
if (getDomainDetails() != null)
sb.append("DomainDetails: ").append(getDomainDetails()).append(",");
if (getAffectedResources() != null)
sb.append("AffectedResources: ").append(getAffectedResources()).append(",");
if (getFirstSeen() != null)
sb.append("FirstSeen: ").append(getFirstSeen()).append(",");
if (getLastSeen() != null)
sb.append("LastSeen: ").append(getLastSeen());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AwsApiCallAction == false)
return false;
AwsApiCallAction other = (AwsApiCallAction) obj;
if (other.getApi() == null ^ this.getApi() == null)
return false;
if (other.getApi() != null && other.getApi().equals(this.getApi()) == false)
return false;
if (other.getServiceName() == null ^ this.getServiceName() == null)
return false;
if (other.getServiceName() != null && other.getServiceName().equals(this.getServiceName()) == false)
return false;
if (other.getCallerType() == null ^ this.getCallerType() == null)
return false;
if (other.getCallerType() != null && other.getCallerType().equals(this.getCallerType()) == false)
return false;
if (other.getRemoteIpDetails() == null ^ this.getRemoteIpDetails() == null)
return false;
if (other.getRemoteIpDetails() != null && other.getRemoteIpDetails().equals(this.getRemoteIpDetails()) == false)
return false;
if (other.getDomainDetails() == null ^ this.getDomainDetails() == null)
return false;
if (other.getDomainDetails() != null && other.getDomainDetails().equals(this.getDomainDetails()) == false)
return false;
if (other.getAffectedResources() == null ^ this.getAffectedResources() == null)
return false;
if (other.getAffectedResources() != null && other.getAffectedResources().equals(this.getAffectedResources()) == false)
return false;
if (other.getFirstSeen() == null ^ this.getFirstSeen() == null)
return false;
if (other.getFirstSeen() != null && other.getFirstSeen().equals(this.getFirstSeen()) == false)
return false;
if (other.getLastSeen() == null ^ this.getLastSeen() == null)
return false;
if (other.getLastSeen() != null && other.getLastSeen().equals(this.getLastSeen()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getApi() == null) ? 0 : getApi().hashCode());
hashCode = prime * hashCode + ((getServiceName() == null) ? 0 : getServiceName().hashCode());
hashCode = prime * hashCode + ((getCallerType() == null) ? 0 : getCallerType().hashCode());
hashCode = prime * hashCode + ((getRemoteIpDetails() == null) ? 0 : getRemoteIpDetails().hashCode());
hashCode = prime * hashCode + ((getDomainDetails() == null) ? 0 : getDomainDetails().hashCode());
hashCode = prime * hashCode + ((getAffectedResources() == null) ? 0 : getAffectedResources().hashCode());
hashCode = prime * hashCode + ((getFirstSeen() == null) ? 0 : getFirstSeen().hashCode());
hashCode = prime * hashCode + ((getLastSeen() == null) ? 0 : getLastSeen().hashCode());
return hashCode;
}
@Override
public AwsApiCallAction clone() {
try {
return (AwsApiCallAction) 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.AwsApiCallActionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}