1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/fsx/model/DescribeBackupsRequest.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8 
9 #include <utility>
10 
11 using namespace Aws::FSx::Model;
12 using namespace Aws::Utils::Json;
13 using namespace Aws::Utils;
14 
DescribeBackupsRequest()15 DescribeBackupsRequest::DescribeBackupsRequest() :
16     m_backupIdsHasBeenSet(false),
17     m_filtersHasBeenSet(false),
18     m_maxResults(0),
19     m_maxResultsHasBeenSet(false),
20     m_nextTokenHasBeenSet(false)
21 {
22 }
23 
SerializePayload() const24 Aws::String DescribeBackupsRequest::SerializePayload() const
25 {
26   JsonValue payload;
27 
28   if(m_backupIdsHasBeenSet)
29   {
30    Array<JsonValue> backupIdsJsonList(m_backupIds.size());
31    for(unsigned backupIdsIndex = 0; backupIdsIndex < backupIdsJsonList.GetLength(); ++backupIdsIndex)
32    {
33      backupIdsJsonList[backupIdsIndex].AsString(m_backupIds[backupIdsIndex]);
34    }
35    payload.WithArray("BackupIds", std::move(backupIdsJsonList));
36 
37   }
38 
39   if(m_filtersHasBeenSet)
40   {
41    Array<JsonValue> filtersJsonList(m_filters.size());
42    for(unsigned filtersIndex = 0; filtersIndex < filtersJsonList.GetLength(); ++filtersIndex)
43    {
44      filtersJsonList[filtersIndex].AsObject(m_filters[filtersIndex].Jsonize());
45    }
46    payload.WithArray("Filters", std::move(filtersJsonList));
47 
48   }
49 
50   if(m_maxResultsHasBeenSet)
51   {
52    payload.WithInteger("MaxResults", m_maxResults);
53 
54   }
55 
56   if(m_nextTokenHasBeenSet)
57   {
58    payload.WithString("NextToken", m_nextToken);
59 
60   }
61 
62   return payload.View().WriteReadable();
63 }
64 
GetRequestSpecificHeaders() const65 Aws::Http::HeaderValueCollection DescribeBackupsRequest::GetRequestSpecificHeaders() const
66 {
67   Aws::Http::HeaderValueCollection headers;
68   headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSSimbaAPIService_v20180301.DescribeBackups"));
69   return headers;
70 
71 }
72 
73 
74 
75 
76