/** * 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 { PersonasSummary::PersonasSummary() : m_entityIdHasBeenSet(false), m_persona(Persona::NOT_SET), m_personaHasBeenSet(false), m_createdAtHasBeenSet(false), m_updatedAtHasBeenSet(false) { } PersonasSummary::PersonasSummary(JsonView jsonValue) : m_entityIdHasBeenSet(false), m_persona(Persona::NOT_SET), m_personaHasBeenSet(false), m_createdAtHasBeenSet(false), m_updatedAtHasBeenSet(false) { *this = jsonValue; } PersonasSummary& PersonasSummary::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("EntityId")) { m_entityId = jsonValue.GetString("EntityId"); m_entityIdHasBeenSet = true; } if(jsonValue.ValueExists("Persona")) { m_persona = PersonaMapper::GetPersonaForName(jsonValue.GetString("Persona")); m_personaHasBeenSet = true; } if(jsonValue.ValueExists("CreatedAt")) { m_createdAt = jsonValue.GetDouble("CreatedAt"); m_createdAtHasBeenSet = true; } if(jsonValue.ValueExists("UpdatedAt")) { m_updatedAt = jsonValue.GetDouble("UpdatedAt"); m_updatedAtHasBeenSet = true; } return *this; } JsonValue PersonasSummary::Jsonize() const { JsonValue payload; if(m_entityIdHasBeenSet) { payload.WithString("EntityId", m_entityId); } if(m_personaHasBeenSet) { payload.WithString("Persona", PersonaMapper::GetNameForPersona(m_persona)); } if(m_createdAtHasBeenSet) { payload.WithDouble("CreatedAt", m_createdAt.SecondsWithMSPrecision()); } if(m_updatedAtHasBeenSet) { payload.WithDouble("UpdatedAt", m_updatedAt.SecondsWithMSPrecision()); } return payload; } } // namespace Model } // namespace kendra } // namespace Aws