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/ContainerSettings.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 
ContainerSettings()21 ContainerSettings::ContainerSettings() :
22     m_cmfcSettingsHasBeenSet(false),
23     m_container(ContainerType::NOT_SET),
24     m_containerHasBeenSet(false),
25     m_f4vSettingsHasBeenSet(false),
26     m_m2tsSettingsHasBeenSet(false),
27     m_m3u8SettingsHasBeenSet(false),
28     m_movSettingsHasBeenSet(false),
29     m_mp4SettingsHasBeenSet(false),
30     m_mpdSettingsHasBeenSet(false),
31     m_mxfSettingsHasBeenSet(false)
32 {
33 }
34 
ContainerSettings(JsonView jsonValue)35 ContainerSettings::ContainerSettings(JsonView jsonValue) :
36     m_cmfcSettingsHasBeenSet(false),
37     m_container(ContainerType::NOT_SET),
38     m_containerHasBeenSet(false),
39     m_f4vSettingsHasBeenSet(false),
40     m_m2tsSettingsHasBeenSet(false),
41     m_m3u8SettingsHasBeenSet(false),
42     m_movSettingsHasBeenSet(false),
43     m_mp4SettingsHasBeenSet(false),
44     m_mpdSettingsHasBeenSet(false),
45     m_mxfSettingsHasBeenSet(false)
46 {
47   *this = jsonValue;
48 }
49 
operator =(JsonView jsonValue)50 ContainerSettings& ContainerSettings::operator =(JsonView jsonValue)
51 {
52   if(jsonValue.ValueExists("cmfcSettings"))
53   {
54     m_cmfcSettings = jsonValue.GetObject("cmfcSettings");
55 
56     m_cmfcSettingsHasBeenSet = true;
57   }
58 
59   if(jsonValue.ValueExists("container"))
60   {
61     m_container = ContainerTypeMapper::GetContainerTypeForName(jsonValue.GetString("container"));
62 
63     m_containerHasBeenSet = true;
64   }
65 
66   if(jsonValue.ValueExists("f4vSettings"))
67   {
68     m_f4vSettings = jsonValue.GetObject("f4vSettings");
69 
70     m_f4vSettingsHasBeenSet = true;
71   }
72 
73   if(jsonValue.ValueExists("m2tsSettings"))
74   {
75     m_m2tsSettings = jsonValue.GetObject("m2tsSettings");
76 
77     m_m2tsSettingsHasBeenSet = true;
78   }
79 
80   if(jsonValue.ValueExists("m3u8Settings"))
81   {
82     m_m3u8Settings = jsonValue.GetObject("m3u8Settings");
83 
84     m_m3u8SettingsHasBeenSet = true;
85   }
86 
87   if(jsonValue.ValueExists("movSettings"))
88   {
89     m_movSettings = jsonValue.GetObject("movSettings");
90 
91     m_movSettingsHasBeenSet = true;
92   }
93 
94   if(jsonValue.ValueExists("mp4Settings"))
95   {
96     m_mp4Settings = jsonValue.GetObject("mp4Settings");
97 
98     m_mp4SettingsHasBeenSet = true;
99   }
100 
101   if(jsonValue.ValueExists("mpdSettings"))
102   {
103     m_mpdSettings = jsonValue.GetObject("mpdSettings");
104 
105     m_mpdSettingsHasBeenSet = true;
106   }
107 
108   if(jsonValue.ValueExists("mxfSettings"))
109   {
110     m_mxfSettings = jsonValue.GetObject("mxfSettings");
111 
112     m_mxfSettingsHasBeenSet = true;
113   }
114 
115   return *this;
116 }
117 
Jsonize() const118 JsonValue ContainerSettings::Jsonize() const
119 {
120   JsonValue payload;
121 
122   if(m_cmfcSettingsHasBeenSet)
123   {
124    payload.WithObject("cmfcSettings", m_cmfcSettings.Jsonize());
125 
126   }
127 
128   if(m_containerHasBeenSet)
129   {
130    payload.WithString("container", ContainerTypeMapper::GetNameForContainerType(m_container));
131   }
132 
133   if(m_f4vSettingsHasBeenSet)
134   {
135    payload.WithObject("f4vSettings", m_f4vSettings.Jsonize());
136 
137   }
138 
139   if(m_m2tsSettingsHasBeenSet)
140   {
141    payload.WithObject("m2tsSettings", m_m2tsSettings.Jsonize());
142 
143   }
144 
145   if(m_m3u8SettingsHasBeenSet)
146   {
147    payload.WithObject("m3u8Settings", m_m3u8Settings.Jsonize());
148 
149   }
150 
151   if(m_movSettingsHasBeenSet)
152   {
153    payload.WithObject("movSettings", m_movSettings.Jsonize());
154 
155   }
156 
157   if(m_mp4SettingsHasBeenSet)
158   {
159    payload.WithObject("mp4Settings", m_mp4Settings.Jsonize());
160 
161   }
162 
163   if(m_mpdSettingsHasBeenSet)
164   {
165    payload.WithObject("mpdSettings", m_mpdSettings.Jsonize());
166 
167   }
168 
169   if(m_mxfSettingsHasBeenSet)
170   {
171    payload.WithObject("mxfSettings", m_mxfSettings.Jsonize());
172 
173   }
174 
175   return payload;
176 }
177 
178 } // namespace Model
179 } // namespace MediaConvert
180 } // namespace Aws
181