1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/lexv2-models/model/KendraConfiguration.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8
9 #include <utility>
10
11 using namespace Aws::Utils::Json;
12 using namespace Aws::Utils;
13
14 namespace Aws
15 {
16 namespace LexModelsV2
17 {
18 namespace Model
19 {
20
KendraConfiguration()21 KendraConfiguration::KendraConfiguration() :
22 m_kendraIndexHasBeenSet(false),
23 m_queryFilterStringEnabled(false),
24 m_queryFilterStringEnabledHasBeenSet(false),
25 m_queryFilterStringHasBeenSet(false)
26 {
27 }
28
KendraConfiguration(JsonView jsonValue)29 KendraConfiguration::KendraConfiguration(JsonView jsonValue) :
30 m_kendraIndexHasBeenSet(false),
31 m_queryFilterStringEnabled(false),
32 m_queryFilterStringEnabledHasBeenSet(false),
33 m_queryFilterStringHasBeenSet(false)
34 {
35 *this = jsonValue;
36 }
37
operator =(JsonView jsonValue)38 KendraConfiguration& KendraConfiguration::operator =(JsonView jsonValue)
39 {
40 if(jsonValue.ValueExists("kendraIndex"))
41 {
42 m_kendraIndex = jsonValue.GetString("kendraIndex");
43
44 m_kendraIndexHasBeenSet = true;
45 }
46
47 if(jsonValue.ValueExists("queryFilterStringEnabled"))
48 {
49 m_queryFilterStringEnabled = jsonValue.GetBool("queryFilterStringEnabled");
50
51 m_queryFilterStringEnabledHasBeenSet = true;
52 }
53
54 if(jsonValue.ValueExists("queryFilterString"))
55 {
56 m_queryFilterString = jsonValue.GetString("queryFilterString");
57
58 m_queryFilterStringHasBeenSet = true;
59 }
60
61 return *this;
62 }
63
Jsonize() const64 JsonValue KendraConfiguration::Jsonize() const
65 {
66 JsonValue payload;
67
68 if(m_kendraIndexHasBeenSet)
69 {
70 payload.WithString("kendraIndex", m_kendraIndex);
71
72 }
73
74 if(m_queryFilterStringEnabledHasBeenSet)
75 {
76 payload.WithBool("queryFilterStringEnabled", m_queryFilterStringEnabled);
77
78 }
79
80 if(m_queryFilterStringHasBeenSet)
81 {
82 payload.WithString("queryFilterString", m_queryFilterString);
83
84 }
85
86 return payload;
87 }
88
89 } // namespace Model
90 } // namespace LexModelsV2
91 } // namespace Aws
92