/**
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

#include <aws/waf/model/WafOverrideAction.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace WAF
{
namespace Model
{

WafOverrideAction::WafOverrideAction() : 
    m_type(WafOverrideActionType::NOT_SET),
    m_typeHasBeenSet(false)
{
}

WafOverrideAction::WafOverrideAction(JsonView jsonValue)
  : WafOverrideAction()
{
  *this = jsonValue;
}

WafOverrideAction& WafOverrideAction::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("Type"))
  {
    m_type = WafOverrideActionTypeMapper::GetWafOverrideActionTypeForName(jsonValue.GetString("Type"));

    m_typeHasBeenSet = true;
  }

  return *this;
}

JsonValue WafOverrideAction::Jsonize() const
{
  JsonValue payload;

  if(m_typeHasBeenSet)
  {
   payload.WithString("Type", WafOverrideActionTypeMapper::GetNameForWafOverrideActionType(m_type));
  }

  return payload;
}

} // namespace Model
} // namespace WAF
} // namespace Aws
