1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/alexaforbusiness/model/SkillSummary.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 AlexaForBusiness
17 {
18 namespace Model
19 {
20 
SkillSummary()21 SkillSummary::SkillSummary() :
22     m_skillIdHasBeenSet(false),
23     m_skillNameHasBeenSet(false),
24     m_supportsLinking(false),
25     m_supportsLinkingHasBeenSet(false),
26     m_enablementType(EnablementType::NOT_SET),
27     m_enablementTypeHasBeenSet(false),
28     m_skillType(SkillType::NOT_SET),
29     m_skillTypeHasBeenSet(false)
30 {
31 }
32 
SkillSummary(JsonView jsonValue)33 SkillSummary::SkillSummary(JsonView jsonValue) :
34     m_skillIdHasBeenSet(false),
35     m_skillNameHasBeenSet(false),
36     m_supportsLinking(false),
37     m_supportsLinkingHasBeenSet(false),
38     m_enablementType(EnablementType::NOT_SET),
39     m_enablementTypeHasBeenSet(false),
40     m_skillType(SkillType::NOT_SET),
41     m_skillTypeHasBeenSet(false)
42 {
43   *this = jsonValue;
44 }
45 
operator =(JsonView jsonValue)46 SkillSummary& SkillSummary::operator =(JsonView jsonValue)
47 {
48   if(jsonValue.ValueExists("SkillId"))
49   {
50     m_skillId = jsonValue.GetString("SkillId");
51 
52     m_skillIdHasBeenSet = true;
53   }
54 
55   if(jsonValue.ValueExists("SkillName"))
56   {
57     m_skillName = jsonValue.GetString("SkillName");
58 
59     m_skillNameHasBeenSet = true;
60   }
61 
62   if(jsonValue.ValueExists("SupportsLinking"))
63   {
64     m_supportsLinking = jsonValue.GetBool("SupportsLinking");
65 
66     m_supportsLinkingHasBeenSet = true;
67   }
68 
69   if(jsonValue.ValueExists("EnablementType"))
70   {
71     m_enablementType = EnablementTypeMapper::GetEnablementTypeForName(jsonValue.GetString("EnablementType"));
72 
73     m_enablementTypeHasBeenSet = true;
74   }
75 
76   if(jsonValue.ValueExists("SkillType"))
77   {
78     m_skillType = SkillTypeMapper::GetSkillTypeForName(jsonValue.GetString("SkillType"));
79 
80     m_skillTypeHasBeenSet = true;
81   }
82 
83   return *this;
84 }
85 
Jsonize() const86 JsonValue SkillSummary::Jsonize() const
87 {
88   JsonValue payload;
89 
90   if(m_skillIdHasBeenSet)
91   {
92    payload.WithString("SkillId", m_skillId);
93 
94   }
95 
96   if(m_skillNameHasBeenSet)
97   {
98    payload.WithString("SkillName", m_skillName);
99 
100   }
101 
102   if(m_supportsLinkingHasBeenSet)
103   {
104    payload.WithBool("SupportsLinking", m_supportsLinking);
105 
106   }
107 
108   if(m_enablementTypeHasBeenSet)
109   {
110    payload.WithString("EnablementType", EnablementTypeMapper::GetNameForEnablementType(m_enablementType));
111   }
112 
113   if(m_skillTypeHasBeenSet)
114   {
115    payload.WithString("SkillType", SkillTypeMapper::GetNameForSkillType(m_skillType));
116   }
117 
118   return payload;
119 }
120 
121 } // namespace Model
122 } // namespace AlexaForBusiness
123 } // namespace Aws
124