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/InputDeviceConfigurableSettings.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 
InputDeviceConfigurableSettings()21 InputDeviceConfigurableSettings::InputDeviceConfigurableSettings() :
22     m_configuredInput(InputDeviceConfiguredInput::NOT_SET),
23     m_configuredInputHasBeenSet(false),
24     m_maxBitrate(0),
25     m_maxBitrateHasBeenSet(false)
26 {
27 }
28 
InputDeviceConfigurableSettings(JsonView jsonValue)29 InputDeviceConfigurableSettings::InputDeviceConfigurableSettings(JsonView jsonValue) :
30     m_configuredInput(InputDeviceConfiguredInput::NOT_SET),
31     m_configuredInputHasBeenSet(false),
32     m_maxBitrate(0),
33     m_maxBitrateHasBeenSet(false)
34 {
35   *this = jsonValue;
36 }
37 
operator =(JsonView jsonValue)38 InputDeviceConfigurableSettings& InputDeviceConfigurableSettings::operator =(JsonView jsonValue)
39 {
40   if(jsonValue.ValueExists("configuredInput"))
41   {
42     m_configuredInput = InputDeviceConfiguredInputMapper::GetInputDeviceConfiguredInputForName(jsonValue.GetString("configuredInput"));
43 
44     m_configuredInputHasBeenSet = true;
45   }
46 
47   if(jsonValue.ValueExists("maxBitrate"))
48   {
49     m_maxBitrate = jsonValue.GetInteger("maxBitrate");
50 
51     m_maxBitrateHasBeenSet = true;
52   }
53 
54   return *this;
55 }
56 
Jsonize() const57 JsonValue InputDeviceConfigurableSettings::Jsonize() const
58 {
59   JsonValue payload;
60 
61   if(m_configuredInputHasBeenSet)
62   {
63    payload.WithString("configuredInput", InputDeviceConfiguredInputMapper::GetNameForInputDeviceConfiguredInput(m_configuredInput));
64   }
65 
66   if(m_maxBitrateHasBeenSet)
67   {
68    payload.WithInteger("maxBitrate", m_maxBitrate);
69 
70   }
71 
72   return payload;
73 }
74 
75 } // namespace Model
76 } // namespace MediaLive
77 } // namespace Aws
78