/* * 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; import com.amazonaws.AmazonWebServiceRequest; /** *

* Updates a rule for the specified Amazon Connect instance. *

*

* Use the Rules Function language to code conditions for the rule. *

*/ public class UpdateRuleRequest extends AmazonWebServiceRequest implements Serializable { /** *

* A unique identifier for the rule. *

*

* Constraints:
* Length: 1 - 256
*/ private String ruleId; /** *

* The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the * instance. *

*

* Constraints:
* Length: 1 - 100
*/ private String instanceId; /** *

* The name of the rule. You can change the name only if * TriggerEventSource is one of the following values: * OnZendeskTicketCreate | * OnZendeskTicketStatusUpdate | * OnSalesforceCaseCreate *

*

* Constraints:
* Length: 1 - 200
* Pattern: ^[0-9a-zA-Z._-]+
*/ private String name; /** *

* The conditions of the rule. *

*/ private String function; /** *

* A list of actions to be run when the rule is triggered. *

*/ private java.util.List actions; /** *

* The publish status of the rule. *

*

* Constraints:
* Allowed Values: DRAFT, PUBLISHED */ private String publishStatus; /** *

* A unique identifier for the rule. *

*

* Constraints:
* Length: 1 - 256
* * @return

* A unique identifier for the rule. *

*/ public String getRuleId() { return ruleId; } /** *

* A unique identifier for the rule. *

*

* Constraints:
* Length: 1 - 256
* * @param ruleId

* A unique identifier for the rule. *

*/ public void setRuleId(String ruleId) { this.ruleId = ruleId; } /** *

* A unique identifier for the rule. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 256
* * @param ruleId

* A unique identifier for the rule. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateRuleRequest withRuleId(String ruleId) { this.ruleId = ruleId; return this; } /** *

* The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the * instance. *

*

* Constraints:
* Length: 1 - 100
* * @return

* The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of * the instance. *

*/ public String getInstanceId() { return instanceId; } /** *

* The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the * instance. *

*

* Constraints:
* Length: 1 - 100
* * @param instanceId

* The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of * the instance. *

*/ public void setInstanceId(String instanceId) { this.instanceId = instanceId; } /** *

* The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the * instance. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 100
* * @param instanceId

* The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of * the instance. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateRuleRequest withInstanceId(String instanceId) { this.instanceId = instanceId; return this; } /** *

* The name of the rule. You can change the name only if * TriggerEventSource is one of the following values: * OnZendeskTicketCreate | * OnZendeskTicketStatusUpdate | * OnSalesforceCaseCreate *

*

* Constraints:
* Length: 1 - 200
* Pattern: ^[0-9a-zA-Z._-]+
* * @return

* The name of the rule. You can change the name only if * TriggerEventSource is one of the following values: * OnZendeskTicketCreate | * OnZendeskTicketStatusUpdate | * OnSalesforceCaseCreate *

*/ public String getName() { return name; } /** *

* The name of the rule. You can change the name only if * TriggerEventSource is one of the following values: * OnZendeskTicketCreate | * OnZendeskTicketStatusUpdate | * OnSalesforceCaseCreate *

*

* Constraints:
* Length: 1 - 200
* Pattern: ^[0-9a-zA-Z._-]+
* * @param name

* The name of the rule. You can change the name only if * TriggerEventSource is one of the following * values: OnZendeskTicketCreate | * OnZendeskTicketStatusUpdate | * OnSalesforceCaseCreate *

*/ public void setName(String name) { this.name = name; } /** *

* The name of the rule. You can change the name only 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. *

* Constraints:
* Length: 1 - 200
* Pattern: ^[0-9a-zA-Z._-]+
* * @param name

* The name of the rule. You can change the name only if * TriggerEventSource is one of the following * values: OnZendeskTicketCreate | * OnZendeskTicketStatusUpdate | * OnSalesforceCaseCreate *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateRuleRequest withName(String name) { this.name = name; return this; } /** *

* The conditions of the rule. *

* * @return

* The conditions of the rule. *

*/ public String getFunction() { return function; } /** *

* The conditions of the rule. *

* * @param function

* The conditions of the rule. *

*/ public void setFunction(String function) { this.function = function; } /** *

* The conditions of the rule. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param function

* The conditions of the rule. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateRuleRequest withFunction(String function) { this.function = function; return this; } /** *

* A list of actions to be run when the rule is triggered. *

* * @return

* A list of actions to be run when the rule is triggered. *

*/ public java.util.List getActions() { return actions; } /** *

* A list of actions to be run when the rule is triggered. *

* * @param actions

* A list of actions to be run when the rule is triggered. *

*/ public void setActions(java.util.Collection actions) { if (actions == null) { this.actions = null; return; } this.actions = new java.util.ArrayList(actions); } /** *

* A list of actions to be run when the rule is triggered. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param actions

* A list of actions to be run when the rule is triggered. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateRuleRequest withActions(RuleAction... actions) { if (getActions() == null) { this.actions = new java.util.ArrayList(actions.length); } for (RuleAction value : actions) { this.actions.add(value); } return this; } /** *

* A list of actions to be run when the rule is triggered. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param actions

* A list of actions to be run when the rule is triggered. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateRuleRequest withActions(java.util.Collection actions) { setActions(actions); return this; } /** *

* The publish status of the rule. *

*

* Constraints:
* Allowed Values: DRAFT, PUBLISHED * * @return

* The publish status of the rule. *

* @see RulePublishStatus */ public String getPublishStatus() { return publishStatus; } /** *

* The publish status of the rule. *

*

* Constraints:
* Allowed Values: DRAFT, PUBLISHED * * @param publishStatus

* The publish status of the rule. *

* @see RulePublishStatus */ public void setPublishStatus(String publishStatus) { this.publishStatus = publishStatus; } /** *

* The publish status of the rule. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: DRAFT, PUBLISHED * * @param publishStatus

* The publish status of the rule. *

* @return A reference to this updated object so that method calls can be * chained together. * @see RulePublishStatus */ public UpdateRuleRequest withPublishStatus(String publishStatus) { this.publishStatus = publishStatus; return this; } /** *

* The publish status of the rule. *

*

* Constraints:
* Allowed Values: DRAFT, PUBLISHED * * @param publishStatus

* The publish status of the rule. *

* @see RulePublishStatus */ public void setPublishStatus(RulePublishStatus publishStatus) { this.publishStatus = publishStatus.toString(); } /** *

* The publish status of the rule. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: DRAFT, PUBLISHED * * @param publishStatus

* The publish status of the rule. *

* @return A reference to this updated object so that method calls can be * chained together. * @see RulePublishStatus */ public UpdateRuleRequest withPublishStatus(RulePublishStatus publishStatus) { this.publishStatus = publishStatus.toString(); 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 (getRuleId() != null) sb.append("RuleId: " + getRuleId() + ","); if (getInstanceId() != null) sb.append("InstanceId: " + getInstanceId() + ","); if (getName() != null) sb.append("Name: " + getName() + ","); if (getFunction() != null) sb.append("Function: " + getFunction() + ","); if (getActions() != null) sb.append("Actions: " + getActions() + ","); if (getPublishStatus() != null) sb.append("PublishStatus: " + getPublishStatus()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRuleId() == null) ? 0 : getRuleId().hashCode()); hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getFunction() == null) ? 0 : getFunction().hashCode()); hashCode = prime * hashCode + ((getActions() == null) ? 0 : getActions().hashCode()); hashCode = prime * hashCode + ((getPublishStatus() == null) ? 0 : getPublishStatus().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateRuleRequest == false) return false; UpdateRuleRequest other = (UpdateRuleRequest) obj; if (other.getRuleId() == null ^ this.getRuleId() == null) return false; if (other.getRuleId() != null && other.getRuleId().equals(this.getRuleId()) == false) return false; if (other.getInstanceId() == null ^ this.getInstanceId() == null) return false; if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getFunction() == null ^ this.getFunction() == null) return false; if (other.getFunction() != null && other.getFunction().equals(this.getFunction()) == false) return false; if (other.getActions() == null ^ this.getActions() == null) return false; if (other.getActions() != null && other.getActions().equals(this.getActions()) == false) return false; if (other.getPublishStatus() == null ^ this.getPublishStatus() == null) return false; if (other.getPublishStatus() != null && other.getPublishStatus().equals(this.getPublishStatus()) == false) return false; return true; } }