/** * 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 { SortingConfiguration::SortingConfiguration() : m_documentAttributeKeyHasBeenSet(false), m_sortOrder(SortOrder::NOT_SET), m_sortOrderHasBeenSet(false) { } SortingConfiguration::SortingConfiguration(JsonView jsonValue) : m_documentAttributeKeyHasBeenSet(false), m_sortOrder(SortOrder::NOT_SET), m_sortOrderHasBeenSet(false) { *this = jsonValue; } SortingConfiguration& SortingConfiguration::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("DocumentAttributeKey")) { m_documentAttributeKey = jsonValue.GetString("DocumentAttributeKey"); m_documentAttributeKeyHasBeenSet = true; } if(jsonValue.ValueExists("SortOrder")) { m_sortOrder = SortOrderMapper::GetSortOrderForName(jsonValue.GetString("SortOrder")); m_sortOrderHasBeenSet = true; } return *this; } JsonValue SortingConfiguration::Jsonize() const { JsonValue payload; if(m_documentAttributeKeyHasBeenSet) { payload.WithString("DocumentAttributeKey", m_documentAttributeKey); } if(m_sortOrderHasBeenSet) { payload.WithString("SortOrder", SortOrderMapper::GetNameForSortOrder(m_sortOrder)); } return payload; } } // namespace Model } // namespace kendra } // namespace Aws