/* * 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.connect.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 CreateTaskTemplateRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

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

*/ private String instanceId; /** *

* The name of the task template. *

*/ private String name; /** *

* The description of the task template. *

*/ private String description; /** *

* The identifier of the flow that runs by default when a task is created by referencing this template. *

*/ private String contactFlowId; /** *

* Constraints that are applicable to the fields listed. *

*/ private TaskTemplateConstraints constraints; /** *

* The default values for fields when a task is created by referencing this template. *

*/ private TaskTemplateDefaults defaults; /** *

* Marks a template as ACTIVE or INACTIVE for a task to refer to it. Tasks can only be * created from ACTIVE templates. If a template is marked as INACTIVE, then a task that * refers to this template cannot be created. *

*/ private String status; /** *

* Fields that are part of the template. *

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

* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, * the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with * idempotent APIs. *

*/ private String clientToken; /** *

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

* * @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. *

* * @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 this.instanceId; } /** *

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

* * @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 Returns a reference to this object so that method calls can be chained together. */ public CreateTaskTemplateRequest withInstanceId(String instanceId) { setInstanceId(instanceId); return this; } /** *

* The name of the task template. *

* * @param name * The name of the task template. */ public void setName(String name) { this.name = name; } /** *

* The name of the task template. *

* * @return The name of the task template. */ public String getName() { return this.name; } /** *

* The name of the task template. *

* * @param name * The name of the task template. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTaskTemplateRequest withName(String name) { setName(name); return this; } /** *

* The description of the task template. *

* * @param description * The description of the task template. */ public void setDescription(String description) { this.description = description; } /** *

* The description of the task template. *

* * @return The description of the task template. */ public String getDescription() { return this.description; } /** *

* The description of the task template. *

* * @param description * The description of the task template. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTaskTemplateRequest withDescription(String description) { setDescription(description); return this; } /** *

* The identifier of the flow that runs by default when a task is created by referencing this template. *

* * @param contactFlowId * The identifier of the flow that runs by default when a task is created by referencing this template. */ public void setContactFlowId(String contactFlowId) { this.contactFlowId = contactFlowId; } /** *

* The identifier of the flow that runs by default when a task is created by referencing this template. *

* * @return The identifier of the flow that runs by default when a task is created by referencing this template. */ public String getContactFlowId() { return this.contactFlowId; } /** *

* The identifier of the flow that runs by default when a task is created by referencing this template. *

* * @param contactFlowId * The identifier of the flow that runs by default when a task is created by referencing this template. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTaskTemplateRequest withContactFlowId(String contactFlowId) { setContactFlowId(contactFlowId); return this; } /** *

* Constraints that are applicable to the fields listed. *

* * @param constraints * Constraints that are applicable to the fields listed. */ public void setConstraints(TaskTemplateConstraints constraints) { this.constraints = constraints; } /** *

* Constraints that are applicable to the fields listed. *

* * @return Constraints that are applicable to the fields listed. */ public TaskTemplateConstraints getConstraints() { return this.constraints; } /** *

* Constraints that are applicable to the fields listed. *

* * @param constraints * Constraints that are applicable to the fields listed. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTaskTemplateRequest withConstraints(TaskTemplateConstraints constraints) { setConstraints(constraints); return this; } /** *

* The default values for fields when a task is created by referencing this template. *

* * @param defaults * The default values for fields when a task is created by referencing this template. */ public void setDefaults(TaskTemplateDefaults defaults) { this.defaults = defaults; } /** *

* The default values for fields when a task is created by referencing this template. *

* * @return The default values for fields when a task is created by referencing this template. */ public TaskTemplateDefaults getDefaults() { return this.defaults; } /** *

* The default values for fields when a task is created by referencing this template. *

* * @param defaults * The default values for fields when a task is created by referencing this template. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTaskTemplateRequest withDefaults(TaskTemplateDefaults defaults) { setDefaults(defaults); return this; } /** *

* Marks a template as ACTIVE or INACTIVE for a task to refer to it. Tasks can only be * created from ACTIVE templates. If a template is marked as INACTIVE, then a task that * refers to this template cannot be created. *

* * @param status * Marks a template as ACTIVE or INACTIVE for a task to refer to it. Tasks can only * be created from ACTIVE templates. If a template is marked as INACTIVE, then a * task that refers to this template cannot be created. * @see TaskTemplateStatus */ public void setStatus(String status) { this.status = status; } /** *

* Marks a template as ACTIVE or INACTIVE for a task to refer to it. Tasks can only be * created from ACTIVE templates. If a template is marked as INACTIVE, then a task that * refers to this template cannot be created. *

* * @return Marks a template as ACTIVE or INACTIVE for a task to refer to it. Tasks can * only be created from ACTIVE templates. If a template is marked as INACTIVE, * then a task that refers to this template cannot be created. * @see TaskTemplateStatus */ public String getStatus() { return this.status; } /** *

* Marks a template as ACTIVE or INACTIVE for a task to refer to it. Tasks can only be * created from ACTIVE templates. If a template is marked as INACTIVE, then a task that * refers to this template cannot be created. *

* * @param status * Marks a template as ACTIVE or INACTIVE for a task to refer to it. Tasks can only * be created from ACTIVE templates. If a template is marked as INACTIVE, then a * task that refers to this template cannot be created. * @return Returns a reference to this object so that method calls can be chained together. * @see TaskTemplateStatus */ public CreateTaskTemplateRequest withStatus(String status) { setStatus(status); return this; } /** *

* Marks a template as ACTIVE or INACTIVE for a task to refer to it. Tasks can only be * created from ACTIVE templates. If a template is marked as INACTIVE, then a task that * refers to this template cannot be created. *

* * @param status * Marks a template as ACTIVE or INACTIVE for a task to refer to it. Tasks can only * be created from ACTIVE templates. If a template is marked as INACTIVE, then a * task that refers to this template cannot be created. * @return Returns a reference to this object so that method calls can be chained together. * @see TaskTemplateStatus */ public CreateTaskTemplateRequest withStatus(TaskTemplateStatus status) { this.status = status.toString(); return this; } /** *

* Fields that are part of the template. *

* * @return Fields that are part of the template. */ public java.util.List getFields() { return fields; } /** *

* Fields that are part of the template. *

* * @param fields * Fields that are part of the template. */ public void setFields(java.util.Collection fields) { if (fields == null) { this.fields = null; return; } this.fields = new java.util.ArrayList(fields); } /** *

* Fields that are part of the template. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setFields(java.util.Collection)} or {@link #withFields(java.util.Collection)} if you want to override the * existing values. *

* * @param fields * Fields that are part of the template. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTaskTemplateRequest withFields(TaskTemplateField... fields) { if (this.fields == null) { setFields(new java.util.ArrayList(fields.length)); } for (TaskTemplateField ele : fields) { this.fields.add(ele); } return this; } /** *

* Fields that are part of the template. *

* * @param fields * Fields that are part of the template. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTaskTemplateRequest withFields(java.util.Collection fields) { setFields(fields); return this; } /** *

* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, * the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with * idempotent APIs. *

* * @param clientToken * A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not * provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries * safe with idempotent APIs. */ public void setClientToken(String clientToken) { this.clientToken = clientToken; } /** *

* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, * the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with * idempotent APIs. *

* * @return A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not * provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see * Making * retries safe with idempotent APIs. */ public String getClientToken() { return this.clientToken; } /** *

* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, * the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with * idempotent APIs. *

* * @param clientToken * A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not * provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries * safe with idempotent APIs. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTaskTemplateRequest withClientToken(String clientToken) { setClientToken(clientToken); 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 (getInstanceId() != null) sb.append("InstanceId: ").append(getInstanceId()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getContactFlowId() != null) sb.append("ContactFlowId: ").append(getContactFlowId()).append(","); if (getConstraints() != null) sb.append("Constraints: ").append(getConstraints()).append(","); if (getDefaults() != null) sb.append("Defaults: ").append(getDefaults()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getFields() != null) sb.append("Fields: ").append(getFields()).append(","); if (getClientToken() != null) sb.append("ClientToken: ").append(getClientToken()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateTaskTemplateRequest == false) return false; CreateTaskTemplateRequest other = (CreateTaskTemplateRequest) obj; 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.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getContactFlowId() == null ^ this.getContactFlowId() == null) return false; if (other.getContactFlowId() != null && other.getContactFlowId().equals(this.getContactFlowId()) == false) return false; if (other.getConstraints() == null ^ this.getConstraints() == null) return false; if (other.getConstraints() != null && other.getConstraints().equals(this.getConstraints()) == false) return false; if (other.getDefaults() == null ^ this.getDefaults() == null) return false; if (other.getDefaults() != null && other.getDefaults().equals(this.getDefaults()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getFields() == null ^ this.getFields() == null) return false; if (other.getFields() != null && other.getFields().equals(this.getFields()) == false) return false; if (other.getClientToken() == null ^ this.getClientToken() == null) return false; if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getContactFlowId() == null) ? 0 : getContactFlowId().hashCode()); hashCode = prime * hashCode + ((getConstraints() == null) ? 0 : getConstraints().hashCode()); hashCode = prime * hashCode + ((getDefaults() == null) ? 0 : getDefaults().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getFields() == null) ? 0 : getFields().hashCode()); hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); return hashCode; } @Override public CreateTaskTemplateRequest clone() { return (CreateTaskTemplateRequest) super.clone(); } }