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