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/HlsSettings.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 
HlsSettings()21 HlsSettings::HlsSettings() :
22     m_audioGroupIdHasBeenSet(false),
23     m_audioOnlyContainer(HlsAudioOnlyContainer::NOT_SET),
24     m_audioOnlyContainerHasBeenSet(false),
25     m_audioRenditionSetsHasBeenSet(false),
26     m_audioTrackType(HlsAudioTrackType::NOT_SET),
27     m_audioTrackTypeHasBeenSet(false),
28     m_descriptiveVideoServiceFlag(HlsDescriptiveVideoServiceFlag::NOT_SET),
29     m_descriptiveVideoServiceFlagHasBeenSet(false),
30     m_iFrameOnlyManifest(HlsIFrameOnlyManifest::NOT_SET),
31     m_iFrameOnlyManifestHasBeenSet(false),
32     m_segmentModifierHasBeenSet(false)
33 {
34 }
35 
HlsSettings(JsonView jsonValue)36 HlsSettings::HlsSettings(JsonView jsonValue) :
37     m_audioGroupIdHasBeenSet(false),
38     m_audioOnlyContainer(HlsAudioOnlyContainer::NOT_SET),
39     m_audioOnlyContainerHasBeenSet(false),
40     m_audioRenditionSetsHasBeenSet(false),
41     m_audioTrackType(HlsAudioTrackType::NOT_SET),
42     m_audioTrackTypeHasBeenSet(false),
43     m_descriptiveVideoServiceFlag(HlsDescriptiveVideoServiceFlag::NOT_SET),
44     m_descriptiveVideoServiceFlagHasBeenSet(false),
45     m_iFrameOnlyManifest(HlsIFrameOnlyManifest::NOT_SET),
46     m_iFrameOnlyManifestHasBeenSet(false),
47     m_segmentModifierHasBeenSet(false)
48 {
49   *this = jsonValue;
50 }
51 
operator =(JsonView jsonValue)52 HlsSettings& HlsSettings::operator =(JsonView jsonValue)
53 {
54   if(jsonValue.ValueExists("audioGroupId"))
55   {
56     m_audioGroupId = jsonValue.GetString("audioGroupId");
57 
58     m_audioGroupIdHasBeenSet = true;
59   }
60 
61   if(jsonValue.ValueExists("audioOnlyContainer"))
62   {
63     m_audioOnlyContainer = HlsAudioOnlyContainerMapper::GetHlsAudioOnlyContainerForName(jsonValue.GetString("audioOnlyContainer"));
64 
65     m_audioOnlyContainerHasBeenSet = true;
66   }
67 
68   if(jsonValue.ValueExists("audioRenditionSets"))
69   {
70     m_audioRenditionSets = jsonValue.GetString("audioRenditionSets");
71 
72     m_audioRenditionSetsHasBeenSet = true;
73   }
74 
75   if(jsonValue.ValueExists("audioTrackType"))
76   {
77     m_audioTrackType = HlsAudioTrackTypeMapper::GetHlsAudioTrackTypeForName(jsonValue.GetString("audioTrackType"));
78 
79     m_audioTrackTypeHasBeenSet = true;
80   }
81 
82   if(jsonValue.ValueExists("descriptiveVideoServiceFlag"))
83   {
84     m_descriptiveVideoServiceFlag = HlsDescriptiveVideoServiceFlagMapper::GetHlsDescriptiveVideoServiceFlagForName(jsonValue.GetString("descriptiveVideoServiceFlag"));
85 
86     m_descriptiveVideoServiceFlagHasBeenSet = true;
87   }
88 
89   if(jsonValue.ValueExists("iFrameOnlyManifest"))
90   {
91     m_iFrameOnlyManifest = HlsIFrameOnlyManifestMapper::GetHlsIFrameOnlyManifestForName(jsonValue.GetString("iFrameOnlyManifest"));
92 
93     m_iFrameOnlyManifestHasBeenSet = true;
94   }
95 
96   if(jsonValue.ValueExists("segmentModifier"))
97   {
98     m_segmentModifier = jsonValue.GetString("segmentModifier");
99 
100     m_segmentModifierHasBeenSet = true;
101   }
102 
103   return *this;
104 }
105 
Jsonize() const106 JsonValue HlsSettings::Jsonize() const
107 {
108   JsonValue payload;
109 
110   if(m_audioGroupIdHasBeenSet)
111   {
112    payload.WithString("audioGroupId", m_audioGroupId);
113 
114   }
115 
116   if(m_audioOnlyContainerHasBeenSet)
117   {
118    payload.WithString("audioOnlyContainer", HlsAudioOnlyContainerMapper::GetNameForHlsAudioOnlyContainer(m_audioOnlyContainer));
119   }
120 
121   if(m_audioRenditionSetsHasBeenSet)
122   {
123    payload.WithString("audioRenditionSets", m_audioRenditionSets);
124 
125   }
126 
127   if(m_audioTrackTypeHasBeenSet)
128   {
129    payload.WithString("audioTrackType", HlsAudioTrackTypeMapper::GetNameForHlsAudioTrackType(m_audioTrackType));
130   }
131 
132   if(m_descriptiveVideoServiceFlagHasBeenSet)
133   {
134    payload.WithString("descriptiveVideoServiceFlag", HlsDescriptiveVideoServiceFlagMapper::GetNameForHlsDescriptiveVideoServiceFlag(m_descriptiveVideoServiceFlag));
135   }
136 
137   if(m_iFrameOnlyManifestHasBeenSet)
138   {
139    payload.WithString("iFrameOnlyManifest", HlsIFrameOnlyManifestMapper::GetNameForHlsIFrameOnlyManifest(m_iFrameOnlyManifest));
140   }
141 
142   if(m_segmentModifierHasBeenSet)
143   {
144    payload.WithString("segmentModifier", m_segmentModifier);
145 
146   }
147 
148   return payload;
149 }
150 
151 } // namespace Model
152 } // namespace MediaConvert
153 } // namespace Aws
154