1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/grafana/model/AssertionAttributes.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 ManagedGrafana
17 {
18 namespace Model
19 {
20
AssertionAttributes()21 AssertionAttributes::AssertionAttributes() :
22 m_emailHasBeenSet(false),
23 m_groupsHasBeenSet(false),
24 m_loginHasBeenSet(false),
25 m_nameHasBeenSet(false),
26 m_orgHasBeenSet(false),
27 m_roleHasBeenSet(false)
28 {
29 }
30
AssertionAttributes(JsonView jsonValue)31 AssertionAttributes::AssertionAttributes(JsonView jsonValue) :
32 m_emailHasBeenSet(false),
33 m_groupsHasBeenSet(false),
34 m_loginHasBeenSet(false),
35 m_nameHasBeenSet(false),
36 m_orgHasBeenSet(false),
37 m_roleHasBeenSet(false)
38 {
39 *this = jsonValue;
40 }
41
operator =(JsonView jsonValue)42 AssertionAttributes& AssertionAttributes::operator =(JsonView jsonValue)
43 {
44 if(jsonValue.ValueExists("email"))
45 {
46 m_email = jsonValue.GetString("email");
47
48 m_emailHasBeenSet = true;
49 }
50
51 if(jsonValue.ValueExists("groups"))
52 {
53 m_groups = jsonValue.GetString("groups");
54
55 m_groupsHasBeenSet = true;
56 }
57
58 if(jsonValue.ValueExists("login"))
59 {
60 m_login = jsonValue.GetString("login");
61
62 m_loginHasBeenSet = true;
63 }
64
65 if(jsonValue.ValueExists("name"))
66 {
67 m_name = jsonValue.GetString("name");
68
69 m_nameHasBeenSet = true;
70 }
71
72 if(jsonValue.ValueExists("org"))
73 {
74 m_org = jsonValue.GetString("org");
75
76 m_orgHasBeenSet = true;
77 }
78
79 if(jsonValue.ValueExists("role"))
80 {
81 m_role = jsonValue.GetString("role");
82
83 m_roleHasBeenSet = true;
84 }
85
86 return *this;
87 }
88
Jsonize() const89 JsonValue AssertionAttributes::Jsonize() const
90 {
91 JsonValue payload;
92
93 if(m_emailHasBeenSet)
94 {
95 payload.WithString("email", m_email);
96
97 }
98
99 if(m_groupsHasBeenSet)
100 {
101 payload.WithString("groups", m_groups);
102
103 }
104
105 if(m_loginHasBeenSet)
106 {
107 payload.WithString("login", m_login);
108
109 }
110
111 if(m_nameHasBeenSet)
112 {
113 payload.WithString("name", m_name);
114
115 }
116
117 if(m_orgHasBeenSet)
118 {
119 payload.WithString("org", m_org);
120
121 }
122
123 if(m_roleHasBeenSet)
124 {
125 payload.WithString("role", m_role);
126
127 }
128
129 return payload;
130 }
131
132 } // namespace Model
133 } // namespace ManagedGrafana
134 } // namespace Aws
135