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