1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/mediaconvert/model/VorbisSettings.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 MediaConvert
17 {
18 namespace Model
19 {
20 
VorbisSettings()21 VorbisSettings::VorbisSettings() :
22     m_channels(0),
23     m_channelsHasBeenSet(false),
24     m_sampleRate(0),
25     m_sampleRateHasBeenSet(false),
26     m_vbrQuality(0),
27     m_vbrQualityHasBeenSet(false)
28 {
29 }
30 
VorbisSettings(JsonView jsonValue)31 VorbisSettings::VorbisSettings(JsonView jsonValue) :
32     m_channels(0),
33     m_channelsHasBeenSet(false),
34     m_sampleRate(0),
35     m_sampleRateHasBeenSet(false),
36     m_vbrQuality(0),
37     m_vbrQualityHasBeenSet(false)
38 {
39   *this = jsonValue;
40 }
41 
operator =(JsonView jsonValue)42 VorbisSettings& VorbisSettings::operator =(JsonView jsonValue)
43 {
44   if(jsonValue.ValueExists("channels"))
45   {
46     m_channels = jsonValue.GetInteger("channels");
47 
48     m_channelsHasBeenSet = true;
49   }
50 
51   if(jsonValue.ValueExists("sampleRate"))
52   {
53     m_sampleRate = jsonValue.GetInteger("sampleRate");
54 
55     m_sampleRateHasBeenSet = true;
56   }
57 
58   if(jsonValue.ValueExists("vbrQuality"))
59   {
60     m_vbrQuality = jsonValue.GetInteger("vbrQuality");
61 
62     m_vbrQualityHasBeenSet = true;
63   }
64 
65   return *this;
66 }
67 
Jsonize() const68 JsonValue VorbisSettings::Jsonize() const
69 {
70   JsonValue payload;
71 
72   if(m_channelsHasBeenSet)
73   {
74    payload.WithInteger("channels", m_channels);
75 
76   }
77 
78   if(m_sampleRateHasBeenSet)
79   {
80    payload.WithInteger("sampleRate", m_sampleRate);
81 
82   }
83 
84   if(m_vbrQualityHasBeenSet)
85   {
86    payload.WithInteger("vbrQuality", m_vbrQuality);
87 
88   }
89 
90   return payload;
91 }
92 
93 } // namespace Model
94 } // namespace MediaConvert
95 } // namespace Aws
96