1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #pragma once
7 #include <aws/lexv2-runtime/LexRuntimeV2_EXPORTS.h>
8 #include <aws/core/utils/memory/stl/AWSString.h>
9 #include <aws/lexv2-runtime/model/ActiveContextTimeToLive.h>
10 #include <aws/core/utils/memory/stl/AWSMap.h>
11 #include <utility>
12 
13 namespace Aws
14 {
15 namespace Utils
16 {
17 namespace Json
18 {
19   class JsonValue;
20   class JsonView;
21 } // namespace Json
22 } // namespace Utils
23 namespace LexRuntimeV2
24 {
25 namespace Model
26 {
27 
28   /**
29    * <p>Contains information about the contexts that a user is using in a session.
30    * You can configure Amazon Lex V2 to set a context when an intent is fulfilled, or
31    * you can set a context using the , , or operations.</p> <p>Use a context to
32    * indicate to Amazon Lex V2 intents that should be used as follow-up intents. For
33    * example, if the active context is <code>order-fulfilled</code>, only intents
34    * that have <code>order-fulfilled</code> configured as a trigger are considered
35    * for follow up.</p><p><h3>See Also:</h3>   <a
36    * href="http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/ActiveContext">AWS
37    * API Reference</a></p>
38    */
39   class AWS_LEXRUNTIMEV2_API ActiveContext
40   {
41   public:
42     ActiveContext();
43     ActiveContext(Aws::Utils::Json::JsonView jsonValue);
44     ActiveContext& operator=(Aws::Utils::Json::JsonView jsonValue);
45     Aws::Utils::Json::JsonValue Jsonize() const;
46 
47 
48     /**
49      * <p>The name of the context.</p>
50      */
GetName()51     inline const Aws::String& GetName() const{ return m_name; }
52 
53     /**
54      * <p>The name of the context.</p>
55      */
NameHasBeenSet()56     inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
57 
58     /**
59      * <p>The name of the context.</p>
60      */
SetName(const Aws::String & value)61     inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }
62 
63     /**
64      * <p>The name of the context.</p>
65      */
SetName(Aws::String && value)66     inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }
67 
68     /**
69      * <p>The name of the context.</p>
70      */
SetName(const char * value)71     inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }
72 
73     /**
74      * <p>The name of the context.</p>
75      */
WithName(const Aws::String & value)76     inline ActiveContext& WithName(const Aws::String& value) { SetName(value); return *this;}
77 
78     /**
79      * <p>The name of the context.</p>
80      */
WithName(Aws::String && value)81     inline ActiveContext& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}
82 
83     /**
84      * <p>The name of the context.</p>
85      */
WithName(const char * value)86     inline ActiveContext& WithName(const char* value) { SetName(value); return *this;}
87 
88 
89     /**
90      * <p>Indicates the number of turns or seconds that the context is active. Once the
91      * time to live expires, the context is no longer returned in a response.</p>
92      */
GetTimeToLive()93     inline const ActiveContextTimeToLive& GetTimeToLive() const{ return m_timeToLive; }
94 
95     /**
96      * <p>Indicates the number of turns or seconds that the context is active. Once the
97      * time to live expires, the context is no longer returned in a response.</p>
98      */
TimeToLiveHasBeenSet()99     inline bool TimeToLiveHasBeenSet() const { return m_timeToLiveHasBeenSet; }
100 
101     /**
102      * <p>Indicates the number of turns or seconds that the context is active. Once the
103      * time to live expires, the context is no longer returned in a response.</p>
104      */
SetTimeToLive(const ActiveContextTimeToLive & value)105     inline void SetTimeToLive(const ActiveContextTimeToLive& value) { m_timeToLiveHasBeenSet = true; m_timeToLive = value; }
106 
107     /**
108      * <p>Indicates the number of turns or seconds that the context is active. Once the
109      * time to live expires, the context is no longer returned in a response.</p>
110      */
SetTimeToLive(ActiveContextTimeToLive && value)111     inline void SetTimeToLive(ActiveContextTimeToLive&& value) { m_timeToLiveHasBeenSet = true; m_timeToLive = std::move(value); }
112 
113     /**
114      * <p>Indicates the number of turns or seconds that the context is active. Once the
115      * time to live expires, the context is no longer returned in a response.</p>
116      */
WithTimeToLive(const ActiveContextTimeToLive & value)117     inline ActiveContext& WithTimeToLive(const ActiveContextTimeToLive& value) { SetTimeToLive(value); return *this;}
118 
119     /**
120      * <p>Indicates the number of turns or seconds that the context is active. Once the
121      * time to live expires, the context is no longer returned in a response.</p>
122      */
WithTimeToLive(ActiveContextTimeToLive && value)123     inline ActiveContext& WithTimeToLive(ActiveContextTimeToLive&& value) { SetTimeToLive(std::move(value)); return *this;}
124 
125 
126     /**
127      * <p>A list of contexts active for the request. A context can be activated when a
128      * previous intent is fulfilled, or by including the context in the request.</p>
129      * <p>If you don't specify a list of contexts, Amazon Lex V2 will use the current
130      * list of contexts for the session. If you specify an empty list, all contexts for
131      * the session are cleared. </p>
132      */
GetContextAttributes()133     inline const Aws::Map<Aws::String, Aws::String>& GetContextAttributes() const{ return m_contextAttributes; }
134 
135     /**
136      * <p>A list of contexts active for the request. A context can be activated when a
137      * previous intent is fulfilled, or by including the context in the request.</p>
138      * <p>If you don't specify a list of contexts, Amazon Lex V2 will use the current
139      * list of contexts for the session. If you specify an empty list, all contexts for
140      * the session are cleared. </p>
141      */
ContextAttributesHasBeenSet()142     inline bool ContextAttributesHasBeenSet() const { return m_contextAttributesHasBeenSet; }
143 
144     /**
145      * <p>A list of contexts active for the request. A context can be activated when a
146      * previous intent is fulfilled, or by including the context in the request.</p>
147      * <p>If you don't specify a list of contexts, Amazon Lex V2 will use the current
148      * list of contexts for the session. If you specify an empty list, all contexts for
149      * the session are cleared. </p>
150      */
SetContextAttributes(const Aws::Map<Aws::String,Aws::String> & value)151     inline void SetContextAttributes(const Aws::Map<Aws::String, Aws::String>& value) { m_contextAttributesHasBeenSet = true; m_contextAttributes = value; }
152 
153     /**
154      * <p>A list of contexts active for the request. A context can be activated when a
155      * previous intent is fulfilled, or by including the context in the request.</p>
156      * <p>If you don't specify a list of contexts, Amazon Lex V2 will use the current
157      * list of contexts for the session. If you specify an empty list, all contexts for
158      * the session are cleared. </p>
159      */
SetContextAttributes(Aws::Map<Aws::String,Aws::String> && value)160     inline void SetContextAttributes(Aws::Map<Aws::String, Aws::String>&& value) { m_contextAttributesHasBeenSet = true; m_contextAttributes = std::move(value); }
161 
162     /**
163      * <p>A list of contexts active for the request. A context can be activated when a
164      * previous intent is fulfilled, or by including the context in the request.</p>
165      * <p>If you don't specify a list of contexts, Amazon Lex V2 will use the current
166      * list of contexts for the session. If you specify an empty list, all contexts for
167      * the session are cleared. </p>
168      */
WithContextAttributes(const Aws::Map<Aws::String,Aws::String> & value)169     inline ActiveContext& WithContextAttributes(const Aws::Map<Aws::String, Aws::String>& value) { SetContextAttributes(value); return *this;}
170 
171     /**
172      * <p>A list of contexts active for the request. A context can be activated when a
173      * previous intent is fulfilled, or by including the context in the request.</p>
174      * <p>If you don't specify a list of contexts, Amazon Lex V2 will use the current
175      * list of contexts for the session. If you specify an empty list, all contexts for
176      * the session are cleared. </p>
177      */
WithContextAttributes(Aws::Map<Aws::String,Aws::String> && value)178     inline ActiveContext& WithContextAttributes(Aws::Map<Aws::String, Aws::String>&& value) { SetContextAttributes(std::move(value)); return *this;}
179 
180     /**
181      * <p>A list of contexts active for the request. A context can be activated when a
182      * previous intent is fulfilled, or by including the context in the request.</p>
183      * <p>If you don't specify a list of contexts, Amazon Lex V2 will use the current
184      * list of contexts for the session. If you specify an empty list, all contexts for
185      * the session are cleared. </p>
186      */
AddContextAttributes(const Aws::String & key,const Aws::String & value)187     inline ActiveContext& AddContextAttributes(const Aws::String& key, const Aws::String& value) { m_contextAttributesHasBeenSet = true; m_contextAttributes.emplace(key, value); return *this; }
188 
189     /**
190      * <p>A list of contexts active for the request. A context can be activated when a
191      * previous intent is fulfilled, or by including the context in the request.</p>
192      * <p>If you don't specify a list of contexts, Amazon Lex V2 will use the current
193      * list of contexts for the session. If you specify an empty list, all contexts for
194      * the session are cleared. </p>
195      */
AddContextAttributes(Aws::String && key,const Aws::String & value)196     inline ActiveContext& AddContextAttributes(Aws::String&& key, const Aws::String& value) { m_contextAttributesHasBeenSet = true; m_contextAttributes.emplace(std::move(key), value); return *this; }
197 
198     /**
199      * <p>A list of contexts active for the request. A context can be activated when a
200      * previous intent is fulfilled, or by including the context in the request.</p>
201      * <p>If you don't specify a list of contexts, Amazon Lex V2 will use the current
202      * list of contexts for the session. If you specify an empty list, all contexts for
203      * the session are cleared. </p>
204      */
AddContextAttributes(const Aws::String & key,Aws::String && value)205     inline ActiveContext& AddContextAttributes(const Aws::String& key, Aws::String&& value) { m_contextAttributesHasBeenSet = true; m_contextAttributes.emplace(key, std::move(value)); return *this; }
206 
207     /**
208      * <p>A list of contexts active for the request. A context can be activated when a
209      * previous intent is fulfilled, or by including the context in the request.</p>
210      * <p>If you don't specify a list of contexts, Amazon Lex V2 will use the current
211      * list of contexts for the session. If you specify an empty list, all contexts for
212      * the session are cleared. </p>
213      */
AddContextAttributes(Aws::String && key,Aws::String && value)214     inline ActiveContext& AddContextAttributes(Aws::String&& key, Aws::String&& value) { m_contextAttributesHasBeenSet = true; m_contextAttributes.emplace(std::move(key), std::move(value)); return *this; }
215 
216     /**
217      * <p>A list of contexts active for the request. A context can be activated when a
218      * previous intent is fulfilled, or by including the context in the request.</p>
219      * <p>If you don't specify a list of contexts, Amazon Lex V2 will use the current
220      * list of contexts for the session. If you specify an empty list, all contexts for
221      * the session are cleared. </p>
222      */
AddContextAttributes(const char * key,Aws::String && value)223     inline ActiveContext& AddContextAttributes(const char* key, Aws::String&& value) { m_contextAttributesHasBeenSet = true; m_contextAttributes.emplace(key, std::move(value)); return *this; }
224 
225     /**
226      * <p>A list of contexts active for the request. A context can be activated when a
227      * previous intent is fulfilled, or by including the context in the request.</p>
228      * <p>If you don't specify a list of contexts, Amazon Lex V2 will use the current
229      * list of contexts for the session. If you specify an empty list, all contexts for
230      * the session are cleared. </p>
231      */
AddContextAttributes(Aws::String && key,const char * value)232     inline ActiveContext& AddContextAttributes(Aws::String&& key, const char* value) { m_contextAttributesHasBeenSet = true; m_contextAttributes.emplace(std::move(key), value); return *this; }
233 
234     /**
235      * <p>A list of contexts active for the request. A context can be activated when a
236      * previous intent is fulfilled, or by including the context in the request.</p>
237      * <p>If you don't specify a list of contexts, Amazon Lex V2 will use the current
238      * list of contexts for the session. If you specify an empty list, all contexts for
239      * the session are cleared. </p>
240      */
AddContextAttributes(const char * key,const char * value)241     inline ActiveContext& AddContextAttributes(const char* key, const char* value) { m_contextAttributesHasBeenSet = true; m_contextAttributes.emplace(key, value); return *this; }
242 
243   private:
244 
245     Aws::String m_name;
246     bool m_nameHasBeenSet;
247 
248     ActiveContextTimeToLive m_timeToLive;
249     bool m_timeToLiveHasBeenSet;
250 
251     Aws::Map<Aws::String, Aws::String> m_contextAttributes;
252     bool m_contextAttributesHasBeenSet;
253   };
254 
255 } // namespace Model
256 } // namespace LexRuntimeV2
257 } // namespace Aws
258