/** * 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 kendra { namespace Model { ExperiencesSummary::ExperiencesSummary() : m_nameHasBeenSet(false), m_idHasBeenSet(false), m_createdAtHasBeenSet(false), m_status(ExperienceStatus::NOT_SET), m_statusHasBeenSet(false), m_endpointsHasBeenSet(false) { } ExperiencesSummary::ExperiencesSummary(JsonView jsonValue) : m_nameHasBeenSet(false), m_idHasBeenSet(false), m_createdAtHasBeenSet(false), m_status(ExperienceStatus::NOT_SET), m_statusHasBeenSet(false), m_endpointsHasBeenSet(false) { *this = jsonValue; } ExperiencesSummary& ExperiencesSummary::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("Id")) { m_id = jsonValue.GetString("Id"); m_idHasBeenSet = true; } if(jsonValue.ValueExists("CreatedAt")) { m_createdAt = jsonValue.GetDouble("CreatedAt"); m_createdAtHasBeenSet = true; } if(jsonValue.ValueExists("Status")) { m_status = ExperienceStatusMapper::GetExperienceStatusForName(jsonValue.GetString("Status")); m_statusHasBeenSet = true; } if(jsonValue.ValueExists("Endpoints")) { Aws::Utils::Array endpointsJsonList = jsonValue.GetArray("Endpoints"); for(unsigned endpointsIndex = 0; endpointsIndex < endpointsJsonList.GetLength(); ++endpointsIndex) { m_endpoints.push_back(endpointsJsonList[endpointsIndex].AsObject()); } m_endpointsHasBeenSet = true; } return *this; } JsonValue ExperiencesSummary::Jsonize() const { JsonValue payload; if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_idHasBeenSet) { payload.WithString("Id", m_id); } if(m_createdAtHasBeenSet) { payload.WithDouble("CreatedAt", m_createdAt.SecondsWithMSPrecision()); } if(m_statusHasBeenSet) { payload.WithString("Status", ExperienceStatusMapper::GetNameForExperienceStatus(m_status)); } if(m_endpointsHasBeenSet) { Aws::Utils::Array endpointsJsonList(m_endpoints.size()); for(unsigned endpointsIndex = 0; endpointsIndex < endpointsJsonList.GetLength(); ++endpointsIndex) { endpointsJsonList[endpointsIndex].AsObject(m_endpoints[endpointsIndex].Jsonize()); } payload.WithArray("Endpoints", std::move(endpointsJsonList)); } return payload; } } // namespace Model } // namespace kendra } // namespace Aws