1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/medialive/model/InputDestination.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 MediaLive
17 {
18 namespace Model
19 {
20
InputDestination()21 InputDestination::InputDestination() :
22 m_ipHasBeenSet(false),
23 m_portHasBeenSet(false),
24 m_urlHasBeenSet(false),
25 m_vpcHasBeenSet(false)
26 {
27 }
28
InputDestination(JsonView jsonValue)29 InputDestination::InputDestination(JsonView jsonValue) :
30 m_ipHasBeenSet(false),
31 m_portHasBeenSet(false),
32 m_urlHasBeenSet(false),
33 m_vpcHasBeenSet(false)
34 {
35 *this = jsonValue;
36 }
37
operator =(JsonView jsonValue)38 InputDestination& InputDestination::operator =(JsonView jsonValue)
39 {
40 if(jsonValue.ValueExists("ip"))
41 {
42 m_ip = jsonValue.GetString("ip");
43
44 m_ipHasBeenSet = true;
45 }
46
47 if(jsonValue.ValueExists("port"))
48 {
49 m_port = jsonValue.GetString("port");
50
51 m_portHasBeenSet = true;
52 }
53
54 if(jsonValue.ValueExists("url"))
55 {
56 m_url = jsonValue.GetString("url");
57
58 m_urlHasBeenSet = true;
59 }
60
61 if(jsonValue.ValueExists("vpc"))
62 {
63 m_vpc = jsonValue.GetObject("vpc");
64
65 m_vpcHasBeenSet = true;
66 }
67
68 return *this;
69 }
70
Jsonize() const71 JsonValue InputDestination::Jsonize() const
72 {
73 JsonValue payload;
74
75 if(m_ipHasBeenSet)
76 {
77 payload.WithString("ip", m_ip);
78
79 }
80
81 if(m_portHasBeenSet)
82 {
83 payload.WithString("port", m_port);
84
85 }
86
87 if(m_urlHasBeenSet)
88 {
89 payload.WithString("url", m_url);
90
91 }
92
93 if(m_vpcHasBeenSet)
94 {
95 payload.WithObject("vpc", m_vpc.Jsonize());
96
97 }
98
99 return payload;
100 }
101
102 } // namespace Model
103 } // namespace MediaLive
104 } // namespace Aws
105