1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/glue/model/SchemaListItem.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 Glue
17 {
18 namespace Model
19 {
20 
SchemaListItem()21 SchemaListItem::SchemaListItem() :
22     m_registryNameHasBeenSet(false),
23     m_schemaNameHasBeenSet(false),
24     m_schemaArnHasBeenSet(false),
25     m_descriptionHasBeenSet(false),
26     m_schemaStatus(SchemaStatus::NOT_SET),
27     m_schemaStatusHasBeenSet(false),
28     m_createdTimeHasBeenSet(false),
29     m_updatedTimeHasBeenSet(false)
30 {
31 }
32 
SchemaListItem(JsonView jsonValue)33 SchemaListItem::SchemaListItem(JsonView jsonValue) :
34     m_registryNameHasBeenSet(false),
35     m_schemaNameHasBeenSet(false),
36     m_schemaArnHasBeenSet(false),
37     m_descriptionHasBeenSet(false),
38     m_schemaStatus(SchemaStatus::NOT_SET),
39     m_schemaStatusHasBeenSet(false),
40     m_createdTimeHasBeenSet(false),
41     m_updatedTimeHasBeenSet(false)
42 {
43   *this = jsonValue;
44 }
45 
operator =(JsonView jsonValue)46 SchemaListItem& SchemaListItem::operator =(JsonView jsonValue)
47 {
48   if(jsonValue.ValueExists("RegistryName"))
49   {
50     m_registryName = jsonValue.GetString("RegistryName");
51 
52     m_registryNameHasBeenSet = true;
53   }
54 
55   if(jsonValue.ValueExists("SchemaName"))
56   {
57     m_schemaName = jsonValue.GetString("SchemaName");
58 
59     m_schemaNameHasBeenSet = true;
60   }
61 
62   if(jsonValue.ValueExists("SchemaArn"))
63   {
64     m_schemaArn = jsonValue.GetString("SchemaArn");
65 
66     m_schemaArnHasBeenSet = true;
67   }
68 
69   if(jsonValue.ValueExists("Description"))
70   {
71     m_description = jsonValue.GetString("Description");
72 
73     m_descriptionHasBeenSet = true;
74   }
75 
76   if(jsonValue.ValueExists("SchemaStatus"))
77   {
78     m_schemaStatus = SchemaStatusMapper::GetSchemaStatusForName(jsonValue.GetString("SchemaStatus"));
79 
80     m_schemaStatusHasBeenSet = true;
81   }
82 
83   if(jsonValue.ValueExists("CreatedTime"))
84   {
85     m_createdTime = jsonValue.GetString("CreatedTime");
86 
87     m_createdTimeHasBeenSet = true;
88   }
89 
90   if(jsonValue.ValueExists("UpdatedTime"))
91   {
92     m_updatedTime = jsonValue.GetString("UpdatedTime");
93 
94     m_updatedTimeHasBeenSet = true;
95   }
96 
97   return *this;
98 }
99 
Jsonize() const100 JsonValue SchemaListItem::Jsonize() const
101 {
102   JsonValue payload;
103 
104   if(m_registryNameHasBeenSet)
105   {
106    payload.WithString("RegistryName", m_registryName);
107 
108   }
109 
110   if(m_schemaNameHasBeenSet)
111   {
112    payload.WithString("SchemaName", m_schemaName);
113 
114   }
115 
116   if(m_schemaArnHasBeenSet)
117   {
118    payload.WithString("SchemaArn", m_schemaArn);
119 
120   }
121 
122   if(m_descriptionHasBeenSet)
123   {
124    payload.WithString("Description", m_description);
125 
126   }
127 
128   if(m_schemaStatusHasBeenSet)
129   {
130    payload.WithString("SchemaStatus", SchemaStatusMapper::GetNameForSchemaStatus(m_schemaStatus));
131   }
132 
133   if(m_createdTimeHasBeenSet)
134   {
135    payload.WithString("CreatedTime", m_createdTime);
136 
137   }
138 
139   if(m_updatedTimeHasBeenSet)
140   {
141    payload.WithString("UpdatedTime", m_updatedTime);
142 
143   }
144 
145   return payload;
146 }
147 
148 } // namespace Model
149 } // namespace Glue
150 } // namespace Aws
151