1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/chime/model/Member.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 Chime
17 {
18 namespace Model
19 {
20 
Member()21 Member::Member() :
22     m_memberIdHasBeenSet(false),
23     m_memberType(MemberType::NOT_SET),
24     m_memberTypeHasBeenSet(false),
25     m_emailHasBeenSet(false),
26     m_fullNameHasBeenSet(false),
27     m_accountIdHasBeenSet(false)
28 {
29 }
30 
Member(JsonView jsonValue)31 Member::Member(JsonView jsonValue) :
32     m_memberIdHasBeenSet(false),
33     m_memberType(MemberType::NOT_SET),
34     m_memberTypeHasBeenSet(false),
35     m_emailHasBeenSet(false),
36     m_fullNameHasBeenSet(false),
37     m_accountIdHasBeenSet(false)
38 {
39   *this = jsonValue;
40 }
41 
operator =(JsonView jsonValue)42 Member& Member::operator =(JsonView jsonValue)
43 {
44   if(jsonValue.ValueExists("MemberId"))
45   {
46     m_memberId = jsonValue.GetString("MemberId");
47 
48     m_memberIdHasBeenSet = true;
49   }
50 
51   if(jsonValue.ValueExists("MemberType"))
52   {
53     m_memberType = MemberTypeMapper::GetMemberTypeForName(jsonValue.GetString("MemberType"));
54 
55     m_memberTypeHasBeenSet = true;
56   }
57 
58   if(jsonValue.ValueExists("Email"))
59   {
60     m_email = jsonValue.GetString("Email");
61 
62     m_emailHasBeenSet = true;
63   }
64 
65   if(jsonValue.ValueExists("FullName"))
66   {
67     m_fullName = jsonValue.GetString("FullName");
68 
69     m_fullNameHasBeenSet = true;
70   }
71 
72   if(jsonValue.ValueExists("AccountId"))
73   {
74     m_accountId = jsonValue.GetString("AccountId");
75 
76     m_accountIdHasBeenSet = true;
77   }
78 
79   return *this;
80 }
81 
Jsonize() const82 JsonValue Member::Jsonize() const
83 {
84   JsonValue payload;
85 
86   if(m_memberIdHasBeenSet)
87   {
88    payload.WithString("MemberId", m_memberId);
89 
90   }
91 
92   if(m_memberTypeHasBeenSet)
93   {
94    payload.WithString("MemberType", MemberTypeMapper::GetNameForMemberType(m_memberType));
95   }
96 
97   if(m_emailHasBeenSet)
98   {
99    payload.WithString("Email", m_email);
100 
101   }
102 
103   if(m_fullNameHasBeenSet)
104   {
105    payload.WithString("FullName", m_fullName);
106 
107   }
108 
109   if(m_accountIdHasBeenSet)
110   {
111    payload.WithString("AccountId", m_accountId);
112 
113   }
114 
115   return payload;
116 }
117 
118 } // namespace Model
119 } // namespace Chime
120 } // namespace Aws
121