/* * 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 contact associated to the user. *

*/ public class AgentContactReference implements Serializable { /** *

* The identifier of the contact in this instance of Amazon Connect. *

*

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

* The channel of the contact. *

*

* Constraints:
* Allowed Values: VOICE, CHAT, TASK */ private String channel; /** *

* How the contact was initiated. *

*

* Constraints:
* Allowed Values: INBOUND, OUTBOUND, TRANSFER, QUEUE_TRANSFER, * CALLBACK, API, DISCONNECT, MONITOR, EXTERNAL_OUTBOUND */ private String initiationMethod; /** *

* The state of the contact. *

*

* Constraints:
* Allowed Values: INCOMING, PENDING, CONNECTING, CONNECTED, * CONNECTED_ONHOLD, MISSED, ERROR, ENDED, REJECTED */ private String agentContactState; /** *

* The epoch timestamp when the contact state started. *

*/ private java.util.Date stateStartTimestamp; /** *

* The time at which the contact was connected to an agent. *

*/ private java.util.Date connectedToAgentTimestamp; /** *

* Contains information about a queue resource for which metrics are * returned. *

*/ private QueueReference queue; /** *

* The identifier of the contact in this instance of Amazon Connect. *

*

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

* The identifier of the contact in this instance of Amazon Connect. *

*/ public String getContactId() { return contactId; } /** *

* The identifier of the contact in this instance of Amazon Connect. *

*

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

* The identifier of the contact in this instance of Amazon * Connect. *

*/ public void setContactId(String contactId) { this.contactId = contactId; } /** *

* The identifier of the contact in this instance of Amazon Connect. *

*

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

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

* The identifier of the contact in this instance of Amazon * Connect. *

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

* The channel of the contact. *

*

* Constraints:
* Allowed Values: VOICE, CHAT, TASK * * @return

* The channel of the contact. *

* @see Channel */ public String getChannel() { return channel; } /** *

* The channel of the contact. *

*

* Constraints:
* Allowed Values: VOICE, CHAT, TASK * * @param channel

* The channel of the contact. *

* @see Channel */ public void setChannel(String channel) { this.channel = channel; } /** *

* The channel of the contact. *

*

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

* Constraints:
* Allowed Values: VOICE, CHAT, TASK * * @param channel

* The channel of the contact. *

* @return A reference to this updated object so that method calls can be * chained together. * @see Channel */ public AgentContactReference withChannel(String channel) { this.channel = channel; return this; } /** *

* The channel of the contact. *

*

* Constraints:
* Allowed Values: VOICE, CHAT, TASK * * @param channel

* The channel of the contact. *

* @see Channel */ public void setChannel(Channel channel) { this.channel = channel.toString(); } /** *

* The channel of the contact. *

*

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

* Constraints:
* Allowed Values: VOICE, CHAT, TASK * * @param channel

* The channel of the contact. *

* @return A reference to this updated object so that method calls can be * chained together. * @see Channel */ public AgentContactReference withChannel(Channel channel) { this.channel = channel.toString(); return this; } /** *

* How the contact was initiated. *

*

* Constraints:
* Allowed Values: INBOUND, OUTBOUND, TRANSFER, QUEUE_TRANSFER, * CALLBACK, API, DISCONNECT, MONITOR, EXTERNAL_OUTBOUND * * @return

* How the contact was initiated. *

* @see ContactInitiationMethod */ public String getInitiationMethod() { return initiationMethod; } /** *

* How the contact was initiated. *

*

* Constraints:
* Allowed Values: INBOUND, OUTBOUND, TRANSFER, QUEUE_TRANSFER, * CALLBACK, API, DISCONNECT, MONITOR, EXTERNAL_OUTBOUND * * @param initiationMethod

* How the contact was initiated. *

* @see ContactInitiationMethod */ public void setInitiationMethod(String initiationMethod) { this.initiationMethod = initiationMethod; } /** *

* How the contact was initiated. *

*

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

* Constraints:
* Allowed Values: INBOUND, OUTBOUND, TRANSFER, QUEUE_TRANSFER, * CALLBACK, API, DISCONNECT, MONITOR, EXTERNAL_OUTBOUND * * @param initiationMethod

* How the contact was initiated. *

* @return A reference to this updated object so that method calls can be * chained together. * @see ContactInitiationMethod */ public AgentContactReference withInitiationMethod(String initiationMethod) { this.initiationMethod = initiationMethod; return this; } /** *

* How the contact was initiated. *

*

* Constraints:
* Allowed Values: INBOUND, OUTBOUND, TRANSFER, QUEUE_TRANSFER, * CALLBACK, API, DISCONNECT, MONITOR, EXTERNAL_OUTBOUND * * @param initiationMethod

* How the contact was initiated. *

* @see ContactInitiationMethod */ public void setInitiationMethod(ContactInitiationMethod initiationMethod) { this.initiationMethod = initiationMethod.toString(); } /** *

* How the contact was initiated. *

*

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

* Constraints:
* Allowed Values: INBOUND, OUTBOUND, TRANSFER, QUEUE_TRANSFER, * CALLBACK, API, DISCONNECT, MONITOR, EXTERNAL_OUTBOUND * * @param initiationMethod

* How the contact was initiated. *

* @return A reference to this updated object so that method calls can be * chained together. * @see ContactInitiationMethod */ public AgentContactReference withInitiationMethod(ContactInitiationMethod initiationMethod) { this.initiationMethod = initiationMethod.toString(); return this; } /** *

* The state of the contact. *

*

* Constraints:
* Allowed Values: INCOMING, PENDING, CONNECTING, CONNECTED, * CONNECTED_ONHOLD, MISSED, ERROR, ENDED, REJECTED * * @return

* The state of the contact. *

* @see ContactState */ public String getAgentContactState() { return agentContactState; } /** *

* The state of the contact. *

*

* Constraints:
* Allowed Values: INCOMING, PENDING, CONNECTING, CONNECTED, * CONNECTED_ONHOLD, MISSED, ERROR, ENDED, REJECTED * * @param agentContactState

* The state of the contact. *

* @see ContactState */ public void setAgentContactState(String agentContactState) { this.agentContactState = agentContactState; } /** *

* The state of the contact. *

*

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

* Constraints:
* Allowed Values: INCOMING, PENDING, CONNECTING, CONNECTED, * CONNECTED_ONHOLD, MISSED, ERROR, ENDED, REJECTED * * @param agentContactState

* The state of the contact. *

* @return A reference to this updated object so that method calls can be * chained together. * @see ContactState */ public AgentContactReference withAgentContactState(String agentContactState) { this.agentContactState = agentContactState; return this; } /** *

* The state of the contact. *

*

* Constraints:
* Allowed Values: INCOMING, PENDING, CONNECTING, CONNECTED, * CONNECTED_ONHOLD, MISSED, ERROR, ENDED, REJECTED * * @param agentContactState

* The state of the contact. *

* @see ContactState */ public void setAgentContactState(ContactState agentContactState) { this.agentContactState = agentContactState.toString(); } /** *

* The state of the contact. *

*

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

* Constraints:
* Allowed Values: INCOMING, PENDING, CONNECTING, CONNECTED, * CONNECTED_ONHOLD, MISSED, ERROR, ENDED, REJECTED * * @param agentContactState

* The state of the contact. *

* @return A reference to this updated object so that method calls can be * chained together. * @see ContactState */ public AgentContactReference withAgentContactState(ContactState agentContactState) { this.agentContactState = agentContactState.toString(); return this; } /** *

* The epoch timestamp when the contact state started. *

* * @return

* The epoch timestamp when the contact state started. *

*/ public java.util.Date getStateStartTimestamp() { return stateStartTimestamp; } /** *

* The epoch timestamp when the contact state started. *

* * @param stateStartTimestamp

* The epoch timestamp when the contact state started. *

*/ public void setStateStartTimestamp(java.util.Date stateStartTimestamp) { this.stateStartTimestamp = stateStartTimestamp; } /** *

* The epoch timestamp when the contact state started. *

*

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

* The epoch timestamp when the contact state started. *

* @return A reference to this updated object so that method calls can be * chained together. */ public AgentContactReference withStateStartTimestamp(java.util.Date stateStartTimestamp) { this.stateStartTimestamp = stateStartTimestamp; return this; } /** *

* The time at which the contact was connected to an agent. *

* * @return

* The time at which the contact was connected to an agent. *

*/ public java.util.Date getConnectedToAgentTimestamp() { return connectedToAgentTimestamp; } /** *

* The time at which the contact was connected to an agent. *

* * @param connectedToAgentTimestamp

* The time at which the contact was connected to an agent. *

*/ public void setConnectedToAgentTimestamp(java.util.Date connectedToAgentTimestamp) { this.connectedToAgentTimestamp = connectedToAgentTimestamp; } /** *

* The time at which the contact was connected to an agent. *

*

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

* The time at which the contact was connected to an agent. *

* @return A reference to this updated object so that method calls can be * chained together. */ public AgentContactReference withConnectedToAgentTimestamp( java.util.Date connectedToAgentTimestamp) { this.connectedToAgentTimestamp = connectedToAgentTimestamp; return this; } /** *

* Contains information about a queue resource for which metrics are * returned. *

* * @return

* Contains information about a queue resource for which metrics are * returned. *

*/ public QueueReference getQueue() { return queue; } /** *

* Contains information about a queue resource for which metrics are * returned. *

* * @param queue

* Contains information about a queue resource for which metrics * are returned. *

*/ public void setQueue(QueueReference queue) { this.queue = queue; } /** *

* Contains information about a queue resource for which metrics are * returned. *

*

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

* Contains information about a queue resource for which metrics * are returned. *

* @return A reference to this updated object so that method calls can be * chained together. */ public AgentContactReference withQueue(QueueReference queue) { this.queue = queue; 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 (getContactId() != null) sb.append("ContactId: " + getContactId() + ","); if (getChannel() != null) sb.append("Channel: " + getChannel() + ","); if (getInitiationMethod() != null) sb.append("InitiationMethod: " + getInitiationMethod() + ","); if (getAgentContactState() != null) sb.append("AgentContactState: " + getAgentContactState() + ","); if (getStateStartTimestamp() != null) sb.append("StateStartTimestamp: " + getStateStartTimestamp() + ","); if (getConnectedToAgentTimestamp() != null) sb.append("ConnectedToAgentTimestamp: " + getConnectedToAgentTimestamp() + ","); if (getQueue() != null) sb.append("Queue: " + getQueue()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getContactId() == null) ? 0 : getContactId().hashCode()); hashCode = prime * hashCode + ((getChannel() == null) ? 0 : getChannel().hashCode()); hashCode = prime * hashCode + ((getInitiationMethod() == null) ? 0 : getInitiationMethod().hashCode()); hashCode = prime * hashCode + ((getAgentContactState() == null) ? 0 : getAgentContactState().hashCode()); hashCode = prime * hashCode + ((getStateStartTimestamp() == null) ? 0 : getStateStartTimestamp().hashCode()); hashCode = prime * hashCode + ((getConnectedToAgentTimestamp() == null) ? 0 : getConnectedToAgentTimestamp() .hashCode()); hashCode = prime * hashCode + ((getQueue() == null) ? 0 : getQueue().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AgentContactReference == false) return false; AgentContactReference other = (AgentContactReference) obj; if (other.getContactId() == null ^ this.getContactId() == null) return false; if (other.getContactId() != null && other.getContactId().equals(this.getContactId()) == false) return false; if (other.getChannel() == null ^ this.getChannel() == null) return false; if (other.getChannel() != null && other.getChannel().equals(this.getChannel()) == false) return false; if (other.getInitiationMethod() == null ^ this.getInitiationMethod() == null) return false; if (other.getInitiationMethod() != null && other.getInitiationMethod().equals(this.getInitiationMethod()) == false) return false; if (other.getAgentContactState() == null ^ this.getAgentContactState() == null) return false; if (other.getAgentContactState() != null && other.getAgentContactState().equals(this.getAgentContactState()) == false) return false; if (other.getStateStartTimestamp() == null ^ this.getStateStartTimestamp() == null) return false; if (other.getStateStartTimestamp() != null && other.getStateStartTimestamp().equals(this.getStateStartTimestamp()) == false) return false; if (other.getConnectedToAgentTimestamp() == null ^ this.getConnectedToAgentTimestamp() == null) return false; if (other.getConnectedToAgentTimestamp() != null && other.getConnectedToAgentTimestamp().equals(this.getConnectedToAgentTimestamp()) == false) return false; if (other.getQueue() == null ^ this.getQueue() == null) return false; if (other.getQueue() != null && other.getQueue().equals(this.getQueue()) == false) return false; return true; } }