/* * 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.lexmodelsv2.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* An object containing information about a specific session. *
* * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SessionSpecification implements Serializable, Cloneable, StructuredPojo { /** ** The identifier of the alias of the bot that the session was held with. *
*/ private String botAliasId; /** ** The version of the bot that the session was held with. *
*/ private String botVersion; /** ** The locale of the bot that the session was held with. *
*/ private String localeId; /** ** The channel that is integrated with the bot that the session was held with. *
*/ private String channel; /** ** The identifier of the session. *
*/ private String sessionId; /** *
* The date and time when the conversation began. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
* The date and time when the conversation ended. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
* The duration of the conversation in seconds. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
* The final state of the conversation. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
* The mode of the session. The possible values are as follows: *
*
* Speech
– The session was spoken.
*
* Text
– The session was written.
*
* DTMF
– The session used a touch-tone keypad (Dual Tone Multi-Frequency).
*
* MultiMode
– The session used multiple modes.
*
* The number of turns that the session took. *
*/ private Long numberOfTurns; /** ** A list of objects containing the name of an intent that was invoked. *
*/ private java.util.List* The identifier of the first request in a session. *
*/ private String originatingRequestId; /** ** The identifier of the alias of the bot that the session was held with. *
* * @param botAliasId * The identifier of the alias of the bot that the session was held with. */ public void setBotAliasId(String botAliasId) { this.botAliasId = botAliasId; } /** ** The identifier of the alias of the bot that the session was held with. *
* * @return The identifier of the alias of the bot that the session was held with. */ public String getBotAliasId() { return this.botAliasId; } /** ** The identifier of the alias of the bot that the session was held with. *
* * @param botAliasId * The identifier of the alias of the bot that the session was held with. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionSpecification withBotAliasId(String botAliasId) { setBotAliasId(botAliasId); return this; } /** ** The version of the bot that the session was held with. *
* * @param botVersion * The version of the bot that the session was held with. */ public void setBotVersion(String botVersion) { this.botVersion = botVersion; } /** ** The version of the bot that the session was held with. *
* * @return The version of the bot that the session was held with. */ public String getBotVersion() { return this.botVersion; } /** ** The version of the bot that the session was held with. *
* * @param botVersion * The version of the bot that the session was held with. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionSpecification withBotVersion(String botVersion) { setBotVersion(botVersion); return this; } /** ** The locale of the bot that the session was held with. *
* * @param localeId * The locale of the bot that the session was held with. */ public void setLocaleId(String localeId) { this.localeId = localeId; } /** ** The locale of the bot that the session was held with. *
* * @return The locale of the bot that the session was held with. */ public String getLocaleId() { return this.localeId; } /** ** The locale of the bot that the session was held with. *
* * @param localeId * The locale of the bot that the session was held with. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionSpecification withLocaleId(String localeId) { setLocaleId(localeId); return this; } /** ** The channel that is integrated with the bot that the session was held with. *
* * @param channel * The channel that is integrated with the bot that the session was held with. */ public void setChannel(String channel) { this.channel = channel; } /** ** The channel that is integrated with the bot that the session was held with. *
* * @return The channel that is integrated with the bot that the session was held with. */ public String getChannel() { return this.channel; } /** ** The channel that is integrated with the bot that the session was held with. *
* * @param channel * The channel that is integrated with the bot that the session was held with. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionSpecification withChannel(String channel) { setChannel(channel); return this; } /** ** The identifier of the session. *
* * @param sessionId * The identifier of the session. */ public void setSessionId(String sessionId) { this.sessionId = sessionId; } /** ** The identifier of the session. *
* * @return The identifier of the session. */ public String getSessionId() { return this.sessionId; } /** ** The identifier of the session. *
* * @param sessionId * The identifier of the session. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionSpecification withSessionId(String sessionId) { setSessionId(sessionId); return this; } /** *
* The date and time when the conversation began. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
sessionId
and an originatingRequestId
.
*/
public void setConversationStartTime(java.util.Date conversationStartTime) {
this.conversationStartTime = conversationStartTime;
}
/**
*
* The date and time when the conversation began. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
sessionId
and an originatingRequestId
.
*/
public java.util.Date getConversationStartTime() {
return this.conversationStartTime;
}
/**
*
* The date and time when the conversation began. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
sessionId
and an originatingRequestId
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SessionSpecification withConversationStartTime(java.util.Date conversationStartTime) {
setConversationStartTime(conversationStartTime);
return this;
}
/**
*
* The date and time when the conversation ended. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
sessionId
and an originatingRequestId
.
*/
public void setConversationEndTime(java.util.Date conversationEndTime) {
this.conversationEndTime = conversationEndTime;
}
/**
*
* The date and time when the conversation ended. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
sessionId
and an originatingRequestId
.
*/
public java.util.Date getConversationEndTime() {
return this.conversationEndTime;
}
/**
*
* The date and time when the conversation ended. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
sessionId
and an originatingRequestId
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SessionSpecification withConversationEndTime(java.util.Date conversationEndTime) {
setConversationEndTime(conversationEndTime);
return this;
}
/**
*
* The duration of the conversation in seconds. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
sessionId
and an originatingRequestId
.
*/
public void setConversationDurationSeconds(Long conversationDurationSeconds) {
this.conversationDurationSeconds = conversationDurationSeconds;
}
/**
*
* The duration of the conversation in seconds. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
sessionId
and an originatingRequestId
.
*/
public Long getConversationDurationSeconds() {
return this.conversationDurationSeconds;
}
/**
*
* The duration of the conversation in seconds. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
sessionId
and an originatingRequestId
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SessionSpecification withConversationDurationSeconds(Long conversationDurationSeconds) {
setConversationDurationSeconds(conversationDurationSeconds);
return this;
}
/**
*
* The final state of the conversation. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
sessionId
and an originatingRequestId
.
* @see ConversationEndState
*/
public void setConversationEndState(String conversationEndState) {
this.conversationEndState = conversationEndState;
}
/**
*
* The final state of the conversation. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
sessionId
and an originatingRequestId
.
* @see ConversationEndState
*/
public String getConversationEndState() {
return this.conversationEndState;
}
/**
*
* The final state of the conversation. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
sessionId
and an originatingRequestId
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConversationEndState
*/
public SessionSpecification withConversationEndState(String conversationEndState) {
setConversationEndState(conversationEndState);
return this;
}
/**
*
* The final state of the conversation. A conversation is defined as a unique combination of a
* sessionId
and an originatingRequestId
.
*
sessionId
and an originatingRequestId
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConversationEndState
*/
public SessionSpecification withConversationEndState(ConversationEndState conversationEndState) {
this.conversationEndState = conversationEndState.toString();
return this;
}
/**
* * The mode of the session. The possible values are as follows: *
*
* Speech
– The session was spoken.
*
* Text
– The session was written.
*
* DTMF
– The session used a touch-tone keypad (Dual Tone Multi-Frequency).
*
* MultiMode
– The session used multiple modes.
*
* Speech
– The session was spoken.
*
* Text
– The session was written.
*
* DTMF
– The session used a touch-tone keypad (Dual Tone Multi-Frequency).
*
* MultiMode
– The session used multiple modes.
*
* The mode of the session. The possible values are as follows: *
*
* Speech
– The session was spoken.
*
* Text
– The session was written.
*
* DTMF
– The session used a touch-tone keypad (Dual Tone Multi-Frequency).
*
* MultiMode
– The session used multiple modes.
*
* Speech
– The session was spoken.
*
* Text
– The session was written.
*
* DTMF
– The session used a touch-tone keypad (Dual Tone Multi-Frequency).
*
* MultiMode
– The session used multiple modes.
*
* The mode of the session. The possible values are as follows: *
*
* Speech
– The session was spoken.
*
* Text
– The session was written.
*
* DTMF
– The session used a touch-tone keypad (Dual Tone Multi-Frequency).
*
* MultiMode
– The session used multiple modes.
*
* Speech
– The session was spoken.
*
* Text
– The session was written.
*
* DTMF
– The session used a touch-tone keypad (Dual Tone Multi-Frequency).
*
* MultiMode
– The session used multiple modes.
*
* The mode of the session. The possible values are as follows: *
*
* Speech
– The session was spoken.
*
* Text
– The session was written.
*
* DTMF
– The session used a touch-tone keypad (Dual Tone Multi-Frequency).
*
* MultiMode
– The session used multiple modes.
*
* Speech
– The session was spoken.
*
* Text
– The session was written.
*
* DTMF
– The session used a touch-tone keypad (Dual Tone Multi-Frequency).
*
* MultiMode
– The session used multiple modes.
*
* The number of turns that the session took. *
* * @param numberOfTurns * The number of turns that the session took. */ public void setNumberOfTurns(Long numberOfTurns) { this.numberOfTurns = numberOfTurns; } /** ** The number of turns that the session took. *
* * @return The number of turns that the session took. */ public Long getNumberOfTurns() { return this.numberOfTurns; } /** ** The number of turns that the session took. *
* * @param numberOfTurns * The number of turns that the session took. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionSpecification withNumberOfTurns(Long numberOfTurns) { setNumberOfTurns(numberOfTurns); return this; } /** ** A list of objects containing the name of an intent that was invoked. *
* * @return A list of objects containing the name of an intent that was invoked. */ public java.util.List* A list of objects containing the name of an intent that was invoked. *
* * @param invokedIntentSamples * A list of objects containing the name of an intent that was invoked. */ public void setInvokedIntentSamples(java.util.Collection* A list of objects containing the name of an intent that was invoked. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setInvokedIntentSamples(java.util.Collection)} or {@link #withInvokedIntentSamples(java.util.Collection)} * if you want to override the existing values. *
* * @param invokedIntentSamples * A list of objects containing the name of an intent that was invoked. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionSpecification withInvokedIntentSamples(InvokedIntentSample... invokedIntentSamples) { if (this.invokedIntentSamples == null) { setInvokedIntentSamples(new java.util.ArrayList* A list of objects containing the name of an intent that was invoked. *
* * @param invokedIntentSamples * A list of objects containing the name of an intent that was invoked. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionSpecification withInvokedIntentSamples(java.util.Collection* The identifier of the first request in a session. *
* * @param originatingRequestId * The identifier of the first request in a session. */ public void setOriginatingRequestId(String originatingRequestId) { this.originatingRequestId = originatingRequestId; } /** ** The identifier of the first request in a session. *
* * @return The identifier of the first request in a session. */ public String getOriginatingRequestId() { return this.originatingRequestId; } /** ** The identifier of the first request in a session. *
* * @param originatingRequestId * The identifier of the first request in a session. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionSpecification withOriginatingRequestId(String originatingRequestId) { setOriginatingRequestId(originatingRequestId); 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 (getBotAliasId() != null) sb.append("BotAliasId: ").append(getBotAliasId()).append(","); if (getBotVersion() != null) sb.append("BotVersion: ").append(getBotVersion()).append(","); if (getLocaleId() != null) sb.append("LocaleId: ").append(getLocaleId()).append(","); if (getChannel() != null) sb.append("Channel: ").append(getChannel()).append(","); if (getSessionId() != null) sb.append("SessionId: ").append(getSessionId()).append(","); if (getConversationStartTime() != null) sb.append("ConversationStartTime: ").append(getConversationStartTime()).append(","); if (getConversationEndTime() != null) sb.append("ConversationEndTime: ").append(getConversationEndTime()).append(","); if (getConversationDurationSeconds() != null) sb.append("ConversationDurationSeconds: ").append(getConversationDurationSeconds()).append(","); if (getConversationEndState() != null) sb.append("ConversationEndState: ").append(getConversationEndState()).append(","); if (getMode() != null) sb.append("Mode: ").append(getMode()).append(","); if (getNumberOfTurns() != null) sb.append("NumberOfTurns: ").append(getNumberOfTurns()).append(","); if (getInvokedIntentSamples() != null) sb.append("InvokedIntentSamples: ").append(getInvokedIntentSamples()).append(","); if (getOriginatingRequestId() != null) sb.append("OriginatingRequestId: ").append(getOriginatingRequestId()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SessionSpecification == false) return false; SessionSpecification other = (SessionSpecification) obj; if (other.getBotAliasId() == null ^ this.getBotAliasId() == null) return false; if (other.getBotAliasId() != null && other.getBotAliasId().equals(this.getBotAliasId()) == false) return false; if (other.getBotVersion() == null ^ this.getBotVersion() == null) return false; if (other.getBotVersion() != null && other.getBotVersion().equals(this.getBotVersion()) == false) return false; if (other.getLocaleId() == null ^ this.getLocaleId() == null) return false; if (other.getLocaleId() != null && other.getLocaleId().equals(this.getLocaleId()) == 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.getSessionId() == null ^ this.getSessionId() == null) return false; if (other.getSessionId() != null && other.getSessionId().equals(this.getSessionId()) == false) return false; if (other.getConversationStartTime() == null ^ this.getConversationStartTime() == null) return false; if (other.getConversationStartTime() != null && other.getConversationStartTime().equals(this.getConversationStartTime()) == false) return false; if (other.getConversationEndTime() == null ^ this.getConversationEndTime() == null) return false; if (other.getConversationEndTime() != null && other.getConversationEndTime().equals(this.getConversationEndTime()) == false) return false; if (other.getConversationDurationSeconds() == null ^ this.getConversationDurationSeconds() == null) return false; if (other.getConversationDurationSeconds() != null && other.getConversationDurationSeconds().equals(this.getConversationDurationSeconds()) == false) return false; if (other.getConversationEndState() == null ^ this.getConversationEndState() == null) return false; if (other.getConversationEndState() != null && other.getConversationEndState().equals(this.getConversationEndState()) == false) return false; if (other.getMode() == null ^ this.getMode() == null) return false; if (other.getMode() != null && other.getMode().equals(this.getMode()) == false) return false; if (other.getNumberOfTurns() == null ^ this.getNumberOfTurns() == null) return false; if (other.getNumberOfTurns() != null && other.getNumberOfTurns().equals(this.getNumberOfTurns()) == false) return false; if (other.getInvokedIntentSamples() == null ^ this.getInvokedIntentSamples() == null) return false; if (other.getInvokedIntentSamples() != null && other.getInvokedIntentSamples().equals(this.getInvokedIntentSamples()) == false) return false; if (other.getOriginatingRequestId() == null ^ this.getOriginatingRequestId() == null) return false; if (other.getOriginatingRequestId() != null && other.getOriginatingRequestId().equals(this.getOriginatingRequestId()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBotAliasId() == null) ? 0 : getBotAliasId().hashCode()); hashCode = prime * hashCode + ((getBotVersion() == null) ? 0 : getBotVersion().hashCode()); hashCode = prime * hashCode + ((getLocaleId() == null) ? 0 : getLocaleId().hashCode()); hashCode = prime * hashCode + ((getChannel() == null) ? 0 : getChannel().hashCode()); hashCode = prime * hashCode + ((getSessionId() == null) ? 0 : getSessionId().hashCode()); hashCode = prime * hashCode + ((getConversationStartTime() == null) ? 0 : getConversationStartTime().hashCode()); hashCode = prime * hashCode + ((getConversationEndTime() == null) ? 0 : getConversationEndTime().hashCode()); hashCode = prime * hashCode + ((getConversationDurationSeconds() == null) ? 0 : getConversationDurationSeconds().hashCode()); hashCode = prime * hashCode + ((getConversationEndState() == null) ? 0 : getConversationEndState().hashCode()); hashCode = prime * hashCode + ((getMode() == null) ? 0 : getMode().hashCode()); hashCode = prime * hashCode + ((getNumberOfTurns() == null) ? 0 : getNumberOfTurns().hashCode()); hashCode = prime * hashCode + ((getInvokedIntentSamples() == null) ? 0 : getInvokedIntentSamples().hashCode()); hashCode = prime * hashCode + ((getOriginatingRequestId() == null) ? 0 : getOriginatingRequestId().hashCode()); return hashCode; } @Override public SessionSpecification clone() { try { return (SessionSpecification) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.lexmodelsv2.model.transform.SessionSpecificationMarshaller.getInstance().marshall(this, protocolMarshaller); } }