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,320 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/core/utils/Outcome.h>
#include <aws/core/auth/AWSAuthSigner.h>
#include <aws/core/client/CoreErrors.h>
#include <aws/core/client/RetryStrategy.h>
#include <aws/core/http/HttpClient.h>
#include <aws/core/http/HttpResponse.h>
#include <aws/core/http/HttpClientFactory.h>
#include <aws/core/auth/AWSCredentialsProviderChain.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <aws/core/utils/threading/Executor.h>
#include <aws/core/utils/DNS.h>
#include <aws/core/utils/logging/LogMacros.h>
#include <aws/savingsplans/SavingsPlansClient.h>
#include <aws/savingsplans/SavingsPlansEndpoint.h>
#include <aws/savingsplans/SavingsPlansErrorMarshaller.h>
#include <aws/savingsplans/model/CreateSavingsPlanRequest.h>
#include <aws/savingsplans/model/DescribeSavingsPlanRatesRequest.h>
#include <aws/savingsplans/model/DescribeSavingsPlansRequest.h>
#include <aws/savingsplans/model/DescribeSavingsPlansOfferingRatesRequest.h>
#include <aws/savingsplans/model/DescribeSavingsPlansOfferingsRequest.h>
#include <aws/savingsplans/model/ListTagsForResourceRequest.h>
#include <aws/savingsplans/model/TagResourceRequest.h>
#include <aws/savingsplans/model/UntagResourceRequest.h>
using namespace Aws;
using namespace Aws::Auth;
using namespace Aws::Client;
using namespace Aws::SavingsPlans;
using namespace Aws::SavingsPlans::Model;
using namespace Aws::Http;
using namespace Aws::Utils::Json;
static const char* SERVICE_NAME = "savingsplans";
static const char* ALLOCATION_TAG = "SavingsPlansClient";
SavingsPlansClient::SavingsPlansClient(const Client::ClientConfiguration& clientConfiguration) :
BASECLASS(clientConfiguration,
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<SavingsPlansErrorMarshaller>(ALLOCATION_TAG)),
m_executor(clientConfiguration.executor)
{
init(clientConfiguration);
}
SavingsPlansClient::SavingsPlansClient(const AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration) :
BASECLASS(clientConfiguration,
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials),
SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<SavingsPlansErrorMarshaller>(ALLOCATION_TAG)),
m_executor(clientConfiguration.executor)
{
init(clientConfiguration);
}
SavingsPlansClient::SavingsPlansClient(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider,
const Client::ClientConfiguration& clientConfiguration) :
BASECLASS(clientConfiguration,
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, credentialsProvider,
SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<SavingsPlansErrorMarshaller>(ALLOCATION_TAG)),
m_executor(clientConfiguration.executor)
{
init(clientConfiguration);
}
SavingsPlansClient::~SavingsPlansClient()
{
}
void SavingsPlansClient::init(const ClientConfiguration& config)
{
SetServiceClientName("savingsplans");
m_configScheme = SchemeMapper::ToString(config.scheme);
if (config.endpointOverride.empty())
{
m_uri = m_configScheme + "://" + SavingsPlansEndpoint::ForRegion(config.region, config.useDualStack);
}
else
{
OverrideEndpoint(config.endpointOverride);
}
}
void SavingsPlansClient::OverrideEndpoint(const Aws::String& endpoint)
{
if (endpoint.compare(0, 7, "http://") == 0 || endpoint.compare(0, 8, "https://") == 0)
{
m_uri = endpoint;
}
else
{
m_uri = m_configScheme + "://" + endpoint;
}
}
CreateSavingsPlanOutcome SavingsPlansClient::CreateSavingsPlan(const CreateSavingsPlanRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/CreateSavingsPlan";
uri.SetPath(uri.GetPath() + ss.str());
return CreateSavingsPlanOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}
CreateSavingsPlanOutcomeCallable SavingsPlansClient::CreateSavingsPlanCallable(const CreateSavingsPlanRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< CreateSavingsPlanOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CreateSavingsPlan(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void SavingsPlansClient::CreateSavingsPlanAsync(const CreateSavingsPlanRequest& request, const CreateSavingsPlanResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->CreateSavingsPlanAsyncHelper( request, handler, context ); } );
}
void SavingsPlansClient::CreateSavingsPlanAsyncHelper(const CreateSavingsPlanRequest& request, const CreateSavingsPlanResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, CreateSavingsPlan(request), context);
}
DescribeSavingsPlanRatesOutcome SavingsPlansClient::DescribeSavingsPlanRates(const DescribeSavingsPlanRatesRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/DescribeSavingsPlanRates";
uri.SetPath(uri.GetPath() + ss.str());
return DescribeSavingsPlanRatesOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}
DescribeSavingsPlanRatesOutcomeCallable SavingsPlansClient::DescribeSavingsPlanRatesCallable(const DescribeSavingsPlanRatesRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< DescribeSavingsPlanRatesOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeSavingsPlanRates(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void SavingsPlansClient::DescribeSavingsPlanRatesAsync(const DescribeSavingsPlanRatesRequest& request, const DescribeSavingsPlanRatesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->DescribeSavingsPlanRatesAsyncHelper( request, handler, context ); } );
}
void SavingsPlansClient::DescribeSavingsPlanRatesAsyncHelper(const DescribeSavingsPlanRatesRequest& request, const DescribeSavingsPlanRatesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, DescribeSavingsPlanRates(request), context);
}
DescribeSavingsPlansOutcome SavingsPlansClient::DescribeSavingsPlans(const DescribeSavingsPlansRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/DescribeSavingsPlans";
uri.SetPath(uri.GetPath() + ss.str());
return DescribeSavingsPlansOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}
DescribeSavingsPlansOutcomeCallable SavingsPlansClient::DescribeSavingsPlansCallable(const DescribeSavingsPlansRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< DescribeSavingsPlansOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeSavingsPlans(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void SavingsPlansClient::DescribeSavingsPlansAsync(const DescribeSavingsPlansRequest& request, const DescribeSavingsPlansResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->DescribeSavingsPlansAsyncHelper( request, handler, context ); } );
}
void SavingsPlansClient::DescribeSavingsPlansAsyncHelper(const DescribeSavingsPlansRequest& request, const DescribeSavingsPlansResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, DescribeSavingsPlans(request), context);
}
DescribeSavingsPlansOfferingRatesOutcome SavingsPlansClient::DescribeSavingsPlansOfferingRates(const DescribeSavingsPlansOfferingRatesRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/DescribeSavingsPlansOfferingRates";
uri.SetPath(uri.GetPath() + ss.str());
return DescribeSavingsPlansOfferingRatesOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}
DescribeSavingsPlansOfferingRatesOutcomeCallable SavingsPlansClient::DescribeSavingsPlansOfferingRatesCallable(const DescribeSavingsPlansOfferingRatesRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< DescribeSavingsPlansOfferingRatesOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeSavingsPlansOfferingRates(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void SavingsPlansClient::DescribeSavingsPlansOfferingRatesAsync(const DescribeSavingsPlansOfferingRatesRequest& request, const DescribeSavingsPlansOfferingRatesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->DescribeSavingsPlansOfferingRatesAsyncHelper( request, handler, context ); } );
}
void SavingsPlansClient::DescribeSavingsPlansOfferingRatesAsyncHelper(const DescribeSavingsPlansOfferingRatesRequest& request, const DescribeSavingsPlansOfferingRatesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, DescribeSavingsPlansOfferingRates(request), context);
}
DescribeSavingsPlansOfferingsOutcome SavingsPlansClient::DescribeSavingsPlansOfferings(const DescribeSavingsPlansOfferingsRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/DescribeSavingsPlansOfferings";
uri.SetPath(uri.GetPath() + ss.str());
return DescribeSavingsPlansOfferingsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}
DescribeSavingsPlansOfferingsOutcomeCallable SavingsPlansClient::DescribeSavingsPlansOfferingsCallable(const DescribeSavingsPlansOfferingsRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< DescribeSavingsPlansOfferingsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeSavingsPlansOfferings(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void SavingsPlansClient::DescribeSavingsPlansOfferingsAsync(const DescribeSavingsPlansOfferingsRequest& request, const DescribeSavingsPlansOfferingsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->DescribeSavingsPlansOfferingsAsyncHelper( request, handler, context ); } );
}
void SavingsPlansClient::DescribeSavingsPlansOfferingsAsyncHelper(const DescribeSavingsPlansOfferingsRequest& request, const DescribeSavingsPlansOfferingsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, DescribeSavingsPlansOfferings(request), context);
}
ListTagsForResourceOutcome SavingsPlansClient::ListTagsForResource(const ListTagsForResourceRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/ListTagsForResource";
uri.SetPath(uri.GetPath() + ss.str());
return ListTagsForResourceOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}
ListTagsForResourceOutcomeCallable SavingsPlansClient::ListTagsForResourceCallable(const ListTagsForResourceRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< ListTagsForResourceOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListTagsForResource(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void SavingsPlansClient::ListTagsForResourceAsync(const ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->ListTagsForResourceAsyncHelper( request, handler, context ); } );
}
void SavingsPlansClient::ListTagsForResourceAsyncHelper(const ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, ListTagsForResource(request), context);
}
TagResourceOutcome SavingsPlansClient::TagResource(const TagResourceRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/TagResource";
uri.SetPath(uri.GetPath() + ss.str());
return TagResourceOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}
TagResourceOutcomeCallable SavingsPlansClient::TagResourceCallable(const TagResourceRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< TagResourceOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->TagResource(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void SavingsPlansClient::TagResourceAsync(const TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->TagResourceAsyncHelper( request, handler, context ); } );
}
void SavingsPlansClient::TagResourceAsyncHelper(const TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, TagResource(request), context);
}
UntagResourceOutcome SavingsPlansClient::UntagResource(const UntagResourceRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/UntagResource";
uri.SetPath(uri.GetPath() + ss.str());
return UntagResourceOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}
UntagResourceOutcomeCallable SavingsPlansClient::UntagResourceCallable(const UntagResourceRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< UntagResourceOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UntagResource(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void SavingsPlansClient::UntagResourceAsync(const UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->UntagResourceAsyncHelper( request, handler, context ); } );
}
void SavingsPlansClient::UntagResourceAsyncHelper(const UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, UntagResource(request), context);
}

View File

@@ -0,0 +1,31 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/SavingsPlansEndpoint.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <aws/core/utils/HashingUtils.h>
using namespace Aws;
using namespace Aws::SavingsPlans;
namespace Aws
{
namespace SavingsPlans
{
namespace SavingsPlansEndpoint
{
Aws::String ForRegion(const Aws::String& regionName, bool useDualStack)
{
AWS_UNREFERENCED_PARAM(regionName);
AWS_UNREFERENCED_PARAM(useDualStack);
return "savingsplans.amazonaws.com";
}
} // namespace SavingsPlansEndpoint
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,22 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/core/client/AWSError.h>
#include <aws/savingsplans/SavingsPlansErrorMarshaller.h>
#include <aws/savingsplans/SavingsPlansErrors.h>
using namespace Aws::Client;
using namespace Aws::SavingsPlans;
AWSError<CoreErrors> SavingsPlansErrorMarshaller::FindErrorByName(const char* errorName) const
{
AWSError<CoreErrors> error = SavingsPlansErrorMapper::GetErrorForName(errorName);
if(error.GetErrorType() != CoreErrors::UNKNOWN)
{
return error;
}
return AWSErrorMarshaller::FindErrorByName(errorName);
}

View File

@@ -0,0 +1,42 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/core/client/AWSError.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/savingsplans/SavingsPlansErrors.h>
using namespace Aws::Client;
using namespace Aws::Utils;
using namespace Aws::SavingsPlans;
namespace Aws
{
namespace SavingsPlans
{
namespace SavingsPlansErrorMapper
{
static const int SERVICE_QUOTA_EXCEEDED_HASH = HashingUtils::HashString("ServiceQuotaExceededException");
static const int INTERNAL_SERVER_HASH = HashingUtils::HashString("InternalServerException");
AWSError<CoreErrors> GetErrorForName(const char* errorName)
{
int hashCode = HashingUtils::HashString(errorName);
if (hashCode == SERVICE_QUOTA_EXCEEDED_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(SavingsPlansErrors::SERVICE_QUOTA_EXCEEDED), false);
}
else if (hashCode == INTERNAL_SERVER_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(SavingsPlansErrors::INTERNAL_SERVER), false);
}
return AWSError<CoreErrors>(CoreErrors::UNKNOWN, false);
}
} // namespace SavingsPlansErrorMapper
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,69 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/CreateSavingsPlanRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
CreateSavingsPlanRequest::CreateSavingsPlanRequest() :
m_savingsPlanOfferingIdHasBeenSet(false),
m_commitmentHasBeenSet(false),
m_upfrontPaymentAmountHasBeenSet(false),
m_clientToken(Aws::Utils::UUID::RandomUUID()),
m_clientTokenHasBeenSet(true),
m_tagsHasBeenSet(false)
{
}
Aws::String CreateSavingsPlanRequest::SerializePayload() const
{
JsonValue payload;
if(m_savingsPlanOfferingIdHasBeenSet)
{
payload.WithString("savingsPlanOfferingId", m_savingsPlanOfferingId);
}
if(m_commitmentHasBeenSet)
{
payload.WithString("commitment", m_commitment);
}
if(m_upfrontPaymentAmountHasBeenSet)
{
payload.WithString("upfrontPaymentAmount", m_upfrontPaymentAmount);
}
if(m_clientTokenHasBeenSet)
{
payload.WithString("clientToken", m_clientToken);
}
if(m_tagsHasBeenSet)
{
JsonValue tagsJsonMap;
for(auto& tagsItem : m_tags)
{
tagsJsonMap.WithString(tagsItem.first, tagsItem.second);
}
payload.WithObject("tags", std::move(tagsJsonMap));
}
return payload.View().WriteReadable();
}

View File

@@ -0,0 +1,40 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/CreateSavingsPlanResult.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::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
CreateSavingsPlanResult::CreateSavingsPlanResult()
{
}
CreateSavingsPlanResult::CreateSavingsPlanResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
CreateSavingsPlanResult& CreateSavingsPlanResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("savingsPlanId"))
{
m_savingsPlanId = jsonValue.GetString("savingsPlanId");
}
return *this;
}

View File

@@ -0,0 +1,70 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/CurrencyCode.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 SavingsPlans
{
namespace Model
{
namespace CurrencyCodeMapper
{
static const int CNY_HASH = HashingUtils::HashString("CNY");
static const int USD_HASH = HashingUtils::HashString("USD");
CurrencyCode GetCurrencyCodeForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == CNY_HASH)
{
return CurrencyCode::CNY;
}
else if (hashCode == USD_HASH)
{
return CurrencyCode::USD;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<CurrencyCode>(hashCode);
}
return CurrencyCode::NOT_SET;
}
Aws::String GetNameForCurrencyCode(CurrencyCode enumValue)
{
switch(enumValue)
{
case CurrencyCode::CNY:
return "CNY";
case CurrencyCode::USD:
return "USD";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace CurrencyCodeMapper
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,62 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/DescribeSavingsPlanRatesRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DescribeSavingsPlanRatesRequest::DescribeSavingsPlanRatesRequest() :
m_savingsPlanIdHasBeenSet(false),
m_filtersHasBeenSet(false),
m_nextTokenHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false)
{
}
Aws::String DescribeSavingsPlanRatesRequest::SerializePayload() const
{
JsonValue payload;
if(m_savingsPlanIdHasBeenSet)
{
payload.WithString("savingsPlanId", m_savingsPlanId);
}
if(m_filtersHasBeenSet)
{
Array<JsonValue> filtersJsonList(m_filters.size());
for(unsigned filtersIndex = 0; filtersIndex < filtersJsonList.GetLength(); ++filtersIndex)
{
filtersJsonList[filtersIndex].AsObject(m_filters[filtersIndex].Jsonize());
}
payload.WithArray("filters", std::move(filtersJsonList));
}
if(m_nextTokenHasBeenSet)
{
payload.WithString("nextToken", m_nextToken);
}
if(m_maxResultsHasBeenSet)
{
payload.WithInteger("maxResults", m_maxResults);
}
return payload.View().WriteReadable();
}

View File

@@ -0,0 +1,55 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/DescribeSavingsPlanRatesResult.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::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DescribeSavingsPlanRatesResult::DescribeSavingsPlanRatesResult()
{
}
DescribeSavingsPlanRatesResult::DescribeSavingsPlanRatesResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DescribeSavingsPlanRatesResult& DescribeSavingsPlanRatesResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("savingsPlanId"))
{
m_savingsPlanId = jsonValue.GetString("savingsPlanId");
}
if(jsonValue.ValueExists("searchResults"))
{
Array<JsonView> searchResultsJsonList = jsonValue.GetArray("searchResults");
for(unsigned searchResultsIndex = 0; searchResultsIndex < searchResultsJsonList.GetLength(); ++searchResultsIndex)
{
m_searchResults.push_back(searchResultsJsonList[searchResultsIndex].AsObject());
}
}
if(jsonValue.ValueExists("nextToken"))
{
m_nextToken = jsonValue.GetString("nextToken");
}
return *this;
}

View File

@@ -0,0 +1,139 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/DescribeSavingsPlansOfferingRatesRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DescribeSavingsPlansOfferingRatesRequest::DescribeSavingsPlansOfferingRatesRequest() :
m_savingsPlanOfferingIdsHasBeenSet(false),
m_savingsPlanPaymentOptionsHasBeenSet(false),
m_savingsPlanTypesHasBeenSet(false),
m_productsHasBeenSet(false),
m_serviceCodesHasBeenSet(false),
m_usageTypesHasBeenSet(false),
m_operationsHasBeenSet(false),
m_filtersHasBeenSet(false),
m_nextTokenHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false)
{
}
Aws::String DescribeSavingsPlansOfferingRatesRequest::SerializePayload() const
{
JsonValue payload;
if(m_savingsPlanOfferingIdsHasBeenSet)
{
Array<JsonValue> savingsPlanOfferingIdsJsonList(m_savingsPlanOfferingIds.size());
for(unsigned savingsPlanOfferingIdsIndex = 0; savingsPlanOfferingIdsIndex < savingsPlanOfferingIdsJsonList.GetLength(); ++savingsPlanOfferingIdsIndex)
{
savingsPlanOfferingIdsJsonList[savingsPlanOfferingIdsIndex].AsString(m_savingsPlanOfferingIds[savingsPlanOfferingIdsIndex]);
}
payload.WithArray("savingsPlanOfferingIds", std::move(savingsPlanOfferingIdsJsonList));
}
if(m_savingsPlanPaymentOptionsHasBeenSet)
{
Array<JsonValue> savingsPlanPaymentOptionsJsonList(m_savingsPlanPaymentOptions.size());
for(unsigned savingsPlanPaymentOptionsIndex = 0; savingsPlanPaymentOptionsIndex < savingsPlanPaymentOptionsJsonList.GetLength(); ++savingsPlanPaymentOptionsIndex)
{
savingsPlanPaymentOptionsJsonList[savingsPlanPaymentOptionsIndex].AsString(SavingsPlanPaymentOptionMapper::GetNameForSavingsPlanPaymentOption(m_savingsPlanPaymentOptions[savingsPlanPaymentOptionsIndex]));
}
payload.WithArray("savingsPlanPaymentOptions", std::move(savingsPlanPaymentOptionsJsonList));
}
if(m_savingsPlanTypesHasBeenSet)
{
Array<JsonValue> savingsPlanTypesJsonList(m_savingsPlanTypes.size());
for(unsigned savingsPlanTypesIndex = 0; savingsPlanTypesIndex < savingsPlanTypesJsonList.GetLength(); ++savingsPlanTypesIndex)
{
savingsPlanTypesJsonList[savingsPlanTypesIndex].AsString(SavingsPlanTypeMapper::GetNameForSavingsPlanType(m_savingsPlanTypes[savingsPlanTypesIndex]));
}
payload.WithArray("savingsPlanTypes", std::move(savingsPlanTypesJsonList));
}
if(m_productsHasBeenSet)
{
Array<JsonValue> productsJsonList(m_products.size());
for(unsigned productsIndex = 0; productsIndex < productsJsonList.GetLength(); ++productsIndex)
{
productsJsonList[productsIndex].AsString(SavingsPlanProductTypeMapper::GetNameForSavingsPlanProductType(m_products[productsIndex]));
}
payload.WithArray("products", std::move(productsJsonList));
}
if(m_serviceCodesHasBeenSet)
{
Array<JsonValue> serviceCodesJsonList(m_serviceCodes.size());
for(unsigned serviceCodesIndex = 0; serviceCodesIndex < serviceCodesJsonList.GetLength(); ++serviceCodesIndex)
{
serviceCodesJsonList[serviceCodesIndex].AsString(SavingsPlanRateServiceCodeMapper::GetNameForSavingsPlanRateServiceCode(m_serviceCodes[serviceCodesIndex]));
}
payload.WithArray("serviceCodes", std::move(serviceCodesJsonList));
}
if(m_usageTypesHasBeenSet)
{
Array<JsonValue> usageTypesJsonList(m_usageTypes.size());
for(unsigned usageTypesIndex = 0; usageTypesIndex < usageTypesJsonList.GetLength(); ++usageTypesIndex)
{
usageTypesJsonList[usageTypesIndex].AsString(m_usageTypes[usageTypesIndex]);
}
payload.WithArray("usageTypes", std::move(usageTypesJsonList));
}
if(m_operationsHasBeenSet)
{
Array<JsonValue> operationsJsonList(m_operations.size());
for(unsigned operationsIndex = 0; operationsIndex < operationsJsonList.GetLength(); ++operationsIndex)
{
operationsJsonList[operationsIndex].AsString(m_operations[operationsIndex]);
}
payload.WithArray("operations", std::move(operationsJsonList));
}
if(m_filtersHasBeenSet)
{
Array<JsonValue> filtersJsonList(m_filters.size());
for(unsigned filtersIndex = 0; filtersIndex < filtersJsonList.GetLength(); ++filtersIndex)
{
filtersJsonList[filtersIndex].AsObject(m_filters[filtersIndex].Jsonize());
}
payload.WithArray("filters", std::move(filtersJsonList));
}
if(m_nextTokenHasBeenSet)
{
payload.WithString("nextToken", m_nextToken);
}
if(m_maxResultsHasBeenSet)
{
payload.WithInteger("maxResults", m_maxResults);
}
return payload.View().WriteReadable();
}

View File

@@ -0,0 +1,49 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/DescribeSavingsPlansOfferingRatesResult.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::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DescribeSavingsPlansOfferingRatesResult::DescribeSavingsPlansOfferingRatesResult()
{
}
DescribeSavingsPlansOfferingRatesResult::DescribeSavingsPlansOfferingRatesResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DescribeSavingsPlansOfferingRatesResult& DescribeSavingsPlansOfferingRatesResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("searchResults"))
{
Array<JsonView> searchResultsJsonList = jsonValue.GetArray("searchResults");
for(unsigned searchResultsIndex = 0; searchResultsIndex < searchResultsJsonList.GetLength(); ++searchResultsIndex)
{
m_searchResults.push_back(searchResultsJsonList[searchResultsIndex].AsObject());
}
}
if(jsonValue.ValueExists("nextToken"))
{
m_nextToken = jsonValue.GetString("nextToken");
}
return *this;
}

View File

@@ -0,0 +1,170 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/DescribeSavingsPlansOfferingsRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DescribeSavingsPlansOfferingsRequest::DescribeSavingsPlansOfferingsRequest() :
m_offeringIdsHasBeenSet(false),
m_paymentOptionsHasBeenSet(false),
m_productType(SavingsPlanProductType::NOT_SET),
m_productTypeHasBeenSet(false),
m_planTypesHasBeenSet(false),
m_durationsHasBeenSet(false),
m_currenciesHasBeenSet(false),
m_descriptionsHasBeenSet(false),
m_serviceCodesHasBeenSet(false),
m_usageTypesHasBeenSet(false),
m_operationsHasBeenSet(false),
m_filtersHasBeenSet(false),
m_nextTokenHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false)
{
}
Aws::String DescribeSavingsPlansOfferingsRequest::SerializePayload() const
{
JsonValue payload;
if(m_offeringIdsHasBeenSet)
{
Array<JsonValue> offeringIdsJsonList(m_offeringIds.size());
for(unsigned offeringIdsIndex = 0; offeringIdsIndex < offeringIdsJsonList.GetLength(); ++offeringIdsIndex)
{
offeringIdsJsonList[offeringIdsIndex].AsString(m_offeringIds[offeringIdsIndex]);
}
payload.WithArray("offeringIds", std::move(offeringIdsJsonList));
}
if(m_paymentOptionsHasBeenSet)
{
Array<JsonValue> paymentOptionsJsonList(m_paymentOptions.size());
for(unsigned paymentOptionsIndex = 0; paymentOptionsIndex < paymentOptionsJsonList.GetLength(); ++paymentOptionsIndex)
{
paymentOptionsJsonList[paymentOptionsIndex].AsString(SavingsPlanPaymentOptionMapper::GetNameForSavingsPlanPaymentOption(m_paymentOptions[paymentOptionsIndex]));
}
payload.WithArray("paymentOptions", std::move(paymentOptionsJsonList));
}
if(m_productTypeHasBeenSet)
{
payload.WithString("productType", SavingsPlanProductTypeMapper::GetNameForSavingsPlanProductType(m_productType));
}
if(m_planTypesHasBeenSet)
{
Array<JsonValue> planTypesJsonList(m_planTypes.size());
for(unsigned planTypesIndex = 0; planTypesIndex < planTypesJsonList.GetLength(); ++planTypesIndex)
{
planTypesJsonList[planTypesIndex].AsString(SavingsPlanTypeMapper::GetNameForSavingsPlanType(m_planTypes[planTypesIndex]));
}
payload.WithArray("planTypes", std::move(planTypesJsonList));
}
if(m_durationsHasBeenSet)
{
Array<JsonValue> durationsJsonList(m_durations.size());
for(unsigned durationsIndex = 0; durationsIndex < durationsJsonList.GetLength(); ++durationsIndex)
{
durationsJsonList[durationsIndex].AsInt64(m_durations[durationsIndex]);
}
payload.WithArray("durations", std::move(durationsJsonList));
}
if(m_currenciesHasBeenSet)
{
Array<JsonValue> currenciesJsonList(m_currencies.size());
for(unsigned currenciesIndex = 0; currenciesIndex < currenciesJsonList.GetLength(); ++currenciesIndex)
{
currenciesJsonList[currenciesIndex].AsString(CurrencyCodeMapper::GetNameForCurrencyCode(m_currencies[currenciesIndex]));
}
payload.WithArray("currencies", std::move(currenciesJsonList));
}
if(m_descriptionsHasBeenSet)
{
Array<JsonValue> descriptionsJsonList(m_descriptions.size());
for(unsigned descriptionsIndex = 0; descriptionsIndex < descriptionsJsonList.GetLength(); ++descriptionsIndex)
{
descriptionsJsonList[descriptionsIndex].AsString(m_descriptions[descriptionsIndex]);
}
payload.WithArray("descriptions", std::move(descriptionsJsonList));
}
if(m_serviceCodesHasBeenSet)
{
Array<JsonValue> serviceCodesJsonList(m_serviceCodes.size());
for(unsigned serviceCodesIndex = 0; serviceCodesIndex < serviceCodesJsonList.GetLength(); ++serviceCodesIndex)
{
serviceCodesJsonList[serviceCodesIndex].AsString(m_serviceCodes[serviceCodesIndex]);
}
payload.WithArray("serviceCodes", std::move(serviceCodesJsonList));
}
if(m_usageTypesHasBeenSet)
{
Array<JsonValue> usageTypesJsonList(m_usageTypes.size());
for(unsigned usageTypesIndex = 0; usageTypesIndex < usageTypesJsonList.GetLength(); ++usageTypesIndex)
{
usageTypesJsonList[usageTypesIndex].AsString(m_usageTypes[usageTypesIndex]);
}
payload.WithArray("usageTypes", std::move(usageTypesJsonList));
}
if(m_operationsHasBeenSet)
{
Array<JsonValue> operationsJsonList(m_operations.size());
for(unsigned operationsIndex = 0; operationsIndex < operationsJsonList.GetLength(); ++operationsIndex)
{
operationsJsonList[operationsIndex].AsString(m_operations[operationsIndex]);
}
payload.WithArray("operations", std::move(operationsJsonList));
}
if(m_filtersHasBeenSet)
{
Array<JsonValue> filtersJsonList(m_filters.size());
for(unsigned filtersIndex = 0; filtersIndex < filtersJsonList.GetLength(); ++filtersIndex)
{
filtersJsonList[filtersIndex].AsObject(m_filters[filtersIndex].Jsonize());
}
payload.WithArray("filters", std::move(filtersJsonList));
}
if(m_nextTokenHasBeenSet)
{
payload.WithString("nextToken", m_nextToken);
}
if(m_maxResultsHasBeenSet)
{
payload.WithInteger("maxResults", m_maxResults);
}
return payload.View().WriteReadable();
}

View File

@@ -0,0 +1,49 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/DescribeSavingsPlansOfferingsResult.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::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DescribeSavingsPlansOfferingsResult::DescribeSavingsPlansOfferingsResult()
{
}
DescribeSavingsPlansOfferingsResult::DescribeSavingsPlansOfferingsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DescribeSavingsPlansOfferingsResult& DescribeSavingsPlansOfferingsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("searchResults"))
{
Array<JsonView> searchResultsJsonList = jsonValue.GetArray("searchResults");
for(unsigned searchResultsIndex = 0; searchResultsIndex < searchResultsJsonList.GetLength(); ++searchResultsIndex)
{
m_searchResults.push_back(searchResultsJsonList[searchResultsIndex].AsObject());
}
}
if(jsonValue.ValueExists("nextToken"))
{
m_nextToken = jsonValue.GetString("nextToken");
}
return *this;
}

View File

@@ -0,0 +1,91 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/DescribeSavingsPlansRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DescribeSavingsPlansRequest::DescribeSavingsPlansRequest() :
m_savingsPlanArnsHasBeenSet(false),
m_savingsPlanIdsHasBeenSet(false),
m_nextTokenHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false),
m_statesHasBeenSet(false),
m_filtersHasBeenSet(false)
{
}
Aws::String DescribeSavingsPlansRequest::SerializePayload() const
{
JsonValue payload;
if(m_savingsPlanArnsHasBeenSet)
{
Array<JsonValue> savingsPlanArnsJsonList(m_savingsPlanArns.size());
for(unsigned savingsPlanArnsIndex = 0; savingsPlanArnsIndex < savingsPlanArnsJsonList.GetLength(); ++savingsPlanArnsIndex)
{
savingsPlanArnsJsonList[savingsPlanArnsIndex].AsString(m_savingsPlanArns[savingsPlanArnsIndex]);
}
payload.WithArray("savingsPlanArns", std::move(savingsPlanArnsJsonList));
}
if(m_savingsPlanIdsHasBeenSet)
{
Array<JsonValue> savingsPlanIdsJsonList(m_savingsPlanIds.size());
for(unsigned savingsPlanIdsIndex = 0; savingsPlanIdsIndex < savingsPlanIdsJsonList.GetLength(); ++savingsPlanIdsIndex)
{
savingsPlanIdsJsonList[savingsPlanIdsIndex].AsString(m_savingsPlanIds[savingsPlanIdsIndex]);
}
payload.WithArray("savingsPlanIds", std::move(savingsPlanIdsJsonList));
}
if(m_nextTokenHasBeenSet)
{
payload.WithString("nextToken", m_nextToken);
}
if(m_maxResultsHasBeenSet)
{
payload.WithInteger("maxResults", m_maxResults);
}
if(m_statesHasBeenSet)
{
Array<JsonValue> statesJsonList(m_states.size());
for(unsigned statesIndex = 0; statesIndex < statesJsonList.GetLength(); ++statesIndex)
{
statesJsonList[statesIndex].AsString(SavingsPlanStateMapper::GetNameForSavingsPlanState(m_states[statesIndex]));
}
payload.WithArray("states", std::move(statesJsonList));
}
if(m_filtersHasBeenSet)
{
Array<JsonValue> filtersJsonList(m_filters.size());
for(unsigned filtersIndex = 0; filtersIndex < filtersJsonList.GetLength(); ++filtersIndex)
{
filtersJsonList[filtersIndex].AsObject(m_filters[filtersIndex].Jsonize());
}
payload.WithArray("filters", std::move(filtersJsonList));
}
return payload.View().WriteReadable();
}

View File

@@ -0,0 +1,49 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/DescribeSavingsPlansResult.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::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DescribeSavingsPlansResult::DescribeSavingsPlansResult()
{
}
DescribeSavingsPlansResult::DescribeSavingsPlansResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DescribeSavingsPlansResult& DescribeSavingsPlansResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("savingsPlans"))
{
Array<JsonView> savingsPlansJsonList = jsonValue.GetArray("savingsPlans");
for(unsigned savingsPlansIndex = 0; savingsPlansIndex < savingsPlansJsonList.GetLength(); ++savingsPlansIndex)
{
m_savingsPlans.push_back(savingsPlansJsonList[savingsPlansIndex].AsObject());
}
}
if(jsonValue.ValueExists("nextToken"))
{
m_nextToken = jsonValue.GetString("nextToken");
}
return *this;
}

View File

@@ -0,0 +1,35 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/ListTagsForResourceRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
ListTagsForResourceRequest::ListTagsForResourceRequest() :
m_resourceArnHasBeenSet(false)
{
}
Aws::String ListTagsForResourceRequest::SerializePayload() const
{
JsonValue payload;
if(m_resourceArnHasBeenSet)
{
payload.WithString("resourceArn", m_resourceArn);
}
return payload.View().WriteReadable();
}

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/ListTagsForResourceResult.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::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
ListTagsForResourceResult::ListTagsForResourceResult()
{
}
ListTagsForResourceResult::ListTagsForResourceResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
ListTagsForResourceResult& ListTagsForResourceResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("tags"))
{
Aws::Map<Aws::String, JsonView> tagsJsonMap = jsonValue.GetObject("tags").GetAllObjects();
for(auto& tagsItem : tagsJsonMap)
{
m_tags[tagsItem.first] = tagsItem.second.AsString();
}
}
return *this;
}

View File

@@ -0,0 +1,139 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/ParentSavingsPlanOffering.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SavingsPlans
{
namespace Model
{
ParentSavingsPlanOffering::ParentSavingsPlanOffering() :
m_offeringIdHasBeenSet(false),
m_paymentOption(SavingsPlanPaymentOption::NOT_SET),
m_paymentOptionHasBeenSet(false),
m_planType(SavingsPlanType::NOT_SET),
m_planTypeHasBeenSet(false),
m_durationSeconds(0),
m_durationSecondsHasBeenSet(false),
m_currency(CurrencyCode::NOT_SET),
m_currencyHasBeenSet(false),
m_planDescriptionHasBeenSet(false)
{
}
ParentSavingsPlanOffering::ParentSavingsPlanOffering(JsonView jsonValue) :
m_offeringIdHasBeenSet(false),
m_paymentOption(SavingsPlanPaymentOption::NOT_SET),
m_paymentOptionHasBeenSet(false),
m_planType(SavingsPlanType::NOT_SET),
m_planTypeHasBeenSet(false),
m_durationSeconds(0),
m_durationSecondsHasBeenSet(false),
m_currency(CurrencyCode::NOT_SET),
m_currencyHasBeenSet(false),
m_planDescriptionHasBeenSet(false)
{
*this = jsonValue;
}
ParentSavingsPlanOffering& ParentSavingsPlanOffering::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("offeringId"))
{
m_offeringId = jsonValue.GetString("offeringId");
m_offeringIdHasBeenSet = true;
}
if(jsonValue.ValueExists("paymentOption"))
{
m_paymentOption = SavingsPlanPaymentOptionMapper::GetSavingsPlanPaymentOptionForName(jsonValue.GetString("paymentOption"));
m_paymentOptionHasBeenSet = true;
}
if(jsonValue.ValueExists("planType"))
{
m_planType = SavingsPlanTypeMapper::GetSavingsPlanTypeForName(jsonValue.GetString("planType"));
m_planTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("durationSeconds"))
{
m_durationSeconds = jsonValue.GetInt64("durationSeconds");
m_durationSecondsHasBeenSet = true;
}
if(jsonValue.ValueExists("currency"))
{
m_currency = CurrencyCodeMapper::GetCurrencyCodeForName(jsonValue.GetString("currency"));
m_currencyHasBeenSet = true;
}
if(jsonValue.ValueExists("planDescription"))
{
m_planDescription = jsonValue.GetString("planDescription");
m_planDescriptionHasBeenSet = true;
}
return *this;
}
JsonValue ParentSavingsPlanOffering::Jsonize() const
{
JsonValue payload;
if(m_offeringIdHasBeenSet)
{
payload.WithString("offeringId", m_offeringId);
}
if(m_paymentOptionHasBeenSet)
{
payload.WithString("paymentOption", SavingsPlanPaymentOptionMapper::GetNameForSavingsPlanPaymentOption(m_paymentOption));
}
if(m_planTypeHasBeenSet)
{
payload.WithString("planType", SavingsPlanTypeMapper::GetNameForSavingsPlanType(m_planType));
}
if(m_durationSecondsHasBeenSet)
{
payload.WithInt64("durationSeconds", m_durationSeconds);
}
if(m_currencyHasBeenSet)
{
payload.WithString("currency", CurrencyCodeMapper::GetNameForCurrencyCode(m_currency));
}
if(m_planDescriptionHasBeenSet)
{
payload.WithString("planDescription", m_planDescription);
}
return payload;
}
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,336 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/SavingsPlan.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SavingsPlans
{
namespace Model
{
SavingsPlan::SavingsPlan() :
m_offeringIdHasBeenSet(false),
m_savingsPlanIdHasBeenSet(false),
m_savingsPlanArnHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_startHasBeenSet(false),
m_endHasBeenSet(false),
m_state(SavingsPlanState::NOT_SET),
m_stateHasBeenSet(false),
m_regionHasBeenSet(false),
m_ec2InstanceFamilyHasBeenSet(false),
m_savingsPlanType(SavingsPlanType::NOT_SET),
m_savingsPlanTypeHasBeenSet(false),
m_paymentOption(SavingsPlanPaymentOption::NOT_SET),
m_paymentOptionHasBeenSet(false),
m_productTypesHasBeenSet(false),
m_currency(CurrencyCode::NOT_SET),
m_currencyHasBeenSet(false),
m_commitmentHasBeenSet(false),
m_upfrontPaymentAmountHasBeenSet(false),
m_recurringPaymentAmountHasBeenSet(false),
m_termDurationInSeconds(0),
m_termDurationInSecondsHasBeenSet(false),
m_tagsHasBeenSet(false)
{
}
SavingsPlan::SavingsPlan(JsonView jsonValue) :
m_offeringIdHasBeenSet(false),
m_savingsPlanIdHasBeenSet(false),
m_savingsPlanArnHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_startHasBeenSet(false),
m_endHasBeenSet(false),
m_state(SavingsPlanState::NOT_SET),
m_stateHasBeenSet(false),
m_regionHasBeenSet(false),
m_ec2InstanceFamilyHasBeenSet(false),
m_savingsPlanType(SavingsPlanType::NOT_SET),
m_savingsPlanTypeHasBeenSet(false),
m_paymentOption(SavingsPlanPaymentOption::NOT_SET),
m_paymentOptionHasBeenSet(false),
m_productTypesHasBeenSet(false),
m_currency(CurrencyCode::NOT_SET),
m_currencyHasBeenSet(false),
m_commitmentHasBeenSet(false),
m_upfrontPaymentAmountHasBeenSet(false),
m_recurringPaymentAmountHasBeenSet(false),
m_termDurationInSeconds(0),
m_termDurationInSecondsHasBeenSet(false),
m_tagsHasBeenSet(false)
{
*this = jsonValue;
}
SavingsPlan& SavingsPlan::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("offeringId"))
{
m_offeringId = jsonValue.GetString("offeringId");
m_offeringIdHasBeenSet = true;
}
if(jsonValue.ValueExists("savingsPlanId"))
{
m_savingsPlanId = jsonValue.GetString("savingsPlanId");
m_savingsPlanIdHasBeenSet = true;
}
if(jsonValue.ValueExists("savingsPlanArn"))
{
m_savingsPlanArn = jsonValue.GetString("savingsPlanArn");
m_savingsPlanArnHasBeenSet = true;
}
if(jsonValue.ValueExists("description"))
{
m_description = jsonValue.GetString("description");
m_descriptionHasBeenSet = true;
}
if(jsonValue.ValueExists("start"))
{
m_start = jsonValue.GetString("start");
m_startHasBeenSet = true;
}
if(jsonValue.ValueExists("end"))
{
m_end = jsonValue.GetString("end");
m_endHasBeenSet = true;
}
if(jsonValue.ValueExists("state"))
{
m_state = SavingsPlanStateMapper::GetSavingsPlanStateForName(jsonValue.GetString("state"));
m_stateHasBeenSet = true;
}
if(jsonValue.ValueExists("region"))
{
m_region = jsonValue.GetString("region");
m_regionHasBeenSet = true;
}
if(jsonValue.ValueExists("ec2InstanceFamily"))
{
m_ec2InstanceFamily = jsonValue.GetString("ec2InstanceFamily");
m_ec2InstanceFamilyHasBeenSet = true;
}
if(jsonValue.ValueExists("savingsPlanType"))
{
m_savingsPlanType = SavingsPlanTypeMapper::GetSavingsPlanTypeForName(jsonValue.GetString("savingsPlanType"));
m_savingsPlanTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("paymentOption"))
{
m_paymentOption = SavingsPlanPaymentOptionMapper::GetSavingsPlanPaymentOptionForName(jsonValue.GetString("paymentOption"));
m_paymentOptionHasBeenSet = true;
}
if(jsonValue.ValueExists("productTypes"))
{
Array<JsonView> productTypesJsonList = jsonValue.GetArray("productTypes");
for(unsigned productTypesIndex = 0; productTypesIndex < productTypesJsonList.GetLength(); ++productTypesIndex)
{
m_productTypes.push_back(SavingsPlanProductTypeMapper::GetSavingsPlanProductTypeForName(productTypesJsonList[productTypesIndex].AsString()));
}
m_productTypesHasBeenSet = true;
}
if(jsonValue.ValueExists("currency"))
{
m_currency = CurrencyCodeMapper::GetCurrencyCodeForName(jsonValue.GetString("currency"));
m_currencyHasBeenSet = true;
}
if(jsonValue.ValueExists("commitment"))
{
m_commitment = jsonValue.GetString("commitment");
m_commitmentHasBeenSet = true;
}
if(jsonValue.ValueExists("upfrontPaymentAmount"))
{
m_upfrontPaymentAmount = jsonValue.GetString("upfrontPaymentAmount");
m_upfrontPaymentAmountHasBeenSet = true;
}
if(jsonValue.ValueExists("recurringPaymentAmount"))
{
m_recurringPaymentAmount = jsonValue.GetString("recurringPaymentAmount");
m_recurringPaymentAmountHasBeenSet = true;
}
if(jsonValue.ValueExists("termDurationInSeconds"))
{
m_termDurationInSeconds = jsonValue.GetInt64("termDurationInSeconds");
m_termDurationInSecondsHasBeenSet = true;
}
if(jsonValue.ValueExists("tags"))
{
Aws::Map<Aws::String, JsonView> tagsJsonMap = jsonValue.GetObject("tags").GetAllObjects();
for(auto& tagsItem : tagsJsonMap)
{
m_tags[tagsItem.first] = tagsItem.second.AsString();
}
m_tagsHasBeenSet = true;
}
return *this;
}
JsonValue SavingsPlan::Jsonize() const
{
JsonValue payload;
if(m_offeringIdHasBeenSet)
{
payload.WithString("offeringId", m_offeringId);
}
if(m_savingsPlanIdHasBeenSet)
{
payload.WithString("savingsPlanId", m_savingsPlanId);
}
if(m_savingsPlanArnHasBeenSet)
{
payload.WithString("savingsPlanArn", m_savingsPlanArn);
}
if(m_descriptionHasBeenSet)
{
payload.WithString("description", m_description);
}
if(m_startHasBeenSet)
{
payload.WithString("start", m_start);
}
if(m_endHasBeenSet)
{
payload.WithString("end", m_end);
}
if(m_stateHasBeenSet)
{
payload.WithString("state", SavingsPlanStateMapper::GetNameForSavingsPlanState(m_state));
}
if(m_regionHasBeenSet)
{
payload.WithString("region", m_region);
}
if(m_ec2InstanceFamilyHasBeenSet)
{
payload.WithString("ec2InstanceFamily", m_ec2InstanceFamily);
}
if(m_savingsPlanTypeHasBeenSet)
{
payload.WithString("savingsPlanType", SavingsPlanTypeMapper::GetNameForSavingsPlanType(m_savingsPlanType));
}
if(m_paymentOptionHasBeenSet)
{
payload.WithString("paymentOption", SavingsPlanPaymentOptionMapper::GetNameForSavingsPlanPaymentOption(m_paymentOption));
}
if(m_productTypesHasBeenSet)
{
Array<JsonValue> productTypesJsonList(m_productTypes.size());
for(unsigned productTypesIndex = 0; productTypesIndex < productTypesJsonList.GetLength(); ++productTypesIndex)
{
productTypesJsonList[productTypesIndex].AsString(SavingsPlanProductTypeMapper::GetNameForSavingsPlanProductType(m_productTypes[productTypesIndex]));
}
payload.WithArray("productTypes", std::move(productTypesJsonList));
}
if(m_currencyHasBeenSet)
{
payload.WithString("currency", CurrencyCodeMapper::GetNameForCurrencyCode(m_currency));
}
if(m_commitmentHasBeenSet)
{
payload.WithString("commitment", m_commitment);
}
if(m_upfrontPaymentAmountHasBeenSet)
{
payload.WithString("upfrontPaymentAmount", m_upfrontPaymentAmount);
}
if(m_recurringPaymentAmountHasBeenSet)
{
payload.WithString("recurringPaymentAmount", m_recurringPaymentAmount);
}
if(m_termDurationInSecondsHasBeenSet)
{
payload.WithInt64("termDurationInSeconds", m_termDurationInSeconds);
}
if(m_tagsHasBeenSet)
{
JsonValue tagsJsonMap;
for(auto& tagsItem : m_tags)
{
tagsJsonMap.WithString(tagsItem.first, tagsItem.second);
}
payload.WithObject("tags", std::move(tagsJsonMap));
}
return payload;
}
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,83 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/SavingsPlanFilter.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SavingsPlans
{
namespace Model
{
SavingsPlanFilter::SavingsPlanFilter() :
m_name(SavingsPlansFilterName::NOT_SET),
m_nameHasBeenSet(false),
m_valuesHasBeenSet(false)
{
}
SavingsPlanFilter::SavingsPlanFilter(JsonView jsonValue) :
m_name(SavingsPlansFilterName::NOT_SET),
m_nameHasBeenSet(false),
m_valuesHasBeenSet(false)
{
*this = jsonValue;
}
SavingsPlanFilter& SavingsPlanFilter::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("name"))
{
m_name = SavingsPlansFilterNameMapper::GetSavingsPlansFilterNameForName(jsonValue.GetString("name"));
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("values"))
{
Array<JsonView> valuesJsonList = jsonValue.GetArray("values");
for(unsigned valuesIndex = 0; valuesIndex < valuesJsonList.GetLength(); ++valuesIndex)
{
m_values.push_back(valuesJsonList[valuesIndex].AsString());
}
m_valuesHasBeenSet = true;
}
return *this;
}
JsonValue SavingsPlanFilter::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("name", SavingsPlansFilterNameMapper::GetNameForSavingsPlansFilterName(m_name));
}
if(m_valuesHasBeenSet)
{
Array<JsonValue> valuesJsonList(m_values.size());
for(unsigned valuesIndex = 0; valuesIndex < valuesJsonList.GetLength(); ++valuesIndex)
{
valuesJsonList[valuesIndex].AsString(m_values[valuesIndex]);
}
payload.WithArray("values", std::move(valuesJsonList));
}
return payload;
}
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,230 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/SavingsPlanOffering.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SavingsPlans
{
namespace Model
{
SavingsPlanOffering::SavingsPlanOffering() :
m_offeringIdHasBeenSet(false),
m_productTypesHasBeenSet(false),
m_planType(SavingsPlanType::NOT_SET),
m_planTypeHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_paymentOption(SavingsPlanPaymentOption::NOT_SET),
m_paymentOptionHasBeenSet(false),
m_durationSeconds(0),
m_durationSecondsHasBeenSet(false),
m_currency(CurrencyCode::NOT_SET),
m_currencyHasBeenSet(false),
m_serviceCodeHasBeenSet(false),
m_usageTypeHasBeenSet(false),
m_operationHasBeenSet(false),
m_propertiesHasBeenSet(false)
{
}
SavingsPlanOffering::SavingsPlanOffering(JsonView jsonValue) :
m_offeringIdHasBeenSet(false),
m_productTypesHasBeenSet(false),
m_planType(SavingsPlanType::NOT_SET),
m_planTypeHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_paymentOption(SavingsPlanPaymentOption::NOT_SET),
m_paymentOptionHasBeenSet(false),
m_durationSeconds(0),
m_durationSecondsHasBeenSet(false),
m_currency(CurrencyCode::NOT_SET),
m_currencyHasBeenSet(false),
m_serviceCodeHasBeenSet(false),
m_usageTypeHasBeenSet(false),
m_operationHasBeenSet(false),
m_propertiesHasBeenSet(false)
{
*this = jsonValue;
}
SavingsPlanOffering& SavingsPlanOffering::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("offeringId"))
{
m_offeringId = jsonValue.GetString("offeringId");
m_offeringIdHasBeenSet = true;
}
if(jsonValue.ValueExists("productTypes"))
{
Array<JsonView> productTypesJsonList = jsonValue.GetArray("productTypes");
for(unsigned productTypesIndex = 0; productTypesIndex < productTypesJsonList.GetLength(); ++productTypesIndex)
{
m_productTypes.push_back(SavingsPlanProductTypeMapper::GetSavingsPlanProductTypeForName(productTypesJsonList[productTypesIndex].AsString()));
}
m_productTypesHasBeenSet = true;
}
if(jsonValue.ValueExists("planType"))
{
m_planType = SavingsPlanTypeMapper::GetSavingsPlanTypeForName(jsonValue.GetString("planType"));
m_planTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("description"))
{
m_description = jsonValue.GetString("description");
m_descriptionHasBeenSet = true;
}
if(jsonValue.ValueExists("paymentOption"))
{
m_paymentOption = SavingsPlanPaymentOptionMapper::GetSavingsPlanPaymentOptionForName(jsonValue.GetString("paymentOption"));
m_paymentOptionHasBeenSet = true;
}
if(jsonValue.ValueExists("durationSeconds"))
{
m_durationSeconds = jsonValue.GetInt64("durationSeconds");
m_durationSecondsHasBeenSet = true;
}
if(jsonValue.ValueExists("currency"))
{
m_currency = CurrencyCodeMapper::GetCurrencyCodeForName(jsonValue.GetString("currency"));
m_currencyHasBeenSet = true;
}
if(jsonValue.ValueExists("serviceCode"))
{
m_serviceCode = jsonValue.GetString("serviceCode");
m_serviceCodeHasBeenSet = true;
}
if(jsonValue.ValueExists("usageType"))
{
m_usageType = jsonValue.GetString("usageType");
m_usageTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("operation"))
{
m_operation = jsonValue.GetString("operation");
m_operationHasBeenSet = true;
}
if(jsonValue.ValueExists("properties"))
{
Array<JsonView> propertiesJsonList = jsonValue.GetArray("properties");
for(unsigned propertiesIndex = 0; propertiesIndex < propertiesJsonList.GetLength(); ++propertiesIndex)
{
m_properties.push_back(propertiesJsonList[propertiesIndex].AsObject());
}
m_propertiesHasBeenSet = true;
}
return *this;
}
JsonValue SavingsPlanOffering::Jsonize() const
{
JsonValue payload;
if(m_offeringIdHasBeenSet)
{
payload.WithString("offeringId", m_offeringId);
}
if(m_productTypesHasBeenSet)
{
Array<JsonValue> productTypesJsonList(m_productTypes.size());
for(unsigned productTypesIndex = 0; productTypesIndex < productTypesJsonList.GetLength(); ++productTypesIndex)
{
productTypesJsonList[productTypesIndex].AsString(SavingsPlanProductTypeMapper::GetNameForSavingsPlanProductType(m_productTypes[productTypesIndex]));
}
payload.WithArray("productTypes", std::move(productTypesJsonList));
}
if(m_planTypeHasBeenSet)
{
payload.WithString("planType", SavingsPlanTypeMapper::GetNameForSavingsPlanType(m_planType));
}
if(m_descriptionHasBeenSet)
{
payload.WithString("description", m_description);
}
if(m_paymentOptionHasBeenSet)
{
payload.WithString("paymentOption", SavingsPlanPaymentOptionMapper::GetNameForSavingsPlanPaymentOption(m_paymentOption));
}
if(m_durationSecondsHasBeenSet)
{
payload.WithInt64("durationSeconds", m_durationSeconds);
}
if(m_currencyHasBeenSet)
{
payload.WithString("currency", CurrencyCodeMapper::GetNameForCurrencyCode(m_currency));
}
if(m_serviceCodeHasBeenSet)
{
payload.WithString("serviceCode", m_serviceCode);
}
if(m_usageTypeHasBeenSet)
{
payload.WithString("usageType", m_usageType);
}
if(m_operationHasBeenSet)
{
payload.WithString("operation", m_operation);
}
if(m_propertiesHasBeenSet)
{
Array<JsonValue> propertiesJsonList(m_properties.size());
for(unsigned propertiesIndex = 0; propertiesIndex < propertiesJsonList.GetLength(); ++propertiesIndex)
{
propertiesJsonList[propertiesIndex].AsObject(m_properties[propertiesIndex].Jsonize());
}
payload.WithArray("properties", std::move(propertiesJsonList));
}
return payload;
}
} // namespace Model
} // namespace SavingsPlans
} // 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/savingsplans/model/SavingsPlanOfferingFilterAttribute.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 SavingsPlans
{
namespace Model
{
namespace SavingsPlanOfferingFilterAttributeMapper
{
static const int region_HASH = HashingUtils::HashString("region");
static const int instanceFamily_HASH = HashingUtils::HashString("instanceFamily");
SavingsPlanOfferingFilterAttribute GetSavingsPlanOfferingFilterAttributeForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == region_HASH)
{
return SavingsPlanOfferingFilterAttribute::region;
}
else if (hashCode == instanceFamily_HASH)
{
return SavingsPlanOfferingFilterAttribute::instanceFamily;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<SavingsPlanOfferingFilterAttribute>(hashCode);
}
return SavingsPlanOfferingFilterAttribute::NOT_SET;
}
Aws::String GetNameForSavingsPlanOfferingFilterAttribute(SavingsPlanOfferingFilterAttribute enumValue)
{
switch(enumValue)
{
case SavingsPlanOfferingFilterAttribute::region:
return "region";
case SavingsPlanOfferingFilterAttribute::instanceFamily:
return "instanceFamily";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace SavingsPlanOfferingFilterAttributeMapper
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,83 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/SavingsPlanOfferingFilterElement.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SavingsPlans
{
namespace Model
{
SavingsPlanOfferingFilterElement::SavingsPlanOfferingFilterElement() :
m_name(SavingsPlanOfferingFilterAttribute::NOT_SET),
m_nameHasBeenSet(false),
m_valuesHasBeenSet(false)
{
}
SavingsPlanOfferingFilterElement::SavingsPlanOfferingFilterElement(JsonView jsonValue) :
m_name(SavingsPlanOfferingFilterAttribute::NOT_SET),
m_nameHasBeenSet(false),
m_valuesHasBeenSet(false)
{
*this = jsonValue;
}
SavingsPlanOfferingFilterElement& SavingsPlanOfferingFilterElement::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("name"))
{
m_name = SavingsPlanOfferingFilterAttributeMapper::GetSavingsPlanOfferingFilterAttributeForName(jsonValue.GetString("name"));
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("values"))
{
Array<JsonView> valuesJsonList = jsonValue.GetArray("values");
for(unsigned valuesIndex = 0; valuesIndex < valuesJsonList.GetLength(); ++valuesIndex)
{
m_values.push_back(valuesJsonList[valuesIndex].AsString());
}
m_valuesHasBeenSet = true;
}
return *this;
}
JsonValue SavingsPlanOfferingFilterElement::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("name", SavingsPlanOfferingFilterAttributeMapper::GetNameForSavingsPlanOfferingFilterAttribute(m_name));
}
if(m_valuesHasBeenSet)
{
Array<JsonValue> valuesJsonList(m_values.size());
for(unsigned valuesIndex = 0; valuesIndex < valuesJsonList.GetLength(); ++valuesIndex)
{
valuesJsonList[valuesIndex].AsString(m_values[valuesIndex]);
}
payload.WithArray("values", std::move(valuesJsonList));
}
return payload;
}
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,75 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/SavingsPlanOfferingProperty.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SavingsPlans
{
namespace Model
{
SavingsPlanOfferingProperty::SavingsPlanOfferingProperty() :
m_name(SavingsPlanOfferingPropertyKey::NOT_SET),
m_nameHasBeenSet(false),
m_valueHasBeenSet(false)
{
}
SavingsPlanOfferingProperty::SavingsPlanOfferingProperty(JsonView jsonValue) :
m_name(SavingsPlanOfferingPropertyKey::NOT_SET),
m_nameHasBeenSet(false),
m_valueHasBeenSet(false)
{
*this = jsonValue;
}
SavingsPlanOfferingProperty& SavingsPlanOfferingProperty::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("name"))
{
m_name = SavingsPlanOfferingPropertyKeyMapper::GetSavingsPlanOfferingPropertyKeyForName(jsonValue.GetString("name"));
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("value"))
{
m_value = jsonValue.GetString("value");
m_valueHasBeenSet = true;
}
return *this;
}
JsonValue SavingsPlanOfferingProperty::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("name", SavingsPlanOfferingPropertyKeyMapper::GetNameForSavingsPlanOfferingPropertyKey(m_name));
}
if(m_valueHasBeenSet)
{
payload.WithString("value", m_value);
}
return payload;
}
} // namespace Model
} // namespace SavingsPlans
} // 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/savingsplans/model/SavingsPlanOfferingPropertyKey.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 SavingsPlans
{
namespace Model
{
namespace SavingsPlanOfferingPropertyKeyMapper
{
static const int region_HASH = HashingUtils::HashString("region");
static const int instanceFamily_HASH = HashingUtils::HashString("instanceFamily");
SavingsPlanOfferingPropertyKey GetSavingsPlanOfferingPropertyKeyForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == region_HASH)
{
return SavingsPlanOfferingPropertyKey::region;
}
else if (hashCode == instanceFamily_HASH)
{
return SavingsPlanOfferingPropertyKey::instanceFamily;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<SavingsPlanOfferingPropertyKey>(hashCode);
}
return SavingsPlanOfferingPropertyKey::NOT_SET;
}
Aws::String GetNameForSavingsPlanOfferingPropertyKey(SavingsPlanOfferingPropertyKey enumValue)
{
switch(enumValue)
{
case SavingsPlanOfferingPropertyKey::region:
return "region";
case SavingsPlanOfferingPropertyKey::instanceFamily:
return "instanceFamily";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace SavingsPlanOfferingPropertyKeyMapper
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,175 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/SavingsPlanOfferingRate.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SavingsPlans
{
namespace Model
{
SavingsPlanOfferingRate::SavingsPlanOfferingRate() :
m_savingsPlanOfferingHasBeenSet(false),
m_rateHasBeenSet(false),
m_unit(SavingsPlanRateUnit::NOT_SET),
m_unitHasBeenSet(false),
m_productType(SavingsPlanProductType::NOT_SET),
m_productTypeHasBeenSet(false),
m_serviceCode(SavingsPlanRateServiceCode::NOT_SET),
m_serviceCodeHasBeenSet(false),
m_usageTypeHasBeenSet(false),
m_operationHasBeenSet(false),
m_propertiesHasBeenSet(false)
{
}
SavingsPlanOfferingRate::SavingsPlanOfferingRate(JsonView jsonValue) :
m_savingsPlanOfferingHasBeenSet(false),
m_rateHasBeenSet(false),
m_unit(SavingsPlanRateUnit::NOT_SET),
m_unitHasBeenSet(false),
m_productType(SavingsPlanProductType::NOT_SET),
m_productTypeHasBeenSet(false),
m_serviceCode(SavingsPlanRateServiceCode::NOT_SET),
m_serviceCodeHasBeenSet(false),
m_usageTypeHasBeenSet(false),
m_operationHasBeenSet(false),
m_propertiesHasBeenSet(false)
{
*this = jsonValue;
}
SavingsPlanOfferingRate& SavingsPlanOfferingRate::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("savingsPlanOffering"))
{
m_savingsPlanOffering = jsonValue.GetObject("savingsPlanOffering");
m_savingsPlanOfferingHasBeenSet = true;
}
if(jsonValue.ValueExists("rate"))
{
m_rate = jsonValue.GetString("rate");
m_rateHasBeenSet = true;
}
if(jsonValue.ValueExists("unit"))
{
m_unit = SavingsPlanRateUnitMapper::GetSavingsPlanRateUnitForName(jsonValue.GetString("unit"));
m_unitHasBeenSet = true;
}
if(jsonValue.ValueExists("productType"))
{
m_productType = SavingsPlanProductTypeMapper::GetSavingsPlanProductTypeForName(jsonValue.GetString("productType"));
m_productTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("serviceCode"))
{
m_serviceCode = SavingsPlanRateServiceCodeMapper::GetSavingsPlanRateServiceCodeForName(jsonValue.GetString("serviceCode"));
m_serviceCodeHasBeenSet = true;
}
if(jsonValue.ValueExists("usageType"))
{
m_usageType = jsonValue.GetString("usageType");
m_usageTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("operation"))
{
m_operation = jsonValue.GetString("operation");
m_operationHasBeenSet = true;
}
if(jsonValue.ValueExists("properties"))
{
Array<JsonView> propertiesJsonList = jsonValue.GetArray("properties");
for(unsigned propertiesIndex = 0; propertiesIndex < propertiesJsonList.GetLength(); ++propertiesIndex)
{
m_properties.push_back(propertiesJsonList[propertiesIndex].AsObject());
}
m_propertiesHasBeenSet = true;
}
return *this;
}
JsonValue SavingsPlanOfferingRate::Jsonize() const
{
JsonValue payload;
if(m_savingsPlanOfferingHasBeenSet)
{
payload.WithObject("savingsPlanOffering", m_savingsPlanOffering.Jsonize());
}
if(m_rateHasBeenSet)
{
payload.WithString("rate", m_rate);
}
if(m_unitHasBeenSet)
{
payload.WithString("unit", SavingsPlanRateUnitMapper::GetNameForSavingsPlanRateUnit(m_unit));
}
if(m_productTypeHasBeenSet)
{
payload.WithString("productType", SavingsPlanProductTypeMapper::GetNameForSavingsPlanProductType(m_productType));
}
if(m_serviceCodeHasBeenSet)
{
payload.WithString("serviceCode", SavingsPlanRateServiceCodeMapper::GetNameForSavingsPlanRateServiceCode(m_serviceCode));
}
if(m_usageTypeHasBeenSet)
{
payload.WithString("usageType", m_usageType);
}
if(m_operationHasBeenSet)
{
payload.WithString("operation", m_operation);
}
if(m_propertiesHasBeenSet)
{
Array<JsonValue> propertiesJsonList(m_properties.size());
for(unsigned propertiesIndex = 0; propertiesIndex < propertiesJsonList.GetLength(); ++propertiesIndex)
{
propertiesJsonList[propertiesIndex].AsObject(m_properties[propertiesIndex].Jsonize());
}
payload.WithArray("properties", std::move(propertiesJsonList));
}
return payload;
}
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,83 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/SavingsPlanOfferingRateFilterElement.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SavingsPlans
{
namespace Model
{
SavingsPlanOfferingRateFilterElement::SavingsPlanOfferingRateFilterElement() :
m_name(SavingsPlanRateFilterAttribute::NOT_SET),
m_nameHasBeenSet(false),
m_valuesHasBeenSet(false)
{
}
SavingsPlanOfferingRateFilterElement::SavingsPlanOfferingRateFilterElement(JsonView jsonValue) :
m_name(SavingsPlanRateFilterAttribute::NOT_SET),
m_nameHasBeenSet(false),
m_valuesHasBeenSet(false)
{
*this = jsonValue;
}
SavingsPlanOfferingRateFilterElement& SavingsPlanOfferingRateFilterElement::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("name"))
{
m_name = SavingsPlanRateFilterAttributeMapper::GetSavingsPlanRateFilterAttributeForName(jsonValue.GetString("name"));
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("values"))
{
Array<JsonView> valuesJsonList = jsonValue.GetArray("values");
for(unsigned valuesIndex = 0; valuesIndex < valuesJsonList.GetLength(); ++valuesIndex)
{
m_values.push_back(valuesJsonList[valuesIndex].AsString());
}
m_valuesHasBeenSet = true;
}
return *this;
}
JsonValue SavingsPlanOfferingRateFilterElement::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("name", SavingsPlanRateFilterAttributeMapper::GetNameForSavingsPlanRateFilterAttribute(m_name));
}
if(m_valuesHasBeenSet)
{
Array<JsonValue> valuesJsonList(m_values.size());
for(unsigned valuesIndex = 0; valuesIndex < valuesJsonList.GetLength(); ++valuesIndex)
{
valuesJsonList[valuesIndex].AsString(m_values[valuesIndex]);
}
payload.WithArray("values", std::move(valuesJsonList));
}
return payload;
}
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,74 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/SavingsPlanOfferingRateProperty.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SavingsPlans
{
namespace Model
{
SavingsPlanOfferingRateProperty::SavingsPlanOfferingRateProperty() :
m_nameHasBeenSet(false),
m_valueHasBeenSet(false)
{
}
SavingsPlanOfferingRateProperty::SavingsPlanOfferingRateProperty(JsonView jsonValue) :
m_nameHasBeenSet(false),
m_valueHasBeenSet(false)
{
*this = jsonValue;
}
SavingsPlanOfferingRateProperty& SavingsPlanOfferingRateProperty::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("name"))
{
m_name = jsonValue.GetString("name");
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("value"))
{
m_value = jsonValue.GetString("value");
m_valueHasBeenSet = true;
}
return *this;
}
JsonValue SavingsPlanOfferingRateProperty::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("name", m_name);
}
if(m_valueHasBeenSet)
{
payload.WithString("value", m_value);
}
return payload;
}
} // namespace Model
} // namespace SavingsPlans
} // 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/savingsplans/model/SavingsPlanPaymentOption.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 SavingsPlans
{
namespace Model
{
namespace SavingsPlanPaymentOptionMapper
{
static const int All_Upfront_HASH = HashingUtils::HashString("All Upfront");
static const int Partial_Upfront_HASH = HashingUtils::HashString("Partial Upfront");
static const int No_Upfront_HASH = HashingUtils::HashString("No Upfront");
SavingsPlanPaymentOption GetSavingsPlanPaymentOptionForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == All_Upfront_HASH)
{
return SavingsPlanPaymentOption::All_Upfront;
}
else if (hashCode == Partial_Upfront_HASH)
{
return SavingsPlanPaymentOption::Partial_Upfront;
}
else if (hashCode == No_Upfront_HASH)
{
return SavingsPlanPaymentOption::No_Upfront;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<SavingsPlanPaymentOption>(hashCode);
}
return SavingsPlanPaymentOption::NOT_SET;
}
Aws::String GetNameForSavingsPlanPaymentOption(SavingsPlanPaymentOption enumValue)
{
switch(enumValue)
{
case SavingsPlanPaymentOption::All_Upfront:
return "All Upfront";
case SavingsPlanPaymentOption::Partial_Upfront:
return "Partial Upfront";
case SavingsPlanPaymentOption::No_Upfront:
return "No Upfront";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace SavingsPlanPaymentOptionMapper
} // namespace Model
} // namespace SavingsPlans
} // 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/savingsplans/model/SavingsPlanProductType.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 SavingsPlans
{
namespace Model
{
namespace SavingsPlanProductTypeMapper
{
static const int EC2_HASH = HashingUtils::HashString("EC2");
static const int Fargate_HASH = HashingUtils::HashString("Fargate");
static const int Lambda_HASH = HashingUtils::HashString("Lambda");
SavingsPlanProductType GetSavingsPlanProductTypeForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == EC2_HASH)
{
return SavingsPlanProductType::EC2;
}
else if (hashCode == Fargate_HASH)
{
return SavingsPlanProductType::Fargate;
}
else if (hashCode == Lambda_HASH)
{
return SavingsPlanProductType::Lambda;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<SavingsPlanProductType>(hashCode);
}
return SavingsPlanProductType::NOT_SET;
}
Aws::String GetNameForSavingsPlanProductType(SavingsPlanProductType enumValue)
{
switch(enumValue)
{
case SavingsPlanProductType::EC2:
return "EC2";
case SavingsPlanProductType::Fargate:
return "Fargate";
case SavingsPlanProductType::Lambda:
return "Lambda";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace SavingsPlanProductTypeMapper
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,176 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/SavingsPlanRate.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SavingsPlans
{
namespace Model
{
SavingsPlanRate::SavingsPlanRate() :
m_rateHasBeenSet(false),
m_currency(CurrencyCode::NOT_SET),
m_currencyHasBeenSet(false),
m_unit(SavingsPlanRateUnit::NOT_SET),
m_unitHasBeenSet(false),
m_productType(SavingsPlanProductType::NOT_SET),
m_productTypeHasBeenSet(false),
m_serviceCode(SavingsPlanRateServiceCode::NOT_SET),
m_serviceCodeHasBeenSet(false),
m_usageTypeHasBeenSet(false),
m_operationHasBeenSet(false),
m_propertiesHasBeenSet(false)
{
}
SavingsPlanRate::SavingsPlanRate(JsonView jsonValue) :
m_rateHasBeenSet(false),
m_currency(CurrencyCode::NOT_SET),
m_currencyHasBeenSet(false),
m_unit(SavingsPlanRateUnit::NOT_SET),
m_unitHasBeenSet(false),
m_productType(SavingsPlanProductType::NOT_SET),
m_productTypeHasBeenSet(false),
m_serviceCode(SavingsPlanRateServiceCode::NOT_SET),
m_serviceCodeHasBeenSet(false),
m_usageTypeHasBeenSet(false),
m_operationHasBeenSet(false),
m_propertiesHasBeenSet(false)
{
*this = jsonValue;
}
SavingsPlanRate& SavingsPlanRate::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("rate"))
{
m_rate = jsonValue.GetString("rate");
m_rateHasBeenSet = true;
}
if(jsonValue.ValueExists("currency"))
{
m_currency = CurrencyCodeMapper::GetCurrencyCodeForName(jsonValue.GetString("currency"));
m_currencyHasBeenSet = true;
}
if(jsonValue.ValueExists("unit"))
{
m_unit = SavingsPlanRateUnitMapper::GetSavingsPlanRateUnitForName(jsonValue.GetString("unit"));
m_unitHasBeenSet = true;
}
if(jsonValue.ValueExists("productType"))
{
m_productType = SavingsPlanProductTypeMapper::GetSavingsPlanProductTypeForName(jsonValue.GetString("productType"));
m_productTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("serviceCode"))
{
m_serviceCode = SavingsPlanRateServiceCodeMapper::GetSavingsPlanRateServiceCodeForName(jsonValue.GetString("serviceCode"));
m_serviceCodeHasBeenSet = true;
}
if(jsonValue.ValueExists("usageType"))
{
m_usageType = jsonValue.GetString("usageType");
m_usageTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("operation"))
{
m_operation = jsonValue.GetString("operation");
m_operationHasBeenSet = true;
}
if(jsonValue.ValueExists("properties"))
{
Array<JsonView> propertiesJsonList = jsonValue.GetArray("properties");
for(unsigned propertiesIndex = 0; propertiesIndex < propertiesJsonList.GetLength(); ++propertiesIndex)
{
m_properties.push_back(propertiesJsonList[propertiesIndex].AsObject());
}
m_propertiesHasBeenSet = true;
}
return *this;
}
JsonValue SavingsPlanRate::Jsonize() const
{
JsonValue payload;
if(m_rateHasBeenSet)
{
payload.WithString("rate", m_rate);
}
if(m_currencyHasBeenSet)
{
payload.WithString("currency", CurrencyCodeMapper::GetNameForCurrencyCode(m_currency));
}
if(m_unitHasBeenSet)
{
payload.WithString("unit", SavingsPlanRateUnitMapper::GetNameForSavingsPlanRateUnit(m_unit));
}
if(m_productTypeHasBeenSet)
{
payload.WithString("productType", SavingsPlanProductTypeMapper::GetNameForSavingsPlanProductType(m_productType));
}
if(m_serviceCodeHasBeenSet)
{
payload.WithString("serviceCode", SavingsPlanRateServiceCodeMapper::GetNameForSavingsPlanRateServiceCode(m_serviceCode));
}
if(m_usageTypeHasBeenSet)
{
payload.WithString("usageType", m_usageType);
}
if(m_operationHasBeenSet)
{
payload.WithString("operation", m_operation);
}
if(m_propertiesHasBeenSet)
{
Array<JsonValue> propertiesJsonList(m_properties.size());
for(unsigned propertiesIndex = 0; propertiesIndex < propertiesJsonList.GetLength(); ++propertiesIndex)
{
propertiesJsonList[propertiesIndex].AsObject(m_properties[propertiesIndex].Jsonize());
}
payload.WithArray("properties", std::move(propertiesJsonList));
}
return payload;
}
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,83 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/SavingsPlanRateFilter.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SavingsPlans
{
namespace Model
{
SavingsPlanRateFilter::SavingsPlanRateFilter() :
m_name(SavingsPlanRateFilterName::NOT_SET),
m_nameHasBeenSet(false),
m_valuesHasBeenSet(false)
{
}
SavingsPlanRateFilter::SavingsPlanRateFilter(JsonView jsonValue) :
m_name(SavingsPlanRateFilterName::NOT_SET),
m_nameHasBeenSet(false),
m_valuesHasBeenSet(false)
{
*this = jsonValue;
}
SavingsPlanRateFilter& SavingsPlanRateFilter::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("name"))
{
m_name = SavingsPlanRateFilterNameMapper::GetSavingsPlanRateFilterNameForName(jsonValue.GetString("name"));
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("values"))
{
Array<JsonView> valuesJsonList = jsonValue.GetArray("values");
for(unsigned valuesIndex = 0; valuesIndex < valuesJsonList.GetLength(); ++valuesIndex)
{
m_values.push_back(valuesJsonList[valuesIndex].AsString());
}
m_valuesHasBeenSet = true;
}
return *this;
}
JsonValue SavingsPlanRateFilter::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("name", SavingsPlanRateFilterNameMapper::GetNameForSavingsPlanRateFilterName(m_name));
}
if(m_valuesHasBeenSet)
{
Array<JsonValue> valuesJsonList(m_values.size());
for(unsigned valuesIndex = 0; valuesIndex < valuesJsonList.GetLength(); ++valuesIndex)
{
valuesJsonList[valuesIndex].AsString(m_values[valuesIndex]);
}
payload.WithArray("values", std::move(valuesJsonList));
}
return payload;
}
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,98 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/SavingsPlanRateFilterAttribute.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 SavingsPlans
{
namespace Model
{
namespace SavingsPlanRateFilterAttributeMapper
{
static const int region_HASH = HashingUtils::HashString("region");
static const int instanceFamily_HASH = HashingUtils::HashString("instanceFamily");
static const int instanceType_HASH = HashingUtils::HashString("instanceType");
static const int productDescription_HASH = HashingUtils::HashString("productDescription");
static const int tenancy_HASH = HashingUtils::HashString("tenancy");
static const int productId_HASH = HashingUtils::HashString("productId");
SavingsPlanRateFilterAttribute GetSavingsPlanRateFilterAttributeForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == region_HASH)
{
return SavingsPlanRateFilterAttribute::region;
}
else if (hashCode == instanceFamily_HASH)
{
return SavingsPlanRateFilterAttribute::instanceFamily;
}
else if (hashCode == instanceType_HASH)
{
return SavingsPlanRateFilterAttribute::instanceType;
}
else if (hashCode == productDescription_HASH)
{
return SavingsPlanRateFilterAttribute::productDescription;
}
else if (hashCode == tenancy_HASH)
{
return SavingsPlanRateFilterAttribute::tenancy;
}
else if (hashCode == productId_HASH)
{
return SavingsPlanRateFilterAttribute::productId;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<SavingsPlanRateFilterAttribute>(hashCode);
}
return SavingsPlanRateFilterAttribute::NOT_SET;
}
Aws::String GetNameForSavingsPlanRateFilterAttribute(SavingsPlanRateFilterAttribute enumValue)
{
switch(enumValue)
{
case SavingsPlanRateFilterAttribute::region:
return "region";
case SavingsPlanRateFilterAttribute::instanceFamily:
return "instanceFamily";
case SavingsPlanRateFilterAttribute::instanceType:
return "instanceType";
case SavingsPlanRateFilterAttribute::productDescription:
return "productDescription";
case SavingsPlanRateFilterAttribute::tenancy:
return "tenancy";
case SavingsPlanRateFilterAttribute::productId:
return "productId";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace SavingsPlanRateFilterAttributeMapper
} // namespace Model
} // namespace SavingsPlans
} // 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/savingsplans/model/SavingsPlanRateFilterName.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 SavingsPlans
{
namespace Model
{
namespace SavingsPlanRateFilterNameMapper
{
static const int region_HASH = HashingUtils::HashString("region");
static const int instanceType_HASH = HashingUtils::HashString("instanceType");
static const int productDescription_HASH = HashingUtils::HashString("productDescription");
static const int tenancy_HASH = HashingUtils::HashString("tenancy");
static const int productType_HASH = HashingUtils::HashString("productType");
static const int serviceCode_HASH = HashingUtils::HashString("serviceCode");
static const int usageType_HASH = HashingUtils::HashString("usageType");
static const int operation_HASH = HashingUtils::HashString("operation");
SavingsPlanRateFilterName GetSavingsPlanRateFilterNameForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == region_HASH)
{
return SavingsPlanRateFilterName::region;
}
else if (hashCode == instanceType_HASH)
{
return SavingsPlanRateFilterName::instanceType;
}
else if (hashCode == productDescription_HASH)
{
return SavingsPlanRateFilterName::productDescription;
}
else if (hashCode == tenancy_HASH)
{
return SavingsPlanRateFilterName::tenancy;
}
else if (hashCode == productType_HASH)
{
return SavingsPlanRateFilterName::productType;
}
else if (hashCode == serviceCode_HASH)
{
return SavingsPlanRateFilterName::serviceCode;
}
else if (hashCode == usageType_HASH)
{
return SavingsPlanRateFilterName::usageType;
}
else if (hashCode == operation_HASH)
{
return SavingsPlanRateFilterName::operation;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<SavingsPlanRateFilterName>(hashCode);
}
return SavingsPlanRateFilterName::NOT_SET;
}
Aws::String GetNameForSavingsPlanRateFilterName(SavingsPlanRateFilterName enumValue)
{
switch(enumValue)
{
case SavingsPlanRateFilterName::region:
return "region";
case SavingsPlanRateFilterName::instanceType:
return "instanceType";
case SavingsPlanRateFilterName::productDescription:
return "productDescription";
case SavingsPlanRateFilterName::tenancy:
return "tenancy";
case SavingsPlanRateFilterName::productType:
return "productType";
case SavingsPlanRateFilterName::serviceCode:
return "serviceCode";
case SavingsPlanRateFilterName::usageType:
return "usageType";
case SavingsPlanRateFilterName::operation:
return "operation";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace SavingsPlanRateFilterNameMapper
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,75 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/SavingsPlanRateProperty.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SavingsPlans
{
namespace Model
{
SavingsPlanRateProperty::SavingsPlanRateProperty() :
m_name(SavingsPlanRatePropertyKey::NOT_SET),
m_nameHasBeenSet(false),
m_valueHasBeenSet(false)
{
}
SavingsPlanRateProperty::SavingsPlanRateProperty(JsonView jsonValue) :
m_name(SavingsPlanRatePropertyKey::NOT_SET),
m_nameHasBeenSet(false),
m_valueHasBeenSet(false)
{
*this = jsonValue;
}
SavingsPlanRateProperty& SavingsPlanRateProperty::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("name"))
{
m_name = SavingsPlanRatePropertyKeyMapper::GetSavingsPlanRatePropertyKeyForName(jsonValue.GetString("name"));
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("value"))
{
m_value = jsonValue.GetString("value");
m_valueHasBeenSet = true;
}
return *this;
}
JsonValue SavingsPlanRateProperty::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("name", SavingsPlanRatePropertyKeyMapper::GetNameForSavingsPlanRatePropertyKey(m_name));
}
if(m_valueHasBeenSet)
{
payload.WithString("value", m_value);
}
return payload;
}
} // namespace Model
} // namespace SavingsPlans
} // 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/savingsplans/model/SavingsPlanRatePropertyKey.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 SavingsPlans
{
namespace Model
{
namespace SavingsPlanRatePropertyKeyMapper
{
static const int region_HASH = HashingUtils::HashString("region");
static const int instanceType_HASH = HashingUtils::HashString("instanceType");
static const int instanceFamily_HASH = HashingUtils::HashString("instanceFamily");
static const int productDescription_HASH = HashingUtils::HashString("productDescription");
static const int tenancy_HASH = HashingUtils::HashString("tenancy");
SavingsPlanRatePropertyKey GetSavingsPlanRatePropertyKeyForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == region_HASH)
{
return SavingsPlanRatePropertyKey::region;
}
else if (hashCode == instanceType_HASH)
{
return SavingsPlanRatePropertyKey::instanceType;
}
else if (hashCode == instanceFamily_HASH)
{
return SavingsPlanRatePropertyKey::instanceFamily;
}
else if (hashCode == productDescription_HASH)
{
return SavingsPlanRatePropertyKey::productDescription;
}
else if (hashCode == tenancy_HASH)
{
return SavingsPlanRatePropertyKey::tenancy;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<SavingsPlanRatePropertyKey>(hashCode);
}
return SavingsPlanRatePropertyKey::NOT_SET;
}
Aws::String GetNameForSavingsPlanRatePropertyKey(SavingsPlanRatePropertyKey enumValue)
{
switch(enumValue)
{
case SavingsPlanRatePropertyKey::region:
return "region";
case SavingsPlanRatePropertyKey::instanceType:
return "instanceType";
case SavingsPlanRatePropertyKey::instanceFamily:
return "instanceFamily";
case SavingsPlanRatePropertyKey::productDescription:
return "productDescription";
case SavingsPlanRatePropertyKey::tenancy:
return "tenancy";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace SavingsPlanRatePropertyKeyMapper
} // namespace Model
} // namespace SavingsPlans
} // 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/savingsplans/model/SavingsPlanRateServiceCode.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 SavingsPlans
{
namespace Model
{
namespace SavingsPlanRateServiceCodeMapper
{
static const int AmazonEC2_HASH = HashingUtils::HashString("AmazonEC2");
static const int AmazonECS_HASH = HashingUtils::HashString("AmazonECS");
static const int AmazonEKS_HASH = HashingUtils::HashString("AmazonEKS");
static const int AWSLambda_HASH = HashingUtils::HashString("AWSLambda");
SavingsPlanRateServiceCode GetSavingsPlanRateServiceCodeForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == AmazonEC2_HASH)
{
return SavingsPlanRateServiceCode::AmazonEC2;
}
else if (hashCode == AmazonECS_HASH)
{
return SavingsPlanRateServiceCode::AmazonECS;
}
else if (hashCode == AmazonEKS_HASH)
{
return SavingsPlanRateServiceCode::AmazonEKS;
}
else if (hashCode == AWSLambda_HASH)
{
return SavingsPlanRateServiceCode::AWSLambda;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<SavingsPlanRateServiceCode>(hashCode);
}
return SavingsPlanRateServiceCode::NOT_SET;
}
Aws::String GetNameForSavingsPlanRateServiceCode(SavingsPlanRateServiceCode enumValue)
{
switch(enumValue)
{
case SavingsPlanRateServiceCode::AmazonEC2:
return "AmazonEC2";
case SavingsPlanRateServiceCode::AmazonECS:
return "AmazonECS";
case SavingsPlanRateServiceCode::AmazonEKS:
return "AmazonEKS";
case SavingsPlanRateServiceCode::AWSLambda:
return "AWSLambda";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace SavingsPlanRateServiceCodeMapper
} // namespace Model
} // namespace SavingsPlans
} // 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/savingsplans/model/SavingsPlanRateUnit.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 SavingsPlans
{
namespace Model
{
namespace SavingsPlanRateUnitMapper
{
static const int Hrs_HASH = HashingUtils::HashString("Hrs");
static const int Lambda_GB_Second_HASH = HashingUtils::HashString("Lambda-GB-Second");
static const int Request_HASH = HashingUtils::HashString("Request");
SavingsPlanRateUnit GetSavingsPlanRateUnitForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == Hrs_HASH)
{
return SavingsPlanRateUnit::Hrs;
}
else if (hashCode == Lambda_GB_Second_HASH)
{
return SavingsPlanRateUnit::Lambda_GB_Second;
}
else if (hashCode == Request_HASH)
{
return SavingsPlanRateUnit::Request;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<SavingsPlanRateUnit>(hashCode);
}
return SavingsPlanRateUnit::NOT_SET;
}
Aws::String GetNameForSavingsPlanRateUnit(SavingsPlanRateUnit enumValue)
{
switch(enumValue)
{
case SavingsPlanRateUnit::Hrs:
return "Hrs";
case SavingsPlanRateUnit::Lambda_GB_Second:
return "Lambda-GB-Second";
case SavingsPlanRateUnit::Request:
return "Request";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace SavingsPlanRateUnitMapper
} // namespace Model
} // namespace SavingsPlans
} // 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/savingsplans/model/SavingsPlanState.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 SavingsPlans
{
namespace Model
{
namespace SavingsPlanStateMapper
{
static const int payment_pending_HASH = HashingUtils::HashString("payment-pending");
static const int payment_failed_HASH = HashingUtils::HashString("payment-failed");
static const int active_HASH = HashingUtils::HashString("active");
static const int retired_HASH = HashingUtils::HashString("retired");
SavingsPlanState GetSavingsPlanStateForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == payment_pending_HASH)
{
return SavingsPlanState::payment_pending;
}
else if (hashCode == payment_failed_HASH)
{
return SavingsPlanState::payment_failed;
}
else if (hashCode == active_HASH)
{
return SavingsPlanState::active;
}
else if (hashCode == retired_HASH)
{
return SavingsPlanState::retired;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<SavingsPlanState>(hashCode);
}
return SavingsPlanState::NOT_SET;
}
Aws::String GetNameForSavingsPlanState(SavingsPlanState enumValue)
{
switch(enumValue)
{
case SavingsPlanState::payment_pending:
return "payment-pending";
case SavingsPlanState::payment_failed:
return "payment-failed";
case SavingsPlanState::active:
return "active";
case SavingsPlanState::retired:
return "retired";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace SavingsPlanStateMapper
} // namespace Model
} // namespace SavingsPlans
} // 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/savingsplans/model/SavingsPlanType.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 SavingsPlans
{
namespace Model
{
namespace SavingsPlanTypeMapper
{
static const int Compute_HASH = HashingUtils::HashString("Compute");
static const int EC2Instance_HASH = HashingUtils::HashString("EC2Instance");
SavingsPlanType GetSavingsPlanTypeForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == Compute_HASH)
{
return SavingsPlanType::Compute;
}
else if (hashCode == EC2Instance_HASH)
{
return SavingsPlanType::EC2Instance;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<SavingsPlanType>(hashCode);
}
return SavingsPlanType::NOT_SET;
}
Aws::String GetNameForSavingsPlanType(SavingsPlanType enumValue)
{
switch(enumValue)
{
case SavingsPlanType::Compute:
return "Compute";
case SavingsPlanType::EC2Instance:
return "EC2Instance";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace SavingsPlanTypeMapper
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,119 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/SavingsPlansFilterName.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 SavingsPlans
{
namespace Model
{
namespace SavingsPlansFilterNameMapper
{
static const int region_HASH = HashingUtils::HashString("region");
static const int ec2_instance_family_HASH = HashingUtils::HashString("ec2-instance-family");
static const int commitment_HASH = HashingUtils::HashString("commitment");
static const int upfront_HASH = HashingUtils::HashString("upfront");
static const int term_HASH = HashingUtils::HashString("term");
static const int savings_plan_type_HASH = HashingUtils::HashString("savings-plan-type");
static const int payment_option_HASH = HashingUtils::HashString("payment-option");
static const int start_HASH = HashingUtils::HashString("start");
static const int end_HASH = HashingUtils::HashString("end");
SavingsPlansFilterName GetSavingsPlansFilterNameForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == region_HASH)
{
return SavingsPlansFilterName::region;
}
else if (hashCode == ec2_instance_family_HASH)
{
return SavingsPlansFilterName::ec2_instance_family;
}
else if (hashCode == commitment_HASH)
{
return SavingsPlansFilterName::commitment;
}
else if (hashCode == upfront_HASH)
{
return SavingsPlansFilterName::upfront;
}
else if (hashCode == term_HASH)
{
return SavingsPlansFilterName::term;
}
else if (hashCode == savings_plan_type_HASH)
{
return SavingsPlansFilterName::savings_plan_type;
}
else if (hashCode == payment_option_HASH)
{
return SavingsPlansFilterName::payment_option;
}
else if (hashCode == start_HASH)
{
return SavingsPlansFilterName::start;
}
else if (hashCode == end_HASH)
{
return SavingsPlansFilterName::end;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<SavingsPlansFilterName>(hashCode);
}
return SavingsPlansFilterName::NOT_SET;
}
Aws::String GetNameForSavingsPlansFilterName(SavingsPlansFilterName enumValue)
{
switch(enumValue)
{
case SavingsPlansFilterName::region:
return "region";
case SavingsPlansFilterName::ec2_instance_family:
return "ec2-instance-family";
case SavingsPlansFilterName::commitment:
return "commitment";
case SavingsPlansFilterName::upfront:
return "upfront";
case SavingsPlansFilterName::term:
return "term";
case SavingsPlansFilterName::savings_plan_type:
return "savings-plan-type";
case SavingsPlansFilterName::payment_option:
return "payment-option";
case SavingsPlansFilterName::start:
return "start";
case SavingsPlansFilterName::end:
return "end";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace SavingsPlansFilterNameMapper
} // namespace Model
} // namespace SavingsPlans
} // namespace Aws

View File

@@ -0,0 +1,47 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/TagResourceRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
TagResourceRequest::TagResourceRequest() :
m_resourceArnHasBeenSet(false),
m_tagsHasBeenSet(false)
{
}
Aws::String TagResourceRequest::SerializePayload() const
{
JsonValue payload;
if(m_resourceArnHasBeenSet)
{
payload.WithString("resourceArn", m_resourceArn);
}
if(m_tagsHasBeenSet)
{
JsonValue tagsJsonMap;
for(auto& tagsItem : m_tags)
{
tagsJsonMap.WithString(tagsItem.first, tagsItem.second);
}
payload.WithObject("tags", std::move(tagsJsonMap));
}
return payload.View().WriteReadable();
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/TagResourceResult.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::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
TagResourceResult::TagResourceResult()
{
}
TagResourceResult::TagResourceResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
TagResourceResult& TagResourceResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}

View File

@@ -0,0 +1,47 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/UntagResourceRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
UntagResourceRequest::UntagResourceRequest() :
m_resourceArnHasBeenSet(false),
m_tagKeysHasBeenSet(false)
{
}
Aws::String UntagResourceRequest::SerializePayload() const
{
JsonValue payload;
if(m_resourceArnHasBeenSet)
{
payload.WithString("resourceArn", m_resourceArn);
}
if(m_tagKeysHasBeenSet)
{
Array<JsonValue> tagKeysJsonList(m_tagKeys.size());
for(unsigned tagKeysIndex = 0; tagKeysIndex < tagKeysJsonList.GetLength(); ++tagKeysIndex)
{
tagKeysJsonList[tagKeysIndex].AsString(m_tagKeys[tagKeysIndex]);
}
payload.WithArray("tagKeys", std::move(tagKeysJsonList));
}
return payload.View().WriteReadable();
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/savingsplans/model/UntagResourceResult.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::SavingsPlans::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
UntagResourceResult::UntagResourceResult()
{
}
UntagResourceResult::UntagResourceResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
UntagResourceResult& UntagResourceResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
return *this;
}