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/SlotTypeSummary.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 
SlotTypeSummary()21 SlotTypeSummary::SlotTypeSummary() :
22     m_slotTypeIdHasBeenSet(false),
23     m_slotTypeNameHasBeenSet(false),
24     m_descriptionHasBeenSet(false),
25     m_parentSlotTypeSignatureHasBeenSet(false),
26     m_lastUpdatedDateTimeHasBeenSet(false)
27 {
28 }
29 
SlotTypeSummary(JsonView jsonValue)30 SlotTypeSummary::SlotTypeSummary(JsonView jsonValue) :
31     m_slotTypeIdHasBeenSet(false),
32     m_slotTypeNameHasBeenSet(false),
33     m_descriptionHasBeenSet(false),
34     m_parentSlotTypeSignatureHasBeenSet(false),
35     m_lastUpdatedDateTimeHasBeenSet(false)
36 {
37   *this = jsonValue;
38 }
39 
operator =(JsonView jsonValue)40 SlotTypeSummary& SlotTypeSummary::operator =(JsonView jsonValue)
41 {
42   if(jsonValue.ValueExists("slotTypeId"))
43   {
44     m_slotTypeId = jsonValue.GetString("slotTypeId");
45 
46     m_slotTypeIdHasBeenSet = true;
47   }
48 
49   if(jsonValue.ValueExists("slotTypeName"))
50   {
51     m_slotTypeName = jsonValue.GetString("slotTypeName");
52 
53     m_slotTypeNameHasBeenSet = true;
54   }
55 
56   if(jsonValue.ValueExists("description"))
57   {
58     m_description = jsonValue.GetString("description");
59 
60     m_descriptionHasBeenSet = true;
61   }
62 
63   if(jsonValue.ValueExists("parentSlotTypeSignature"))
64   {
65     m_parentSlotTypeSignature = jsonValue.GetString("parentSlotTypeSignature");
66 
67     m_parentSlotTypeSignatureHasBeenSet = true;
68   }
69 
70   if(jsonValue.ValueExists("lastUpdatedDateTime"))
71   {
72     m_lastUpdatedDateTime = jsonValue.GetDouble("lastUpdatedDateTime");
73 
74     m_lastUpdatedDateTimeHasBeenSet = true;
75   }
76 
77   return *this;
78 }
79 
Jsonize() const80 JsonValue SlotTypeSummary::Jsonize() const
81 {
82   JsonValue payload;
83 
84   if(m_slotTypeIdHasBeenSet)
85   {
86    payload.WithString("slotTypeId", m_slotTypeId);
87 
88   }
89 
90   if(m_slotTypeNameHasBeenSet)
91   {
92    payload.WithString("slotTypeName", m_slotTypeName);
93 
94   }
95 
96   if(m_descriptionHasBeenSet)
97   {
98    payload.WithString("description", m_description);
99 
100   }
101 
102   if(m_parentSlotTypeSignatureHasBeenSet)
103   {
104    payload.WithString("parentSlotTypeSignature", m_parentSlotTypeSignature);
105 
106   }
107 
108   if(m_lastUpdatedDateTimeHasBeenSet)
109   {
110    payload.WithDouble("lastUpdatedDateTime", m_lastUpdatedDateTime.SecondsWithMSPrecision());
111   }
112 
113   return payload;
114 }
115 
116 } // namespace Model
117 } // namespace LexModelsV2
118 } // namespace Aws
119