/** * 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 { AwsWafv2RuleGroupDetails::AwsWafv2RuleGroupDetails() : m_capacity(0), m_capacityHasBeenSet(false), m_descriptionHasBeenSet(false), m_idHasBeenSet(false), m_nameHasBeenSet(false), m_arnHasBeenSet(false), m_rulesHasBeenSet(false), m_scopeHasBeenSet(false), m_visibilityConfigHasBeenSet(false) { } AwsWafv2RuleGroupDetails::AwsWafv2RuleGroupDetails(JsonView jsonValue) : m_capacity(0), m_capacityHasBeenSet(false), m_descriptionHasBeenSet(false), m_idHasBeenSet(false), m_nameHasBeenSet(false), m_arnHasBeenSet(false), m_rulesHasBeenSet(false), m_scopeHasBeenSet(false), m_visibilityConfigHasBeenSet(false) { *this = jsonValue; } AwsWafv2RuleGroupDetails& AwsWafv2RuleGroupDetails::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Capacity")) { m_capacity = jsonValue.GetInt64("Capacity"); m_capacityHasBeenSet = true; } if(jsonValue.ValueExists("Description")) { m_description = jsonValue.GetString("Description"); m_descriptionHasBeenSet = true; } if(jsonValue.ValueExists("Id")) { m_id = jsonValue.GetString("Id"); m_idHasBeenSet = true; } if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("Arn")) { m_arn = jsonValue.GetString("Arn"); m_arnHasBeenSet = true; } if(jsonValue.ValueExists("Rules")) { Aws::Utils::Array rulesJsonList = jsonValue.GetArray("Rules"); for(unsigned rulesIndex = 0; rulesIndex < rulesJsonList.GetLength(); ++rulesIndex) { m_rules.push_back(rulesJsonList[rulesIndex].AsObject()); } m_rulesHasBeenSet = true; } if(jsonValue.ValueExists("Scope")) { m_scope = jsonValue.GetString("Scope"); m_scopeHasBeenSet = true; } if(jsonValue.ValueExists("VisibilityConfig")) { m_visibilityConfig = jsonValue.GetObject("VisibilityConfig"); m_visibilityConfigHasBeenSet = true; } return *this; } JsonValue AwsWafv2RuleGroupDetails::Jsonize() const { JsonValue payload; if(m_capacityHasBeenSet) { payload.WithInt64("Capacity", m_capacity); } if(m_descriptionHasBeenSet) { payload.WithString("Description", m_description); } if(m_idHasBeenSet) { payload.WithString("Id", m_id); } if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_arnHasBeenSet) { payload.WithString("Arn", m_arn); } if(m_rulesHasBeenSet) { Aws::Utils::Array rulesJsonList(m_rules.size()); for(unsigned rulesIndex = 0; rulesIndex < rulesJsonList.GetLength(); ++rulesIndex) { rulesJsonList[rulesIndex].AsObject(m_rules[rulesIndex].Jsonize()); } payload.WithArray("Rules", std::move(rulesJsonList)); } if(m_scopeHasBeenSet) { payload.WithString("Scope", m_scope); } if(m_visibilityConfigHasBeenSet) { payload.WithObject("VisibilityConfig", m_visibilityConfig.Jsonize()); } return payload; } } // namespace Model } // namespace SecurityHub } // namespace Aws