1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/cloudtrail/model/UpdateTrailResult.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::CloudTrail::Model; 15 using namespace Aws::Utils::Json; 16 using namespace Aws::Utils; 17 using namespace Aws; 18 UpdateTrailResult()19UpdateTrailResult::UpdateTrailResult() : 20 m_includeGlobalServiceEvents(false), 21 m_isMultiRegionTrail(false), 22 m_logFileValidationEnabled(false), 23 m_isOrganizationTrail(false) 24 { 25 } 26 UpdateTrailResult(const Aws::AmazonWebServiceResult<JsonValue> & result)27UpdateTrailResult::UpdateTrailResult(const Aws::AmazonWebServiceResult<JsonValue>& result) : 28 m_includeGlobalServiceEvents(false), 29 m_isMultiRegionTrail(false), 30 m_logFileValidationEnabled(false), 31 m_isOrganizationTrail(false) 32 { 33 *this = result; 34 } 35 operator =(const Aws::AmazonWebServiceResult<JsonValue> & result)36UpdateTrailResult& UpdateTrailResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result) 37 { 38 JsonView jsonValue = result.GetPayload().View(); 39 if(jsonValue.ValueExists("Name")) 40 { 41 m_name = jsonValue.GetString("Name"); 42 43 } 44 45 if(jsonValue.ValueExists("S3BucketName")) 46 { 47 m_s3BucketName = jsonValue.GetString("S3BucketName"); 48 49 } 50 51 if(jsonValue.ValueExists("S3KeyPrefix")) 52 { 53 m_s3KeyPrefix = jsonValue.GetString("S3KeyPrefix"); 54 55 } 56 57 if(jsonValue.ValueExists("SnsTopicARN")) 58 { 59 m_snsTopicARN = jsonValue.GetString("SnsTopicARN"); 60 61 } 62 63 if(jsonValue.ValueExists("IncludeGlobalServiceEvents")) 64 { 65 m_includeGlobalServiceEvents = jsonValue.GetBool("IncludeGlobalServiceEvents"); 66 67 } 68 69 if(jsonValue.ValueExists("IsMultiRegionTrail")) 70 { 71 m_isMultiRegionTrail = jsonValue.GetBool("IsMultiRegionTrail"); 72 73 } 74 75 if(jsonValue.ValueExists("TrailARN")) 76 { 77 m_trailARN = jsonValue.GetString("TrailARN"); 78 79 } 80 81 if(jsonValue.ValueExists("LogFileValidationEnabled")) 82 { 83 m_logFileValidationEnabled = jsonValue.GetBool("LogFileValidationEnabled"); 84 85 } 86 87 if(jsonValue.ValueExists("CloudWatchLogsLogGroupArn")) 88 { 89 m_cloudWatchLogsLogGroupArn = jsonValue.GetString("CloudWatchLogsLogGroupArn"); 90 91 } 92 93 if(jsonValue.ValueExists("CloudWatchLogsRoleArn")) 94 { 95 m_cloudWatchLogsRoleArn = jsonValue.GetString("CloudWatchLogsRoleArn"); 96 97 } 98 99 if(jsonValue.ValueExists("KmsKeyId")) 100 { 101 m_kmsKeyId = jsonValue.GetString("KmsKeyId"); 102 103 } 104 105 if(jsonValue.ValueExists("IsOrganizationTrail")) 106 { 107 m_isOrganizationTrail = jsonValue.GetBool("IsOrganizationTrail"); 108 109 } 110 111 112 113 return *this; 114 } 115