/** * 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 Backup { namespace Model { RecoveryPointByResource::RecoveryPointByResource() : m_recoveryPointArnHasBeenSet(false), m_creationDateHasBeenSet(false), m_status(RecoveryPointStatus::NOT_SET), m_statusHasBeenSet(false), m_encryptionKeyArnHasBeenSet(false), m_backupSizeBytes(0), m_backupSizeBytesHasBeenSet(false), m_backupVaultNameHasBeenSet(false) { } RecoveryPointByResource::RecoveryPointByResource(JsonView jsonValue) : m_recoveryPointArnHasBeenSet(false), m_creationDateHasBeenSet(false), m_status(RecoveryPointStatus::NOT_SET), m_statusHasBeenSet(false), m_encryptionKeyArnHasBeenSet(false), m_backupSizeBytes(0), m_backupSizeBytesHasBeenSet(false), m_backupVaultNameHasBeenSet(false) { *this = jsonValue; } RecoveryPointByResource& RecoveryPointByResource::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("RecoveryPointArn")) { m_recoveryPointArn = jsonValue.GetString("RecoveryPointArn"); m_recoveryPointArnHasBeenSet = true; } if(jsonValue.ValueExists("CreationDate")) { m_creationDate = jsonValue.GetDouble("CreationDate"); m_creationDateHasBeenSet = true; } if(jsonValue.ValueExists("Status")) { m_status = RecoveryPointStatusMapper::GetRecoveryPointStatusForName(jsonValue.GetString("Status")); m_statusHasBeenSet = true; } if(jsonValue.ValueExists("EncryptionKeyArn")) { m_encryptionKeyArn = jsonValue.GetString("EncryptionKeyArn"); m_encryptionKeyArnHasBeenSet = true; } if(jsonValue.ValueExists("BackupSizeBytes")) { m_backupSizeBytes = jsonValue.GetInt64("BackupSizeBytes"); m_backupSizeBytesHasBeenSet = true; } if(jsonValue.ValueExists("BackupVaultName")) { m_backupVaultName = jsonValue.GetString("BackupVaultName"); m_backupVaultNameHasBeenSet = true; } return *this; } JsonValue RecoveryPointByResource::Jsonize() const { JsonValue payload; if(m_recoveryPointArnHasBeenSet) { payload.WithString("RecoveryPointArn", m_recoveryPointArn); } if(m_creationDateHasBeenSet) { payload.WithDouble("CreationDate", m_creationDate.SecondsWithMSPrecision()); } if(m_statusHasBeenSet) { payload.WithString("Status", RecoveryPointStatusMapper::GetNameForRecoveryPointStatus(m_status)); } if(m_encryptionKeyArnHasBeenSet) { payload.WithString("EncryptionKeyArn", m_encryptionKeyArn); } if(m_backupSizeBytesHasBeenSet) { payload.WithInt64("BackupSizeBytes", m_backupSizeBytes); } if(m_backupVaultNameHasBeenSet) { payload.WithString("BackupVaultName", m_backupVaultName); } return payload; } } // namespace Model } // namespace Backup } // namespace Aws