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,76 @@
add_project(aws-cpp-sdk-pricing "C++ SDK for the AWS pricing service" aws-cpp-sdk-core)
file(GLOB AWS_PRICING_HEADERS
"include/aws/pricing/*.h"
)
file(GLOB AWS_PRICING_MODEL_HEADERS
"include/aws/pricing/model/*.h"
)
file(GLOB AWS_PRICING_SOURCE
"source/*.cpp"
)
file(GLOB AWS_PRICING_MODEL_SOURCE
"source/model/*.cpp"
)
file(GLOB PRICING_UNIFIED_HEADERS
${AWS_PRICING_HEADERS}
${AWS_PRICING_MODEL_HEADERS}
)
file(GLOB PRICING_UNITY_SRC
${AWS_PRICING_SOURCE}
${AWS_PRICING_MODEL_SOURCE}
)
if(ENABLE_UNITY_BUILD)
enable_unity_build("PRICING" PRICING_UNITY_SRC)
endif()
file(GLOB PRICING_SRC
${PRICING_UNIFIED_HEADERS}
${PRICING_UNITY_SRC}
)
if(WIN32)
#if we are compiling for visual studio, create a sane directory tree.
if(MSVC)
source_group("Header Files\\aws\\pricing" FILES ${AWS_PRICING_HEADERS})
source_group("Header Files\\aws\\pricing\\model" FILES ${AWS_PRICING_MODEL_HEADERS})
source_group("Source Files" FILES ${AWS_PRICING_SOURCE})
source_group("Source Files\\model" FILES ${AWS_PRICING_MODEL_SOURCE})
endif(MSVC)
endif()
set(PRICING_INCLUDES
"${CMAKE_CURRENT_SOURCE_DIR}/include/"
)
add_library(${PROJECT_NAME} ${PRICING_SRC})
add_library(AWS::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
set_compiler_flags(${PROJECT_NAME})
set_compiler_warnings(${PROJECT_NAME})
if(USE_WINDOWS_DLL_SEMANTICS AND BUILD_SHARED_LIBS)
target_compile_definitions(${PROJECT_NAME} PRIVATE "AWS_PRICING_EXPORTS")
endif()
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(${PROJECT_NAME} PRIVATE ${PLATFORM_DEP_LIBS} ${PROJECT_LIBS})
setup_install()
install (FILES ${AWS_PRICING_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/pricing)
install (FILES ${AWS_PRICING_MODEL_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/pricing/model)
do_packaging()

View File

@@ -0,0 +1,251 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pricing/Pricing_EXPORTS.h>
#include <aws/pricing/PricingErrors.h>
#include <aws/core/client/AWSError.h>
#include <aws/core/client/ClientConfiguration.h>
#include <aws/core/client/AWSClient.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/pricing/model/DescribeServicesResult.h>
#include <aws/pricing/model/GetAttributeValuesResult.h>
#include <aws/pricing/model/GetProductsResult.h>
#include <aws/core/client/AsyncCallerContext.h>
#include <aws/core/http/HttpTypes.h>
#include <future>
#include <functional>
namespace Aws
{
namespace Http
{
class HttpClient;
class HttpClientFactory;
} // namespace Http
namespace Utils
{
template< typename R, typename E> class Outcome;
namespace Threading
{
class Executor;
} // namespace Threading
} // namespace Utils
namespace Auth
{
class AWSCredentials;
class AWSCredentialsProvider;
} // namespace Auth
namespace Client
{
class RetryStrategy;
} // namespace Client
namespace Pricing
{
namespace Model
{
class DescribeServicesRequest;
class GetAttributeValuesRequest;
class GetProductsRequest;
typedef Aws::Utils::Outcome<DescribeServicesResult, PricingError> DescribeServicesOutcome;
typedef Aws::Utils::Outcome<GetAttributeValuesResult, PricingError> GetAttributeValuesOutcome;
typedef Aws::Utils::Outcome<GetProductsResult, PricingError> GetProductsOutcome;
typedef std::future<DescribeServicesOutcome> DescribeServicesOutcomeCallable;
typedef std::future<GetAttributeValuesOutcome> GetAttributeValuesOutcomeCallable;
typedef std::future<GetProductsOutcome> GetProductsOutcomeCallable;
} // namespace Model
class PricingClient;
typedef std::function<void(const PricingClient*, const Model::DescribeServicesRequest&, const Model::DescribeServicesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeServicesResponseReceivedHandler;
typedef std::function<void(const PricingClient*, const Model::GetAttributeValuesRequest&, const Model::GetAttributeValuesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetAttributeValuesResponseReceivedHandler;
typedef std::function<void(const PricingClient*, const Model::GetProductsRequest&, const Model::GetProductsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetProductsResponseReceivedHandler;
/**
* <p>AWS Price List Service API (AWS Price List Service) is a centralized and
* convenient way to programmatically query Amazon Web Services for services,
* products, and pricing information. The AWS Price List Service uses standardized
* product attributes such as <code>Location</code>, <code>Storage Class</code>,
* and <code>Operating System</code>, and provides prices at the SKU level. You can
* use the AWS Price List Service to build cost control and scenario planning
* tools, reconcile billing data, forecast future spend for budgeting purposes, and
* provide cost benefit analysis that compare your internal workloads with AWS.</p>
* <p>Use <code>GetServices</code> without a service code to retrieve the service
* codes for all AWS services, then <code>GetServices</code> with a service code to
* retreive the attribute names for that service. After you have the service code
* and attribute names, you can use <code>GetAttributeValues</code> to see what
* values are available for an attribute. With the service code and an attribute
* name and value, you can use <code>GetProducts</code> to find specific products
* that you're interested in, such as an <code>AmazonEC2</code> instance, with a
* <code>Provisioned IOPS</code> <code>volumeType</code>.</p> <p>Service
* Endpoint</p> <p>AWS Price List Service API provides the following two
* endpoints:</p> <ul> <li> <p>https://api.pricing.us-east-1.amazonaws.com</p>
* </li> <li> <p>https://api.pricing.ap-south-1.amazonaws.com</p> </li> </ul>
*/
class AWS_PRICING_API PricingClient : public Aws::Client::AWSJsonClient
{
public:
typedef Aws::Client::AWSJsonClient BASECLASS;
/**
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
PricingClient(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
/**
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
PricingClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
/**
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
* the default http client factory will be used
*/
PricingClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
virtual ~PricingClient();
/**
* <p>Returns the metadata for one service or a list of the metadata for all
* services. Use this without a service code to get the service codes for all
* services. Use it with a service code, such as <code>AmazonEC2</code>, to get
* information specific to that service, such as the attribute names available for
* that service. For example, some of the attribute names available for EC2 are
* <code>volumeType</code>, <code>maxIopsVolume</code>, <code>operation</code>,
* <code>locationType</code>, and
* <code>instanceCapacity10xlarge</code>.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/DescribeServices">AWS
* API Reference</a></p>
*/
virtual Model::DescribeServicesOutcome DescribeServices(const Model::DescribeServicesRequest& request) const;
/**
* <p>Returns the metadata for one service or a list of the metadata for all
* services. Use this without a service code to get the service codes for all
* services. Use it with a service code, such as <code>AmazonEC2</code>, to get
* information specific to that service, such as the attribute names available for
* that service. For example, some of the attribute names available for EC2 are
* <code>volumeType</code>, <code>maxIopsVolume</code>, <code>operation</code>,
* <code>locationType</code>, and
* <code>instanceCapacity10xlarge</code>.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/DescribeServices">AWS
* API Reference</a></p>
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::DescribeServicesOutcomeCallable DescribeServicesCallable(const Model::DescribeServicesRequest& request) const;
/**
* <p>Returns the metadata for one service or a list of the metadata for all
* services. Use this without a service code to get the service codes for all
* services. Use it with a service code, such as <code>AmazonEC2</code>, to get
* information specific to that service, such as the attribute names available for
* that service. For example, some of the attribute names available for EC2 are
* <code>volumeType</code>, <code>maxIopsVolume</code>, <code>operation</code>,
* <code>locationType</code>, and
* <code>instanceCapacity10xlarge</code>.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/DescribeServices">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void DescribeServicesAsync(const Model::DescribeServicesRequest& request, const DescribeServicesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
/**
* <p>Returns a list of attribute values. Attibutes are similar to the details in a
* Price List API offer file. For a list of available attributes, see <a
* href="http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/reading-an-offer.html#pps-defs">Offer
* File Definitions</a> in the <a
* href="http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-what-is.html">AWS
* Billing and Cost Management User Guide</a>.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetAttributeValues">AWS
* API Reference</a></p>
*/
virtual Model::GetAttributeValuesOutcome GetAttributeValues(const Model::GetAttributeValuesRequest& request) const;
/**
* <p>Returns a list of attribute values. Attibutes are similar to the details in a
* Price List API offer file. For a list of available attributes, see <a
* href="http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/reading-an-offer.html#pps-defs">Offer
* File Definitions</a> in the <a
* href="http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-what-is.html">AWS
* Billing and Cost Management User Guide</a>.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetAttributeValues">AWS
* API Reference</a></p>
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::GetAttributeValuesOutcomeCallable GetAttributeValuesCallable(const Model::GetAttributeValuesRequest& request) const;
/**
* <p>Returns a list of attribute values. Attibutes are similar to the details in a
* Price List API offer file. For a list of available attributes, see <a
* href="http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/reading-an-offer.html#pps-defs">Offer
* File Definitions</a> in the <a
* href="http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-what-is.html">AWS
* Billing and Cost Management User Guide</a>.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetAttributeValues">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void GetAttributeValuesAsync(const Model::GetAttributeValuesRequest& request, const GetAttributeValuesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
/**
* <p>Returns a list of all products that match the filter criteria.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetProducts">AWS
* API Reference</a></p>
*/
virtual Model::GetProductsOutcome GetProducts(const Model::GetProductsRequest& request) const;
/**
* <p>Returns a list of all products that match the filter criteria.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetProducts">AWS
* API Reference</a></p>
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::GetProductsOutcomeCallable GetProductsCallable(const Model::GetProductsRequest& request) const;
/**
* <p>Returns a list of all products that match the filter criteria.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetProducts">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void GetProductsAsync(const Model::GetProductsRequest& request, const GetProductsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
void OverrideEndpoint(const Aws::String& endpoint);
private:
void init(const Aws::Client::ClientConfiguration& clientConfiguration);
void DescribeServicesAsyncHelper(const Model::DescribeServicesRequest& request, const DescribeServicesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
void GetAttributeValuesAsyncHelper(const Model::GetAttributeValuesRequest& request, const GetAttributeValuesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
void GetProductsAsyncHelper(const Model::GetProductsRequest& request, const GetProductsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
Aws::String m_uri;
Aws::String m_configScheme;
std::shared_ptr<Aws::Utils::Threading::Executor> m_executor;
};
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,21 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pricing/Pricing_EXPORTS.h>
#include <aws/core/Region.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace Pricing
{
namespace PricingEndpoint
{
AWS_PRICING_API Aws::String ForRegion(const Aws::String& regionName, bool useDualStack = false);
} // namespace PricingEndpoint
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,23 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pricing/Pricing_EXPORTS.h>
#include <aws/core/client/AWSErrorMarshaller.h>
namespace Aws
{
namespace Client
{
class AWS_PRICING_API PricingErrorMarshaller : public Aws::Client::JsonErrorMarshaller
{
public:
Aws::Client::AWSError<Aws::Client::CoreErrors> FindErrorByName(const char* exceptionName) const override;
};
} // namespace Client
} // namespace Aws

View File

@@ -0,0 +1,76 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/core/client/AWSError.h>
#include <aws/core/client/CoreErrors.h>
#include <aws/pricing/Pricing_EXPORTS.h>
namespace Aws
{
namespace Pricing
{
enum class PricingErrors
{
//From Core//
//////////////////////////////////////////////////////////////////////////////////////////
INCOMPLETE_SIGNATURE = 0,
INTERNAL_FAILURE = 1,
INVALID_ACTION = 2,
INVALID_CLIENT_TOKEN_ID = 3,
INVALID_PARAMETER_COMBINATION = 4,
INVALID_QUERY_PARAMETER = 5,
INVALID_PARAMETER_VALUE = 6,
MISSING_ACTION = 7, // SDK should never allow
MISSING_AUTHENTICATION_TOKEN = 8, // SDK should never allow
MISSING_PARAMETER = 9, // SDK should never allow
OPT_IN_REQUIRED = 10,
REQUEST_EXPIRED = 11,
SERVICE_UNAVAILABLE = 12,
THROTTLING = 13,
VALIDATION = 14,
ACCESS_DENIED = 15,
RESOURCE_NOT_FOUND = 16,
UNRECOGNIZED_CLIENT = 17,
MALFORMED_QUERY_STRING = 18,
SLOW_DOWN = 19,
REQUEST_TIME_TOO_SKEWED = 20,
INVALID_SIGNATURE = 21,
SIGNATURE_DOES_NOT_MATCH = 22,
INVALID_ACCESS_KEY_ID = 23,
REQUEST_TIMEOUT = 24,
NETWORK_CONNECTION = 99,
UNKNOWN = 100,
///////////////////////////////////////////////////////////////////////////////////////////
EXPIRED_NEXT_TOKEN= static_cast<int>(Aws::Client::CoreErrors::SERVICE_EXTENSION_START_RANGE) + 1,
INTERNAL_ERROR,
INVALID_NEXT_TOKEN,
INVALID_PARAMETER,
NOT_FOUND
};
class AWS_PRICING_API PricingError : public Aws::Client::AWSError<PricingErrors>
{
public:
PricingError() {}
PricingError(const Aws::Client::AWSError<Aws::Client::CoreErrors>& rhs) : Aws::Client::AWSError<PricingErrors>(rhs) {}
PricingError(Aws::Client::AWSError<Aws::Client::CoreErrors>&& rhs) : Aws::Client::AWSError<PricingErrors>(rhs) {}
PricingError(const Aws::Client::AWSError<PricingErrors>& rhs) : Aws::Client::AWSError<PricingErrors>(rhs) {}
PricingError(Aws::Client::AWSError<PricingErrors>&& rhs) : Aws::Client::AWSError<PricingErrors>(rhs) {}
template <typename T>
T GetModeledError();
};
namespace PricingErrorMapper
{
AWS_PRICING_API Aws::Client::AWSError<Aws::Client::CoreErrors> GetErrorForName(const char* errorName);
}
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,42 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pricing/Pricing_EXPORTS.h>
#include <aws/core/AmazonSerializableWebServiceRequest.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <aws/core/http/HttpRequest.h>
namespace Aws
{
namespace Pricing
{
class AWS_PRICING_API PricingRequest : public Aws::AmazonSerializableWebServiceRequest
{
public:
virtual ~PricingRequest () {}
void AddParametersToRequest(Aws::Http::HttpRequest& httpRequest) const { AWS_UNREFERENCED_PARAM(httpRequest); }
inline Aws::Http::HeaderValueCollection GetHeaders() const override
{
auto headers = GetRequestSpecificHeaders();
if(headers.size() == 0 || (headers.size() > 0 && headers.count(Aws::Http::CONTENT_TYPE_HEADER) == 0))
{
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::CONTENT_TYPE_HEADER, Aws::AMZN_JSON_CONTENT_TYPE_1_1 ));
}
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::API_VERSION_HEADER, "2017-10-15"));
return headers;
}
protected:
virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); }
};
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,29 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#ifdef _MSC_VER
//disable windows complaining about max template size.
#pragma warning (disable : 4503)
#endif // _MSC_VER
#if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32)
#ifdef _MSC_VER
#pragma warning(disable : 4251)
#endif // _MSC_VER
#ifdef USE_IMPORT_EXPORT
#ifdef AWS_PRICING_EXPORTS
#define AWS_PRICING_API __declspec(dllexport)
#else
#define AWS_PRICING_API __declspec(dllimport)
#endif /* AWS_PRICING_EXPORTS */
#else
#define AWS_PRICING_API
#endif // USE_IMPORT_EXPORT
#else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
#define AWS_PRICING_API
#endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)

View File

@@ -0,0 +1,90 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pricing/Pricing_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace Pricing
{
namespace Model
{
/**
* <p>The values of a given attribute, such as <code>Throughput Optimized
* HDD</code> or <code>Provisioned IOPS</code> for the <code>Amazon EC2</code>
* <code>volumeType</code> attribute.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/AttributeValue">AWS
* API Reference</a></p>
*/
class AWS_PRICING_API AttributeValue
{
public:
AttributeValue();
AttributeValue(Aws::Utils::Json::JsonView jsonValue);
AttributeValue& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The specific value of an <code>attributeName</code>.</p>
*/
inline const Aws::String& GetValue() const{ return m_value; }
/**
* <p>The specific value of an <code>attributeName</code>.</p>
*/
inline bool ValueHasBeenSet() const { return m_valueHasBeenSet; }
/**
* <p>The specific value of an <code>attributeName</code>.</p>
*/
inline void SetValue(const Aws::String& value) { m_valueHasBeenSet = true; m_value = value; }
/**
* <p>The specific value of an <code>attributeName</code>.</p>
*/
inline void SetValue(Aws::String&& value) { m_valueHasBeenSet = true; m_value = std::move(value); }
/**
* <p>The specific value of an <code>attributeName</code>.</p>
*/
inline void SetValue(const char* value) { m_valueHasBeenSet = true; m_value.assign(value); }
/**
* <p>The specific value of an <code>attributeName</code>.</p>
*/
inline AttributeValue& WithValue(const Aws::String& value) { SetValue(value); return *this;}
/**
* <p>The specific value of an <code>attributeName</code>.</p>
*/
inline AttributeValue& WithValue(Aws::String&& value) { SetValue(std::move(value)); return *this;}
/**
* <p>The specific value of an <code>attributeName</code>.</p>
*/
inline AttributeValue& WithValue(const char* value) { SetValue(value); return *this;}
private:
Aws::String m_value;
bool m_valueHasBeenSet;
};
} // namespace Model
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,237 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pricing/Pricing_EXPORTS.h>
#include <aws/pricing/PricingRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Pricing
{
namespace Model
{
/**
*/
class AWS_PRICING_API DescribeServicesRequest : public PricingRequest
{
public:
DescribeServicesRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "DescribeServices"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The code for the service whose information you want to retrieve, such as
* <code>AmazonEC2</code>. You can use the <code>ServiceCode</code> to filter the
* results in a <code>GetProducts</code> call. To retrieve a list of all services,
* leave this blank.</p>
*/
inline const Aws::String& GetServiceCode() const{ return m_serviceCode; }
/**
* <p>The code for the service whose information you want to retrieve, such as
* <code>AmazonEC2</code>. You can use the <code>ServiceCode</code> to filter the
* results in a <code>GetProducts</code> call. To retrieve a list of all services,
* leave this blank.</p>
*/
inline bool ServiceCodeHasBeenSet() const { return m_serviceCodeHasBeenSet; }
/**
* <p>The code for the service whose information you want to retrieve, such as
* <code>AmazonEC2</code>. You can use the <code>ServiceCode</code> to filter the
* results in a <code>GetProducts</code> call. To retrieve a list of all services,
* leave this blank.</p>
*/
inline void SetServiceCode(const Aws::String& value) { m_serviceCodeHasBeenSet = true; m_serviceCode = value; }
/**
* <p>The code for the service whose information you want to retrieve, such as
* <code>AmazonEC2</code>. You can use the <code>ServiceCode</code> to filter the
* results in a <code>GetProducts</code> call. To retrieve a list of all services,
* leave this blank.</p>
*/
inline void SetServiceCode(Aws::String&& value) { m_serviceCodeHasBeenSet = true; m_serviceCode = std::move(value); }
/**
* <p>The code for the service whose information you want to retrieve, such as
* <code>AmazonEC2</code>. You can use the <code>ServiceCode</code> to filter the
* results in a <code>GetProducts</code> call. To retrieve a list of all services,
* leave this blank.</p>
*/
inline void SetServiceCode(const char* value) { m_serviceCodeHasBeenSet = true; m_serviceCode.assign(value); }
/**
* <p>The code for the service whose information you want to retrieve, such as
* <code>AmazonEC2</code>. You can use the <code>ServiceCode</code> to filter the
* results in a <code>GetProducts</code> call. To retrieve a list of all services,
* leave this blank.</p>
*/
inline DescribeServicesRequest& WithServiceCode(const Aws::String& value) { SetServiceCode(value); return *this;}
/**
* <p>The code for the service whose information you want to retrieve, such as
* <code>AmazonEC2</code>. You can use the <code>ServiceCode</code> to filter the
* results in a <code>GetProducts</code> call. To retrieve a list of all services,
* leave this blank.</p>
*/
inline DescribeServicesRequest& WithServiceCode(Aws::String&& value) { SetServiceCode(std::move(value)); return *this;}
/**
* <p>The code for the service whose information you want to retrieve, such as
* <code>AmazonEC2</code>. You can use the <code>ServiceCode</code> to filter the
* results in a <code>GetProducts</code> call. To retrieve a list of all services,
* leave this blank.</p>
*/
inline DescribeServicesRequest& WithServiceCode(const char* value) { SetServiceCode(value); return *this;}
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline const Aws::String& GetFormatVersion() const{ return m_formatVersion; }
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline bool FormatVersionHasBeenSet() const { return m_formatVersionHasBeenSet; }
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline void SetFormatVersion(const Aws::String& value) { m_formatVersionHasBeenSet = true; m_formatVersion = value; }
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline void SetFormatVersion(Aws::String&& value) { m_formatVersionHasBeenSet = true; m_formatVersion = std::move(value); }
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline void SetFormatVersion(const char* value) { m_formatVersionHasBeenSet = true; m_formatVersion.assign(value); }
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline DescribeServicesRequest& WithFormatVersion(const Aws::String& value) { SetFormatVersion(value); return *this;}
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline DescribeServicesRequest& WithFormatVersion(Aws::String&& value) { SetFormatVersion(std::move(value)); return *this;}
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline DescribeServicesRequest& WithFormatVersion(const char* value) { SetFormatVersion(value); return *this;}
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline DescribeServicesRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline DescribeServicesRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline DescribeServicesRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}
/**
* <p>The maximum number of results that you want returned in the response.</p>
*/
inline int GetMaxResults() const{ return m_maxResults; }
/**
* <p>The maximum number of results that you want returned in the response.</p>
*/
inline bool MaxResultsHasBeenSet() const { return m_maxResultsHasBeenSet; }
/**
* <p>The maximum number of results that you want returned in the response.</p>
*/
inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; }
/**
* <p>The maximum number of results that you want returned in the response.</p>
*/
inline DescribeServicesRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;}
private:
Aws::String m_serviceCode;
bool m_serviceCodeHasBeenSet;
Aws::String m_formatVersion;
bool m_formatVersionHasBeenSet;
Aws::String m_nextToken;
bool m_nextTokenHasBeenSet;
int m_maxResults;
bool m_maxResultsHasBeenSet;
};
} // namespace Model
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,155 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pricing/Pricing_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/pricing/model/Service.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace Pricing
{
namespace Model
{
class AWS_PRICING_API DescribeServicesResult
{
public:
DescribeServicesResult();
DescribeServicesResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
DescribeServicesResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The service metadata for the service or services in the response.</p>
*/
inline const Aws::Vector<Service>& GetServices() const{ return m_services; }
/**
* <p>The service metadata for the service or services in the response.</p>
*/
inline void SetServices(const Aws::Vector<Service>& value) { m_services = value; }
/**
* <p>The service metadata for the service or services in the response.</p>
*/
inline void SetServices(Aws::Vector<Service>&& value) { m_services = std::move(value); }
/**
* <p>The service metadata for the service or services in the response.</p>
*/
inline DescribeServicesResult& WithServices(const Aws::Vector<Service>& value) { SetServices(value); return *this;}
/**
* <p>The service metadata for the service or services in the response.</p>
*/
inline DescribeServicesResult& WithServices(Aws::Vector<Service>&& value) { SetServices(std::move(value)); return *this;}
/**
* <p>The service metadata for the service or services in the response.</p>
*/
inline DescribeServicesResult& AddServices(const Service& value) { m_services.push_back(value); return *this; }
/**
* <p>The service metadata for the service or services in the response.</p>
*/
inline DescribeServicesResult& AddServices(Service&& value) { m_services.push_back(std::move(value)); return *this; }
/**
* <p>The format version of the response. For example, <code>aws_v1</code>.</p>
*/
inline const Aws::String& GetFormatVersion() const{ return m_formatVersion; }
/**
* <p>The format version of the response. For example, <code>aws_v1</code>.</p>
*/
inline void SetFormatVersion(const Aws::String& value) { m_formatVersion = value; }
/**
* <p>The format version of the response. For example, <code>aws_v1</code>.</p>
*/
inline void SetFormatVersion(Aws::String&& value) { m_formatVersion = std::move(value); }
/**
* <p>The format version of the response. For example, <code>aws_v1</code>.</p>
*/
inline void SetFormatVersion(const char* value) { m_formatVersion.assign(value); }
/**
* <p>The format version of the response. For example, <code>aws_v1</code>.</p>
*/
inline DescribeServicesResult& WithFormatVersion(const Aws::String& value) { SetFormatVersion(value); return *this;}
/**
* <p>The format version of the response. For example, <code>aws_v1</code>.</p>
*/
inline DescribeServicesResult& WithFormatVersion(Aws::String&& value) { SetFormatVersion(std::move(value)); return *this;}
/**
* <p>The format version of the response. For example, <code>aws_v1</code>.</p>
*/
inline DescribeServicesResult& WithFormatVersion(const char* value) { SetFormatVersion(value); return *this;}
/**
* <p>The pagination token for the next set of retreivable results.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>The pagination token for the next set of retreivable results.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextToken = value; }
/**
* <p>The pagination token for the next set of retreivable results.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); }
/**
* <p>The pagination token for the next set of retreivable results.</p>
*/
inline void SetNextToken(const char* value) { m_nextToken.assign(value); }
/**
* <p>The pagination token for the next set of retreivable results.</p>
*/
inline DescribeServicesResult& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>The pagination token for the next set of retreivable results.</p>
*/
inline DescribeServicesResult& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>The pagination token for the next set of retreivable results.</p>
*/
inline DescribeServicesResult& WithNextToken(const char* value) { SetNextToken(value); return *this;}
private:
Aws::Vector<Service> m_services;
Aws::String m_formatVersion;
Aws::String m_nextToken;
};
} // namespace Model
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,268 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pricing/Pricing_EXPORTS.h>
#include <aws/pricing/model/FilterType.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace Pricing
{
namespace Model
{
/**
* <p>The constraints that you want all returned products to match.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/Filter">AWS API
* Reference</a></p>
*/
class AWS_PRICING_API Filter
{
public:
Filter();
Filter(Aws::Utils::Json::JsonView jsonValue);
Filter& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The type of filter that you want to use.</p> <p>Valid values are:
* <code>TERM_MATCH</code>. <code>TERM_MATCH</code> returns only products that
* match both the given filter field and the given value.</p>
*/
inline const FilterType& GetType() const{ return m_type; }
/**
* <p>The type of filter that you want to use.</p> <p>Valid values are:
* <code>TERM_MATCH</code>. <code>TERM_MATCH</code> returns only products that
* match both the given filter field and the given value.</p>
*/
inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; }
/**
* <p>The type of filter that you want to use.</p> <p>Valid values are:
* <code>TERM_MATCH</code>. <code>TERM_MATCH</code> returns only products that
* match both the given filter field and the given value.</p>
*/
inline void SetType(const FilterType& value) { m_typeHasBeenSet = true; m_type = value; }
/**
* <p>The type of filter that you want to use.</p> <p>Valid values are:
* <code>TERM_MATCH</code>. <code>TERM_MATCH</code> returns only products that
* match both the given filter field and the given value.</p>
*/
inline void SetType(FilterType&& value) { m_typeHasBeenSet = true; m_type = std::move(value); }
/**
* <p>The type of filter that you want to use.</p> <p>Valid values are:
* <code>TERM_MATCH</code>. <code>TERM_MATCH</code> returns only products that
* match both the given filter field and the given value.</p>
*/
inline Filter& WithType(const FilterType& value) { SetType(value); return *this;}
/**
* <p>The type of filter that you want to use.</p> <p>Valid values are:
* <code>TERM_MATCH</code>. <code>TERM_MATCH</code> returns only products that
* match both the given filter field and the given value.</p>
*/
inline Filter& WithType(FilterType&& value) { SetType(std::move(value)); return *this;}
/**
* <p>The product metadata field that you want to filter on. You can filter by just
* the service code to see all products for a specific service, filter by just the
* attribute name to see a specific attribute for multiple services, or use both a
* service code and an attribute name to retrieve only products that match both
* fields.</p> <p>Valid values include: <code>ServiceCode</code>, and all attribute
* names</p> <p>For example, you can filter by the <code>AmazonEC2</code> service
* code and the <code>volumeType</code> attribute name to get the prices for only
* Amazon EC2 volumes.</p>
*/
inline const Aws::String& GetField() const{ return m_field; }
/**
* <p>The product metadata field that you want to filter on. You can filter by just
* the service code to see all products for a specific service, filter by just the
* attribute name to see a specific attribute for multiple services, or use both a
* service code and an attribute name to retrieve only products that match both
* fields.</p> <p>Valid values include: <code>ServiceCode</code>, and all attribute
* names</p> <p>For example, you can filter by the <code>AmazonEC2</code> service
* code and the <code>volumeType</code> attribute name to get the prices for only
* Amazon EC2 volumes.</p>
*/
inline bool FieldHasBeenSet() const { return m_fieldHasBeenSet; }
/**
* <p>The product metadata field that you want to filter on. You can filter by just
* the service code to see all products for a specific service, filter by just the
* attribute name to see a specific attribute for multiple services, or use both a
* service code and an attribute name to retrieve only products that match both
* fields.</p> <p>Valid values include: <code>ServiceCode</code>, and all attribute
* names</p> <p>For example, you can filter by the <code>AmazonEC2</code> service
* code and the <code>volumeType</code> attribute name to get the prices for only
* Amazon EC2 volumes.</p>
*/
inline void SetField(const Aws::String& value) { m_fieldHasBeenSet = true; m_field = value; }
/**
* <p>The product metadata field that you want to filter on. You can filter by just
* the service code to see all products for a specific service, filter by just the
* attribute name to see a specific attribute for multiple services, or use both a
* service code and an attribute name to retrieve only products that match both
* fields.</p> <p>Valid values include: <code>ServiceCode</code>, and all attribute
* names</p> <p>For example, you can filter by the <code>AmazonEC2</code> service
* code and the <code>volumeType</code> attribute name to get the prices for only
* Amazon EC2 volumes.</p>
*/
inline void SetField(Aws::String&& value) { m_fieldHasBeenSet = true; m_field = std::move(value); }
/**
* <p>The product metadata field that you want to filter on. You can filter by just
* the service code to see all products for a specific service, filter by just the
* attribute name to see a specific attribute for multiple services, or use both a
* service code and an attribute name to retrieve only products that match both
* fields.</p> <p>Valid values include: <code>ServiceCode</code>, and all attribute
* names</p> <p>For example, you can filter by the <code>AmazonEC2</code> service
* code and the <code>volumeType</code> attribute name to get the prices for only
* Amazon EC2 volumes.</p>
*/
inline void SetField(const char* value) { m_fieldHasBeenSet = true; m_field.assign(value); }
/**
* <p>The product metadata field that you want to filter on. You can filter by just
* the service code to see all products for a specific service, filter by just the
* attribute name to see a specific attribute for multiple services, or use both a
* service code and an attribute name to retrieve only products that match both
* fields.</p> <p>Valid values include: <code>ServiceCode</code>, and all attribute
* names</p> <p>For example, you can filter by the <code>AmazonEC2</code> service
* code and the <code>volumeType</code> attribute name to get the prices for only
* Amazon EC2 volumes.</p>
*/
inline Filter& WithField(const Aws::String& value) { SetField(value); return *this;}
/**
* <p>The product metadata field that you want to filter on. You can filter by just
* the service code to see all products for a specific service, filter by just the
* attribute name to see a specific attribute for multiple services, or use both a
* service code and an attribute name to retrieve only products that match both
* fields.</p> <p>Valid values include: <code>ServiceCode</code>, and all attribute
* names</p> <p>For example, you can filter by the <code>AmazonEC2</code> service
* code and the <code>volumeType</code> attribute name to get the prices for only
* Amazon EC2 volumes.</p>
*/
inline Filter& WithField(Aws::String&& value) { SetField(std::move(value)); return *this;}
/**
* <p>The product metadata field that you want to filter on. You can filter by just
* the service code to see all products for a specific service, filter by just the
* attribute name to see a specific attribute for multiple services, or use both a
* service code and an attribute name to retrieve only products that match both
* fields.</p> <p>Valid values include: <code>ServiceCode</code>, and all attribute
* names</p> <p>For example, you can filter by the <code>AmazonEC2</code> service
* code and the <code>volumeType</code> attribute name to get the prices for only
* Amazon EC2 volumes.</p>
*/
inline Filter& WithField(const char* value) { SetField(value); return *this;}
/**
* <p>The service code or attribute value that you want to filter by. If you are
* filtering by service code this is the actual service code, such as
* <code>AmazonEC2</code>. If you are filtering by attribute name, this is the
* attribute value that you want the returned products to match, such as a
* <code>Provisioned IOPS</code> volume.</p>
*/
inline const Aws::String& GetValue() const{ return m_value; }
/**
* <p>The service code or attribute value that you want to filter by. If you are
* filtering by service code this is the actual service code, such as
* <code>AmazonEC2</code>. If you are filtering by attribute name, this is the
* attribute value that you want the returned products to match, such as a
* <code>Provisioned IOPS</code> volume.</p>
*/
inline bool ValueHasBeenSet() const { return m_valueHasBeenSet; }
/**
* <p>The service code or attribute value that you want to filter by. If you are
* filtering by service code this is the actual service code, such as
* <code>AmazonEC2</code>. If you are filtering by attribute name, this is the
* attribute value that you want the returned products to match, such as a
* <code>Provisioned IOPS</code> volume.</p>
*/
inline void SetValue(const Aws::String& value) { m_valueHasBeenSet = true; m_value = value; }
/**
* <p>The service code or attribute value that you want to filter by. If you are
* filtering by service code this is the actual service code, such as
* <code>AmazonEC2</code>. If you are filtering by attribute name, this is the
* attribute value that you want the returned products to match, such as a
* <code>Provisioned IOPS</code> volume.</p>
*/
inline void SetValue(Aws::String&& value) { m_valueHasBeenSet = true; m_value = std::move(value); }
/**
* <p>The service code or attribute value that you want to filter by. If you are
* filtering by service code this is the actual service code, such as
* <code>AmazonEC2</code>. If you are filtering by attribute name, this is the
* attribute value that you want the returned products to match, such as a
* <code>Provisioned IOPS</code> volume.</p>
*/
inline void SetValue(const char* value) { m_valueHasBeenSet = true; m_value.assign(value); }
/**
* <p>The service code or attribute value that you want to filter by. If you are
* filtering by service code this is the actual service code, such as
* <code>AmazonEC2</code>. If you are filtering by attribute name, this is the
* attribute value that you want the returned products to match, such as a
* <code>Provisioned IOPS</code> volume.</p>
*/
inline Filter& WithValue(const Aws::String& value) { SetValue(value); return *this;}
/**
* <p>The service code or attribute value that you want to filter by. If you are
* filtering by service code this is the actual service code, such as
* <code>AmazonEC2</code>. If you are filtering by attribute name, this is the
* attribute value that you want the returned products to match, such as a
* <code>Provisioned IOPS</code> volume.</p>
*/
inline Filter& WithValue(Aws::String&& value) { SetValue(std::move(value)); return *this;}
/**
* <p>The service code or attribute value that you want to filter by. If you are
* filtering by service code this is the actual service code, such as
* <code>AmazonEC2</code>. If you are filtering by attribute name, this is the
* attribute value that you want the returned products to match, such as a
* <code>Provisioned IOPS</code> volume.</p>
*/
inline Filter& WithValue(const char* value) { SetValue(value); return *this;}
private:
FilterType m_type;
bool m_typeHasBeenSet;
Aws::String m_field;
bool m_fieldHasBeenSet;
Aws::String m_value;
bool m_valueHasBeenSet;
};
} // namespace Model
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,30 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pricing/Pricing_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace Pricing
{
namespace Model
{
enum class FilterType
{
NOT_SET,
TERM_MATCH
};
namespace FilterTypeMapper
{
AWS_PRICING_API FilterType GetFilterTypeForName(const Aws::String& name);
AWS_PRICING_API Aws::String GetNameForFilterType(FilterType value);
} // namespace FilterTypeMapper
} // namespace Model
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,229 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pricing/Pricing_EXPORTS.h>
#include <aws/pricing/PricingRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Pricing
{
namespace Model
{
/**
*/
class AWS_PRICING_API GetAttributeValuesRequest : public PricingRequest
{
public:
GetAttributeValuesRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "GetAttributeValues"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The service code for the service whose attributes you want to retrieve. For
* example, if you want the retrieve an EC2 attribute, use
* <code>AmazonEC2</code>.</p>
*/
inline const Aws::String& GetServiceCode() const{ return m_serviceCode; }
/**
* <p>The service code for the service whose attributes you want to retrieve. For
* example, if you want the retrieve an EC2 attribute, use
* <code>AmazonEC2</code>.</p>
*/
inline bool ServiceCodeHasBeenSet() const { return m_serviceCodeHasBeenSet; }
/**
* <p>The service code for the service whose attributes you want to retrieve. For
* example, if you want the retrieve an EC2 attribute, use
* <code>AmazonEC2</code>.</p>
*/
inline void SetServiceCode(const Aws::String& value) { m_serviceCodeHasBeenSet = true; m_serviceCode = value; }
/**
* <p>The service code for the service whose attributes you want to retrieve. For
* example, if you want the retrieve an EC2 attribute, use
* <code>AmazonEC2</code>.</p>
*/
inline void SetServiceCode(Aws::String&& value) { m_serviceCodeHasBeenSet = true; m_serviceCode = std::move(value); }
/**
* <p>The service code for the service whose attributes you want to retrieve. For
* example, if you want the retrieve an EC2 attribute, use
* <code>AmazonEC2</code>.</p>
*/
inline void SetServiceCode(const char* value) { m_serviceCodeHasBeenSet = true; m_serviceCode.assign(value); }
/**
* <p>The service code for the service whose attributes you want to retrieve. For
* example, if you want the retrieve an EC2 attribute, use
* <code>AmazonEC2</code>.</p>
*/
inline GetAttributeValuesRequest& WithServiceCode(const Aws::String& value) { SetServiceCode(value); return *this;}
/**
* <p>The service code for the service whose attributes you want to retrieve. For
* example, if you want the retrieve an EC2 attribute, use
* <code>AmazonEC2</code>.</p>
*/
inline GetAttributeValuesRequest& WithServiceCode(Aws::String&& value) { SetServiceCode(std::move(value)); return *this;}
/**
* <p>The service code for the service whose attributes you want to retrieve. For
* example, if you want the retrieve an EC2 attribute, use
* <code>AmazonEC2</code>.</p>
*/
inline GetAttributeValuesRequest& WithServiceCode(const char* value) { SetServiceCode(value); return *this;}
/**
* <p>The name of the attribute that you want to retrieve the values for, such as
* <code>volumeType</code>.</p>
*/
inline const Aws::String& GetAttributeName() const{ return m_attributeName; }
/**
* <p>The name of the attribute that you want to retrieve the values for, such as
* <code>volumeType</code>.</p>
*/
inline bool AttributeNameHasBeenSet() const { return m_attributeNameHasBeenSet; }
/**
* <p>The name of the attribute that you want to retrieve the values for, such as
* <code>volumeType</code>.</p>
*/
inline void SetAttributeName(const Aws::String& value) { m_attributeNameHasBeenSet = true; m_attributeName = value; }
/**
* <p>The name of the attribute that you want to retrieve the values for, such as
* <code>volumeType</code>.</p>
*/
inline void SetAttributeName(Aws::String&& value) { m_attributeNameHasBeenSet = true; m_attributeName = std::move(value); }
/**
* <p>The name of the attribute that you want to retrieve the values for, such as
* <code>volumeType</code>.</p>
*/
inline void SetAttributeName(const char* value) { m_attributeNameHasBeenSet = true; m_attributeName.assign(value); }
/**
* <p>The name of the attribute that you want to retrieve the values for, such as
* <code>volumeType</code>.</p>
*/
inline GetAttributeValuesRequest& WithAttributeName(const Aws::String& value) { SetAttributeName(value); return *this;}
/**
* <p>The name of the attribute that you want to retrieve the values for, such as
* <code>volumeType</code>.</p>
*/
inline GetAttributeValuesRequest& WithAttributeName(Aws::String&& value) { SetAttributeName(std::move(value)); return *this;}
/**
* <p>The name of the attribute that you want to retrieve the values for, such as
* <code>volumeType</code>.</p>
*/
inline GetAttributeValuesRequest& WithAttributeName(const char* value) { SetAttributeName(value); return *this;}
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline GetAttributeValuesRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline GetAttributeValuesRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline GetAttributeValuesRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}
/**
* <p>The maximum number of results to return in response.</p>
*/
inline int GetMaxResults() const{ return m_maxResults; }
/**
* <p>The maximum number of results to return in response.</p>
*/
inline bool MaxResultsHasBeenSet() const { return m_maxResultsHasBeenSet; }
/**
* <p>The maximum number of results to return in response.</p>
*/
inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; }
/**
* <p>The maximum number of results to return in response.</p>
*/
inline GetAttributeValuesRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;}
private:
Aws::String m_serviceCode;
bool m_serviceCodeHasBeenSet;
Aws::String m_attributeName;
bool m_attributeNameHasBeenSet;
Aws::String m_nextToken;
bool m_nextTokenHasBeenSet;
int m_maxResults;
bool m_maxResultsHasBeenSet;
};
} // namespace Model
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,131 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pricing/Pricing_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/pricing/model/AttributeValue.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace Pricing
{
namespace Model
{
class AWS_PRICING_API GetAttributeValuesResult
{
public:
GetAttributeValuesResult();
GetAttributeValuesResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
GetAttributeValuesResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The list of values for an attribute. For example, <code>Throughput Optimized
* HDD</code> and <code>Provisioned IOPS</code> are two available values for the
* <code>AmazonEC2</code> <code>volumeType</code>.</p>
*/
inline const Aws::Vector<AttributeValue>& GetAttributeValues() const{ return m_attributeValues; }
/**
* <p>The list of values for an attribute. For example, <code>Throughput Optimized
* HDD</code> and <code>Provisioned IOPS</code> are two available values for the
* <code>AmazonEC2</code> <code>volumeType</code>.</p>
*/
inline void SetAttributeValues(const Aws::Vector<AttributeValue>& value) { m_attributeValues = value; }
/**
* <p>The list of values for an attribute. For example, <code>Throughput Optimized
* HDD</code> and <code>Provisioned IOPS</code> are two available values for the
* <code>AmazonEC2</code> <code>volumeType</code>.</p>
*/
inline void SetAttributeValues(Aws::Vector<AttributeValue>&& value) { m_attributeValues = std::move(value); }
/**
* <p>The list of values for an attribute. For example, <code>Throughput Optimized
* HDD</code> and <code>Provisioned IOPS</code> are two available values for the
* <code>AmazonEC2</code> <code>volumeType</code>.</p>
*/
inline GetAttributeValuesResult& WithAttributeValues(const Aws::Vector<AttributeValue>& value) { SetAttributeValues(value); return *this;}
/**
* <p>The list of values for an attribute. For example, <code>Throughput Optimized
* HDD</code> and <code>Provisioned IOPS</code> are two available values for the
* <code>AmazonEC2</code> <code>volumeType</code>.</p>
*/
inline GetAttributeValuesResult& WithAttributeValues(Aws::Vector<AttributeValue>&& value) { SetAttributeValues(std::move(value)); return *this;}
/**
* <p>The list of values for an attribute. For example, <code>Throughput Optimized
* HDD</code> and <code>Provisioned IOPS</code> are two available values for the
* <code>AmazonEC2</code> <code>volumeType</code>.</p>
*/
inline GetAttributeValuesResult& AddAttributeValues(const AttributeValue& value) { m_attributeValues.push_back(value); return *this; }
/**
* <p>The list of values for an attribute. For example, <code>Throughput Optimized
* HDD</code> and <code>Provisioned IOPS</code> are two available values for the
* <code>AmazonEC2</code> <code>volumeType</code>.</p>
*/
inline GetAttributeValuesResult& AddAttributeValues(AttributeValue&& value) { m_attributeValues.push_back(std::move(value)); return *this; }
/**
* <p>The pagination token that indicates the next set of results to retrieve.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>The pagination token that indicates the next set of results to retrieve.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextToken = value; }
/**
* <p>The pagination token that indicates the next set of results to retrieve.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); }
/**
* <p>The pagination token that indicates the next set of results to retrieve.</p>
*/
inline void SetNextToken(const char* value) { m_nextToken.assign(value); }
/**
* <p>The pagination token that indicates the next set of results to retrieve.</p>
*/
inline GetAttributeValuesResult& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>The pagination token that indicates the next set of results to retrieve.</p>
*/
inline GetAttributeValuesResult& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>The pagination token that indicates the next set of results to retrieve.</p>
*/
inline GetAttributeValuesResult& WithNextToken(const char* value) { SetNextToken(value); return *this;}
private:
Aws::Vector<AttributeValue> m_attributeValues;
Aws::String m_nextToken;
};
} // namespace Model
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,267 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pricing/Pricing_EXPORTS.h>
#include <aws/pricing/PricingRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/pricing/model/Filter.h>
#include <utility>
namespace Aws
{
namespace Pricing
{
namespace Model
{
/**
*/
class AWS_PRICING_API GetProductsRequest : public PricingRequest
{
public:
GetProductsRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "GetProducts"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The code for the service whose products you want to retrieve. </p>
*/
inline const Aws::String& GetServiceCode() const{ return m_serviceCode; }
/**
* <p>The code for the service whose products you want to retrieve. </p>
*/
inline bool ServiceCodeHasBeenSet() const { return m_serviceCodeHasBeenSet; }
/**
* <p>The code for the service whose products you want to retrieve. </p>
*/
inline void SetServiceCode(const Aws::String& value) { m_serviceCodeHasBeenSet = true; m_serviceCode = value; }
/**
* <p>The code for the service whose products you want to retrieve. </p>
*/
inline void SetServiceCode(Aws::String&& value) { m_serviceCodeHasBeenSet = true; m_serviceCode = std::move(value); }
/**
* <p>The code for the service whose products you want to retrieve. </p>
*/
inline void SetServiceCode(const char* value) { m_serviceCodeHasBeenSet = true; m_serviceCode.assign(value); }
/**
* <p>The code for the service whose products you want to retrieve. </p>
*/
inline GetProductsRequest& WithServiceCode(const Aws::String& value) { SetServiceCode(value); return *this;}
/**
* <p>The code for the service whose products you want to retrieve. </p>
*/
inline GetProductsRequest& WithServiceCode(Aws::String&& value) { SetServiceCode(std::move(value)); return *this;}
/**
* <p>The code for the service whose products you want to retrieve. </p>
*/
inline GetProductsRequest& WithServiceCode(const char* value) { SetServiceCode(value); return *this;}
/**
* <p>The list of filters that limit the returned products. only products that
* match all filters are returned.</p>
*/
inline const Aws::Vector<Filter>& GetFilters() const{ return m_filters; }
/**
* <p>The list of filters that limit the returned products. only products that
* match all filters are returned.</p>
*/
inline bool FiltersHasBeenSet() const { return m_filtersHasBeenSet; }
/**
* <p>The list of filters that limit the returned products. only products that
* match all filters are returned.</p>
*/
inline void SetFilters(const Aws::Vector<Filter>& value) { m_filtersHasBeenSet = true; m_filters = value; }
/**
* <p>The list of filters that limit the returned products. only products that
* match all filters are returned.</p>
*/
inline void SetFilters(Aws::Vector<Filter>&& value) { m_filtersHasBeenSet = true; m_filters = std::move(value); }
/**
* <p>The list of filters that limit the returned products. only products that
* match all filters are returned.</p>
*/
inline GetProductsRequest& WithFilters(const Aws::Vector<Filter>& value) { SetFilters(value); return *this;}
/**
* <p>The list of filters that limit the returned products. only products that
* match all filters are returned.</p>
*/
inline GetProductsRequest& WithFilters(Aws::Vector<Filter>&& value) { SetFilters(std::move(value)); return *this;}
/**
* <p>The list of filters that limit the returned products. only products that
* match all filters are returned.</p>
*/
inline GetProductsRequest& AddFilters(const Filter& value) { m_filtersHasBeenSet = true; m_filters.push_back(value); return *this; }
/**
* <p>The list of filters that limit the returned products. only products that
* match all filters are returned.</p>
*/
inline GetProductsRequest& AddFilters(Filter&& value) { m_filtersHasBeenSet = true; m_filters.push_back(std::move(value)); return *this; }
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline const Aws::String& GetFormatVersion() const{ return m_formatVersion; }
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline bool FormatVersionHasBeenSet() const { return m_formatVersionHasBeenSet; }
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline void SetFormatVersion(const Aws::String& value) { m_formatVersionHasBeenSet = true; m_formatVersion = value; }
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline void SetFormatVersion(Aws::String&& value) { m_formatVersionHasBeenSet = true; m_formatVersion = std::move(value); }
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline void SetFormatVersion(const char* value) { m_formatVersionHasBeenSet = true; m_formatVersion.assign(value); }
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline GetProductsRequest& WithFormatVersion(const Aws::String& value) { SetFormatVersion(value); return *this;}
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline GetProductsRequest& WithFormatVersion(Aws::String&& value) { SetFormatVersion(std::move(value)); return *this;}
/**
* <p>The format version that you want the response to be in.</p> <p>Valid values
* are: <code>aws_v1</code> </p>
*/
inline GetProductsRequest& WithFormatVersion(const char* value) { SetFormatVersion(value); return *this;}
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline GetProductsRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline GetProductsRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>The pagination token that indicates the next set of results that you want to
* retrieve.</p>
*/
inline GetProductsRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}
/**
* <p>The maximum number of results to return in the response.</p>
*/
inline int GetMaxResults() const{ return m_maxResults; }
/**
* <p>The maximum number of results to return in the response.</p>
*/
inline bool MaxResultsHasBeenSet() const { return m_maxResultsHasBeenSet; }
/**
* <p>The maximum number of results to return in the response.</p>
*/
inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; }
/**
* <p>The maximum number of results to return in the response.</p>
*/
inline GetProductsRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;}
private:
Aws::String m_serviceCode;
bool m_serviceCodeHasBeenSet;
Aws::Vector<Filter> m_filters;
bool m_filtersHasBeenSet;
Aws::String m_formatVersion;
bool m_formatVersionHasBeenSet;
Aws::String m_nextToken;
bool m_nextTokenHasBeenSet;
int m_maxResults;
bool m_maxResultsHasBeenSet;
};
} // namespace Model
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,167 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pricing/Pricing_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace Pricing
{
namespace Model
{
class AWS_PRICING_API GetProductsResult
{
public:
GetProductsResult();
GetProductsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
GetProductsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The format version of the response. For example, aws_v1.</p>
*/
inline const Aws::String& GetFormatVersion() const{ return m_formatVersion; }
/**
* <p>The format version of the response. For example, aws_v1.</p>
*/
inline void SetFormatVersion(const Aws::String& value) { m_formatVersion = value; }
/**
* <p>The format version of the response. For example, aws_v1.</p>
*/
inline void SetFormatVersion(Aws::String&& value) { m_formatVersion = std::move(value); }
/**
* <p>The format version of the response. For example, aws_v1.</p>
*/
inline void SetFormatVersion(const char* value) { m_formatVersion.assign(value); }
/**
* <p>The format version of the response. For example, aws_v1.</p>
*/
inline GetProductsResult& WithFormatVersion(const Aws::String& value) { SetFormatVersion(value); return *this;}
/**
* <p>The format version of the response. For example, aws_v1.</p>
*/
inline GetProductsResult& WithFormatVersion(Aws::String&& value) { SetFormatVersion(std::move(value)); return *this;}
/**
* <p>The format version of the response. For example, aws_v1.</p>
*/
inline GetProductsResult& WithFormatVersion(const char* value) { SetFormatVersion(value); return *this;}
/**
* <p>The list of products that match your filters. The list contains both the
* product metadata and the price information.</p>
*/
inline const Aws::Vector<Aws::String>& GetPriceList() const{ return m_priceList; }
/**
* <p>The list of products that match your filters. The list contains both the
* product metadata and the price information.</p>
*/
inline void SetPriceList(const Aws::Vector<Aws::String>& value) { m_priceList = value; }
/**
* <p>The list of products that match your filters. The list contains both the
* product metadata and the price information.</p>
*/
inline void SetPriceList(Aws::Vector<Aws::String>&& value) { m_priceList = std::move(value); }
/**
* <p>The list of products that match your filters. The list contains both the
* product metadata and the price information.</p>
*/
inline GetProductsResult& WithPriceList(const Aws::Vector<Aws::String>& value) { SetPriceList(value); return *this;}
/**
* <p>The list of products that match your filters. The list contains both the
* product metadata and the price information.</p>
*/
inline GetProductsResult& WithPriceList(Aws::Vector<Aws::String>&& value) { SetPriceList(std::move(value)); return *this;}
/**
* <p>The list of products that match your filters. The list contains both the
* product metadata and the price information.</p>
*/
inline GetProductsResult& AddPriceList(const Aws::String& value) { m_priceList.push_back(value); return *this; }
/**
* <p>The list of products that match your filters. The list contains both the
* product metadata and the price information.</p>
*/
inline GetProductsResult& AddPriceList(Aws::String&& value) { m_priceList.push_back(std::move(value)); return *this; }
/**
* <p>The list of products that match your filters. The list contains both the
* product metadata and the price information.</p>
*/
inline GetProductsResult& AddPriceList(const char* value) { m_priceList.push_back(value); return *this; }
/**
* <p>The pagination token that indicates the next set of results to retrieve.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>The pagination token that indicates the next set of results to retrieve.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextToken = value; }
/**
* <p>The pagination token that indicates the next set of results to retrieve.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); }
/**
* <p>The pagination token that indicates the next set of results to retrieve.</p>
*/
inline void SetNextToken(const char* value) { m_nextToken.assign(value); }
/**
* <p>The pagination token that indicates the next set of results to retrieve.</p>
*/
inline GetProductsResult& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>The pagination token that indicates the next set of results to retrieve.</p>
*/
inline GetProductsResult& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>The pagination token that indicates the next set of results to retrieve.</p>
*/
inline GetProductsResult& WithNextToken(const char* value) { SetNextToken(value); return *this;}
private:
Aws::String m_formatVersion;
Aws::Vector<Aws::String> m_priceList;
Aws::String m_nextToken;
};
} // namespace Model
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,139 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pricing/Pricing_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace Pricing
{
namespace Model
{
/**
* <p>The metadata for a service, such as the service code and available attribute
* names.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/Service">AWS API
* Reference</a></p>
*/
class AWS_PRICING_API Service
{
public:
Service();
Service(Aws::Utils::Json::JsonView jsonValue);
Service& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The code for the AWS service.</p>
*/
inline const Aws::String& GetServiceCode() const{ return m_serviceCode; }
/**
* <p>The code for the AWS service.</p>
*/
inline bool ServiceCodeHasBeenSet() const { return m_serviceCodeHasBeenSet; }
/**
* <p>The code for the AWS service.</p>
*/
inline void SetServiceCode(const Aws::String& value) { m_serviceCodeHasBeenSet = true; m_serviceCode = value; }
/**
* <p>The code for the AWS service.</p>
*/
inline void SetServiceCode(Aws::String&& value) { m_serviceCodeHasBeenSet = true; m_serviceCode = std::move(value); }
/**
* <p>The code for the AWS service.</p>
*/
inline void SetServiceCode(const char* value) { m_serviceCodeHasBeenSet = true; m_serviceCode.assign(value); }
/**
* <p>The code for the AWS service.</p>
*/
inline Service& WithServiceCode(const Aws::String& value) { SetServiceCode(value); return *this;}
/**
* <p>The code for the AWS service.</p>
*/
inline Service& WithServiceCode(Aws::String&& value) { SetServiceCode(std::move(value)); return *this;}
/**
* <p>The code for the AWS service.</p>
*/
inline Service& WithServiceCode(const char* value) { SetServiceCode(value); return *this;}
/**
* <p>The attributes that are available for this service.</p>
*/
inline const Aws::Vector<Aws::String>& GetAttributeNames() const{ return m_attributeNames; }
/**
* <p>The attributes that are available for this service.</p>
*/
inline bool AttributeNamesHasBeenSet() const { return m_attributeNamesHasBeenSet; }
/**
* <p>The attributes that are available for this service.</p>
*/
inline void SetAttributeNames(const Aws::Vector<Aws::String>& value) { m_attributeNamesHasBeenSet = true; m_attributeNames = value; }
/**
* <p>The attributes that are available for this service.</p>
*/
inline void SetAttributeNames(Aws::Vector<Aws::String>&& value) { m_attributeNamesHasBeenSet = true; m_attributeNames = std::move(value); }
/**
* <p>The attributes that are available for this service.</p>
*/
inline Service& WithAttributeNames(const Aws::Vector<Aws::String>& value) { SetAttributeNames(value); return *this;}
/**
* <p>The attributes that are available for this service.</p>
*/
inline Service& WithAttributeNames(Aws::Vector<Aws::String>&& value) { SetAttributeNames(std::move(value)); return *this;}
/**
* <p>The attributes that are available for this service.</p>
*/
inline Service& AddAttributeNames(const Aws::String& value) { m_attributeNamesHasBeenSet = true; m_attributeNames.push_back(value); return *this; }
/**
* <p>The attributes that are available for this service.</p>
*/
inline Service& AddAttributeNames(Aws::String&& value) { m_attributeNamesHasBeenSet = true; m_attributeNames.push_back(std::move(value)); return *this; }
/**
* <p>The attributes that are available for this service.</p>
*/
inline Service& AddAttributeNames(const char* value) { m_attributeNamesHasBeenSet = true; m_attributeNames.push_back(value); return *this; }
private:
Aws::String m_serviceCode;
bool m_serviceCodeHasBeenSet;
Aws::Vector<Aws::String> m_attributeNames;
bool m_attributeNamesHasBeenSet;
};
} // namespace Model
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,180 @@
/**
* 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/pricing/PricingClient.h>
#include <aws/pricing/PricingEndpoint.h>
#include <aws/pricing/PricingErrorMarshaller.h>
#include <aws/pricing/model/DescribeServicesRequest.h>
#include <aws/pricing/model/GetAttributeValuesRequest.h>
#include <aws/pricing/model/GetProductsRequest.h>
using namespace Aws;
using namespace Aws::Auth;
using namespace Aws::Client;
using namespace Aws::Pricing;
using namespace Aws::Pricing::Model;
using namespace Aws::Http;
using namespace Aws::Utils::Json;
static const char* SERVICE_NAME = "pricing";
static const char* ALLOCATION_TAG = "PricingClient";
PricingClient::PricingClient(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<PricingErrorMarshaller>(ALLOCATION_TAG)),
m_executor(clientConfiguration.executor)
{
init(clientConfiguration);
}
PricingClient::PricingClient(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<PricingErrorMarshaller>(ALLOCATION_TAG)),
m_executor(clientConfiguration.executor)
{
init(clientConfiguration);
}
PricingClient::PricingClient(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<PricingErrorMarshaller>(ALLOCATION_TAG)),
m_executor(clientConfiguration.executor)
{
init(clientConfiguration);
}
PricingClient::~PricingClient()
{
}
void PricingClient::init(const ClientConfiguration& config)
{
SetServiceClientName("api.pricing");
m_configScheme = SchemeMapper::ToString(config.scheme);
if (config.endpointOverride.empty())
{
m_uri = m_configScheme + "://" + PricingEndpoint::ForRegion(config.region, config.useDualStack);
}
else
{
OverrideEndpoint(config.endpointOverride);
}
}
void PricingClient::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;
}
}
DescribeServicesOutcome PricingClient::DescribeServices(const DescribeServicesRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/";
uri.SetPath(uri.GetPath() + ss.str());
return DescribeServicesOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}
DescribeServicesOutcomeCallable PricingClient::DescribeServicesCallable(const DescribeServicesRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< DescribeServicesOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeServices(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void PricingClient::DescribeServicesAsync(const DescribeServicesRequest& request, const DescribeServicesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->DescribeServicesAsyncHelper( request, handler, context ); } );
}
void PricingClient::DescribeServicesAsyncHelper(const DescribeServicesRequest& request, const DescribeServicesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, DescribeServices(request), context);
}
GetAttributeValuesOutcome PricingClient::GetAttributeValues(const GetAttributeValuesRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/";
uri.SetPath(uri.GetPath() + ss.str());
return GetAttributeValuesOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}
GetAttributeValuesOutcomeCallable PricingClient::GetAttributeValuesCallable(const GetAttributeValuesRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< GetAttributeValuesOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetAttributeValues(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void PricingClient::GetAttributeValuesAsync(const GetAttributeValuesRequest& request, const GetAttributeValuesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->GetAttributeValuesAsyncHelper( request, handler, context ); } );
}
void PricingClient::GetAttributeValuesAsyncHelper(const GetAttributeValuesRequest& request, const GetAttributeValuesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, GetAttributeValues(request), context);
}
GetProductsOutcome PricingClient::GetProducts(const GetProductsRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/";
uri.SetPath(uri.GetPath() + ss.str());
return GetProductsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}
GetProductsOutcomeCallable PricingClient::GetProductsCallable(const GetProductsRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< GetProductsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetProducts(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void PricingClient::GetProductsAsync(const GetProductsRequest& request, const GetProductsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->GetProductsAsyncHelper( request, handler, context ); } );
}
void PricingClient::GetProductsAsyncHelper(const GetProductsRequest& request, const GetProductsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, GetProducts(request), context);
}

View File

@@ -0,0 +1,64 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/pricing/PricingEndpoint.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <aws/core/utils/HashingUtils.h>
using namespace Aws;
using namespace Aws::Pricing;
namespace Aws
{
namespace Pricing
{
namespace PricingEndpoint
{
static const int CN_NORTH_1_HASH = Aws::Utils::HashingUtils::HashString("cn-north-1");
static const int CN_NORTHWEST_1_HASH = Aws::Utils::HashingUtils::HashString("cn-northwest-1");
static const int US_ISO_EAST_1_HASH = Aws::Utils::HashingUtils::HashString("us-iso-east-1");
static const int US_ISOB_EAST_1_HASH = Aws::Utils::HashingUtils::HashString("us-isob-east-1");
Aws::String ForRegion(const Aws::String& regionName, bool useDualStack)
{
// Fallback to us-east-1 if global endpoint does not exists.
Aws::String region = regionName == Aws::Region::AWS_GLOBAL ? Aws::Region::US_EAST_1 : regionName;
auto hash = Aws::Utils::HashingUtils::HashString(region.c_str());
Aws::StringStream ss;
ss << "api.pricing" << ".";
if(useDualStack)
{
ss << "dualstack.";
}
ss << region;
if (hash == CN_NORTH_1_HASH || hash == CN_NORTHWEST_1_HASH)
{
ss << ".amazonaws.com.cn";
}
else if (hash == US_ISO_EAST_1_HASH)
{
ss << ".c2s.ic.gov";
}
else if (hash == US_ISOB_EAST_1_HASH)
{
ss << ".sc2s.sgov.gov";
}
else
{
ss << ".amazonaws.com";
}
return ss.str();
}
} // namespace PricingEndpoint
} // namespace Pricing
} // 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/pricing/PricingErrorMarshaller.h>
#include <aws/pricing/PricingErrors.h>
using namespace Aws::Client;
using namespace Aws::Pricing;
AWSError<CoreErrors> PricingErrorMarshaller::FindErrorByName(const char* errorName) const
{
AWSError<CoreErrors> error = PricingErrorMapper::GetErrorForName(errorName);
if(error.GetErrorType() != CoreErrors::UNKNOWN)
{
return error;
}
return AWSErrorMarshaller::FindErrorByName(errorName);
}

View File

@@ -0,0 +1,57 @@
/**
* 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/pricing/PricingErrors.h>
using namespace Aws::Client;
using namespace Aws::Utils;
using namespace Aws::Pricing;
namespace Aws
{
namespace Pricing
{
namespace PricingErrorMapper
{
static const int INTERNAL_ERROR_HASH = HashingUtils::HashString("InternalErrorException");
static const int NOT_FOUND_HASH = HashingUtils::HashString("NotFoundException");
static const int INVALID_PARAMETER_HASH = HashingUtils::HashString("InvalidParameterException");
static const int INVALID_NEXT_TOKEN_HASH = HashingUtils::HashString("InvalidNextTokenException");
static const int EXPIRED_NEXT_TOKEN_HASH = HashingUtils::HashString("ExpiredNextTokenException");
AWSError<CoreErrors> GetErrorForName(const char* errorName)
{
int hashCode = HashingUtils::HashString(errorName);
if (hashCode == INTERNAL_ERROR_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(PricingErrors::INTERNAL_ERROR), false);
}
else if (hashCode == NOT_FOUND_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(PricingErrors::NOT_FOUND), false);
}
else if (hashCode == INVALID_PARAMETER_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(PricingErrors::INVALID_PARAMETER), false);
}
else if (hashCode == INVALID_NEXT_TOKEN_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(PricingErrors::INVALID_NEXT_TOKEN), false);
}
else if (hashCode == EXPIRED_NEXT_TOKEN_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(PricingErrors::EXPIRED_NEXT_TOKEN), false);
}
return AWSError<CoreErrors>(CoreErrors::UNKNOWN, false);
}
} // namespace PricingErrorMapper
} // namespace Pricing
} // namespace Aws

View File

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

View File

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

View File

@@ -0,0 +1,55 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/pricing/model/DescribeServicesResult.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::Pricing::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DescribeServicesResult::DescribeServicesResult()
{
}
DescribeServicesResult::DescribeServicesResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DescribeServicesResult& DescribeServicesResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("Services"))
{
Array<JsonView> servicesJsonList = jsonValue.GetArray("Services");
for(unsigned servicesIndex = 0; servicesIndex < servicesJsonList.GetLength(); ++servicesIndex)
{
m_services.push_back(servicesJsonList[servicesIndex].AsObject());
}
}
if(jsonValue.ValueExists("FormatVersion"))
{
m_formatVersion = jsonValue.GetString("FormatVersion");
}
if(jsonValue.ValueExists("NextToken"))
{
m_nextToken = jsonValue.GetString("NextToken");
}
return *this;
}

View File

@@ -0,0 +1,90 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/pricing/model/Filter.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Pricing
{
namespace Model
{
Filter::Filter() :
m_type(FilterType::NOT_SET),
m_typeHasBeenSet(false),
m_fieldHasBeenSet(false),
m_valueHasBeenSet(false)
{
}
Filter::Filter(JsonView jsonValue) :
m_type(FilterType::NOT_SET),
m_typeHasBeenSet(false),
m_fieldHasBeenSet(false),
m_valueHasBeenSet(false)
{
*this = jsonValue;
}
Filter& Filter::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Type"))
{
m_type = FilterTypeMapper::GetFilterTypeForName(jsonValue.GetString("Type"));
m_typeHasBeenSet = true;
}
if(jsonValue.ValueExists("Field"))
{
m_field = jsonValue.GetString("Field");
m_fieldHasBeenSet = true;
}
if(jsonValue.ValueExists("Value"))
{
m_value = jsonValue.GetString("Value");
m_valueHasBeenSet = true;
}
return *this;
}
JsonValue Filter::Jsonize() const
{
JsonValue payload;
if(m_typeHasBeenSet)
{
payload.WithString("Type", FilterTypeMapper::GetNameForFilterType(m_type));
}
if(m_fieldHasBeenSet)
{
payload.WithString("Field", m_field);
}
if(m_valueHasBeenSet)
{
payload.WithString("Value", m_value);
}
return payload;
}
} // namespace Model
} // namespace Pricing
} // namespace Aws

View File

@@ -0,0 +1,63 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/pricing/model/FilterType.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 Pricing
{
namespace Model
{
namespace FilterTypeMapper
{
static const int TERM_MATCH_HASH = HashingUtils::HashString("TERM_MATCH");
FilterType GetFilterTypeForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == TERM_MATCH_HASH)
{
return FilterType::TERM_MATCH;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<FilterType>(hashCode);
}
return FilterType::NOT_SET;
}
Aws::String GetNameForFilterType(FilterType enumValue)
{
switch(enumValue)
{
case FilterType::TERM_MATCH:
return "TERM_MATCH";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace FilterTypeMapper
} // namespace Model
} // namespace Pricing
} // namespace Aws

View File

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

View File

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

View File

@@ -0,0 +1,77 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/pricing/model/GetProductsRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Pricing::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
GetProductsRequest::GetProductsRequest() :
m_serviceCodeHasBeenSet(false),
m_filtersHasBeenSet(false),
m_formatVersionHasBeenSet(false),
m_nextTokenHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false)
{
}
Aws::String GetProductsRequest::SerializePayload() const
{
JsonValue payload;
if(m_serviceCodeHasBeenSet)
{
payload.WithString("ServiceCode", m_serviceCode);
}
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_formatVersionHasBeenSet)
{
payload.WithString("FormatVersion", m_formatVersion);
}
if(m_nextTokenHasBeenSet)
{
payload.WithString("NextToken", m_nextToken);
}
if(m_maxResultsHasBeenSet)
{
payload.WithInteger("MaxResults", m_maxResults);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection GetProductsRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSPriceListService.GetProducts"));
return headers;
}

View File

@@ -0,0 +1,55 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/pricing/model/GetProductsResult.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::Pricing::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
GetProductsResult::GetProductsResult()
{
}
GetProductsResult::GetProductsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
GetProductsResult& GetProductsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("FormatVersion"))
{
m_formatVersion = jsonValue.GetString("FormatVersion");
}
if(jsonValue.ValueExists("PriceList"))
{
Array<JsonView> priceListJsonList = jsonValue.GetArray("PriceList");
for(unsigned priceListIndex = 0; priceListIndex < priceListJsonList.GetLength(); ++priceListIndex)
{
m_priceList.push_back(priceListJsonList[priceListIndex].AsString());
}
}
if(jsonValue.ValueExists("NextToken"))
{
m_nextToken = jsonValue.GetString("NextToken");
}
return *this;
}

View File

@@ -0,0 +1,82 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/pricing/model/Service.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Pricing
{
namespace Model
{
Service::Service() :
m_serviceCodeHasBeenSet(false),
m_attributeNamesHasBeenSet(false)
{
}
Service::Service(JsonView jsonValue) :
m_serviceCodeHasBeenSet(false),
m_attributeNamesHasBeenSet(false)
{
*this = jsonValue;
}
Service& Service::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("ServiceCode"))
{
m_serviceCode = jsonValue.GetString("ServiceCode");
m_serviceCodeHasBeenSet = true;
}
if(jsonValue.ValueExists("AttributeNames"))
{
Array<JsonView> attributeNamesJsonList = jsonValue.GetArray("AttributeNames");
for(unsigned attributeNamesIndex = 0; attributeNamesIndex < attributeNamesJsonList.GetLength(); ++attributeNamesIndex)
{
m_attributeNames.push_back(attributeNamesJsonList[attributeNamesIndex].AsString());
}
m_attributeNamesHasBeenSet = true;
}
return *this;
}
JsonValue Service::Jsonize() const
{
JsonValue payload;
if(m_serviceCodeHasBeenSet)
{
payload.WithString("ServiceCode", m_serviceCode);
}
if(m_attributeNamesHasBeenSet)
{
Array<JsonValue> attributeNamesJsonList(m_attributeNames.size());
for(unsigned attributeNamesIndex = 0; attributeNamesIndex < attributeNamesJsonList.GetLength(); ++attributeNamesIndex)
{
attributeNamesJsonList[attributeNamesIndex].AsString(m_attributeNames[attributeNamesIndex]);
}
payload.WithArray("AttributeNames", std::move(attributeNamesJsonList));
}
return payload;
}
} // namespace Model
} // namespace Pricing
} // namespace Aws