1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/ssm/model/FailedCreateAssociation.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 SSM
17 {
18 namespace Model
19 {
20
FailedCreateAssociation()21 FailedCreateAssociation::FailedCreateAssociation() :
22 m_entryHasBeenSet(false),
23 m_messageHasBeenSet(false),
24 m_fault(Fault::NOT_SET),
25 m_faultHasBeenSet(false)
26 {
27 }
28
FailedCreateAssociation(JsonView jsonValue)29 FailedCreateAssociation::FailedCreateAssociation(JsonView jsonValue) :
30 m_entryHasBeenSet(false),
31 m_messageHasBeenSet(false),
32 m_fault(Fault::NOT_SET),
33 m_faultHasBeenSet(false)
34 {
35 *this = jsonValue;
36 }
37
operator =(JsonView jsonValue)38 FailedCreateAssociation& FailedCreateAssociation::operator =(JsonView jsonValue)
39 {
40 if(jsonValue.ValueExists("Entry"))
41 {
42 m_entry = jsonValue.GetObject("Entry");
43
44 m_entryHasBeenSet = true;
45 }
46
47 if(jsonValue.ValueExists("Message"))
48 {
49 m_message = jsonValue.GetString("Message");
50
51 m_messageHasBeenSet = true;
52 }
53
54 if(jsonValue.ValueExists("Fault"))
55 {
56 m_fault = FaultMapper::GetFaultForName(jsonValue.GetString("Fault"));
57
58 m_faultHasBeenSet = true;
59 }
60
61 return *this;
62 }
63
Jsonize() const64 JsonValue FailedCreateAssociation::Jsonize() const
65 {
66 JsonValue payload;
67
68 if(m_entryHasBeenSet)
69 {
70 payload.WithObject("Entry", m_entry.Jsonize());
71
72 }
73
74 if(m_messageHasBeenSet)
75 {
76 payload.WithString("Message", m_message);
77
78 }
79
80 if(m_faultHasBeenSet)
81 {
82 payload.WithString("Fault", FaultMapper::GetNameForFault(m_fault));
83 }
84
85 return payload;
86 }
87
88 } // namespace Model
89 } // namespace SSM
90 } // namespace Aws
91