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/SchemaReference.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 
SchemaReference()21 SchemaReference::SchemaReference() :
22     m_schemaIdHasBeenSet(false),
23     m_schemaVersionIdHasBeenSet(false),
24     m_schemaVersionNumber(0),
25     m_schemaVersionNumberHasBeenSet(false)
26 {
27 }
28 
SchemaReference(JsonView jsonValue)29 SchemaReference::SchemaReference(JsonView jsonValue) :
30     m_schemaIdHasBeenSet(false),
31     m_schemaVersionIdHasBeenSet(false),
32     m_schemaVersionNumber(0),
33     m_schemaVersionNumberHasBeenSet(false)
34 {
35   *this = jsonValue;
36 }
37 
operator =(JsonView jsonValue)38 SchemaReference& SchemaReference::operator =(JsonView jsonValue)
39 {
40   if(jsonValue.ValueExists("SchemaId"))
41   {
42     m_schemaId = jsonValue.GetObject("SchemaId");
43 
44     m_schemaIdHasBeenSet = true;
45   }
46 
47   if(jsonValue.ValueExists("SchemaVersionId"))
48   {
49     m_schemaVersionId = jsonValue.GetString("SchemaVersionId");
50 
51     m_schemaVersionIdHasBeenSet = true;
52   }
53 
54   if(jsonValue.ValueExists("SchemaVersionNumber"))
55   {
56     m_schemaVersionNumber = jsonValue.GetInt64("SchemaVersionNumber");
57 
58     m_schemaVersionNumberHasBeenSet = true;
59   }
60 
61   return *this;
62 }
63 
Jsonize() const64 JsonValue SchemaReference::Jsonize() const
65 {
66   JsonValue payload;
67 
68   if(m_schemaIdHasBeenSet)
69   {
70    payload.WithObject("SchemaId", m_schemaId.Jsonize());
71 
72   }
73 
74   if(m_schemaVersionIdHasBeenSet)
75   {
76    payload.WithString("SchemaVersionId", m_schemaVersionId);
77 
78   }
79 
80   if(m_schemaVersionNumberHasBeenSet)
81   {
82    payload.WithInt64("SchemaVersionNumber", m_schemaVersionNumber);
83 
84   }
85 
86   return payload;
87 }
88 
89 } // namespace Model
90 } // namespace Glue
91 } // namespace Aws
92