com.amazonaws.services.frauddetector.model.SendEventRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-frauddetector 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.frauddetector.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 SendEventRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The event ID to upload.
*
*/
private String eventId;
/**
*
* The event type name of the event.
*
*/
private String eventTypeName;
/**
*
* The timestamp that defines when the event under evaluation occurred. The timestamp must be specified using ISO
* 8601 standard in UTC.
*
*/
private String eventTimestamp;
/**
*
* Names of the event type's variables you defined in Amazon Fraud Detector to represent data elements and their
* corresponding values for the event you are sending for evaluation.
*
*/
private java.util.Map eventVariables;
/**
*
* The label to associate with the event. Required if specifying labelTimestamp
.
*
*/
private String assignedLabel;
/**
*
* The timestamp associated with the label. Required if specifying assignedLabel
.
*
*/
private String labelTimestamp;
/**
*
* An array of entities.
*
*/
private java.util.List entities;
/**
*
* The event ID to upload.
*
*
* @param eventId
* The event ID to upload.
*/
public void setEventId(String eventId) {
this.eventId = eventId;
}
/**
*
* The event ID to upload.
*
*
* @return The event ID to upload.
*/
public String getEventId() {
return this.eventId;
}
/**
*
* The event ID to upload.
*
*
* @param eventId
* The event ID to upload.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEventRequest withEventId(String eventId) {
setEventId(eventId);
return this;
}
/**
*
* The event type name of the event.
*
*
* @param eventTypeName
* The event type name of the event.
*/
public void setEventTypeName(String eventTypeName) {
this.eventTypeName = eventTypeName;
}
/**
*
* The event type name of the event.
*
*
* @return The event type name of the event.
*/
public String getEventTypeName() {
return this.eventTypeName;
}
/**
*
* The event type name of the event.
*
*
* @param eventTypeName
* The event type name of the event.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEventRequest withEventTypeName(String eventTypeName) {
setEventTypeName(eventTypeName);
return this;
}
/**
*
* The timestamp that defines when the event under evaluation occurred. The timestamp must be specified using ISO
* 8601 standard in UTC.
*
*
* @param eventTimestamp
* The timestamp that defines when the event under evaluation occurred. The timestamp must be specified using
* ISO 8601 standard in UTC.
*/
public void setEventTimestamp(String eventTimestamp) {
this.eventTimestamp = eventTimestamp;
}
/**
*
* The timestamp that defines when the event under evaluation occurred. The timestamp must be specified using ISO
* 8601 standard in UTC.
*
*
* @return The timestamp that defines when the event under evaluation occurred. The timestamp must be specified
* using ISO 8601 standard in UTC.
*/
public String getEventTimestamp() {
return this.eventTimestamp;
}
/**
*
* The timestamp that defines when the event under evaluation occurred. The timestamp must be specified using ISO
* 8601 standard in UTC.
*
*
* @param eventTimestamp
* The timestamp that defines when the event under evaluation occurred. The timestamp must be specified using
* ISO 8601 standard in UTC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEventRequest withEventTimestamp(String eventTimestamp) {
setEventTimestamp(eventTimestamp);
return this;
}
/**
*
* Names of the event type's variables you defined in Amazon Fraud Detector to represent data elements and their
* corresponding values for the event you are sending for evaluation.
*
*
* @return Names of the event type's variables you defined in Amazon Fraud Detector to represent data elements and
* their corresponding values for the event you are sending for evaluation.
*/
public java.util.Map getEventVariables() {
return eventVariables;
}
/**
*
* Names of the event type's variables you defined in Amazon Fraud Detector to represent data elements and their
* corresponding values for the event you are sending for evaluation.
*
*
* @param eventVariables
* Names of the event type's variables you defined in Amazon Fraud Detector to represent data elements and
* their corresponding values for the event you are sending for evaluation.
*/
public void setEventVariables(java.util.Map eventVariables) {
this.eventVariables = eventVariables;
}
/**
*
* Names of the event type's variables you defined in Amazon Fraud Detector to represent data elements and their
* corresponding values for the event you are sending for evaluation.
*
*
* @param eventVariables
* Names of the event type's variables you defined in Amazon Fraud Detector to represent data elements and
* their corresponding values for the event you are sending for evaluation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEventRequest withEventVariables(java.util.Map eventVariables) {
setEventVariables(eventVariables);
return this;
}
/**
* Add a single EventVariables entry
*
* @see SendEventRequest#withEventVariables
* @returns a reference to this object so that method calls can be chained together.
*/
public SendEventRequest addEventVariablesEntry(String key, String value) {
if (null == this.eventVariables) {
this.eventVariables = new java.util.HashMap();
}
if (this.eventVariables.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.eventVariables.put(key, value);
return this;
}
/**
* Removes all the entries added into EventVariables.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEventRequest clearEventVariablesEntries() {
this.eventVariables = null;
return this;
}
/**
*
* The label to associate with the event. Required if specifying labelTimestamp
.
*
*
* @param assignedLabel
* The label to associate with the event. Required if specifying labelTimestamp
.
*/
public void setAssignedLabel(String assignedLabel) {
this.assignedLabel = assignedLabel;
}
/**
*
* The label to associate with the event. Required if specifying labelTimestamp
.
*
*
* @return The label to associate with the event. Required if specifying labelTimestamp
.
*/
public String getAssignedLabel() {
return this.assignedLabel;
}
/**
*
* The label to associate with the event. Required if specifying labelTimestamp
.
*
*
* @param assignedLabel
* The label to associate with the event. Required if specifying labelTimestamp
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEventRequest withAssignedLabel(String assignedLabel) {
setAssignedLabel(assignedLabel);
return this;
}
/**
*
* The timestamp associated with the label. Required if specifying assignedLabel
.
*
*
* @param labelTimestamp
* The timestamp associated with the label. Required if specifying assignedLabel
.
*/
public void setLabelTimestamp(String labelTimestamp) {
this.labelTimestamp = labelTimestamp;
}
/**
*
* The timestamp associated with the label. Required if specifying assignedLabel
.
*
*
* @return The timestamp associated with the label. Required if specifying assignedLabel
.
*/
public String getLabelTimestamp() {
return this.labelTimestamp;
}
/**
*
* The timestamp associated with the label. Required if specifying assignedLabel
.
*
*
* @param labelTimestamp
* The timestamp associated with the label. Required if specifying assignedLabel
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEventRequest withLabelTimestamp(String labelTimestamp) {
setLabelTimestamp(labelTimestamp);
return this;
}
/**
*
* An array of entities.
*
*
* @return An array of entities.
*/
public java.util.List getEntities() {
return entities;
}
/**
*
* An array of entities.
*
*
* @param entities
* An array of entities.
*/
public void setEntities(java.util.Collection entities) {
if (entities == null) {
this.entities = null;
return;
}
this.entities = new java.util.ArrayList(entities);
}
/**
*
* An array of entities.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setEntities(java.util.Collection)} or {@link #withEntities(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param entities
* An array of entities.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEventRequest withEntities(Entity... entities) {
if (this.entities == null) {
setEntities(new java.util.ArrayList(entities.length));
}
for (Entity ele : entities) {
this.entities.add(ele);
}
return this;
}
/**
*
* An array of entities.
*
*
* @param entities
* An array of entities.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SendEventRequest withEntities(java.util.Collection entities) {
setEntities(entities);
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 (getEventId() != null)
sb.append("EventId: ").append(getEventId()).append(",");
if (getEventTypeName() != null)
sb.append("EventTypeName: ").append(getEventTypeName()).append(",");
if (getEventTimestamp() != null)
sb.append("EventTimestamp: ").append(getEventTimestamp()).append(",");
if (getEventVariables() != null)
sb.append("EventVariables: ").append("***Sensitive Data Redacted***").append(",");
if (getAssignedLabel() != null)
sb.append("AssignedLabel: ").append(getAssignedLabel()).append(",");
if (getLabelTimestamp() != null)
sb.append("LabelTimestamp: ").append(getLabelTimestamp()).append(",");
if (getEntities() != null)
sb.append("Entities: ").append("***Sensitive Data Redacted***");
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SendEventRequest == false)
return false;
SendEventRequest other = (SendEventRequest) obj;
if (other.getEventId() == null ^ this.getEventId() == null)
return false;
if (other.getEventId() != null && other.getEventId().equals(this.getEventId()) == false)
return false;
if (other.getEventTypeName() == null ^ this.getEventTypeName() == null)
return false;
if (other.getEventTypeName() != null && other.getEventTypeName().equals(this.getEventTypeName()) == false)
return false;
if (other.getEventTimestamp() == null ^ this.getEventTimestamp() == null)
return false;
if (other.getEventTimestamp() != null && other.getEventTimestamp().equals(this.getEventTimestamp()) == false)
return false;
if (other.getEventVariables() == null ^ this.getEventVariables() == null)
return false;
if (other.getEventVariables() != null && other.getEventVariables().equals(this.getEventVariables()) == false)
return false;
if (other.getAssignedLabel() == null ^ this.getAssignedLabel() == null)
return false;
if (other.getAssignedLabel() != null && other.getAssignedLabel().equals(this.getAssignedLabel()) == false)
return false;
if (other.getLabelTimestamp() == null ^ this.getLabelTimestamp() == null)
return false;
if (other.getLabelTimestamp() != null && other.getLabelTimestamp().equals(this.getLabelTimestamp()) == false)
return false;
if (other.getEntities() == null ^ this.getEntities() == null)
return false;
if (other.getEntities() != null && other.getEntities().equals(this.getEntities()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getEventId() == null) ? 0 : getEventId().hashCode());
hashCode = prime * hashCode + ((getEventTypeName() == null) ? 0 : getEventTypeName().hashCode());
hashCode = prime * hashCode + ((getEventTimestamp() == null) ? 0 : getEventTimestamp().hashCode());
hashCode = prime * hashCode + ((getEventVariables() == null) ? 0 : getEventVariables().hashCode());
hashCode = prime * hashCode + ((getAssignedLabel() == null) ? 0 : getAssignedLabel().hashCode());
hashCode = prime * hashCode + ((getLabelTimestamp() == null) ? 0 : getLabelTimestamp().hashCode());
hashCode = prime * hashCode + ((getEntities() == null) ? 0 : getEntities().hashCode());
return hashCode;
}
@Override
public SendEventRequest clone() {
return (SendEventRequest) super.clone();
}
}