/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace SecurityHub { namespace Model { AwsEc2VolumeDetails::AwsEc2VolumeDetails() : m_createTimeHasBeenSet(false), m_deviceNameHasBeenSet(false), m_encrypted(false), m_encryptedHasBeenSet(false), m_size(0), m_sizeHasBeenSet(false), m_snapshotIdHasBeenSet(false), m_statusHasBeenSet(false), m_kmsKeyIdHasBeenSet(false), m_attachmentsHasBeenSet(false), m_volumeIdHasBeenSet(false), m_volumeTypeHasBeenSet(false), m_volumeScanStatusHasBeenSet(false) { } AwsEc2VolumeDetails::AwsEc2VolumeDetails(JsonView jsonValue) : m_createTimeHasBeenSet(false), m_deviceNameHasBeenSet(false), m_encrypted(false), m_encryptedHasBeenSet(false), m_size(0), m_sizeHasBeenSet(false), m_snapshotIdHasBeenSet(false), m_statusHasBeenSet(false), m_kmsKeyIdHasBeenSet(false), m_attachmentsHasBeenSet(false), m_volumeIdHasBeenSet(false), m_volumeTypeHasBeenSet(false), m_volumeScanStatusHasBeenSet(false) { *this = jsonValue; } AwsEc2VolumeDetails& AwsEc2VolumeDetails::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("CreateTime")) { m_createTime = jsonValue.GetString("CreateTime"); m_createTimeHasBeenSet = true; } if(jsonValue.ValueExists("DeviceName")) { m_deviceName = jsonValue.GetString("DeviceName"); m_deviceNameHasBeenSet = true; } if(jsonValue.ValueExists("Encrypted")) { m_encrypted = jsonValue.GetBool("Encrypted"); m_encryptedHasBeenSet = true; } if(jsonValue.ValueExists("Size")) { m_size = jsonValue.GetInteger("Size"); m_sizeHasBeenSet = true; } if(jsonValue.ValueExists("SnapshotId")) { m_snapshotId = jsonValue.GetString("SnapshotId"); m_snapshotIdHasBeenSet = true; } if(jsonValue.ValueExists("Status")) { m_status = jsonValue.GetString("Status"); m_statusHasBeenSet = true; } if(jsonValue.ValueExists("KmsKeyId")) { m_kmsKeyId = jsonValue.GetString("KmsKeyId"); m_kmsKeyIdHasBeenSet = true; } if(jsonValue.ValueExists("Attachments")) { Aws::Utils::Array attachmentsJsonList = jsonValue.GetArray("Attachments"); for(unsigned attachmentsIndex = 0; attachmentsIndex < attachmentsJsonList.GetLength(); ++attachmentsIndex) { m_attachments.push_back(attachmentsJsonList[attachmentsIndex].AsObject()); } m_attachmentsHasBeenSet = true; } if(jsonValue.ValueExists("VolumeId")) { m_volumeId = jsonValue.GetString("VolumeId"); m_volumeIdHasBeenSet = true; } if(jsonValue.ValueExists("VolumeType")) { m_volumeType = jsonValue.GetString("VolumeType"); m_volumeTypeHasBeenSet = true; } if(jsonValue.ValueExists("VolumeScanStatus")) { m_volumeScanStatus = jsonValue.GetString("VolumeScanStatus"); m_volumeScanStatusHasBeenSet = true; } return *this; } JsonValue AwsEc2VolumeDetails::Jsonize() const { JsonValue payload; if(m_createTimeHasBeenSet) { payload.WithString("CreateTime", m_createTime); } if(m_deviceNameHasBeenSet) { payload.WithString("DeviceName", m_deviceName); } if(m_encryptedHasBeenSet) { payload.WithBool("Encrypted", m_encrypted); } if(m_sizeHasBeenSet) { payload.WithInteger("Size", m_size); } if(m_snapshotIdHasBeenSet) { payload.WithString("SnapshotId", m_snapshotId); } if(m_statusHasBeenSet) { payload.WithString("Status", m_status); } if(m_kmsKeyIdHasBeenSet) { payload.WithString("KmsKeyId", m_kmsKeyId); } if(m_attachmentsHasBeenSet) { Aws::Utils::Array attachmentsJsonList(m_attachments.size()); for(unsigned attachmentsIndex = 0; attachmentsIndex < attachmentsJsonList.GetLength(); ++attachmentsIndex) { attachmentsJsonList[attachmentsIndex].AsObject(m_attachments[attachmentsIndex].Jsonize()); } payload.WithArray("Attachments", std::move(attachmentsJsonList)); } if(m_volumeIdHasBeenSet) { payload.WithString("VolumeId", m_volumeId); } if(m_volumeTypeHasBeenSet) { payload.WithString("VolumeType", m_volumeType); } if(m_volumeScanStatusHasBeenSet) { payload.WithString("VolumeScanStatus", m_volumeScanStatus); } return payload; } } // namespace Model } // namespace SecurityHub } // namespace Aws