1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/elasticfilesystem/model/CreateFileSystemRequest.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8 
9 #include <utility>
10 
11 using namespace Aws::EFS::Model;
12 using namespace Aws::Utils::Json;
13 using namespace Aws::Utils;
14 
CreateFileSystemRequest()15 CreateFileSystemRequest::CreateFileSystemRequest() :
16     m_creationToken(Aws::Utils::UUID::RandomUUID()),
17     m_creationTokenHasBeenSet(true),
18     m_performanceMode(PerformanceMode::NOT_SET),
19     m_performanceModeHasBeenSet(false),
20     m_encrypted(false),
21     m_encryptedHasBeenSet(false),
22     m_kmsKeyIdHasBeenSet(false),
23     m_throughputMode(ThroughputMode::NOT_SET),
24     m_throughputModeHasBeenSet(false),
25     m_provisionedThroughputInMibps(0.0),
26     m_provisionedThroughputInMibpsHasBeenSet(false),
27     m_availabilityZoneNameHasBeenSet(false),
28     m_backup(false),
29     m_backupHasBeenSet(false),
30     m_tagsHasBeenSet(false)
31 {
32 }
33 
SerializePayload() const34 Aws::String CreateFileSystemRequest::SerializePayload() const
35 {
36   JsonValue payload;
37 
38   if(m_creationTokenHasBeenSet)
39   {
40    payload.WithString("CreationToken", m_creationToken);
41 
42   }
43 
44   if(m_performanceModeHasBeenSet)
45   {
46    payload.WithString("PerformanceMode", PerformanceModeMapper::GetNameForPerformanceMode(m_performanceMode));
47   }
48 
49   if(m_encryptedHasBeenSet)
50   {
51    payload.WithBool("Encrypted", m_encrypted);
52 
53   }
54 
55   if(m_kmsKeyIdHasBeenSet)
56   {
57    payload.WithString("KmsKeyId", m_kmsKeyId);
58 
59   }
60 
61   if(m_throughputModeHasBeenSet)
62   {
63    payload.WithString("ThroughputMode", ThroughputModeMapper::GetNameForThroughputMode(m_throughputMode));
64   }
65 
66   if(m_provisionedThroughputInMibpsHasBeenSet)
67   {
68    payload.WithDouble("ProvisionedThroughputInMibps", m_provisionedThroughputInMibps);
69 
70   }
71 
72   if(m_availabilityZoneNameHasBeenSet)
73   {
74    payload.WithString("AvailabilityZoneName", m_availabilityZoneName);
75 
76   }
77 
78   if(m_backupHasBeenSet)
79   {
80    payload.WithBool("Backup", m_backup);
81 
82   }
83 
84   if(m_tagsHasBeenSet)
85   {
86    Array<JsonValue> tagsJsonList(m_tags.size());
87    for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
88    {
89      tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize());
90    }
91    payload.WithArray("Tags", std::move(tagsJsonList));
92 
93   }
94 
95   return payload.View().WriteReadable();
96 }
97 
98 
99 
100 
101