1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/comprehend/model/KeyPhrasesDetectionJobProperties.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 Comprehend
17 {
18 namespace Model
19 {
20 
KeyPhrasesDetectionJobProperties()21 KeyPhrasesDetectionJobProperties::KeyPhrasesDetectionJobProperties() :
22     m_jobIdHasBeenSet(false),
23     m_jobArnHasBeenSet(false),
24     m_jobNameHasBeenSet(false),
25     m_jobStatus(JobStatus::NOT_SET),
26     m_jobStatusHasBeenSet(false),
27     m_messageHasBeenSet(false),
28     m_submitTimeHasBeenSet(false),
29     m_endTimeHasBeenSet(false),
30     m_inputDataConfigHasBeenSet(false),
31     m_outputDataConfigHasBeenSet(false),
32     m_languageCode(LanguageCode::NOT_SET),
33     m_languageCodeHasBeenSet(false),
34     m_dataAccessRoleArnHasBeenSet(false),
35     m_volumeKmsKeyIdHasBeenSet(false),
36     m_vpcConfigHasBeenSet(false)
37 {
38 }
39 
KeyPhrasesDetectionJobProperties(JsonView jsonValue)40 KeyPhrasesDetectionJobProperties::KeyPhrasesDetectionJobProperties(JsonView jsonValue) :
41     m_jobIdHasBeenSet(false),
42     m_jobArnHasBeenSet(false),
43     m_jobNameHasBeenSet(false),
44     m_jobStatus(JobStatus::NOT_SET),
45     m_jobStatusHasBeenSet(false),
46     m_messageHasBeenSet(false),
47     m_submitTimeHasBeenSet(false),
48     m_endTimeHasBeenSet(false),
49     m_inputDataConfigHasBeenSet(false),
50     m_outputDataConfigHasBeenSet(false),
51     m_languageCode(LanguageCode::NOT_SET),
52     m_languageCodeHasBeenSet(false),
53     m_dataAccessRoleArnHasBeenSet(false),
54     m_volumeKmsKeyIdHasBeenSet(false),
55     m_vpcConfigHasBeenSet(false)
56 {
57   *this = jsonValue;
58 }
59 
operator =(JsonView jsonValue)60 KeyPhrasesDetectionJobProperties& KeyPhrasesDetectionJobProperties::operator =(JsonView jsonValue)
61 {
62   if(jsonValue.ValueExists("JobId"))
63   {
64     m_jobId = jsonValue.GetString("JobId");
65 
66     m_jobIdHasBeenSet = true;
67   }
68 
69   if(jsonValue.ValueExists("JobArn"))
70   {
71     m_jobArn = jsonValue.GetString("JobArn");
72 
73     m_jobArnHasBeenSet = true;
74   }
75 
76   if(jsonValue.ValueExists("JobName"))
77   {
78     m_jobName = jsonValue.GetString("JobName");
79 
80     m_jobNameHasBeenSet = true;
81   }
82 
83   if(jsonValue.ValueExists("JobStatus"))
84   {
85     m_jobStatus = JobStatusMapper::GetJobStatusForName(jsonValue.GetString("JobStatus"));
86 
87     m_jobStatusHasBeenSet = true;
88   }
89 
90   if(jsonValue.ValueExists("Message"))
91   {
92     m_message = jsonValue.GetString("Message");
93 
94     m_messageHasBeenSet = true;
95   }
96 
97   if(jsonValue.ValueExists("SubmitTime"))
98   {
99     m_submitTime = jsonValue.GetDouble("SubmitTime");
100 
101     m_submitTimeHasBeenSet = true;
102   }
103 
104   if(jsonValue.ValueExists("EndTime"))
105   {
106     m_endTime = jsonValue.GetDouble("EndTime");
107 
108     m_endTimeHasBeenSet = true;
109   }
110 
111   if(jsonValue.ValueExists("InputDataConfig"))
112   {
113     m_inputDataConfig = jsonValue.GetObject("InputDataConfig");
114 
115     m_inputDataConfigHasBeenSet = true;
116   }
117 
118   if(jsonValue.ValueExists("OutputDataConfig"))
119   {
120     m_outputDataConfig = jsonValue.GetObject("OutputDataConfig");
121 
122     m_outputDataConfigHasBeenSet = true;
123   }
124 
125   if(jsonValue.ValueExists("LanguageCode"))
126   {
127     m_languageCode = LanguageCodeMapper::GetLanguageCodeForName(jsonValue.GetString("LanguageCode"));
128 
129     m_languageCodeHasBeenSet = true;
130   }
131 
132   if(jsonValue.ValueExists("DataAccessRoleArn"))
133   {
134     m_dataAccessRoleArn = jsonValue.GetString("DataAccessRoleArn");
135 
136     m_dataAccessRoleArnHasBeenSet = true;
137   }
138 
139   if(jsonValue.ValueExists("VolumeKmsKeyId"))
140   {
141     m_volumeKmsKeyId = jsonValue.GetString("VolumeKmsKeyId");
142 
143     m_volumeKmsKeyIdHasBeenSet = true;
144   }
145 
146   if(jsonValue.ValueExists("VpcConfig"))
147   {
148     m_vpcConfig = jsonValue.GetObject("VpcConfig");
149 
150     m_vpcConfigHasBeenSet = true;
151   }
152 
153   return *this;
154 }
155 
Jsonize() const156 JsonValue KeyPhrasesDetectionJobProperties::Jsonize() const
157 {
158   JsonValue payload;
159 
160   if(m_jobIdHasBeenSet)
161   {
162    payload.WithString("JobId", m_jobId);
163 
164   }
165 
166   if(m_jobArnHasBeenSet)
167   {
168    payload.WithString("JobArn", m_jobArn);
169 
170   }
171 
172   if(m_jobNameHasBeenSet)
173   {
174    payload.WithString("JobName", m_jobName);
175 
176   }
177 
178   if(m_jobStatusHasBeenSet)
179   {
180    payload.WithString("JobStatus", JobStatusMapper::GetNameForJobStatus(m_jobStatus));
181   }
182 
183   if(m_messageHasBeenSet)
184   {
185    payload.WithString("Message", m_message);
186 
187   }
188 
189   if(m_submitTimeHasBeenSet)
190   {
191    payload.WithDouble("SubmitTime", m_submitTime.SecondsWithMSPrecision());
192   }
193 
194   if(m_endTimeHasBeenSet)
195   {
196    payload.WithDouble("EndTime", m_endTime.SecondsWithMSPrecision());
197   }
198 
199   if(m_inputDataConfigHasBeenSet)
200   {
201    payload.WithObject("InputDataConfig", m_inputDataConfig.Jsonize());
202 
203   }
204 
205   if(m_outputDataConfigHasBeenSet)
206   {
207    payload.WithObject("OutputDataConfig", m_outputDataConfig.Jsonize());
208 
209   }
210 
211   if(m_languageCodeHasBeenSet)
212   {
213    payload.WithString("LanguageCode", LanguageCodeMapper::GetNameForLanguageCode(m_languageCode));
214   }
215 
216   if(m_dataAccessRoleArnHasBeenSet)
217   {
218    payload.WithString("DataAccessRoleArn", m_dataAccessRoleArn);
219 
220   }
221 
222   if(m_volumeKmsKeyIdHasBeenSet)
223   {
224    payload.WithString("VolumeKmsKeyId", m_volumeKmsKeyId);
225 
226   }
227 
228   if(m_vpcConfigHasBeenSet)
229   {
230    payload.WithObject("VpcConfig", m_vpcConfig.Jsonize());
231 
232   }
233 
234   return payload;
235 }
236 
237 } // namespace Model
238 } // namespace Comprehend
239 } // namespace Aws
240