/* * 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.lexruntime.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 { /** *

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

*

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

* * @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 Returns a reference to this object so that method calls can be chained together. */ public GetSessionResult withRecentIntentSummaryView(IntentSummary... recentIntentSummaryView) { if (this.recentIntentSummaryView == null) { setRecentIntentSummaryView(new java.util.ArrayList(recentIntentSummaryView.length)); } for (IntentSummary ele : recentIntentSummaryView) { this.recentIntentSummaryView.add(ele); } 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. *

* * @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 Returns a reference to this 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. *

* * @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 Returns a reference to this object so that method calls can be chained together. */ public GetSessionResult withSessionAttributes(java.util.Map sessionAttributes) { setSessionAttributes(sessionAttributes); return this; } /** * Add a single SessionAttributes entry * * @see GetSessionResult#withSessionAttributes * @returns a reference to this 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. * * @return 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. *

* * @param sessionId * A unique identifier for the session. */ public void setSessionId(String sessionId) { this.sessionId = sessionId; } /** *

* A unique identifier for the session. *

* * @return A unique identifier for the session. */ public String getSessionId() { return this.sessionId; } /** *

* A unique identifier for the session. *

* * @param sessionId * A unique identifier for the 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; } /** *

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

* * @return Describes the current state of the bot. */ public DialogAction getDialogAction() { return this.dialogAction; } /** *

* Describes the current state of the bot. *

* * @param dialogAction * Describes the current state of the bot. * @return Returns a reference to this object so that method calls can be chained together. */ public GetSessionResult withDialogAction(DialogAction dialogAction) { setDialogAction(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. *

*

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

* * @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 Returns a reference to this object so that method calls can be chained together. */ public GetSessionResult withActiveContexts(ActiveContext... activeContexts) { if (this.activeContexts == null) { setActiveContexts(new java.util.ArrayList(activeContexts.length)); } for (ActiveContext ele : activeContexts) { this.activeContexts.add(ele); } 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. *

* * @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 Returns a reference to this 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. 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 (getRecentIntentSummaryView() != null) sb.append("RecentIntentSummaryView: ").append(getRecentIntentSummaryView()).append(","); if (getSessionAttributes() != null) sb.append("SessionAttributes: ").append("***Sensitive Data Redacted***").append(","); if (getSessionId() != null) sb.append("SessionId: ").append(getSessionId()).append(","); if (getDialogAction() != null) sb.append("DialogAction: ").append(getDialogAction()).append(","); if (getActiveContexts() != null) sb.append("ActiveContexts: ").append("***Sensitive Data Redacted***"); 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.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; } @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 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); } } }