feat(hos_client_create, hos_client_destory): 多次调用destory不会导致重复释放

This commit is contained in:
彭宣正
2020-12-14 17:24:58 +08:00
parent 505d529c32
commit 10b370e486
55976 changed files with 8544395 additions and 2 deletions

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AssociateDRTLogBucketRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
AssociateDRTLogBucketRequest::AssociateDRTLogBucketRequest() :
m_logBucketHasBeenSet(false)
{
}
Aws::String AssociateDRTLogBucketRequest::SerializePayload() const
{
JsonValue payload;
if(m_logBucketHasBeenSet)
{
payload.WithString("LogBucket", m_logBucket);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection AssociateDRTLogBucketRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.AssociateDRTLogBucket"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AssociateDRTLogBucketResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
AssociateDRTLogBucketResult::AssociateDRTLogBucketResult()
{
}
AssociateDRTLogBucketResult::AssociateDRTLogBucketResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
AssociateDRTLogBucketResult& AssociateDRTLogBucketResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AssociateDRTRoleRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
AssociateDRTRoleRequest::AssociateDRTRoleRequest() :
m_roleArnHasBeenSet(false)
{
}
Aws::String AssociateDRTRoleRequest::SerializePayload() const
{
JsonValue payload;
if(m_roleArnHasBeenSet)
{
payload.WithString("RoleArn", m_roleArn);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection AssociateDRTRoleRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.AssociateDRTRole"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AssociateDRTRoleResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
AssociateDRTRoleResult::AssociateDRTRoleResult()
{
}
AssociateDRTRoleResult::AssociateDRTRoleResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
AssociateDRTRoleResult& AssociateDRTRoleResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,50 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AssociateHealthCheckRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
AssociateHealthCheckRequest::AssociateHealthCheckRequest() :
m_protectionIdHasBeenSet(false),
m_healthCheckArnHasBeenSet(false)
{
}
Aws::String AssociateHealthCheckRequest::SerializePayload() const
{
JsonValue payload;
if(m_protectionIdHasBeenSet)
{
payload.WithString("ProtectionId", m_protectionId);
}
if(m_healthCheckArnHasBeenSet)
{
payload.WithString("HealthCheckArn", m_healthCheckArn);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection AssociateHealthCheckRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.AssociateHealthCheck"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AssociateHealthCheckResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
AssociateHealthCheckResult::AssociateHealthCheckResult()
{
}
AssociateHealthCheckResult::AssociateHealthCheckResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
AssociateHealthCheckResult& AssociateHealthCheckResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,48 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AssociateProactiveEngagementDetailsRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
AssociateProactiveEngagementDetailsRequest::AssociateProactiveEngagementDetailsRequest() :
m_emergencyContactListHasBeenSet(false)
{
}
Aws::String AssociateProactiveEngagementDetailsRequest::SerializePayload() const
{
JsonValue payload;
if(m_emergencyContactListHasBeenSet)
{
Array<JsonValue> emergencyContactListJsonList(m_emergencyContactList.size());
for(unsigned emergencyContactListIndex = 0; emergencyContactListIndex < emergencyContactListJsonList.GetLength(); ++emergencyContactListIndex)
{
emergencyContactListJsonList[emergencyContactListIndex].AsObject(m_emergencyContactList[emergencyContactListIndex].Jsonize());
}
payload.WithArray("EmergencyContactList", std::move(emergencyContactListJsonList));
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection AssociateProactiveEngagementDetailsRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.AssociateProactiveEngagementDetails"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AssociateProactiveEngagementDetailsResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
AssociateProactiveEngagementDetailsResult::AssociateProactiveEngagementDetailsResult()
{
}
AssociateProactiveEngagementDetailsResult::AssociateProactiveEngagementDetailsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
AssociateProactiveEngagementDetailsResult& AssociateProactiveEngagementDetailsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,194 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AttackDetail.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
AttackDetail::AttackDetail() :
m_attackIdHasBeenSet(false),
m_resourceArnHasBeenSet(false),
m_subResourcesHasBeenSet(false),
m_startTimeHasBeenSet(false),
m_endTimeHasBeenSet(false),
m_attackCountersHasBeenSet(false),
m_attackPropertiesHasBeenSet(false),
m_mitigationsHasBeenSet(false)
{
}
AttackDetail::AttackDetail(JsonView jsonValue) :
m_attackIdHasBeenSet(false),
m_resourceArnHasBeenSet(false),
m_subResourcesHasBeenSet(false),
m_startTimeHasBeenSet(false),
m_endTimeHasBeenSet(false),
m_attackCountersHasBeenSet(false),
m_attackPropertiesHasBeenSet(false),
m_mitigationsHasBeenSet(false)
{
*this = jsonValue;
}
AttackDetail& AttackDetail::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("AttackId"))
{
m_attackId = jsonValue.GetString("AttackId");
m_attackIdHasBeenSet = true;
}
if(jsonValue.ValueExists("ResourceArn"))
{
m_resourceArn = jsonValue.GetString("ResourceArn");
m_resourceArnHasBeenSet = true;
}
if(jsonValue.ValueExists("SubResources"))
{
Array<JsonView> subResourcesJsonList = jsonValue.GetArray("SubResources");
for(unsigned subResourcesIndex = 0; subResourcesIndex < subResourcesJsonList.GetLength(); ++subResourcesIndex)
{
m_subResources.push_back(subResourcesJsonList[subResourcesIndex].AsObject());
}
m_subResourcesHasBeenSet = true;
}
if(jsonValue.ValueExists("StartTime"))
{
m_startTime = jsonValue.GetDouble("StartTime");
m_startTimeHasBeenSet = true;
}
if(jsonValue.ValueExists("EndTime"))
{
m_endTime = jsonValue.GetDouble("EndTime");
m_endTimeHasBeenSet = true;
}
if(jsonValue.ValueExists("AttackCounters"))
{
Array<JsonView> attackCountersJsonList = jsonValue.GetArray("AttackCounters");
for(unsigned attackCountersIndex = 0; attackCountersIndex < attackCountersJsonList.GetLength(); ++attackCountersIndex)
{
m_attackCounters.push_back(attackCountersJsonList[attackCountersIndex].AsObject());
}
m_attackCountersHasBeenSet = true;
}
if(jsonValue.ValueExists("AttackProperties"))
{
Array<JsonView> attackPropertiesJsonList = jsonValue.GetArray("AttackProperties");
for(unsigned attackPropertiesIndex = 0; attackPropertiesIndex < attackPropertiesJsonList.GetLength(); ++attackPropertiesIndex)
{
m_attackProperties.push_back(attackPropertiesJsonList[attackPropertiesIndex].AsObject());
}
m_attackPropertiesHasBeenSet = true;
}
if(jsonValue.ValueExists("Mitigations"))
{
Array<JsonView> mitigationsJsonList = jsonValue.GetArray("Mitigations");
for(unsigned mitigationsIndex = 0; mitigationsIndex < mitigationsJsonList.GetLength(); ++mitigationsIndex)
{
m_mitigations.push_back(mitigationsJsonList[mitigationsIndex].AsObject());
}
m_mitigationsHasBeenSet = true;
}
return *this;
}
JsonValue AttackDetail::Jsonize() const
{
JsonValue payload;
if(m_attackIdHasBeenSet)
{
payload.WithString("AttackId", m_attackId);
}
if(m_resourceArnHasBeenSet)
{
payload.WithString("ResourceArn", m_resourceArn);
}
if(m_subResourcesHasBeenSet)
{
Array<JsonValue> subResourcesJsonList(m_subResources.size());
for(unsigned subResourcesIndex = 0; subResourcesIndex < subResourcesJsonList.GetLength(); ++subResourcesIndex)
{
subResourcesJsonList[subResourcesIndex].AsObject(m_subResources[subResourcesIndex].Jsonize());
}
payload.WithArray("SubResources", std::move(subResourcesJsonList));
}
if(m_startTimeHasBeenSet)
{
payload.WithDouble("StartTime", m_startTime.SecondsWithMSPrecision());
}
if(m_endTimeHasBeenSet)
{
payload.WithDouble("EndTime", m_endTime.SecondsWithMSPrecision());
}
if(m_attackCountersHasBeenSet)
{
Array<JsonValue> attackCountersJsonList(m_attackCounters.size());
for(unsigned attackCountersIndex = 0; attackCountersIndex < attackCountersJsonList.GetLength(); ++attackCountersIndex)
{
attackCountersJsonList[attackCountersIndex].AsObject(m_attackCounters[attackCountersIndex].Jsonize());
}
payload.WithArray("AttackCounters", std::move(attackCountersJsonList));
}
if(m_attackPropertiesHasBeenSet)
{
Array<JsonValue> attackPropertiesJsonList(m_attackProperties.size());
for(unsigned attackPropertiesIndex = 0; attackPropertiesIndex < attackPropertiesJsonList.GetLength(); ++attackPropertiesIndex)
{
attackPropertiesJsonList[attackPropertiesIndex].AsObject(m_attackProperties[attackPropertiesIndex].Jsonize());
}
payload.WithArray("AttackProperties", std::move(attackPropertiesJsonList));
}
if(m_mitigationsHasBeenSet)
{
Array<JsonValue> mitigationsJsonList(m_mitigations.size());
for(unsigned mitigationsIndex = 0; mitigationsIndex < mitigationsJsonList.GetLength(); ++mitigationsIndex)
{
mitigationsJsonList[mitigationsIndex].AsObject(m_mitigations[mitigationsIndex].Jsonize());
}
payload.WithArray("Mitigations", std::move(mitigationsJsonList));
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,70 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AttackLayer.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
namespace AttackLayerMapper
{
static const int NETWORK_HASH = HashingUtils::HashString("NETWORK");
static const int APPLICATION_HASH = HashingUtils::HashString("APPLICATION");
AttackLayer GetAttackLayerForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == NETWORK_HASH)
{
return AttackLayer::NETWORK;
}
else if (hashCode == APPLICATION_HASH)
{
return AttackLayer::APPLICATION;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<AttackLayer>(hashCode);
}
return AttackLayer::NOT_SET;
}
Aws::String GetNameForAttackLayer(AttackLayer enumValue)
{
switch(enumValue)
{
case AttackLayer::NETWORK:
return "NETWORK";
case AttackLayer::APPLICATION:
return "APPLICATION";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace AttackLayerMapper
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,132 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AttackProperty.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
AttackProperty::AttackProperty() :
m_attackLayer(AttackLayer::NOT_SET),
m_attackLayerHasBeenSet(false),
m_attackPropertyIdentifier(AttackPropertyIdentifier::NOT_SET),
m_attackPropertyIdentifierHasBeenSet(false),
m_topContributorsHasBeenSet(false),
m_unit(Unit::NOT_SET),
m_unitHasBeenSet(false),
m_total(0),
m_totalHasBeenSet(false)
{
}
AttackProperty::AttackProperty(JsonView jsonValue) :
m_attackLayer(AttackLayer::NOT_SET),
m_attackLayerHasBeenSet(false),
m_attackPropertyIdentifier(AttackPropertyIdentifier::NOT_SET),
m_attackPropertyIdentifierHasBeenSet(false),
m_topContributorsHasBeenSet(false),
m_unit(Unit::NOT_SET),
m_unitHasBeenSet(false),
m_total(0),
m_totalHasBeenSet(false)
{
*this = jsonValue;
}
AttackProperty& AttackProperty::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("AttackLayer"))
{
m_attackLayer = AttackLayerMapper::GetAttackLayerForName(jsonValue.GetString("AttackLayer"));
m_attackLayerHasBeenSet = true;
}
if(jsonValue.ValueExists("AttackPropertyIdentifier"))
{
m_attackPropertyIdentifier = AttackPropertyIdentifierMapper::GetAttackPropertyIdentifierForName(jsonValue.GetString("AttackPropertyIdentifier"));
m_attackPropertyIdentifierHasBeenSet = true;
}
if(jsonValue.ValueExists("TopContributors"))
{
Array<JsonView> topContributorsJsonList = jsonValue.GetArray("TopContributors");
for(unsigned topContributorsIndex = 0; topContributorsIndex < topContributorsJsonList.GetLength(); ++topContributorsIndex)
{
m_topContributors.push_back(topContributorsJsonList[topContributorsIndex].AsObject());
}
m_topContributorsHasBeenSet = true;
}
if(jsonValue.ValueExists("Unit"))
{
m_unit = UnitMapper::GetUnitForName(jsonValue.GetString("Unit"));
m_unitHasBeenSet = true;
}
if(jsonValue.ValueExists("Total"))
{
m_total = jsonValue.GetInt64("Total");
m_totalHasBeenSet = true;
}
return *this;
}
JsonValue AttackProperty::Jsonize() const
{
JsonValue payload;
if(m_attackLayerHasBeenSet)
{
payload.WithString("AttackLayer", AttackLayerMapper::GetNameForAttackLayer(m_attackLayer));
}
if(m_attackPropertyIdentifierHasBeenSet)
{
payload.WithString("AttackPropertyIdentifier", AttackPropertyIdentifierMapper::GetNameForAttackPropertyIdentifier(m_attackPropertyIdentifier));
}
if(m_topContributorsHasBeenSet)
{
Array<JsonValue> topContributorsJsonList(m_topContributors.size());
for(unsigned topContributorsIndex = 0; topContributorsIndex < topContributorsJsonList.GetLength(); ++topContributorsIndex)
{
topContributorsJsonList[topContributorsIndex].AsObject(m_topContributors[topContributorsIndex].Jsonize());
}
payload.WithArray("TopContributors", std::move(topContributorsJsonList));
}
if(m_unitHasBeenSet)
{
payload.WithString("Unit", UnitMapper::GetNameForUnit(m_unit));
}
if(m_totalHasBeenSet)
{
payload.WithInt64("Total", m_total);
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,112 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AttackPropertyIdentifier.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
namespace AttackPropertyIdentifierMapper
{
static const int DESTINATION_URL_HASH = HashingUtils::HashString("DESTINATION_URL");
static const int REFERRER_HASH = HashingUtils::HashString("REFERRER");
static const int SOURCE_ASN_HASH = HashingUtils::HashString("SOURCE_ASN");
static const int SOURCE_COUNTRY_HASH = HashingUtils::HashString("SOURCE_COUNTRY");
static const int SOURCE_IP_ADDRESS_HASH = HashingUtils::HashString("SOURCE_IP_ADDRESS");
static const int SOURCE_USER_AGENT_HASH = HashingUtils::HashString("SOURCE_USER_AGENT");
static const int WORDPRESS_PINGBACK_REFLECTOR_HASH = HashingUtils::HashString("WORDPRESS_PINGBACK_REFLECTOR");
static const int WORDPRESS_PINGBACK_SOURCE_HASH = HashingUtils::HashString("WORDPRESS_PINGBACK_SOURCE");
AttackPropertyIdentifier GetAttackPropertyIdentifierForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == DESTINATION_URL_HASH)
{
return AttackPropertyIdentifier::DESTINATION_URL;
}
else if (hashCode == REFERRER_HASH)
{
return AttackPropertyIdentifier::REFERRER;
}
else if (hashCode == SOURCE_ASN_HASH)
{
return AttackPropertyIdentifier::SOURCE_ASN;
}
else if (hashCode == SOURCE_COUNTRY_HASH)
{
return AttackPropertyIdentifier::SOURCE_COUNTRY;
}
else if (hashCode == SOURCE_IP_ADDRESS_HASH)
{
return AttackPropertyIdentifier::SOURCE_IP_ADDRESS;
}
else if (hashCode == SOURCE_USER_AGENT_HASH)
{
return AttackPropertyIdentifier::SOURCE_USER_AGENT;
}
else if (hashCode == WORDPRESS_PINGBACK_REFLECTOR_HASH)
{
return AttackPropertyIdentifier::WORDPRESS_PINGBACK_REFLECTOR;
}
else if (hashCode == WORDPRESS_PINGBACK_SOURCE_HASH)
{
return AttackPropertyIdentifier::WORDPRESS_PINGBACK_SOURCE;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<AttackPropertyIdentifier>(hashCode);
}
return AttackPropertyIdentifier::NOT_SET;
}
Aws::String GetNameForAttackPropertyIdentifier(AttackPropertyIdentifier enumValue)
{
switch(enumValue)
{
case AttackPropertyIdentifier::DESTINATION_URL:
return "DESTINATION_URL";
case AttackPropertyIdentifier::REFERRER:
return "REFERRER";
case AttackPropertyIdentifier::SOURCE_ASN:
return "SOURCE_ASN";
case AttackPropertyIdentifier::SOURCE_COUNTRY:
return "SOURCE_COUNTRY";
case AttackPropertyIdentifier::SOURCE_IP_ADDRESS:
return "SOURCE_IP_ADDRESS";
case AttackPropertyIdentifier::SOURCE_USER_AGENT:
return "SOURCE_USER_AGENT";
case AttackPropertyIdentifier::WORDPRESS_PINGBACK_REFLECTOR:
return "WORDPRESS_PINGBACK_REFLECTOR";
case AttackPropertyIdentifier::WORDPRESS_PINGBACK_SOURCE:
return "WORDPRESS_PINGBACK_SOURCE";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace AttackPropertyIdentifierMapper
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,125 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AttackSummary.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
AttackSummary::AttackSummary() :
m_attackIdHasBeenSet(false),
m_resourceArnHasBeenSet(false),
m_startTimeHasBeenSet(false),
m_endTimeHasBeenSet(false),
m_attackVectorsHasBeenSet(false)
{
}
AttackSummary::AttackSummary(JsonView jsonValue) :
m_attackIdHasBeenSet(false),
m_resourceArnHasBeenSet(false),
m_startTimeHasBeenSet(false),
m_endTimeHasBeenSet(false),
m_attackVectorsHasBeenSet(false)
{
*this = jsonValue;
}
AttackSummary& AttackSummary::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("AttackId"))
{
m_attackId = jsonValue.GetString("AttackId");
m_attackIdHasBeenSet = true;
}
if(jsonValue.ValueExists("ResourceArn"))
{
m_resourceArn = jsonValue.GetString("ResourceArn");
m_resourceArnHasBeenSet = true;
}
if(jsonValue.ValueExists("StartTime"))
{
m_startTime = jsonValue.GetDouble("StartTime");
m_startTimeHasBeenSet = true;
}
if(jsonValue.ValueExists("EndTime"))
{
m_endTime = jsonValue.GetDouble("EndTime");
m_endTimeHasBeenSet = true;
}
if(jsonValue.ValueExists("AttackVectors"))
{
Array<JsonView> attackVectorsJsonList = jsonValue.GetArray("AttackVectors");
for(unsigned attackVectorsIndex = 0; attackVectorsIndex < attackVectorsJsonList.GetLength(); ++attackVectorsIndex)
{
m_attackVectors.push_back(attackVectorsJsonList[attackVectorsIndex].AsObject());
}
m_attackVectorsHasBeenSet = true;
}
return *this;
}
JsonValue AttackSummary::Jsonize() const
{
JsonValue payload;
if(m_attackIdHasBeenSet)
{
payload.WithString("AttackId", m_attackId);
}
if(m_resourceArnHasBeenSet)
{
payload.WithString("ResourceArn", m_resourceArn);
}
if(m_startTimeHasBeenSet)
{
payload.WithDouble("StartTime", m_startTime.SecondsWithMSPrecision());
}
if(m_endTimeHasBeenSet)
{
payload.WithDouble("EndTime", m_endTime.SecondsWithMSPrecision());
}
if(m_attackVectorsHasBeenSet)
{
Array<JsonValue> attackVectorsJsonList(m_attackVectors.size());
for(unsigned attackVectorsIndex = 0; attackVectorsIndex < attackVectorsJsonList.GetLength(); ++attackVectorsIndex)
{
attackVectorsJsonList[attackVectorsIndex].AsObject(m_attackVectors[attackVectorsIndex].Jsonize());
}
payload.WithArray("AttackVectors", std::move(attackVectorsJsonList));
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,59 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AttackVectorDescription.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
AttackVectorDescription::AttackVectorDescription() :
m_vectorTypeHasBeenSet(false)
{
}
AttackVectorDescription::AttackVectorDescription(JsonView jsonValue) :
m_vectorTypeHasBeenSet(false)
{
*this = jsonValue;
}
AttackVectorDescription& AttackVectorDescription::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("VectorType"))
{
m_vectorType = jsonValue.GetString("VectorType");
m_vectorTypeHasBeenSet = true;
}
return *this;
}
JsonValue AttackVectorDescription::Jsonize() const
{
JsonValue payload;
if(m_vectorTypeHasBeenSet)
{
payload.WithString("VectorType", m_vectorType);
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,70 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/AutoRenew.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
namespace AutoRenewMapper
{
static const int ENABLED_HASH = HashingUtils::HashString("ENABLED");
static const int DISABLED_HASH = HashingUtils::HashString("DISABLED");
AutoRenew GetAutoRenewForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == ENABLED_HASH)
{
return AutoRenew::ENABLED;
}
else if (hashCode == DISABLED_HASH)
{
return AutoRenew::DISABLED;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<AutoRenew>(hashCode);
}
return AutoRenew::NOT_SET;
}
Aws::String GetNameForAutoRenew(AutoRenew enumValue)
{
switch(enumValue)
{
case AutoRenew::ENABLED:
return "ENABLED";
case AutoRenew::DISABLED:
return "DISABLED";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace AutoRenewMapper
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,76 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/Contributor.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
Contributor::Contributor() :
m_nameHasBeenSet(false),
m_value(0),
m_valueHasBeenSet(false)
{
}
Contributor::Contributor(JsonView jsonValue) :
m_nameHasBeenSet(false),
m_value(0),
m_valueHasBeenSet(false)
{
*this = jsonValue;
}
Contributor& Contributor::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Name"))
{
m_name = jsonValue.GetString("Name");
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("Value"))
{
m_value = jsonValue.GetInt64("Value");
m_valueHasBeenSet = true;
}
return *this;
}
JsonValue Contributor::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("Name", m_name);
}
if(m_valueHasBeenSet)
{
payload.WithInt64("Value", m_value);
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,50 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/CreateProtectionRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
CreateProtectionRequest::CreateProtectionRequest() :
m_nameHasBeenSet(false),
m_resourceArnHasBeenSet(false)
{
}
Aws::String CreateProtectionRequest::SerializePayload() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("Name", m_name);
}
if(m_resourceArnHasBeenSet)
{
payload.WithString("ResourceArn", m_resourceArn);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection CreateProtectionRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.CreateProtection"));
return headers;
}

View File

@@ -0,0 +1,40 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/CreateProtectionResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
CreateProtectionResult::CreateProtectionResult()
{
}
CreateProtectionResult::CreateProtectionResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
CreateProtectionResult& CreateProtectionResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("ProtectionId"))
{
m_protectionId = jsonValue.GetString("ProtectionId");
}
return *this;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/CreateSubscriptionRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
CreateSubscriptionRequest::CreateSubscriptionRequest()
{
}
Aws::String CreateSubscriptionRequest::SerializePayload() const
{
return "{}";
}
Aws::Http::HeaderValueCollection CreateSubscriptionRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.CreateSubscription"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/CreateSubscriptionResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
CreateSubscriptionResult::CreateSubscriptionResult()
{
}
CreateSubscriptionResult::CreateSubscriptionResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
CreateSubscriptionResult& CreateSubscriptionResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DeleteProtectionRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DeleteProtectionRequest::DeleteProtectionRequest() :
m_protectionIdHasBeenSet(false)
{
}
Aws::String DeleteProtectionRequest::SerializePayload() const
{
JsonValue payload;
if(m_protectionIdHasBeenSet)
{
payload.WithString("ProtectionId", m_protectionId);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection DeleteProtectionRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.DeleteProtection"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DeleteProtectionResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DeleteProtectionResult::DeleteProtectionResult()
{
}
DeleteProtectionResult::DeleteProtectionResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DeleteProtectionResult& DeleteProtectionResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DescribeAttackRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DescribeAttackRequest::DescribeAttackRequest() :
m_attackIdHasBeenSet(false)
{
}
Aws::String DescribeAttackRequest::SerializePayload() const
{
JsonValue payload;
if(m_attackIdHasBeenSet)
{
payload.WithString("AttackId", m_attackId);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection DescribeAttackRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.DescribeAttack"));
return headers;
}

View File

@@ -0,0 +1,40 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DescribeAttackResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DescribeAttackResult::DescribeAttackResult()
{
}
DescribeAttackResult::DescribeAttackResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DescribeAttackResult& DescribeAttackResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("Attack"))
{
m_attack = jsonValue.GetObject("Attack");
}
return *this;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DescribeDRTAccessRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DescribeDRTAccessRequest::DescribeDRTAccessRequest()
{
}
Aws::String DescribeDRTAccessRequest::SerializePayload() const
{
return "{}";
}
Aws::Http::HeaderValueCollection DescribeDRTAccessRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.DescribeDRTAccess"));
return headers;
}

View File

@@ -0,0 +1,49 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DescribeDRTAccessResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DescribeDRTAccessResult::DescribeDRTAccessResult()
{
}
DescribeDRTAccessResult::DescribeDRTAccessResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DescribeDRTAccessResult& DescribeDRTAccessResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("RoleArn"))
{
m_roleArn = jsonValue.GetString("RoleArn");
}
if(jsonValue.ValueExists("LogBucketList"))
{
Array<JsonView> logBucketListJsonList = jsonValue.GetArray("LogBucketList");
for(unsigned logBucketListIndex = 0; logBucketListIndex < logBucketListJsonList.GetLength(); ++logBucketListIndex)
{
m_logBucketList.push_back(logBucketListJsonList[logBucketListIndex].AsString());
}
}
return *this;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DescribeEmergencyContactSettingsRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DescribeEmergencyContactSettingsRequest::DescribeEmergencyContactSettingsRequest()
{
}
Aws::String DescribeEmergencyContactSettingsRequest::SerializePayload() const
{
return "{}";
}
Aws::Http::HeaderValueCollection DescribeEmergencyContactSettingsRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.DescribeEmergencyContactSettings"));
return headers;
}

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DescribeEmergencyContactSettingsResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DescribeEmergencyContactSettingsResult::DescribeEmergencyContactSettingsResult()
{
}
DescribeEmergencyContactSettingsResult::DescribeEmergencyContactSettingsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DescribeEmergencyContactSettingsResult& DescribeEmergencyContactSettingsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("EmergencyContactList"))
{
Array<JsonView> emergencyContactListJsonList = jsonValue.GetArray("EmergencyContactList");
for(unsigned emergencyContactListIndex = 0; emergencyContactListIndex < emergencyContactListJsonList.GetLength(); ++emergencyContactListIndex)
{
m_emergencyContactList.push_back(emergencyContactListJsonList[emergencyContactListIndex].AsObject());
}
}
return *this;
}

View File

@@ -0,0 +1,50 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DescribeProtectionRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DescribeProtectionRequest::DescribeProtectionRequest() :
m_protectionIdHasBeenSet(false),
m_resourceArnHasBeenSet(false)
{
}
Aws::String DescribeProtectionRequest::SerializePayload() const
{
JsonValue payload;
if(m_protectionIdHasBeenSet)
{
payload.WithString("ProtectionId", m_protectionId);
}
if(m_resourceArnHasBeenSet)
{
payload.WithString("ResourceArn", m_resourceArn);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection DescribeProtectionRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.DescribeProtection"));
return headers;
}

View File

@@ -0,0 +1,40 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DescribeProtectionResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DescribeProtectionResult::DescribeProtectionResult()
{
}
DescribeProtectionResult::DescribeProtectionResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DescribeProtectionResult& DescribeProtectionResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("Protection"))
{
m_protection = jsonValue.GetObject("Protection");
}
return *this;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DescribeSubscriptionRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DescribeSubscriptionRequest::DescribeSubscriptionRequest()
{
}
Aws::String DescribeSubscriptionRequest::SerializePayload() const
{
return "{}";
}
Aws::Http::HeaderValueCollection DescribeSubscriptionRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.DescribeSubscription"));
return headers;
}

View File

@@ -0,0 +1,40 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DescribeSubscriptionResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DescribeSubscriptionResult::DescribeSubscriptionResult()
{
}
DescribeSubscriptionResult::DescribeSubscriptionResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DescribeSubscriptionResult& DescribeSubscriptionResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("Subscription"))
{
m_subscription = jsonValue.GetObject("Subscription");
}
return *this;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DisableProactiveEngagementRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DisableProactiveEngagementRequest::DisableProactiveEngagementRequest()
{
}
Aws::String DisableProactiveEngagementRequest::SerializePayload() const
{
return "{}";
}
Aws::Http::HeaderValueCollection DisableProactiveEngagementRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.DisableProactiveEngagement"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DisableProactiveEngagementResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DisableProactiveEngagementResult::DisableProactiveEngagementResult()
{
}
DisableProactiveEngagementResult::DisableProactiveEngagementResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DisableProactiveEngagementResult& DisableProactiveEngagementResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DisassociateDRTLogBucketRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DisassociateDRTLogBucketRequest::DisassociateDRTLogBucketRequest() :
m_logBucketHasBeenSet(false)
{
}
Aws::String DisassociateDRTLogBucketRequest::SerializePayload() const
{
JsonValue payload;
if(m_logBucketHasBeenSet)
{
payload.WithString("LogBucket", m_logBucket);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection DisassociateDRTLogBucketRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.DisassociateDRTLogBucket"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DisassociateDRTLogBucketResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DisassociateDRTLogBucketResult::DisassociateDRTLogBucketResult()
{
}
DisassociateDRTLogBucketResult::DisassociateDRTLogBucketResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DisassociateDRTLogBucketResult& DisassociateDRTLogBucketResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DisassociateDRTRoleRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DisassociateDRTRoleRequest::DisassociateDRTRoleRequest()
{
}
Aws::String DisassociateDRTRoleRequest::SerializePayload() const
{
return "{}";
}
Aws::Http::HeaderValueCollection DisassociateDRTRoleRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.DisassociateDRTRole"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DisassociateDRTRoleResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DisassociateDRTRoleResult::DisassociateDRTRoleResult()
{
}
DisassociateDRTRoleResult::DisassociateDRTRoleResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DisassociateDRTRoleResult& DisassociateDRTRoleResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,50 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DisassociateHealthCheckRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DisassociateHealthCheckRequest::DisassociateHealthCheckRequest() :
m_protectionIdHasBeenSet(false),
m_healthCheckArnHasBeenSet(false)
{
}
Aws::String DisassociateHealthCheckRequest::SerializePayload() const
{
JsonValue payload;
if(m_protectionIdHasBeenSet)
{
payload.WithString("ProtectionId", m_protectionId);
}
if(m_healthCheckArnHasBeenSet)
{
payload.WithString("HealthCheckArn", m_healthCheckArn);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection DisassociateHealthCheckRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.DisassociateHealthCheck"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/DisassociateHealthCheckResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DisassociateHealthCheckResult::DisassociateHealthCheckResult()
{
}
DisassociateHealthCheckResult::DisassociateHealthCheckResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DisassociateHealthCheckResult& DisassociateHealthCheckResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,89 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/EmergencyContact.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
EmergencyContact::EmergencyContact() :
m_emailAddressHasBeenSet(false),
m_phoneNumberHasBeenSet(false),
m_contactNotesHasBeenSet(false)
{
}
EmergencyContact::EmergencyContact(JsonView jsonValue) :
m_emailAddressHasBeenSet(false),
m_phoneNumberHasBeenSet(false),
m_contactNotesHasBeenSet(false)
{
*this = jsonValue;
}
EmergencyContact& EmergencyContact::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("EmailAddress"))
{
m_emailAddress = jsonValue.GetString("EmailAddress");
m_emailAddressHasBeenSet = true;
}
if(jsonValue.ValueExists("PhoneNumber"))
{
m_phoneNumber = jsonValue.GetString("PhoneNumber");
m_phoneNumberHasBeenSet = true;
}
if(jsonValue.ValueExists("ContactNotes"))
{
m_contactNotes = jsonValue.GetString("ContactNotes");
m_contactNotesHasBeenSet = true;
}
return *this;
}
JsonValue EmergencyContact::Jsonize() const
{
JsonValue payload;
if(m_emailAddressHasBeenSet)
{
payload.WithString("EmailAddress", m_emailAddress);
}
if(m_phoneNumberHasBeenSet)
{
payload.WithString("PhoneNumber", m_phoneNumber);
}
if(m_contactNotesHasBeenSet)
{
payload.WithString("ContactNotes", m_contactNotes);
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/EnableProactiveEngagementRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
EnableProactiveEngagementRequest::EnableProactiveEngagementRequest()
{
}
Aws::String EnableProactiveEngagementRequest::SerializePayload() const
{
return "{}";
}
Aws::Http::HeaderValueCollection EnableProactiveEngagementRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.EnableProactiveEngagement"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/EnableProactiveEngagementResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
EnableProactiveEngagementResult::EnableProactiveEngagementResult()
{
}
EnableProactiveEngagementResult::EnableProactiveEngagementResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
EnableProactiveEngagementResult& EnableProactiveEngagementResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/GetSubscriptionStateRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
GetSubscriptionStateRequest::GetSubscriptionStateRequest()
{
}
Aws::String GetSubscriptionStateRequest::SerializePayload() const
{
return "{}";
}
Aws::Http::HeaderValueCollection GetSubscriptionStateRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.GetSubscriptionState"));
return headers;
}

View File

@@ -0,0 +1,42 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/GetSubscriptionStateResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
GetSubscriptionStateResult::GetSubscriptionStateResult() :
m_subscriptionState(SubscriptionState::NOT_SET)
{
}
GetSubscriptionStateResult::GetSubscriptionStateResult(const Aws::AmazonWebServiceResult<JsonValue>& result) :
m_subscriptionState(SubscriptionState::NOT_SET)
{
*this = result;
}
GetSubscriptionStateResult& GetSubscriptionStateResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("SubscriptionState"))
{
m_subscriptionState = SubscriptionStateMapper::GetSubscriptionStateForName(jsonValue.GetString("SubscriptionState"));
}
return *this;
}

View File

@@ -0,0 +1,76 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/Limit.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
Limit::Limit() :
m_typeHasBeenSet(false),
m_max(0),
m_maxHasBeenSet(false)
{
}
Limit::Limit(JsonView jsonValue) :
m_typeHasBeenSet(false),
m_max(0),
m_maxHasBeenSet(false)
{
*this = jsonValue;
}
Limit& Limit::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Type"))
{
m_type = jsonValue.GetString("Type");
m_typeHasBeenSet = true;
}
if(jsonValue.ValueExists("Max"))
{
m_max = jsonValue.GetInt64("Max");
m_maxHasBeenSet = true;
}
return *this;
}
JsonValue Limit::Jsonize() const
{
JsonValue payload;
if(m_typeHasBeenSet)
{
payload.WithString("Type", m_type);
}
if(m_maxHasBeenSet)
{
payload.WithInt64("Max", m_max);
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,91 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/LimitsExceededException.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
LimitsExceededException::LimitsExceededException() :
m_messageHasBeenSet(false),
m_typeHasBeenSet(false),
m_limit(0),
m_limitHasBeenSet(false)
{
}
LimitsExceededException::LimitsExceededException(JsonView jsonValue) :
m_messageHasBeenSet(false),
m_typeHasBeenSet(false),
m_limit(0),
m_limitHasBeenSet(false)
{
*this = jsonValue;
}
LimitsExceededException& LimitsExceededException::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("message"))
{
m_message = jsonValue.GetString("message");
m_messageHasBeenSet = true;
}
if(jsonValue.ValueExists("Type"))
{
m_type = jsonValue.GetString("Type");
m_typeHasBeenSet = true;
}
if(jsonValue.ValueExists("Limit"))
{
m_limit = jsonValue.GetInt64("Limit");
m_limitHasBeenSet = true;
}
return *this;
}
JsonValue LimitsExceededException::Jsonize() const
{
JsonValue payload;
if(m_messageHasBeenSet)
{
payload.WithString("message", m_message);
}
if(m_typeHasBeenSet)
{
payload.WithString("Type", m_type);
}
if(m_limitHasBeenSet)
{
payload.WithInt64("Limit", m_limit);
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,77 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/ListAttacksRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
ListAttacksRequest::ListAttacksRequest() :
m_resourceArnsHasBeenSet(false),
m_startTimeHasBeenSet(false),
m_endTimeHasBeenSet(false),
m_nextTokenHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false)
{
}
Aws::String ListAttacksRequest::SerializePayload() const
{
JsonValue payload;
if(m_resourceArnsHasBeenSet)
{
Array<JsonValue> resourceArnsJsonList(m_resourceArns.size());
for(unsigned resourceArnsIndex = 0; resourceArnsIndex < resourceArnsJsonList.GetLength(); ++resourceArnsIndex)
{
resourceArnsJsonList[resourceArnsIndex].AsString(m_resourceArns[resourceArnsIndex]);
}
payload.WithArray("ResourceArns", std::move(resourceArnsJsonList));
}
if(m_startTimeHasBeenSet)
{
payload.WithObject("StartTime", m_startTime.Jsonize());
}
if(m_endTimeHasBeenSet)
{
payload.WithObject("EndTime", m_endTime.Jsonize());
}
if(m_nextTokenHasBeenSet)
{
payload.WithString("NextToken", m_nextToken);
}
if(m_maxResultsHasBeenSet)
{
payload.WithInteger("MaxResults", m_maxResults);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection ListAttacksRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.ListAttacks"));
return headers;
}

View File

@@ -0,0 +1,49 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/ListAttacksResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
ListAttacksResult::ListAttacksResult()
{
}
ListAttacksResult::ListAttacksResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
ListAttacksResult& ListAttacksResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("AttackSummaries"))
{
Array<JsonView> attackSummariesJsonList = jsonValue.GetArray("AttackSummaries");
for(unsigned attackSummariesIndex = 0; attackSummariesIndex < attackSummariesJsonList.GetLength(); ++attackSummariesIndex)
{
m_attackSummaries.push_back(attackSummariesJsonList[attackSummariesIndex].AsObject());
}
}
if(jsonValue.ValueExists("NextToken"))
{
m_nextToken = jsonValue.GetString("NextToken");
}
return *this;
}

View File

@@ -0,0 +1,51 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/ListProtectionsRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
ListProtectionsRequest::ListProtectionsRequest() :
m_nextTokenHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false)
{
}
Aws::String ListProtectionsRequest::SerializePayload() const
{
JsonValue payload;
if(m_nextTokenHasBeenSet)
{
payload.WithString("NextToken", m_nextToken);
}
if(m_maxResultsHasBeenSet)
{
payload.WithInteger("MaxResults", m_maxResults);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection ListProtectionsRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.ListProtections"));
return headers;
}

View File

@@ -0,0 +1,49 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/ListProtectionsResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
ListProtectionsResult::ListProtectionsResult()
{
}
ListProtectionsResult::ListProtectionsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
ListProtectionsResult& ListProtectionsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("Protections"))
{
Array<JsonView> protectionsJsonList = jsonValue.GetArray("Protections");
for(unsigned protectionsIndex = 0; protectionsIndex < protectionsJsonList.GetLength(); ++protectionsIndex)
{
m_protections.push_back(protectionsJsonList[protectionsIndex].AsObject());
}
}
if(jsonValue.ValueExists("NextToken"))
{
m_nextToken = jsonValue.GetString("NextToken");
}
return *this;
}

View File

@@ -0,0 +1,59 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/Mitigation.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
Mitigation::Mitigation() :
m_mitigationNameHasBeenSet(false)
{
}
Mitigation::Mitigation(JsonView jsonValue) :
m_mitigationNameHasBeenSet(false)
{
*this = jsonValue;
}
Mitigation& Mitigation::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("MitigationName"))
{
m_mitigationName = jsonValue.GetString("MitigationName");
m_mitigationNameHasBeenSet = true;
}
return *this;
}
JsonValue Mitigation::Jsonize() const
{
JsonValue payload;
if(m_mitigationNameHasBeenSet)
{
payload.WithString("MitigationName", m_mitigationName);
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,77 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/ProactiveEngagementStatus.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
namespace ProactiveEngagementStatusMapper
{
static const int ENABLED_HASH = HashingUtils::HashString("ENABLED");
static const int DISABLED_HASH = HashingUtils::HashString("DISABLED");
static const int PENDING_HASH = HashingUtils::HashString("PENDING");
ProactiveEngagementStatus GetProactiveEngagementStatusForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == ENABLED_HASH)
{
return ProactiveEngagementStatus::ENABLED;
}
else if (hashCode == DISABLED_HASH)
{
return ProactiveEngagementStatus::DISABLED;
}
else if (hashCode == PENDING_HASH)
{
return ProactiveEngagementStatus::PENDING;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<ProactiveEngagementStatus>(hashCode);
}
return ProactiveEngagementStatus::NOT_SET;
}
Aws::String GetNameForProactiveEngagementStatus(ProactiveEngagementStatus enumValue)
{
switch(enumValue)
{
case ProactiveEngagementStatus::ENABLED:
return "ENABLED";
case ProactiveEngagementStatus::DISABLED:
return "DISABLED";
case ProactiveEngagementStatus::PENDING:
return "PENDING";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace ProactiveEngagementStatusMapper
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,112 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/Protection.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
Protection::Protection() :
m_idHasBeenSet(false),
m_nameHasBeenSet(false),
m_resourceArnHasBeenSet(false),
m_healthCheckIdsHasBeenSet(false)
{
}
Protection::Protection(JsonView jsonValue) :
m_idHasBeenSet(false),
m_nameHasBeenSet(false),
m_resourceArnHasBeenSet(false),
m_healthCheckIdsHasBeenSet(false)
{
*this = jsonValue;
}
Protection& Protection::operator =(JsonView jsonValue)
{
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("ResourceArn"))
{
m_resourceArn = jsonValue.GetString("ResourceArn");
m_resourceArnHasBeenSet = true;
}
if(jsonValue.ValueExists("HealthCheckIds"))
{
Array<JsonView> healthCheckIdsJsonList = jsonValue.GetArray("HealthCheckIds");
for(unsigned healthCheckIdsIndex = 0; healthCheckIdsIndex < healthCheckIdsJsonList.GetLength(); ++healthCheckIdsIndex)
{
m_healthCheckIds.push_back(healthCheckIdsJsonList[healthCheckIdsIndex].AsString());
}
m_healthCheckIdsHasBeenSet = true;
}
return *this;
}
JsonValue Protection::Jsonize() const
{
JsonValue payload;
if(m_idHasBeenSet)
{
payload.WithString("Id", m_id);
}
if(m_nameHasBeenSet)
{
payload.WithString("Name", m_name);
}
if(m_resourceArnHasBeenSet)
{
payload.WithString("ResourceArn", m_resourceArn);
}
if(m_healthCheckIdsHasBeenSet)
{
Array<JsonValue> healthCheckIdsJsonList(m_healthCheckIds.size());
for(unsigned healthCheckIdsIndex = 0; healthCheckIdsIndex < healthCheckIdsJsonList.GetLength(); ++healthCheckIdsIndex)
{
healthCheckIdsJsonList[healthCheckIdsIndex].AsString(m_healthCheckIds[healthCheckIdsIndex]);
}
payload.WithArray("HealthCheckIds", std::move(healthCheckIdsJsonList));
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,121 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/SubResourceSummary.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
SubResourceSummary::SubResourceSummary() :
m_type(SubResourceType::NOT_SET),
m_typeHasBeenSet(false),
m_idHasBeenSet(false),
m_attackVectorsHasBeenSet(false),
m_countersHasBeenSet(false)
{
}
SubResourceSummary::SubResourceSummary(JsonView jsonValue) :
m_type(SubResourceType::NOT_SET),
m_typeHasBeenSet(false),
m_idHasBeenSet(false),
m_attackVectorsHasBeenSet(false),
m_countersHasBeenSet(false)
{
*this = jsonValue;
}
SubResourceSummary& SubResourceSummary::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Type"))
{
m_type = SubResourceTypeMapper::GetSubResourceTypeForName(jsonValue.GetString("Type"));
m_typeHasBeenSet = true;
}
if(jsonValue.ValueExists("Id"))
{
m_id = jsonValue.GetString("Id");
m_idHasBeenSet = true;
}
if(jsonValue.ValueExists("AttackVectors"))
{
Array<JsonView> attackVectorsJsonList = jsonValue.GetArray("AttackVectors");
for(unsigned attackVectorsIndex = 0; attackVectorsIndex < attackVectorsJsonList.GetLength(); ++attackVectorsIndex)
{
m_attackVectors.push_back(attackVectorsJsonList[attackVectorsIndex].AsObject());
}
m_attackVectorsHasBeenSet = true;
}
if(jsonValue.ValueExists("Counters"))
{
Array<JsonView> countersJsonList = jsonValue.GetArray("Counters");
for(unsigned countersIndex = 0; countersIndex < countersJsonList.GetLength(); ++countersIndex)
{
m_counters.push_back(countersJsonList[countersIndex].AsObject());
}
m_countersHasBeenSet = true;
}
return *this;
}
JsonValue SubResourceSummary::Jsonize() const
{
JsonValue payload;
if(m_typeHasBeenSet)
{
payload.WithString("Type", SubResourceTypeMapper::GetNameForSubResourceType(m_type));
}
if(m_idHasBeenSet)
{
payload.WithString("Id", m_id);
}
if(m_attackVectorsHasBeenSet)
{
Array<JsonValue> attackVectorsJsonList(m_attackVectors.size());
for(unsigned attackVectorsIndex = 0; attackVectorsIndex < attackVectorsJsonList.GetLength(); ++attackVectorsIndex)
{
attackVectorsJsonList[attackVectorsIndex].AsObject(m_attackVectors[attackVectorsIndex].Jsonize());
}
payload.WithArray("AttackVectors", std::move(attackVectorsJsonList));
}
if(m_countersHasBeenSet)
{
Array<JsonValue> countersJsonList(m_counters.size());
for(unsigned countersIndex = 0; countersIndex < countersJsonList.GetLength(); ++countersIndex)
{
countersJsonList[countersIndex].AsObject(m_counters[countersIndex].Jsonize());
}
payload.WithArray("Counters", std::move(countersJsonList));
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,70 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/SubResourceType.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
namespace SubResourceTypeMapper
{
static const int IP_HASH = HashingUtils::HashString("IP");
static const int URL_HASH = HashingUtils::HashString("URL");
SubResourceType GetSubResourceTypeForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == IP_HASH)
{
return SubResourceType::IP;
}
else if (hashCode == URL_HASH)
{
return SubResourceType::URL;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<SubResourceType>(hashCode);
}
return SubResourceType::NOT_SET;
}
Aws::String GetNameForSubResourceType(SubResourceType enumValue)
{
switch(enumValue)
{
case SubResourceType::IP:
return "IP";
case SubResourceType::URL:
return "URL";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace SubResourceTypeMapper
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,144 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/Subscription.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
Subscription::Subscription() :
m_startTimeHasBeenSet(false),
m_endTimeHasBeenSet(false),
m_timeCommitmentInSeconds(0),
m_timeCommitmentInSecondsHasBeenSet(false),
m_autoRenew(AutoRenew::NOT_SET),
m_autoRenewHasBeenSet(false),
m_limitsHasBeenSet(false),
m_proactiveEngagementStatus(ProactiveEngagementStatus::NOT_SET),
m_proactiveEngagementStatusHasBeenSet(false)
{
}
Subscription::Subscription(JsonView jsonValue) :
m_startTimeHasBeenSet(false),
m_endTimeHasBeenSet(false),
m_timeCommitmentInSeconds(0),
m_timeCommitmentInSecondsHasBeenSet(false),
m_autoRenew(AutoRenew::NOT_SET),
m_autoRenewHasBeenSet(false),
m_limitsHasBeenSet(false),
m_proactiveEngagementStatus(ProactiveEngagementStatus::NOT_SET),
m_proactiveEngagementStatusHasBeenSet(false)
{
*this = jsonValue;
}
Subscription& Subscription::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("StartTime"))
{
m_startTime = jsonValue.GetDouble("StartTime");
m_startTimeHasBeenSet = true;
}
if(jsonValue.ValueExists("EndTime"))
{
m_endTime = jsonValue.GetDouble("EndTime");
m_endTimeHasBeenSet = true;
}
if(jsonValue.ValueExists("TimeCommitmentInSeconds"))
{
m_timeCommitmentInSeconds = jsonValue.GetInt64("TimeCommitmentInSeconds");
m_timeCommitmentInSecondsHasBeenSet = true;
}
if(jsonValue.ValueExists("AutoRenew"))
{
m_autoRenew = AutoRenewMapper::GetAutoRenewForName(jsonValue.GetString("AutoRenew"));
m_autoRenewHasBeenSet = true;
}
if(jsonValue.ValueExists("Limits"))
{
Array<JsonView> limitsJsonList = jsonValue.GetArray("Limits");
for(unsigned limitsIndex = 0; limitsIndex < limitsJsonList.GetLength(); ++limitsIndex)
{
m_limits.push_back(limitsJsonList[limitsIndex].AsObject());
}
m_limitsHasBeenSet = true;
}
if(jsonValue.ValueExists("ProactiveEngagementStatus"))
{
m_proactiveEngagementStatus = ProactiveEngagementStatusMapper::GetProactiveEngagementStatusForName(jsonValue.GetString("ProactiveEngagementStatus"));
m_proactiveEngagementStatusHasBeenSet = true;
}
return *this;
}
JsonValue Subscription::Jsonize() const
{
JsonValue payload;
if(m_startTimeHasBeenSet)
{
payload.WithDouble("StartTime", m_startTime.SecondsWithMSPrecision());
}
if(m_endTimeHasBeenSet)
{
payload.WithDouble("EndTime", m_endTime.SecondsWithMSPrecision());
}
if(m_timeCommitmentInSecondsHasBeenSet)
{
payload.WithInt64("TimeCommitmentInSeconds", m_timeCommitmentInSeconds);
}
if(m_autoRenewHasBeenSet)
{
payload.WithString("AutoRenew", AutoRenewMapper::GetNameForAutoRenew(m_autoRenew));
}
if(m_limitsHasBeenSet)
{
Array<JsonValue> limitsJsonList(m_limits.size());
for(unsigned limitsIndex = 0; limitsIndex < limitsJsonList.GetLength(); ++limitsIndex)
{
limitsJsonList[limitsIndex].AsObject(m_limits[limitsIndex].Jsonize());
}
payload.WithArray("Limits", std::move(limitsJsonList));
}
if(m_proactiveEngagementStatusHasBeenSet)
{
payload.WithString("ProactiveEngagementStatus", ProactiveEngagementStatusMapper::GetNameForProactiveEngagementStatus(m_proactiveEngagementStatus));
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,70 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/SubscriptionState.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
namespace SubscriptionStateMapper
{
static const int ACTIVE_HASH = HashingUtils::HashString("ACTIVE");
static const int INACTIVE_HASH = HashingUtils::HashString("INACTIVE");
SubscriptionState GetSubscriptionStateForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == ACTIVE_HASH)
{
return SubscriptionState::ACTIVE;
}
else if (hashCode == INACTIVE_HASH)
{
return SubscriptionState::INACTIVE;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<SubscriptionState>(hashCode);
}
return SubscriptionState::NOT_SET;
}
Aws::String GetNameForSubscriptionState(SubscriptionState enumValue)
{
switch(enumValue)
{
case SubscriptionState::ACTIVE:
return "ACTIVE";
case SubscriptionState::INACTIVE:
return "INACTIVE";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace SubscriptionStateMapper
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,82 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/SummarizedAttackVector.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
SummarizedAttackVector::SummarizedAttackVector() :
m_vectorTypeHasBeenSet(false),
m_vectorCountersHasBeenSet(false)
{
}
SummarizedAttackVector::SummarizedAttackVector(JsonView jsonValue) :
m_vectorTypeHasBeenSet(false),
m_vectorCountersHasBeenSet(false)
{
*this = jsonValue;
}
SummarizedAttackVector& SummarizedAttackVector::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("VectorType"))
{
m_vectorType = jsonValue.GetString("VectorType");
m_vectorTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("VectorCounters"))
{
Array<JsonView> vectorCountersJsonList = jsonValue.GetArray("VectorCounters");
for(unsigned vectorCountersIndex = 0; vectorCountersIndex < vectorCountersJsonList.GetLength(); ++vectorCountersIndex)
{
m_vectorCounters.push_back(vectorCountersJsonList[vectorCountersIndex].AsObject());
}
m_vectorCountersHasBeenSet = true;
}
return *this;
}
JsonValue SummarizedAttackVector::Jsonize() const
{
JsonValue payload;
if(m_vectorTypeHasBeenSet)
{
payload.WithString("VectorType", m_vectorType);
}
if(m_vectorCountersHasBeenSet)
{
Array<JsonValue> vectorCountersJsonList(m_vectorCounters.size());
for(unsigned vectorCountersIndex = 0; vectorCountersIndex < vectorCountersJsonList.GetLength(); ++vectorCountersIndex)
{
vectorCountersJsonList[vectorCountersIndex].AsObject(m_vectorCounters[vectorCountersIndex].Jsonize());
}
payload.WithArray("VectorCounters", std::move(vectorCountersJsonList));
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,142 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/SummarizedCounter.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
SummarizedCounter::SummarizedCounter() :
m_nameHasBeenSet(false),
m_max(0.0),
m_maxHasBeenSet(false),
m_average(0.0),
m_averageHasBeenSet(false),
m_sum(0.0),
m_sumHasBeenSet(false),
m_n(0),
m_nHasBeenSet(false),
m_unitHasBeenSet(false)
{
}
SummarizedCounter::SummarizedCounter(JsonView jsonValue) :
m_nameHasBeenSet(false),
m_max(0.0),
m_maxHasBeenSet(false),
m_average(0.0),
m_averageHasBeenSet(false),
m_sum(0.0),
m_sumHasBeenSet(false),
m_n(0),
m_nHasBeenSet(false),
m_unitHasBeenSet(false)
{
*this = jsonValue;
}
SummarizedCounter& SummarizedCounter::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Name"))
{
m_name = jsonValue.GetString("Name");
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("Max"))
{
m_max = jsonValue.GetDouble("Max");
m_maxHasBeenSet = true;
}
if(jsonValue.ValueExists("Average"))
{
m_average = jsonValue.GetDouble("Average");
m_averageHasBeenSet = true;
}
if(jsonValue.ValueExists("Sum"))
{
m_sum = jsonValue.GetDouble("Sum");
m_sumHasBeenSet = true;
}
if(jsonValue.ValueExists("N"))
{
m_n = jsonValue.GetInteger("N");
m_nHasBeenSet = true;
}
if(jsonValue.ValueExists("Unit"))
{
m_unit = jsonValue.GetString("Unit");
m_unitHasBeenSet = true;
}
return *this;
}
JsonValue SummarizedCounter::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("Name", m_name);
}
if(m_maxHasBeenSet)
{
payload.WithDouble("Max", m_max);
}
if(m_averageHasBeenSet)
{
payload.WithDouble("Average", m_average);
}
if(m_sumHasBeenSet)
{
payload.WithDouble("Sum", m_sum);
}
if(m_nHasBeenSet)
{
payload.WithInteger("N", m_n);
}
if(m_unitHasBeenSet)
{
payload.WithString("Unit", m_unit);
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,72 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/TimeRange.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
TimeRange::TimeRange() :
m_fromInclusiveHasBeenSet(false),
m_toExclusiveHasBeenSet(false)
{
}
TimeRange::TimeRange(JsonView jsonValue) :
m_fromInclusiveHasBeenSet(false),
m_toExclusiveHasBeenSet(false)
{
*this = jsonValue;
}
TimeRange& TimeRange::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("FromInclusive"))
{
m_fromInclusive = jsonValue.GetDouble("FromInclusive");
m_fromInclusiveHasBeenSet = true;
}
if(jsonValue.ValueExists("ToExclusive"))
{
m_toExclusive = jsonValue.GetDouble("ToExclusive");
m_toExclusiveHasBeenSet = true;
}
return *this;
}
JsonValue TimeRange::Jsonize() const
{
JsonValue payload;
if(m_fromInclusiveHasBeenSet)
{
payload.WithDouble("FromInclusive", m_fromInclusive.SecondsWithMSPrecision());
}
if(m_toExclusiveHasBeenSet)
{
payload.WithDouble("ToExclusive", m_toExclusive.SecondsWithMSPrecision());
}
return payload;
}
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,84 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/Unit.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace Shield
{
namespace Model
{
namespace UnitMapper
{
static const int BITS_HASH = HashingUtils::HashString("BITS");
static const int BYTES_HASH = HashingUtils::HashString("BYTES");
static const int PACKETS_HASH = HashingUtils::HashString("PACKETS");
static const int REQUESTS_HASH = HashingUtils::HashString("REQUESTS");
Unit GetUnitForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == BITS_HASH)
{
return Unit::BITS;
}
else if (hashCode == BYTES_HASH)
{
return Unit::BYTES;
}
else if (hashCode == PACKETS_HASH)
{
return Unit::PACKETS;
}
else if (hashCode == REQUESTS_HASH)
{
return Unit::REQUESTS;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<Unit>(hashCode);
}
return Unit::NOT_SET;
}
Aws::String GetNameForUnit(Unit enumValue)
{
switch(enumValue)
{
case Unit::BITS:
return "BITS";
case Unit::BYTES:
return "BYTES";
case Unit::PACKETS:
return "PACKETS";
case Unit::REQUESTS:
return "REQUESTS";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace UnitMapper
} // namespace Model
} // namespace Shield
} // namespace Aws

View File

@@ -0,0 +1,48 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/UpdateEmergencyContactSettingsRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
UpdateEmergencyContactSettingsRequest::UpdateEmergencyContactSettingsRequest() :
m_emergencyContactListHasBeenSet(false)
{
}
Aws::String UpdateEmergencyContactSettingsRequest::SerializePayload() const
{
JsonValue payload;
if(m_emergencyContactListHasBeenSet)
{
Array<JsonValue> emergencyContactListJsonList(m_emergencyContactList.size());
for(unsigned emergencyContactListIndex = 0; emergencyContactListIndex < emergencyContactListJsonList.GetLength(); ++emergencyContactListIndex)
{
emergencyContactListJsonList[emergencyContactListIndex].AsObject(m_emergencyContactList[emergencyContactListIndex].Jsonize());
}
payload.WithArray("EmergencyContactList", std::move(emergencyContactListJsonList));
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection UpdateEmergencyContactSettingsRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.UpdateEmergencyContactSettings"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/UpdateEmergencyContactSettingsResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
UpdateEmergencyContactSettingsResult::UpdateEmergencyContactSettingsResult()
{
}
UpdateEmergencyContactSettingsResult::UpdateEmergencyContactSettingsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
UpdateEmergencyContactSettingsResult& UpdateEmergencyContactSettingsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/UpdateSubscriptionRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
UpdateSubscriptionRequest::UpdateSubscriptionRequest() :
m_autoRenew(AutoRenew::NOT_SET),
m_autoRenewHasBeenSet(false)
{
}
Aws::String UpdateSubscriptionRequest::SerializePayload() const
{
JsonValue payload;
if(m_autoRenewHasBeenSet)
{
payload.WithString("AutoRenew", AutoRenewMapper::GetNameForAutoRenew(m_autoRenew));
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection UpdateSubscriptionRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShield_20160616.UpdateSubscription"));
return headers;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/UpdateSubscriptionResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::Shield::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
UpdateSubscriptionResult::UpdateSubscriptionResult()
{
}
UpdateSubscriptionResult::UpdateSubscriptionResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
UpdateSubscriptionResult& UpdateSubscriptionResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}