/** * 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 FSx { namespace Model { RetentionPeriod::RetentionPeriod() : m_type(RetentionPeriodType::NOT_SET), m_typeHasBeenSet(false), m_value(0), m_valueHasBeenSet(false) { } RetentionPeriod::RetentionPeriod(JsonView jsonValue) : m_type(RetentionPeriodType::NOT_SET), m_typeHasBeenSet(false), m_value(0), m_valueHasBeenSet(false) { *this = jsonValue; } RetentionPeriod& RetentionPeriod::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Type")) { m_type = RetentionPeriodTypeMapper::GetRetentionPeriodTypeForName(jsonValue.GetString("Type")); m_typeHasBeenSet = true; } if(jsonValue.ValueExists("Value")) { m_value = jsonValue.GetInteger("Value"); m_valueHasBeenSet = true; } return *this; } JsonValue RetentionPeriod::Jsonize() const { JsonValue payload; if(m_typeHasBeenSet) { payload.WithString("Type", RetentionPeriodTypeMapper::GetNameForRetentionPeriodType(m_type)); } if(m_valueHasBeenSet) { payload.WithInteger("Value", m_value); } return payload; } } // namespace Model } // namespace FSx } // namespace Aws