/* * Copyright 2010-2021 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.lexrts.model; import java.io.Serializable; public class GetSessionResult implements Serializable { /** *

* An array of information about the intents used in the session. The array * can contain a maximum of three summaries. If more than three intents are * used in the session, the recentIntentSummaryView operation * contains information about the last three intents used. *

*

* If you set the checkpointLabelFilter parameter in the * request, the array contains only the intents with the specified label. *

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

* Map of key/value pairs representing the session-specific context * information. It contains application information passed between Amazon * Lex and a client application. *

*/ private java.util.Map sessionAttributes; /** *

* A unique identifier for the session. *

*/ private String sessionId; /** *

* Describes the current state of the bot. *

*/ private DialogAction dialogAction; /** *

* A list of active contexts for the session. A context can be set when an * intent is fulfilled or by calling the PostContent, * PostText, or PutSession operation. *

*

* You can use a context to control the intents that can follow up an * intent, or to modify the operation of your application. *

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

* An array of information about the intents used in the session. The array * can contain a maximum of three summaries. If more than three intents are * used in the session, the recentIntentSummaryView operation * contains information about the last three intents used. *

*

* If you set the checkpointLabelFilter parameter in the * request, the array contains only the intents with the specified label. *

* * @return

* An array of information about the intents used in the session. * The array can contain a maximum of three summaries. If more than * three intents are used in the session, the * recentIntentSummaryView operation contains * information about the last three intents used. *

*

* If you set the checkpointLabelFilter parameter in * the request, the array contains only the intents with the * specified label. *

*/ public java.util.List getRecentIntentSummaryView() { return recentIntentSummaryView; } /** *

* An array of information about the intents used in the session. The array * can contain a maximum of three summaries. If more than three intents are * used in the session, the recentIntentSummaryView operation * contains information about the last three intents used. *

*

* If you set the checkpointLabelFilter parameter in the * request, the array contains only the intents with the specified label. *

* * @param recentIntentSummaryView

* An array of information about the intents used in the session. * The array can contain a maximum of three summaries. If more * than three intents are used in the session, the * recentIntentSummaryView operation contains * information about the last three intents used. *

*

* If you set the checkpointLabelFilter parameter in * the request, the array contains only the intents with the * specified label. *

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

* An array of information about the intents used in the session. The array * can contain a maximum of three summaries. If more than three intents are * used in the session, the recentIntentSummaryView operation * contains information about the last three intents used. *

*

* If you set the checkpointLabelFilter parameter in the * request, the array contains only the intents with the specified label. *

*

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

* An array of information about the intents used in the session. * The array can contain a maximum of three summaries. If more * than three intents are used in the session, the * recentIntentSummaryView operation contains * information about the last three intents used. *

*

* If you set the checkpointLabelFilter parameter in * the request, the array contains only the intents with the * specified label. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetSessionResult withRecentIntentSummaryView(IntentSummary... recentIntentSummaryView) { if (getRecentIntentSummaryView() == null) { this.recentIntentSummaryView = new java.util.ArrayList( recentIntentSummaryView.length); } for (IntentSummary value : recentIntentSummaryView) { this.recentIntentSummaryView.add(value); } return this; } /** *

* An array of information about the intents used in the session. The array * can contain a maximum of three summaries. If more than three intents are * used in the session, the recentIntentSummaryView operation * contains information about the last three intents used. *

*

* If you set the checkpointLabelFilter parameter in the * request, the array contains only the intents with the specified label. *

*

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

* An array of information about the intents used in the session. * The array can contain a maximum of three summaries. If more * than three intents are used in the session, the * recentIntentSummaryView operation contains * information about the last three intents used. *

*

* If you set the checkpointLabelFilter parameter in * the request, the array contains only the intents with the * specified label. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetSessionResult withRecentIntentSummaryView( java.util.Collection recentIntentSummaryView) { setRecentIntentSummaryView(recentIntentSummaryView); return this; } /** *

* Map of key/value pairs representing the session-specific context * information. It contains application information passed between Amazon * Lex and a client application. *

* * @return

* Map of key/value pairs representing the session-specific context * information. It contains application information passed between * Amazon Lex and a client application. *

*/ public java.util.Map getSessionAttributes() { return sessionAttributes; } /** *

* Map of key/value pairs representing the session-specific context * information. It contains application information passed between Amazon * Lex and a client application. *

* * @param sessionAttributes

* Map of key/value pairs representing the session-specific * context information. It contains application information * passed between Amazon Lex and a client application. *

*/ public void setSessionAttributes(java.util.Map sessionAttributes) { this.sessionAttributes = sessionAttributes; } /** *

* Map of key/value pairs representing the session-specific context * information. It contains application information passed between Amazon * Lex and a client application. *

*

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

* Map of key/value pairs representing the session-specific * context information. It contains application information * passed between Amazon Lex and a client application. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetSessionResult withSessionAttributes(java.util.Map sessionAttributes) { this.sessionAttributes = sessionAttributes; return this; } /** *

* Map of key/value pairs representing the session-specific context * information. It contains application information passed between Amazon * Lex and a client application. *

*

* The method adds a new key-value pair into sessionAttributes parameter, * and returns a reference to this object so that method calls can be * chained together. * * @param key The key of the entry to be added into sessionAttributes. * @param value The corresponding value of the entry to be added into * sessionAttributes. * @return A reference to this updated object so that method calls can be * chained together. */ public GetSessionResult addsessionAttributesEntry(String key, String value) { if (null == this.sessionAttributes) { this.sessionAttributes = new java.util.HashMap(); } if (this.sessionAttributes.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.sessionAttributes.put(key, value); return this; } /** * Removes all the entries added into sessionAttributes. *

* Returns a reference to this object so that method calls can be chained * together. */ public GetSessionResult clearsessionAttributesEntries() { this.sessionAttributes = null; return this; } /** *

* A unique identifier for the session. *

* * @return

* A unique identifier for the session. *

*/ public String getSessionId() { return sessionId; } /** *

* A unique identifier for the session. *

* * @param sessionId

* A unique identifier for the session. *

*/ public void setSessionId(String sessionId) { this.sessionId = sessionId; } /** *

* A unique identifier for the session. *

*

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

* A unique identifier for the session. *

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

* Describes the current state of the bot. *

* * @return

* Describes the current state of the bot. *

*/ public DialogAction getDialogAction() { return dialogAction; } /** *

* Describes the current state of the bot. *

* * @param dialogAction

* Describes the current state of the bot. *

*/ public void setDialogAction(DialogAction dialogAction) { this.dialogAction = dialogAction; } /** *

* Describes the current state of the bot. *

*

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

* Describes the current state of the bot. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetSessionResult withDialogAction(DialogAction dialogAction) { this.dialogAction = dialogAction; return this; } /** *

* A list of active contexts for the session. A context can be set when an * intent is fulfilled or by calling the PostContent, * PostText, or PutSession operation. *

*

* You can use a context to control the intents that can follow up an * intent, or to modify the operation of your application. *

* * @return

* A list of active contexts for the session. A context can be set * when an intent is fulfilled or by calling the * PostContent, PostText, or * PutSession operation. *

*

* You can use a context to control the intents that can follow up * an intent, or to modify the operation of your application. *

*/ public java.util.List getActiveContexts() { return activeContexts; } /** *

* A list of active contexts for the session. A context can be set when an * intent is fulfilled or by calling the PostContent, * PostText, or PutSession operation. *

*

* You can use a context to control the intents that can follow up an * intent, or to modify the operation of your application. *

* * @param activeContexts

* A list of active contexts for the session. A context can be * set when an intent is fulfilled or by calling the * PostContent, PostText, or * PutSession operation. *

*

* You can use a context to control the intents that can follow * up an intent, or to modify the operation of your application. *

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

* A list of active contexts for the session. A context can be set when an * intent is fulfilled or by calling the PostContent, * PostText, or PutSession operation. *

*

* You can use a context to control the intents that can follow up an * intent, or to modify the operation of your application. *

*

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

* A list of active contexts for the session. A context can be * set when an intent is fulfilled or by calling the * PostContent, PostText, or * PutSession operation. *

*

* You can use a context to control the intents that can follow * up an intent, or to modify the operation of your application. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetSessionResult withActiveContexts(ActiveContext... activeContexts) { if (getActiveContexts() == null) { this.activeContexts = new java.util.ArrayList(activeContexts.length); } for (ActiveContext value : activeContexts) { this.activeContexts.add(value); } return this; } /** *

* A list of active contexts for the session. A context can be set when an * intent is fulfilled or by calling the PostContent, * PostText, or PutSession operation. *

*

* You can use a context to control the intents that can follow up an * intent, or to modify the operation of your application. *

*

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

* A list of active contexts for the session. A context can be * set when an intent is fulfilled or by calling the * PostContent, PostText, or * PutSession operation. *

*

* You can use a context to control the intents that can follow * up an intent, or to modify the operation of your application. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetSessionResult withActiveContexts(java.util.Collection activeContexts) { setActiveContexts(activeContexts); 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 (getRecentIntentSummaryView() != null) sb.append("recentIntentSummaryView: " + getRecentIntentSummaryView() + ","); if (getSessionAttributes() != null) sb.append("sessionAttributes: " + getSessionAttributes() + ","); if (getSessionId() != null) sb.append("sessionId: " + getSessionId() + ","); if (getDialogAction() != null) sb.append("dialogAction: " + getDialogAction() + ","); if (getActiveContexts() != null) sb.append("activeContexts: " + getActiveContexts()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRecentIntentSummaryView() == null) ? 0 : getRecentIntentSummaryView() .hashCode()); hashCode = prime * hashCode + ((getSessionAttributes() == null) ? 0 : getSessionAttributes().hashCode()); hashCode = prime * hashCode + ((getSessionId() == null) ? 0 : getSessionId().hashCode()); hashCode = prime * hashCode + ((getDialogAction() == null) ? 0 : getDialogAction().hashCode()); hashCode = prime * hashCode + ((getActiveContexts() == null) ? 0 : getActiveContexts().hashCode()); return hashCode; } @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.getRecentIntentSummaryView() == null ^ this.getRecentIntentSummaryView() == null) return false; if (other.getRecentIntentSummaryView() != null && other.getRecentIntentSummaryView().equals(this.getRecentIntentSummaryView()) == false) return false; if (other.getSessionAttributes() == null ^ this.getSessionAttributes() == null) return false; if (other.getSessionAttributes() != null && other.getSessionAttributes().equals(this.getSessionAttributes()) == 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.getDialogAction() == null ^ this.getDialogAction() == null) return false; if (other.getDialogAction() != null && other.getDialogAction().equals(this.getDialogAction()) == false) return false; if (other.getActiveContexts() == null ^ this.getActiveContexts() == null) return false; if (other.getActiveContexts() != null && other.getActiveContexts().equals(this.getActiveContexts()) == false) return false; return true; } }