1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/sagemaker/model/FlowDefinitionSummary.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 SageMaker
17 {
18 namespace Model
19 {
20
FlowDefinitionSummary()21 FlowDefinitionSummary::FlowDefinitionSummary() :
22 m_flowDefinitionNameHasBeenSet(false),
23 m_flowDefinitionArnHasBeenSet(false),
24 m_flowDefinitionStatus(FlowDefinitionStatus::NOT_SET),
25 m_flowDefinitionStatusHasBeenSet(false),
26 m_creationTimeHasBeenSet(false),
27 m_failureReasonHasBeenSet(false)
28 {
29 }
30
FlowDefinitionSummary(JsonView jsonValue)31 FlowDefinitionSummary::FlowDefinitionSummary(JsonView jsonValue) :
32 m_flowDefinitionNameHasBeenSet(false),
33 m_flowDefinitionArnHasBeenSet(false),
34 m_flowDefinitionStatus(FlowDefinitionStatus::NOT_SET),
35 m_flowDefinitionStatusHasBeenSet(false),
36 m_creationTimeHasBeenSet(false),
37 m_failureReasonHasBeenSet(false)
38 {
39 *this = jsonValue;
40 }
41
operator =(JsonView jsonValue)42 FlowDefinitionSummary& FlowDefinitionSummary::operator =(JsonView jsonValue)
43 {
44 if(jsonValue.ValueExists("FlowDefinitionName"))
45 {
46 m_flowDefinitionName = jsonValue.GetString("FlowDefinitionName");
47
48 m_flowDefinitionNameHasBeenSet = true;
49 }
50
51 if(jsonValue.ValueExists("FlowDefinitionArn"))
52 {
53 m_flowDefinitionArn = jsonValue.GetString("FlowDefinitionArn");
54
55 m_flowDefinitionArnHasBeenSet = true;
56 }
57
58 if(jsonValue.ValueExists("FlowDefinitionStatus"))
59 {
60 m_flowDefinitionStatus = FlowDefinitionStatusMapper::GetFlowDefinitionStatusForName(jsonValue.GetString("FlowDefinitionStatus"));
61
62 m_flowDefinitionStatusHasBeenSet = true;
63 }
64
65 if(jsonValue.ValueExists("CreationTime"))
66 {
67 m_creationTime = jsonValue.GetDouble("CreationTime");
68
69 m_creationTimeHasBeenSet = true;
70 }
71
72 if(jsonValue.ValueExists("FailureReason"))
73 {
74 m_failureReason = jsonValue.GetString("FailureReason");
75
76 m_failureReasonHasBeenSet = true;
77 }
78
79 return *this;
80 }
81
Jsonize() const82 JsonValue FlowDefinitionSummary::Jsonize() const
83 {
84 JsonValue payload;
85
86 if(m_flowDefinitionNameHasBeenSet)
87 {
88 payload.WithString("FlowDefinitionName", m_flowDefinitionName);
89
90 }
91
92 if(m_flowDefinitionArnHasBeenSet)
93 {
94 payload.WithString("FlowDefinitionArn", m_flowDefinitionArn);
95
96 }
97
98 if(m_flowDefinitionStatusHasBeenSet)
99 {
100 payload.WithString("FlowDefinitionStatus", FlowDefinitionStatusMapper::GetNameForFlowDefinitionStatus(m_flowDefinitionStatus));
101 }
102
103 if(m_creationTimeHasBeenSet)
104 {
105 payload.WithDouble("CreationTime", m_creationTime.SecondsWithMSPrecision());
106 }
107
108 if(m_failureReasonHasBeenSet)
109 {
110 payload.WithString("FailureReason", m_failureReason);
111
112 }
113
114 return payload;
115 }
116
117 } // namespace Model
118 } // namespace SageMaker
119 } // namespace Aws
120