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/TaskRunProperties.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 
TaskRunProperties()21 TaskRunProperties::TaskRunProperties() :
22     m_taskType(TaskType::NOT_SET),
23     m_taskTypeHasBeenSet(false),
24     m_importLabelsTaskRunPropertiesHasBeenSet(false),
25     m_exportLabelsTaskRunPropertiesHasBeenSet(false),
26     m_labelingSetGenerationTaskRunPropertiesHasBeenSet(false),
27     m_findMatchesTaskRunPropertiesHasBeenSet(false)
28 {
29 }
30 
TaskRunProperties(JsonView jsonValue)31 TaskRunProperties::TaskRunProperties(JsonView jsonValue) :
32     m_taskType(TaskType::NOT_SET),
33     m_taskTypeHasBeenSet(false),
34     m_importLabelsTaskRunPropertiesHasBeenSet(false),
35     m_exportLabelsTaskRunPropertiesHasBeenSet(false),
36     m_labelingSetGenerationTaskRunPropertiesHasBeenSet(false),
37     m_findMatchesTaskRunPropertiesHasBeenSet(false)
38 {
39   *this = jsonValue;
40 }
41 
operator =(JsonView jsonValue)42 TaskRunProperties& TaskRunProperties::operator =(JsonView jsonValue)
43 {
44   if(jsonValue.ValueExists("TaskType"))
45   {
46     m_taskType = TaskTypeMapper::GetTaskTypeForName(jsonValue.GetString("TaskType"));
47 
48     m_taskTypeHasBeenSet = true;
49   }
50 
51   if(jsonValue.ValueExists("ImportLabelsTaskRunProperties"))
52   {
53     m_importLabelsTaskRunProperties = jsonValue.GetObject("ImportLabelsTaskRunProperties");
54 
55     m_importLabelsTaskRunPropertiesHasBeenSet = true;
56   }
57 
58   if(jsonValue.ValueExists("ExportLabelsTaskRunProperties"))
59   {
60     m_exportLabelsTaskRunProperties = jsonValue.GetObject("ExportLabelsTaskRunProperties");
61 
62     m_exportLabelsTaskRunPropertiesHasBeenSet = true;
63   }
64 
65   if(jsonValue.ValueExists("LabelingSetGenerationTaskRunProperties"))
66   {
67     m_labelingSetGenerationTaskRunProperties = jsonValue.GetObject("LabelingSetGenerationTaskRunProperties");
68 
69     m_labelingSetGenerationTaskRunPropertiesHasBeenSet = true;
70   }
71 
72   if(jsonValue.ValueExists("FindMatchesTaskRunProperties"))
73   {
74     m_findMatchesTaskRunProperties = jsonValue.GetObject("FindMatchesTaskRunProperties");
75 
76     m_findMatchesTaskRunPropertiesHasBeenSet = true;
77   }
78 
79   return *this;
80 }
81 
Jsonize() const82 JsonValue TaskRunProperties::Jsonize() const
83 {
84   JsonValue payload;
85 
86   if(m_taskTypeHasBeenSet)
87   {
88    payload.WithString("TaskType", TaskTypeMapper::GetNameForTaskType(m_taskType));
89   }
90 
91   if(m_importLabelsTaskRunPropertiesHasBeenSet)
92   {
93    payload.WithObject("ImportLabelsTaskRunProperties", m_importLabelsTaskRunProperties.Jsonize());
94 
95   }
96 
97   if(m_exportLabelsTaskRunPropertiesHasBeenSet)
98   {
99    payload.WithObject("ExportLabelsTaskRunProperties", m_exportLabelsTaskRunProperties.Jsonize());
100 
101   }
102 
103   if(m_labelingSetGenerationTaskRunPropertiesHasBeenSet)
104   {
105    payload.WithObject("LabelingSetGenerationTaskRunProperties", m_labelingSetGenerationTaskRunProperties.Jsonize());
106 
107   }
108 
109   if(m_findMatchesTaskRunPropertiesHasBeenSet)
110   {
111    payload.WithObject("FindMatchesTaskRunProperties", m_findMatchesTaskRunProperties.Jsonize());
112 
113   }
114 
115   return payload;
116 }
117 
118 } // namespace Model
119 } // namespace Glue
120 } // namespace Aws
121