/** * 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 ComputeOptimizer { namespace Model { AccountEnrollmentStatus::AccountEnrollmentStatus() : m_accountIdHasBeenSet(false), m_status(Status::NOT_SET), m_statusHasBeenSet(false), m_statusReasonHasBeenSet(false), m_lastUpdatedTimestampHasBeenSet(false) { } AccountEnrollmentStatus::AccountEnrollmentStatus(JsonView jsonValue) : m_accountIdHasBeenSet(false), m_status(Status::NOT_SET), m_statusHasBeenSet(false), m_statusReasonHasBeenSet(false), m_lastUpdatedTimestampHasBeenSet(false) { *this = jsonValue; } AccountEnrollmentStatus& AccountEnrollmentStatus::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("accountId")) { m_accountId = jsonValue.GetString("accountId"); m_accountIdHasBeenSet = true; } if(jsonValue.ValueExists("status")) { m_status = StatusMapper::GetStatusForName(jsonValue.GetString("status")); m_statusHasBeenSet = true; } if(jsonValue.ValueExists("statusReason")) { m_statusReason = jsonValue.GetString("statusReason"); m_statusReasonHasBeenSet = true; } if(jsonValue.ValueExists("lastUpdatedTimestamp")) { m_lastUpdatedTimestamp = jsonValue.GetDouble("lastUpdatedTimestamp"); m_lastUpdatedTimestampHasBeenSet = true; } return *this; } JsonValue AccountEnrollmentStatus::Jsonize() const { JsonValue payload; if(m_accountIdHasBeenSet) { payload.WithString("accountId", m_accountId); } if(m_statusHasBeenSet) { payload.WithString("status", StatusMapper::GetNameForStatus(m_status)); } if(m_statusReasonHasBeenSet) { payload.WithString("statusReason", m_statusReason); } if(m_lastUpdatedTimestampHasBeenSet) { payload.WithDouble("lastUpdatedTimestamp", m_lastUpdatedTimestamp.SecondsWithMSPrecision()); } return payload; } } // namespace Model } // namespace ComputeOptimizer } // namespace Aws