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