1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/swf/model/RequestCancelExternalWorkflowExecutionInitiatedEventAttributes.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 SWF
17 {
18 namespace Model
19 {
20 
RequestCancelExternalWorkflowExecutionInitiatedEventAttributes()21 RequestCancelExternalWorkflowExecutionInitiatedEventAttributes::RequestCancelExternalWorkflowExecutionInitiatedEventAttributes() :
22     m_workflowIdHasBeenSet(false),
23     m_runIdHasBeenSet(false),
24     m_decisionTaskCompletedEventId(0),
25     m_decisionTaskCompletedEventIdHasBeenSet(false),
26     m_controlHasBeenSet(false)
27 {
28 }
29 
RequestCancelExternalWorkflowExecutionInitiatedEventAttributes(JsonView jsonValue)30 RequestCancelExternalWorkflowExecutionInitiatedEventAttributes::RequestCancelExternalWorkflowExecutionInitiatedEventAttributes(JsonView jsonValue) :
31     m_workflowIdHasBeenSet(false),
32     m_runIdHasBeenSet(false),
33     m_decisionTaskCompletedEventId(0),
34     m_decisionTaskCompletedEventIdHasBeenSet(false),
35     m_controlHasBeenSet(false)
36 {
37   *this = jsonValue;
38 }
39 
operator =(JsonView jsonValue)40 RequestCancelExternalWorkflowExecutionInitiatedEventAttributes& RequestCancelExternalWorkflowExecutionInitiatedEventAttributes::operator =(JsonView jsonValue)
41 {
42   if(jsonValue.ValueExists("workflowId"))
43   {
44     m_workflowId = jsonValue.GetString("workflowId");
45 
46     m_workflowIdHasBeenSet = true;
47   }
48 
49   if(jsonValue.ValueExists("runId"))
50   {
51     m_runId = jsonValue.GetString("runId");
52 
53     m_runIdHasBeenSet = true;
54   }
55 
56   if(jsonValue.ValueExists("decisionTaskCompletedEventId"))
57   {
58     m_decisionTaskCompletedEventId = jsonValue.GetInt64("decisionTaskCompletedEventId");
59 
60     m_decisionTaskCompletedEventIdHasBeenSet = true;
61   }
62 
63   if(jsonValue.ValueExists("control"))
64   {
65     m_control = jsonValue.GetString("control");
66 
67     m_controlHasBeenSet = true;
68   }
69 
70   return *this;
71 }
72 
Jsonize() const73 JsonValue RequestCancelExternalWorkflowExecutionInitiatedEventAttributes::Jsonize() const
74 {
75   JsonValue payload;
76 
77   if(m_workflowIdHasBeenSet)
78   {
79    payload.WithString("workflowId", m_workflowId);
80 
81   }
82 
83   if(m_runIdHasBeenSet)
84   {
85    payload.WithString("runId", m_runId);
86 
87   }
88 
89   if(m_decisionTaskCompletedEventIdHasBeenSet)
90   {
91    payload.WithInt64("decisionTaskCompletedEventId", m_decisionTaskCompletedEventId);
92 
93   }
94 
95   if(m_controlHasBeenSet)
96   {
97    payload.WithString("control", m_control);
98 
99   }
100 
101   return payload;
102 }
103 
104 } // namespace Model
105 } // namespace SWF
106 } // namespace Aws
107