1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/chime-sdk-messaging/model/BatchCreateChannelMembershipResult.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::ChimeSDKMessaging::Model;
15 using namespace Aws::Utils::Json;
16 using namespace Aws::Utils;
17 using namespace Aws;
18 
BatchCreateChannelMembershipResult()19 BatchCreateChannelMembershipResult::BatchCreateChannelMembershipResult()
20 {
21 }
22 
BatchCreateChannelMembershipResult(const Aws::AmazonWebServiceResult<JsonValue> & result)23 BatchCreateChannelMembershipResult::BatchCreateChannelMembershipResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
24 {
25   *this = result;
26 }
27 
operator =(const Aws::AmazonWebServiceResult<JsonValue> & result)28 BatchCreateChannelMembershipResult& BatchCreateChannelMembershipResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
29 {
30   JsonView jsonValue = result.GetPayload().View();
31   if(jsonValue.ValueExists("BatchChannelMemberships"))
32   {
33     m_batchChannelMemberships = jsonValue.GetObject("BatchChannelMemberships");
34 
35   }
36 
37   if(jsonValue.ValueExists("Errors"))
38   {
39     Array<JsonView> errorsJsonList = jsonValue.GetArray("Errors");
40     for(unsigned errorsIndex = 0; errorsIndex < errorsJsonList.GetLength(); ++errorsIndex)
41     {
42       m_errors.push_back(errorsJsonList[errorsIndex].AsObject());
43     }
44   }
45 
46 
47 
48   return *this;
49 }
50