1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/route53domains/model/DomainSummary.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 Route53Domains
17 {
18 namespace Model
19 {
20
DomainSummary()21 DomainSummary::DomainSummary() :
22 m_domainNameHasBeenSet(false),
23 m_autoRenew(false),
24 m_autoRenewHasBeenSet(false),
25 m_transferLock(false),
26 m_transferLockHasBeenSet(false),
27 m_expiryHasBeenSet(false)
28 {
29 }
30
DomainSummary(JsonView jsonValue)31 DomainSummary::DomainSummary(JsonView jsonValue) :
32 m_domainNameHasBeenSet(false),
33 m_autoRenew(false),
34 m_autoRenewHasBeenSet(false),
35 m_transferLock(false),
36 m_transferLockHasBeenSet(false),
37 m_expiryHasBeenSet(false)
38 {
39 *this = jsonValue;
40 }
41
operator =(JsonView jsonValue)42 DomainSummary& DomainSummary::operator =(JsonView jsonValue)
43 {
44 if(jsonValue.ValueExists("DomainName"))
45 {
46 m_domainName = jsonValue.GetString("DomainName");
47
48 m_domainNameHasBeenSet = true;
49 }
50
51 if(jsonValue.ValueExists("AutoRenew"))
52 {
53 m_autoRenew = jsonValue.GetBool("AutoRenew");
54
55 m_autoRenewHasBeenSet = true;
56 }
57
58 if(jsonValue.ValueExists("TransferLock"))
59 {
60 m_transferLock = jsonValue.GetBool("TransferLock");
61
62 m_transferLockHasBeenSet = true;
63 }
64
65 if(jsonValue.ValueExists("Expiry"))
66 {
67 m_expiry = jsonValue.GetDouble("Expiry");
68
69 m_expiryHasBeenSet = true;
70 }
71
72 return *this;
73 }
74
Jsonize() const75 JsonValue DomainSummary::Jsonize() const
76 {
77 JsonValue payload;
78
79 if(m_domainNameHasBeenSet)
80 {
81 payload.WithString("DomainName", m_domainName);
82
83 }
84
85 if(m_autoRenewHasBeenSet)
86 {
87 payload.WithBool("AutoRenew", m_autoRenew);
88
89 }
90
91 if(m_transferLockHasBeenSet)
92 {
93 payload.WithBool("TransferLock", m_transferLock);
94
95 }
96
97 if(m_expiryHasBeenSet)
98 {
99 payload.WithDouble("Expiry", m_expiry.SecondsWithMSPrecision());
100 }
101
102 return payload;
103 }
104
105 } // namespace Model
106 } // namespace Route53Domains
107 } // namespace Aws
108