/* * Copyright 2010-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.connect.model; import java.io.Serializable; /** *
* Information about the action to be performed when a rule is triggered. *
*/ public class RuleAction implements Serializable { /** ** The type of action that creates a rule. *
*
* Constraints:
* Allowed Values: CREATE_TASK, ASSIGN_CONTACT_CATEGORY,
* GENERATE_EVENTBRIDGE_EVENT, SEND_NOTIFICATION
*/
private String actionType;
/**
*
* Information about the task action. This field is required if
* TriggerEventSource
is one of the following values:
* OnZendeskTicketCreate
|
* OnZendeskTicketStatusUpdate
|
* OnSalesforceCaseCreate
*
* Information about the EventBridge action. *
*/ private EventBridgeActionDefinition eventBridgeAction; /** ** Information about the contact category action. *
*/ private AssignContactCategoryActionDefinition assignContactCategoryAction; /** ** Information about the send notification action. *
*/ private SendNotificationActionDefinition sendNotificationAction; /** ** The type of action that creates a rule. *
*
* Constraints:
* Allowed Values: CREATE_TASK, ASSIGN_CONTACT_CATEGORY,
* GENERATE_EVENTBRIDGE_EVENT, SEND_NOTIFICATION
*
* @return
* The type of action that creates a rule. *
* @see ActionType */ public String getActionType() { return actionType; } /** ** The type of action that creates a rule. *
*
* Constraints:
* Allowed Values: CREATE_TASK, ASSIGN_CONTACT_CATEGORY,
* GENERATE_EVENTBRIDGE_EVENT, SEND_NOTIFICATION
*
* @param actionType
* The type of action that creates a rule. *
* @see ActionType */ public void setActionType(String actionType) { this.actionType = actionType; } /** ** The type of action that creates a rule. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: CREATE_TASK, ASSIGN_CONTACT_CATEGORY,
* GENERATE_EVENTBRIDGE_EVENT, SEND_NOTIFICATION
*
* @param actionType
* The type of action that creates a rule. *
* @return A reference to this updated object so that method calls can be * chained together. * @see ActionType */ public RuleAction withActionType(String actionType) { this.actionType = actionType; return this; } /** ** The type of action that creates a rule. *
*
* Constraints:
* Allowed Values: CREATE_TASK, ASSIGN_CONTACT_CATEGORY,
* GENERATE_EVENTBRIDGE_EVENT, SEND_NOTIFICATION
*
* @param actionType
* The type of action that creates a rule. *
* @see ActionType */ public void setActionType(ActionType actionType) { this.actionType = actionType.toString(); } /** ** The type of action that creates a rule. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: CREATE_TASK, ASSIGN_CONTACT_CATEGORY,
* GENERATE_EVENTBRIDGE_EVENT, SEND_NOTIFICATION
*
* @param actionType
* The type of action that creates a rule. *
* @return A reference to this updated object so that method calls can be * chained together. * @see ActionType */ public RuleAction withActionType(ActionType actionType) { this.actionType = actionType.toString(); return this; } /** *
* Information about the task action. This field is required if
* TriggerEventSource
is one of the following values:
* OnZendeskTicketCreate
|
* OnZendeskTicketStatusUpdate
|
* OnSalesforceCaseCreate
*
* Information about the task action. This field is required if
* TriggerEventSource
is one of the following values:
* OnZendeskTicketCreate
|
* OnZendeskTicketStatusUpdate
|
* OnSalesforceCaseCreate
*
* Information about the task action. This field is required if
* TriggerEventSource
is one of the following values:
* OnZendeskTicketCreate
|
* OnZendeskTicketStatusUpdate
|
* OnSalesforceCaseCreate
*
* Information about the task action. This field is required if
* TriggerEventSource
is one of the following
* values: OnZendeskTicketCreate
|
* OnZendeskTicketStatusUpdate
|
* OnSalesforceCaseCreate
*
* Information about the task action. This field is required if
* TriggerEventSource
is one of the following values:
* OnZendeskTicketCreate
|
* OnZendeskTicketStatusUpdate
|
* OnSalesforceCaseCreate
*
* Returns a reference to this object so that method calls can be chained * together. * * @param taskAction
* Information about the task action. This field is required if
* TriggerEventSource
is one of the following
* values: OnZendeskTicketCreate
|
* OnZendeskTicketStatusUpdate
|
* OnSalesforceCaseCreate
*
* Information about the EventBridge action. *
* * @return* Information about the EventBridge action. *
*/ public EventBridgeActionDefinition getEventBridgeAction() { return eventBridgeAction; } /** ** Information about the EventBridge action. *
* * @param eventBridgeAction* Information about the EventBridge action. *
*/ public void setEventBridgeAction(EventBridgeActionDefinition eventBridgeAction) { this.eventBridgeAction = eventBridgeAction; } /** ** Information about the EventBridge action. *
** Returns a reference to this object so that method calls can be chained * together. * * @param eventBridgeAction
* Information about the EventBridge action. *
* @return A reference to this updated object so that method calls can be * chained together. */ public RuleAction withEventBridgeAction(EventBridgeActionDefinition eventBridgeAction) { this.eventBridgeAction = eventBridgeAction; return this; } /** ** Information about the contact category action. *
* * @return* Information about the contact category action. *
*/ public AssignContactCategoryActionDefinition getAssignContactCategoryAction() { return assignContactCategoryAction; } /** ** Information about the contact category action. *
* * @param assignContactCategoryAction* Information about the contact category action. *
*/ public void setAssignContactCategoryAction( AssignContactCategoryActionDefinition assignContactCategoryAction) { this.assignContactCategoryAction = assignContactCategoryAction; } /** ** Information about the contact category action. *
** Returns a reference to this object so that method calls can be chained * together. * * @param assignContactCategoryAction
* Information about the contact category action. *
* @return A reference to this updated object so that method calls can be * chained together. */ public RuleAction withAssignContactCategoryAction( AssignContactCategoryActionDefinition assignContactCategoryAction) { this.assignContactCategoryAction = assignContactCategoryAction; return this; } /** ** Information about the send notification action. *
* * @return* Information about the send notification action. *
*/ public SendNotificationActionDefinition getSendNotificationAction() { return sendNotificationAction; } /** ** Information about the send notification action. *
* * @param sendNotificationAction* Information about the send notification action. *
*/ public void setSendNotificationAction(SendNotificationActionDefinition sendNotificationAction) { this.sendNotificationAction = sendNotificationAction; } /** ** Information about the send notification action. *
** Returns a reference to this object so that method calls can be chained * together. * * @param sendNotificationAction
* Information about the send notification action. *
* @return A reference to this updated object so that method calls can be * chained together. */ public RuleAction withSendNotificationAction( SendNotificationActionDefinition sendNotificationAction) { this.sendNotificationAction = sendNotificationAction; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getActionType() != null) sb.append("ActionType: " + getActionType() + ","); if (getTaskAction() != null) sb.append("TaskAction: " + getTaskAction() + ","); if (getEventBridgeAction() != null) sb.append("EventBridgeAction: " + getEventBridgeAction() + ","); if (getAssignContactCategoryAction() != null) sb.append("AssignContactCategoryAction: " + getAssignContactCategoryAction() + ","); if (getSendNotificationAction() != null) sb.append("SendNotificationAction: " + getSendNotificationAction()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getActionType() == null) ? 0 : getActionType().hashCode()); hashCode = prime * hashCode + ((getTaskAction() == null) ? 0 : getTaskAction().hashCode()); hashCode = prime * hashCode + ((getEventBridgeAction() == null) ? 0 : getEventBridgeAction().hashCode()); hashCode = prime * hashCode + ((getAssignContactCategoryAction() == null) ? 0 : getAssignContactCategoryAction().hashCode()); hashCode = prime * hashCode + ((getSendNotificationAction() == null) ? 0 : getSendNotificationAction() .hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RuleAction == false) return false; RuleAction other = (RuleAction) obj; if (other.getActionType() == null ^ this.getActionType() == null) return false; if (other.getActionType() != null && other.getActionType().equals(this.getActionType()) == false) return false; if (other.getTaskAction() == null ^ this.getTaskAction() == null) return false; if (other.getTaskAction() != null && other.getTaskAction().equals(this.getTaskAction()) == false) return false; if (other.getEventBridgeAction() == null ^ this.getEventBridgeAction() == null) return false; if (other.getEventBridgeAction() != null && other.getEventBridgeAction().equals(this.getEventBridgeAction()) == false) return false; if (other.getAssignContactCategoryAction() == null ^ this.getAssignContactCategoryAction() == null) return false; if (other.getAssignContactCategoryAction() != null && other.getAssignContactCategoryAction().equals( this.getAssignContactCategoryAction()) == false) return false; if (other.getSendNotificationAction() == null ^ this.getSendNotificationAction() == null) return false; if (other.getSendNotificationAction() != null && other.getSendNotificationAction().equals(this.getSendNotificationAction()) == false) return false; return true; } }