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/InputDecryptionSettings.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 
InputDecryptionSettings()21 InputDecryptionSettings::InputDecryptionSettings() :
22     m_decryptionMode(DecryptionMode::NOT_SET),
23     m_decryptionModeHasBeenSet(false),
24     m_encryptedDecryptionKeyHasBeenSet(false),
25     m_initializationVectorHasBeenSet(false),
26     m_kmsKeyRegionHasBeenSet(false)
27 {
28 }
29 
InputDecryptionSettings(JsonView jsonValue)30 InputDecryptionSettings::InputDecryptionSettings(JsonView jsonValue) :
31     m_decryptionMode(DecryptionMode::NOT_SET),
32     m_decryptionModeHasBeenSet(false),
33     m_encryptedDecryptionKeyHasBeenSet(false),
34     m_initializationVectorHasBeenSet(false),
35     m_kmsKeyRegionHasBeenSet(false)
36 {
37   *this = jsonValue;
38 }
39 
operator =(JsonView jsonValue)40 InputDecryptionSettings& InputDecryptionSettings::operator =(JsonView jsonValue)
41 {
42   if(jsonValue.ValueExists("decryptionMode"))
43   {
44     m_decryptionMode = DecryptionModeMapper::GetDecryptionModeForName(jsonValue.GetString("decryptionMode"));
45 
46     m_decryptionModeHasBeenSet = true;
47   }
48 
49   if(jsonValue.ValueExists("encryptedDecryptionKey"))
50   {
51     m_encryptedDecryptionKey = jsonValue.GetString("encryptedDecryptionKey");
52 
53     m_encryptedDecryptionKeyHasBeenSet = true;
54   }
55 
56   if(jsonValue.ValueExists("initializationVector"))
57   {
58     m_initializationVector = jsonValue.GetString("initializationVector");
59 
60     m_initializationVectorHasBeenSet = true;
61   }
62 
63   if(jsonValue.ValueExists("kmsKeyRegion"))
64   {
65     m_kmsKeyRegion = jsonValue.GetString("kmsKeyRegion");
66 
67     m_kmsKeyRegionHasBeenSet = true;
68   }
69 
70   return *this;
71 }
72 
Jsonize() const73 JsonValue InputDecryptionSettings::Jsonize() const
74 {
75   JsonValue payload;
76 
77   if(m_decryptionModeHasBeenSet)
78   {
79    payload.WithString("decryptionMode", DecryptionModeMapper::GetNameForDecryptionMode(m_decryptionMode));
80   }
81 
82   if(m_encryptedDecryptionKeyHasBeenSet)
83   {
84    payload.WithString("encryptedDecryptionKey", m_encryptedDecryptionKey);
85 
86   }
87 
88   if(m_initializationVectorHasBeenSet)
89   {
90    payload.WithString("initializationVector", m_initializationVector);
91 
92   }
93 
94   if(m_kmsKeyRegionHasBeenSet)
95   {
96    payload.WithString("kmsKeyRegion", m_kmsKeyRegion);
97 
98   }
99 
100   return payload;
101 }
102 
103 } // namespace Model
104 } // namespace MediaConvert
105 } // namespace Aws
106