/* * 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.lexruntimev2.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GetSessionResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable { /** *

* The identifier of the returned session. *

*/ private String sessionId; /** *

* A list of messages that were last sent to the user. The messages are ordered based on the order that your * returned the messages from your Lambda function or the order that messages are defined in the bot. *

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

* A list of intents that Amazon Lex V2 determined might satisfy the user's utterance. *

*

* Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the * interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in * the utterance. *

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

* Represents the current state of the dialog between the user and the bot. *

*

* You can use this to determine the progress of the conversation and what the next action might be. *

*/ private SessionState sessionState; /** *

* The identifier of the returned session. *

* * @param sessionId * The identifier of the returned session. */ public void setSessionId(String sessionId) { this.sessionId = sessionId; } /** *

* The identifier of the returned session. *

* * @return The identifier of the returned session. */ public String getSessionId() { return this.sessionId; } /** *

* The identifier of the returned session. *

* * @param sessionId * The identifier of the returned session. * @return Returns a reference to this object so that method calls can be chained together. */ public GetSessionResult withSessionId(String sessionId) { setSessionId(sessionId); return this; } /** *

* A list of messages that were last sent to the user. The messages are ordered based on the order that your * returned the messages from your Lambda function or the order that messages are defined in the bot. *

* * @return A list of messages that were last sent to the user. The messages are ordered based on the order that your * returned the messages from your Lambda function or the order that messages are defined in the bot. */ public java.util.List getMessages() { return messages; } /** *

* A list of messages that were last sent to the user. The messages are ordered based on the order that your * returned the messages from your Lambda function or the order that messages are defined in the bot. *

* * @param messages * A list of messages that were last sent to the user. The messages are ordered based on the order that your * returned the messages from your Lambda function or the order that messages are defined in the bot. */ public void setMessages(java.util.Collection messages) { if (messages == null) { this.messages = null; return; } this.messages = new java.util.ArrayList(messages); } /** *

* A list of messages that were last sent to the user. The messages are ordered based on the order that your * returned the messages from your Lambda function or the order that messages are defined in the bot. *

*

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

* * @param messages * A list of messages that were last sent to the user. The messages are ordered based on the order that your * returned the messages from your Lambda function or the order that messages are defined in the bot. * @return Returns a reference to this object so that method calls can be chained together. */ public GetSessionResult withMessages(Message... messages) { if (this.messages == null) { setMessages(new java.util.ArrayList(messages.length)); } for (Message ele : messages) { this.messages.add(ele); } return this; } /** *

* A list of messages that were last sent to the user. The messages are ordered based on the order that your * returned the messages from your Lambda function or the order that messages are defined in the bot. *

* * @param messages * A list of messages that were last sent to the user. The messages are ordered based on the order that your * returned the messages from your Lambda function or the order that messages are defined in the bot. * @return Returns a reference to this object so that method calls can be chained together. */ public GetSessionResult withMessages(java.util.Collection messages) { setMessages(messages); return this; } /** *

* A list of intents that Amazon Lex V2 determined might satisfy the user's utterance. *

*

* Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the * interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in * the utterance. *

* * @return A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.

*

* Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the * interpretation is the correct one, and an optional sentiment response that indicates the sentiment * expressed in the utterance. */ public java.util.List getInterpretations() { return interpretations; } /** *

* A list of intents that Amazon Lex V2 determined might satisfy the user's utterance. *

*

* Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the * interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in * the utterance. *

* * @param interpretations * A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.

*

* Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the * interpretation is the correct one, and an optional sentiment response that indicates the sentiment * expressed in the utterance. */ public void setInterpretations(java.util.Collection interpretations) { if (interpretations == null) { this.interpretations = null; return; } this.interpretations = new java.util.ArrayList(interpretations); } /** *

* A list of intents that Amazon Lex V2 determined might satisfy the user's utterance. *

*

* Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the * interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in * the utterance. *

*

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

* * @param interpretations * A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.

*

* Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the * interpretation is the correct one, and an optional sentiment response that indicates the sentiment * expressed in the utterance. * @return Returns a reference to this object so that method calls can be chained together. */ public GetSessionResult withInterpretations(Interpretation... interpretations) { if (this.interpretations == null) { setInterpretations(new java.util.ArrayList(interpretations.length)); } for (Interpretation ele : interpretations) { this.interpretations.add(ele); } return this; } /** *

* A list of intents that Amazon Lex V2 determined might satisfy the user's utterance. *

*

* Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the * interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in * the utterance. *

* * @param interpretations * A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.

*

* Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the * interpretation is the correct one, and an optional sentiment response that indicates the sentiment * expressed in the utterance. * @return Returns a reference to this object so that method calls can be chained together. */ public GetSessionResult withInterpretations(java.util.Collection interpretations) { setInterpretations(interpretations); return this; } /** *

* Represents the current state of the dialog between the user and the bot. *

*

* You can use this to determine the progress of the conversation and what the next action might be. *

* * @param sessionState * Represents the current state of the dialog between the user and the bot.

*

* You can use this to determine the progress of the conversation and what the next action might be. */ public void setSessionState(SessionState sessionState) { this.sessionState = sessionState; } /** *

* Represents the current state of the dialog between the user and the bot. *

*

* You can use this to determine the progress of the conversation and what the next action might be. *

* * @return Represents the current state of the dialog between the user and the bot.

*

* You can use this to determine the progress of the conversation and what the next action might be. */ public SessionState getSessionState() { return this.sessionState; } /** *

* Represents the current state of the dialog between the user and the bot. *

*

* You can use this to determine the progress of the conversation and what the next action might be. *

* * @param sessionState * Represents the current state of the dialog between the user and the bot.

*

* You can use this to determine the progress of the conversation and what the next action might be. * @return Returns a reference to this object so that method calls can be chained together. */ public GetSessionResult withSessionState(SessionState sessionState) { setSessionState(sessionState); 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 (getSessionId() != null) sb.append("SessionId: ").append(getSessionId()).append(","); if (getMessages() != null) sb.append("Messages: ").append(getMessages()).append(","); if (getInterpretations() != null) sb.append("Interpretations: ").append(getInterpretations()).append(","); if (getSessionState() != null) sb.append("SessionState: ").append(getSessionState()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetSessionResult == false) return false; GetSessionResult other = (GetSessionResult) obj; if (other.getSessionId() == null ^ this.getSessionId() == null) return false; if (other.getSessionId() != null && other.getSessionId().equals(this.getSessionId()) == false) return false; if (other.getMessages() == null ^ this.getMessages() == null) return false; if (other.getMessages() != null && other.getMessages().equals(this.getMessages()) == false) return false; if (other.getInterpretations() == null ^ this.getInterpretations() == null) return false; if (other.getInterpretations() != null && other.getInterpretations().equals(this.getInterpretations()) == false) return false; if (other.getSessionState() == null ^ this.getSessionState() == null) return false; if (other.getSessionState() != null && other.getSessionState().equals(this.getSessionState()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSessionId() == null) ? 0 : getSessionId().hashCode()); hashCode = prime * hashCode + ((getMessages() == null) ? 0 : getMessages().hashCode()); hashCode = prime * hashCode + ((getInterpretations() == null) ? 0 : getInterpretations().hashCode()); hashCode = prime * hashCode + ((getSessionState() == null) ? 0 : getSessionState().hashCode()); return hashCode; } @Override public GetSessionResult clone() { try { return (GetSessionResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }