1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/glue/model/BatchGetPartitionResult.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8 #include <aws/core/AmazonWebServiceResult.h>
9 #include <aws/core/utils/StringUtils.h>
10 #include <aws/core/utils/UnreferencedParam.h>
11 
12 #include <utility>
13 
14 using namespace Aws::Glue::Model;
15 using namespace Aws::Utils::Json;
16 using namespace Aws::Utils;
17 using namespace Aws;
18 
BatchGetPartitionResult()19 BatchGetPartitionResult::BatchGetPartitionResult()
20 {
21 }
22 
BatchGetPartitionResult(const Aws::AmazonWebServiceResult<JsonValue> & result)23 BatchGetPartitionResult::BatchGetPartitionResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
24 {
25   *this = result;
26 }
27 
operator =(const Aws::AmazonWebServiceResult<JsonValue> & result)28 BatchGetPartitionResult& BatchGetPartitionResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
29 {
30   JsonView jsonValue = result.GetPayload().View();
31   if(jsonValue.ValueExists("Partitions"))
32   {
33     Array<JsonView> partitionsJsonList = jsonValue.GetArray("Partitions");
34     for(unsigned partitionsIndex = 0; partitionsIndex < partitionsJsonList.GetLength(); ++partitionsIndex)
35     {
36       m_partitions.push_back(partitionsJsonList[partitionsIndex].AsObject());
37     }
38   }
39 
40   if(jsonValue.ValueExists("UnprocessedKeys"))
41   {
42     Array<JsonView> unprocessedKeysJsonList = jsonValue.GetArray("UnprocessedKeys");
43     for(unsigned unprocessedKeysIndex = 0; unprocessedKeysIndex < unprocessedKeysJsonList.GetLength(); ++unprocessedKeysIndex)
44     {
45       m_unprocessedKeys.push_back(unprocessedKeysJsonList[unprocessedKeysIndex].AsObject());
46     }
47   }
48 
49 
50 
51   return *this;
52 }
53