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,383 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/meteringmarketplace/MarketplaceMeteringErrors.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/meteringmarketplace/model/BatchMeterUsageResult.h>
#include <aws/meteringmarketplace/model/MeterUsageResult.h>
#include <aws/meteringmarketplace/model/RegisterUsageResult.h>
#include <aws/meteringmarketplace/model/ResolveCustomerResult.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 MarketplaceMetering
{
namespace Model
{
class BatchMeterUsageRequest;
class MeterUsageRequest;
class RegisterUsageRequest;
class ResolveCustomerRequest;
typedef Aws::Utils::Outcome<BatchMeterUsageResult, MarketplaceMeteringError> BatchMeterUsageOutcome;
typedef Aws::Utils::Outcome<MeterUsageResult, MarketplaceMeteringError> MeterUsageOutcome;
typedef Aws::Utils::Outcome<RegisterUsageResult, MarketplaceMeteringError> RegisterUsageOutcome;
typedef Aws::Utils::Outcome<ResolveCustomerResult, MarketplaceMeteringError> ResolveCustomerOutcome;
typedef std::future<BatchMeterUsageOutcome> BatchMeterUsageOutcomeCallable;
typedef std::future<MeterUsageOutcome> MeterUsageOutcomeCallable;
typedef std::future<RegisterUsageOutcome> RegisterUsageOutcomeCallable;
typedef std::future<ResolveCustomerOutcome> ResolveCustomerOutcomeCallable;
} // namespace Model
class MarketplaceMeteringClient;
typedef std::function<void(const MarketplaceMeteringClient*, const Model::BatchMeterUsageRequest&, const Model::BatchMeterUsageOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > BatchMeterUsageResponseReceivedHandler;
typedef std::function<void(const MarketplaceMeteringClient*, const Model::MeterUsageRequest&, const Model::MeterUsageOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > MeterUsageResponseReceivedHandler;
typedef std::function<void(const MarketplaceMeteringClient*, const Model::RegisterUsageRequest&, const Model::RegisterUsageOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > RegisterUsageResponseReceivedHandler;
typedef std::function<void(const MarketplaceMeteringClient*, const Model::ResolveCustomerRequest&, const Model::ResolveCustomerOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ResolveCustomerResponseReceivedHandler;
/**
* <fullname>AWS Marketplace Metering Service</fullname> <p>This reference provides
* descriptions of the low-level AWS Marketplace Metering Service API.</p> <p>AWS
* Marketplace sellers can use this API to submit usage data for custom usage
* dimensions.</p> <p>For information on the permissions you need to use this API,
* see <a
* href="https://docs.aws.amazon.com/marketplace/latest/userguide/iam-user-policy-for-aws-marketplace-actions.html">AWS
* Marketing metering and entitlement API permissions</a> in the <i>AWS Marketplace
* Seller Guide.</i> </p> <p> <b>Submitting Metering Records</b> </p> <ul> <li> <p>
* <i>MeterUsage</i>- Submits the metering record for a Marketplace product.
* MeterUsage is called from an EC2 instance or a container running on EKS or
* ECS.</p> </li> <li> <p> <i>BatchMeterUsage</i>- Submits the metering record for
* a set of customers. BatchMeterUsage is called from a software-as-a-service
* (SaaS) application.</p> </li> </ul> <p> <b>Accepting New Customers</b> </p> <ul>
* <li> <p> <i>ResolveCustomer</i>- Called by a SaaS application during the
* registration process. When a buyer visits your website during the registration
* process, the buyer submits a Registration Token through the browser. The
* Registration Token is resolved through this API to obtain a CustomerIdentifier
* and Product Code.</p> </li> </ul> <p> <b>Entitlement and Metering for Paid
* Container Products</b> </p> <ul> <li> <p> Paid container software products sold
* through AWS Marketplace must integrate with the AWS Marketplace Metering Service
* and call the RegisterUsage operation for software entitlement and metering. Free
* and BYOL products for Amazon ECS or Amazon EKS aren't required to call
* RegisterUsage, but you can do so if you want to receive usage data in your
* seller reports. For more information on using the RegisterUsage operation, see
* <a
* href="https://docs.aws.amazon.com/marketplace/latest/userguide/container-based-products.html">Container-Based
* Products</a>. </p> </li> </ul> <p>BatchMeterUsage API calls are captured by AWS
* CloudTrail. You can use Cloudtrail to verify that the SaaS metering records that
* you sent are accurate by searching for records with the eventName of
* BatchMeterUsage. You can also use CloudTrail to audit records over time. For
* more information, see the <i> <a
* href="http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html">AWS
* CloudTrail User Guide</a> </i>.</p>
*/
class AWS_MARKETPLACEMETERING_API MarketplaceMeteringClient : 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.
*/
MarketplaceMeteringClient(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.
*/
MarketplaceMeteringClient(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
*/
MarketplaceMeteringClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
virtual ~MarketplaceMeteringClient();
/**
* <p>BatchMeterUsage is called from a SaaS application listed on the AWS
* Marketplace to post metering records for a set of customers.</p> <p>For
* identical requests, the API is idempotent; requests can be retried with the same
* records or a subset of the input records.</p> <p>Every request to
* BatchMeterUsage is for one product. If you need to meter usage for multiple
* products, you must make multiple calls to BatchMeterUsage.</p>
* <p>BatchMeterUsage can process up to 25 UsageRecords at a time.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/BatchMeterUsage">AWS
* API Reference</a></p>
*/
virtual Model::BatchMeterUsageOutcome BatchMeterUsage(const Model::BatchMeterUsageRequest& request) const;
/**
* <p>BatchMeterUsage is called from a SaaS application listed on the AWS
* Marketplace to post metering records for a set of customers.</p> <p>For
* identical requests, the API is idempotent; requests can be retried with the same
* records or a subset of the input records.</p> <p>Every request to
* BatchMeterUsage is for one product. If you need to meter usage for multiple
* products, you must make multiple calls to BatchMeterUsage.</p>
* <p>BatchMeterUsage can process up to 25 UsageRecords at a time.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/BatchMeterUsage">AWS
* API Reference</a></p>
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::BatchMeterUsageOutcomeCallable BatchMeterUsageCallable(const Model::BatchMeterUsageRequest& request) const;
/**
* <p>BatchMeterUsage is called from a SaaS application listed on the AWS
* Marketplace to post metering records for a set of customers.</p> <p>For
* identical requests, the API is idempotent; requests can be retried with the same
* records or a subset of the input records.</p> <p>Every request to
* BatchMeterUsage is for one product. If you need to meter usage for multiple
* products, you must make multiple calls to BatchMeterUsage.</p>
* <p>BatchMeterUsage can process up to 25 UsageRecords at a time.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/BatchMeterUsage">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void BatchMeterUsageAsync(const Model::BatchMeterUsageRequest& request, const BatchMeterUsageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
/**
* <p>API to emit metering records. For identical requests, the API is idempotent.
* It simply returns the metering record ID.</p> <p>MeterUsage is authenticated on
* the buyer's AWS account using credentials from the EC2 instance, ECS task, or
* EKS pod.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/MeterUsage">AWS
* API Reference</a></p>
*/
virtual Model::MeterUsageOutcome MeterUsage(const Model::MeterUsageRequest& request) const;
/**
* <p>API to emit metering records. For identical requests, the API is idempotent.
* It simply returns the metering record ID.</p> <p>MeterUsage is authenticated on
* the buyer's AWS account using credentials from the EC2 instance, ECS task, or
* EKS pod.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/MeterUsage">AWS
* API Reference</a></p>
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::MeterUsageOutcomeCallable MeterUsageCallable(const Model::MeterUsageRequest& request) const;
/**
* <p>API to emit metering records. For identical requests, the API is idempotent.
* It simply returns the metering record ID.</p> <p>MeterUsage is authenticated on
* the buyer's AWS account using credentials from the EC2 instance, ECS task, or
* EKS pod.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/MeterUsage">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void MeterUsageAsync(const Model::MeterUsageRequest& request, const MeterUsageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
/**
* <p>Paid container software products sold through AWS Marketplace must integrate
* with the AWS Marketplace Metering Service and call the RegisterUsage operation
* for software entitlement and metering. Free and BYOL products for Amazon ECS or
* Amazon EKS aren't required to call RegisterUsage, but you may choose to do so if
* you would like to receive usage data in your seller reports. The sections below
* explain the behavior of RegisterUsage. RegisterUsage performs two primary
* functions: metering and entitlement.</p> <ul> <li> <p> <i>Entitlement</i>:
* RegisterUsage allows you to verify that the customer running your paid software
* is subscribed to your product on AWS Marketplace, enabling you to guard against
* unauthorized use. Your container image that integrates with RegisterUsage is
* only required to guard against unauthorized use at container startup, as such a
* CustomerNotSubscribedException/PlatformNotSupportedException will only be thrown
* on the initial call to RegisterUsage. Subsequent calls from the same Amazon ECS
* task instance (e.g. task-id) or Amazon EKS pod will not throw a
* CustomerNotSubscribedException, even if the customer unsubscribes while the
* Amazon ECS task or Amazon EKS pod is still running.</p> </li> <li> <p>
* <i>Metering</i>: RegisterUsage meters software use per ECS task, per hour, or
* per pod for Amazon EKS with usage prorated to the second. A minimum of 1 minute
* of usage applies to tasks that are short lived. For example, if a customer has a
* 10 node Amazon ECS or Amazon EKS cluster and a service configured as a Daemon
* Set, then Amazon ECS or Amazon EKS will launch a task on all 10 cluster nodes
* and the customer will be charged: (10 * hourly_rate). Metering for software use
* is automatically handled by the AWS Marketplace Metering Control Plane -- your
* software is not required to perform any metering specific actions, other than
* call RegisterUsage once for metering of software use to commence. The AWS
* Marketplace Metering Control Plane will also continue to bill customers for
* running ECS tasks and Amazon EKS pods, regardless of the customers subscription
* state, removing the need for your software to perform entitlement checks at
* runtime.</p> </li> </ul><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/RegisterUsage">AWS
* API Reference</a></p>
*/
virtual Model::RegisterUsageOutcome RegisterUsage(const Model::RegisterUsageRequest& request) const;
/**
* <p>Paid container software products sold through AWS Marketplace must integrate
* with the AWS Marketplace Metering Service and call the RegisterUsage operation
* for software entitlement and metering. Free and BYOL products for Amazon ECS or
* Amazon EKS aren't required to call RegisterUsage, but you may choose to do so if
* you would like to receive usage data in your seller reports. The sections below
* explain the behavior of RegisterUsage. RegisterUsage performs two primary
* functions: metering and entitlement.</p> <ul> <li> <p> <i>Entitlement</i>:
* RegisterUsage allows you to verify that the customer running your paid software
* is subscribed to your product on AWS Marketplace, enabling you to guard against
* unauthorized use. Your container image that integrates with RegisterUsage is
* only required to guard against unauthorized use at container startup, as such a
* CustomerNotSubscribedException/PlatformNotSupportedException will only be thrown
* on the initial call to RegisterUsage. Subsequent calls from the same Amazon ECS
* task instance (e.g. task-id) or Amazon EKS pod will not throw a
* CustomerNotSubscribedException, even if the customer unsubscribes while the
* Amazon ECS task or Amazon EKS pod is still running.</p> </li> <li> <p>
* <i>Metering</i>: RegisterUsage meters software use per ECS task, per hour, or
* per pod for Amazon EKS with usage prorated to the second. A minimum of 1 minute
* of usage applies to tasks that are short lived. For example, if a customer has a
* 10 node Amazon ECS or Amazon EKS cluster and a service configured as a Daemon
* Set, then Amazon ECS or Amazon EKS will launch a task on all 10 cluster nodes
* and the customer will be charged: (10 * hourly_rate). Metering for software use
* is automatically handled by the AWS Marketplace Metering Control Plane -- your
* software is not required to perform any metering specific actions, other than
* call RegisterUsage once for metering of software use to commence. The AWS
* Marketplace Metering Control Plane will also continue to bill customers for
* running ECS tasks and Amazon EKS pods, regardless of the customers subscription
* state, removing the need for your software to perform entitlement checks at
* runtime.</p> </li> </ul><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/RegisterUsage">AWS
* API Reference</a></p>
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::RegisterUsageOutcomeCallable RegisterUsageCallable(const Model::RegisterUsageRequest& request) const;
/**
* <p>Paid container software products sold through AWS Marketplace must integrate
* with the AWS Marketplace Metering Service and call the RegisterUsage operation
* for software entitlement and metering. Free and BYOL products for Amazon ECS or
* Amazon EKS aren't required to call RegisterUsage, but you may choose to do so if
* you would like to receive usage data in your seller reports. The sections below
* explain the behavior of RegisterUsage. RegisterUsage performs two primary
* functions: metering and entitlement.</p> <ul> <li> <p> <i>Entitlement</i>:
* RegisterUsage allows you to verify that the customer running your paid software
* is subscribed to your product on AWS Marketplace, enabling you to guard against
* unauthorized use. Your container image that integrates with RegisterUsage is
* only required to guard against unauthorized use at container startup, as such a
* CustomerNotSubscribedException/PlatformNotSupportedException will only be thrown
* on the initial call to RegisterUsage. Subsequent calls from the same Amazon ECS
* task instance (e.g. task-id) or Amazon EKS pod will not throw a
* CustomerNotSubscribedException, even if the customer unsubscribes while the
* Amazon ECS task or Amazon EKS pod is still running.</p> </li> <li> <p>
* <i>Metering</i>: RegisterUsage meters software use per ECS task, per hour, or
* per pod for Amazon EKS with usage prorated to the second. A minimum of 1 minute
* of usage applies to tasks that are short lived. For example, if a customer has a
* 10 node Amazon ECS or Amazon EKS cluster and a service configured as a Daemon
* Set, then Amazon ECS or Amazon EKS will launch a task on all 10 cluster nodes
* and the customer will be charged: (10 * hourly_rate). Metering for software use
* is automatically handled by the AWS Marketplace Metering Control Plane -- your
* software is not required to perform any metering specific actions, other than
* call RegisterUsage once for metering of software use to commence. The AWS
* Marketplace Metering Control Plane will also continue to bill customers for
* running ECS tasks and Amazon EKS pods, regardless of the customers subscription
* state, removing the need for your software to perform entitlement checks at
* runtime.</p> </li> </ul><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/RegisterUsage">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void RegisterUsageAsync(const Model::RegisterUsageRequest& request, const RegisterUsageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
/**
* <p>ResolveCustomer is called by a SaaS application during the registration
* process. When a buyer visits your website during the registration process, the
* buyer submits a registration token through their browser. The registration token
* is resolved through this API to obtain a CustomerIdentifier and product
* code.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/ResolveCustomer">AWS
* API Reference</a></p>
*/
virtual Model::ResolveCustomerOutcome ResolveCustomer(const Model::ResolveCustomerRequest& request) const;
/**
* <p>ResolveCustomer is called by a SaaS application during the registration
* process. When a buyer visits your website during the registration process, the
* buyer submits a registration token through their browser. The registration token
* is resolved through this API to obtain a CustomerIdentifier and product
* code.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/ResolveCustomer">AWS
* API Reference</a></p>
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::ResolveCustomerOutcomeCallable ResolveCustomerCallable(const Model::ResolveCustomerRequest& request) const;
/**
* <p>ResolveCustomer is called by a SaaS application during the registration
* process. When a buyer visits your website during the registration process, the
* buyer submits a registration token through their browser. The registration token
* is resolved through this API to obtain a CustomerIdentifier and product
* code.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/ResolveCustomer">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void ResolveCustomerAsync(const Model::ResolveCustomerRequest& request, const ResolveCustomerResponseReceivedHandler& 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 BatchMeterUsageAsyncHelper(const Model::BatchMeterUsageRequest& request, const BatchMeterUsageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
void MeterUsageAsyncHelper(const Model::MeterUsageRequest& request, const MeterUsageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
void RegisterUsageAsyncHelper(const Model::RegisterUsageRequest& request, const RegisterUsageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
void ResolveCustomerAsyncHelper(const Model::ResolveCustomerRequest& request, const ResolveCustomerResponseReceivedHandler& 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 MarketplaceMetering
} // 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/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/core/Region.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace MarketplaceMetering
{
namespace MarketplaceMeteringEndpoint
{
AWS_MARKETPLACEMETERING_API Aws::String ForRegion(const Aws::String& regionName, bool useDualStack = false);
} // namespace MarketplaceMeteringEndpoint
} // namespace MarketplaceMetering
} // 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/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/core/client/AWSErrorMarshaller.h>
namespace Aws
{
namespace Client
{
class AWS_MARKETPLACEMETERING_API MarketplaceMeteringErrorMarshaller : 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,85 @@
/**
* 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/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
namespace Aws
{
namespace MarketplaceMetering
{
enum class MarketplaceMeteringErrors
{
//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,
///////////////////////////////////////////////////////////////////////////////////////////
CUSTOMER_NOT_ENTITLED= static_cast<int>(Aws::Client::CoreErrors::SERVICE_EXTENSION_START_RANGE) + 1,
DISABLED_API,
DUPLICATE_REQUEST,
EXPIRED_TOKEN,
INTERNAL_SERVICE_ERROR,
INVALID_CUSTOMER_IDENTIFIER,
INVALID_ENDPOINT_REGION,
INVALID_PRODUCT_CODE,
INVALID_PUBLIC_KEY_VERSION,
INVALID_REGION,
INVALID_TOKEN,
INVALID_USAGE_DIMENSION,
PLATFORM_NOT_SUPPORTED,
TIMESTAMP_OUT_OF_BOUNDS
};
class AWS_MARKETPLACEMETERING_API MarketplaceMeteringError : public Aws::Client::AWSError<MarketplaceMeteringErrors>
{
public:
MarketplaceMeteringError() {}
MarketplaceMeteringError(const Aws::Client::AWSError<Aws::Client::CoreErrors>& rhs) : Aws::Client::AWSError<MarketplaceMeteringErrors>(rhs) {}
MarketplaceMeteringError(Aws::Client::AWSError<Aws::Client::CoreErrors>&& rhs) : Aws::Client::AWSError<MarketplaceMeteringErrors>(rhs) {}
MarketplaceMeteringError(const Aws::Client::AWSError<MarketplaceMeteringErrors>& rhs) : Aws::Client::AWSError<MarketplaceMeteringErrors>(rhs) {}
MarketplaceMeteringError(Aws::Client::AWSError<MarketplaceMeteringErrors>&& rhs) : Aws::Client::AWSError<MarketplaceMeteringErrors>(rhs) {}
template <typename T>
T GetModeledError();
};
namespace MarketplaceMeteringErrorMapper
{
AWS_MARKETPLACEMETERING_API Aws::Client::AWSError<Aws::Client::CoreErrors> GetErrorForName(const char* errorName);
}
} // namespace MarketplaceMetering
} // 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/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/core/AmazonSerializableWebServiceRequest.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <aws/core/http/HttpRequest.h>
namespace Aws
{
namespace MarketplaceMetering
{
class AWS_MARKETPLACEMETERING_API MarketplaceMeteringRequest : public Aws::AmazonSerializableWebServiceRequest
{
public:
virtual ~MarketplaceMeteringRequest () {}
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, "2016-01-14"));
return headers;
}
protected:
virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); }
};
} // namespace MarketplaceMetering
} // 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_MARKETPLACEMETERING_EXPORTS
#define AWS_MARKETPLACEMETERING_API __declspec(dllexport)
#else
#define AWS_MARKETPLACEMETERING_API __declspec(dllimport)
#endif /* AWS_MARKETPLACEMETERING_EXPORTS */
#else
#define AWS_MARKETPLACEMETERING_API
#endif // USE_IMPORT_EXPORT
#else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
#define AWS_MARKETPLACEMETERING_API
#endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)

View File

@@ -0,0 +1,159 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/meteringmarketplace/MarketplaceMeteringRequest.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/meteringmarketplace/model/UsageRecord.h>
#include <utility>
namespace Aws
{
namespace MarketplaceMetering
{
namespace Model
{
/**
* <p>A BatchMeterUsageRequest contains UsageRecords, which indicate quantities of
* usage within your application.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/BatchMeterUsageRequest">AWS
* API Reference</a></p>
*/
class AWS_MARKETPLACEMETERING_API BatchMeterUsageRequest : public MarketplaceMeteringRequest
{
public:
BatchMeterUsageRequest();
// 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 "BatchMeterUsage"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The set of UsageRecords to submit. BatchMeterUsage accepts up to 25
* UsageRecords at a time.</p>
*/
inline const Aws::Vector<UsageRecord>& GetUsageRecords() const{ return m_usageRecords; }
/**
* <p>The set of UsageRecords to submit. BatchMeterUsage accepts up to 25
* UsageRecords at a time.</p>
*/
inline bool UsageRecordsHasBeenSet() const { return m_usageRecordsHasBeenSet; }
/**
* <p>The set of UsageRecords to submit. BatchMeterUsage accepts up to 25
* UsageRecords at a time.</p>
*/
inline void SetUsageRecords(const Aws::Vector<UsageRecord>& value) { m_usageRecordsHasBeenSet = true; m_usageRecords = value; }
/**
* <p>The set of UsageRecords to submit. BatchMeterUsage accepts up to 25
* UsageRecords at a time.</p>
*/
inline void SetUsageRecords(Aws::Vector<UsageRecord>&& value) { m_usageRecordsHasBeenSet = true; m_usageRecords = std::move(value); }
/**
* <p>The set of UsageRecords to submit. BatchMeterUsage accepts up to 25
* UsageRecords at a time.</p>
*/
inline BatchMeterUsageRequest& WithUsageRecords(const Aws::Vector<UsageRecord>& value) { SetUsageRecords(value); return *this;}
/**
* <p>The set of UsageRecords to submit. BatchMeterUsage accepts up to 25
* UsageRecords at a time.</p>
*/
inline BatchMeterUsageRequest& WithUsageRecords(Aws::Vector<UsageRecord>&& value) { SetUsageRecords(std::move(value)); return *this;}
/**
* <p>The set of UsageRecords to submit. BatchMeterUsage accepts up to 25
* UsageRecords at a time.</p>
*/
inline BatchMeterUsageRequest& AddUsageRecords(const UsageRecord& value) { m_usageRecordsHasBeenSet = true; m_usageRecords.push_back(value); return *this; }
/**
* <p>The set of UsageRecords to submit. BatchMeterUsage accepts up to 25
* UsageRecords at a time.</p>
*/
inline BatchMeterUsageRequest& AddUsageRecords(UsageRecord&& value) { m_usageRecordsHasBeenSet = true; m_usageRecords.push_back(std::move(value)); return *this; }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline const Aws::String& GetProductCode() const{ return m_productCode; }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline bool ProductCodeHasBeenSet() const { return m_productCodeHasBeenSet; }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline void SetProductCode(const Aws::String& value) { m_productCodeHasBeenSet = true; m_productCode = value; }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline void SetProductCode(Aws::String&& value) { m_productCodeHasBeenSet = true; m_productCode = std::move(value); }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline void SetProductCode(const char* value) { m_productCodeHasBeenSet = true; m_productCode.assign(value); }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline BatchMeterUsageRequest& WithProductCode(const Aws::String& value) { SetProductCode(value); return *this;}
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline BatchMeterUsageRequest& WithProductCode(Aws::String&& value) { SetProductCode(std::move(value)); return *this;}
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline BatchMeterUsageRequest& WithProductCode(const char* value) { SetProductCode(value); return *this;}
private:
Aws::Vector<UsageRecord> m_usageRecords;
bool m_usageRecordsHasBeenSet;
Aws::String m_productCode;
bool m_productCodeHasBeenSet;
};
} // namespace Model
} // namespace MarketplaceMetering
} // namespace Aws

View File

@@ -0,0 +1,144 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/meteringmarketplace/model/UsageRecordResult.h>
#include <aws/meteringmarketplace/model/UsageRecord.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace MarketplaceMetering
{
namespace Model
{
/**
* <p>Contains the UsageRecords processed by BatchMeterUsage and any records that
* have failed due to transient error.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/BatchMeterUsageResult">AWS
* API Reference</a></p>
*/
class AWS_MARKETPLACEMETERING_API BatchMeterUsageResult
{
public:
BatchMeterUsageResult();
BatchMeterUsageResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
BatchMeterUsageResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>Contains all UsageRecords processed by BatchMeterUsage. These records were
* either honored by AWS Marketplace Metering Service or were invalid.</p>
*/
inline const Aws::Vector<UsageRecordResult>& GetResults() const{ return m_results; }
/**
* <p>Contains all UsageRecords processed by BatchMeterUsage. These records were
* either honored by AWS Marketplace Metering Service or were invalid.</p>
*/
inline void SetResults(const Aws::Vector<UsageRecordResult>& value) { m_results = value; }
/**
* <p>Contains all UsageRecords processed by BatchMeterUsage. These records were
* either honored by AWS Marketplace Metering Service or were invalid.</p>
*/
inline void SetResults(Aws::Vector<UsageRecordResult>&& value) { m_results = std::move(value); }
/**
* <p>Contains all UsageRecords processed by BatchMeterUsage. These records were
* either honored by AWS Marketplace Metering Service or were invalid.</p>
*/
inline BatchMeterUsageResult& WithResults(const Aws::Vector<UsageRecordResult>& value) { SetResults(value); return *this;}
/**
* <p>Contains all UsageRecords processed by BatchMeterUsage. These records were
* either honored by AWS Marketplace Metering Service or were invalid.</p>
*/
inline BatchMeterUsageResult& WithResults(Aws::Vector<UsageRecordResult>&& value) { SetResults(std::move(value)); return *this;}
/**
* <p>Contains all UsageRecords processed by BatchMeterUsage. These records were
* either honored by AWS Marketplace Metering Service or were invalid.</p>
*/
inline BatchMeterUsageResult& AddResults(const UsageRecordResult& value) { m_results.push_back(value); return *this; }
/**
* <p>Contains all UsageRecords processed by BatchMeterUsage. These records were
* either honored by AWS Marketplace Metering Service or were invalid.</p>
*/
inline BatchMeterUsageResult& AddResults(UsageRecordResult&& value) { m_results.push_back(std::move(value)); return *this; }
/**
* <p>Contains all UsageRecords that were not processed by BatchMeterUsage. This is
* a list of UsageRecords. You can retry the failed request by making another
* BatchMeterUsage call with this list as input in the BatchMeterUsageRequest.</p>
*/
inline const Aws::Vector<UsageRecord>& GetUnprocessedRecords() const{ return m_unprocessedRecords; }
/**
* <p>Contains all UsageRecords that were not processed by BatchMeterUsage. This is
* a list of UsageRecords. You can retry the failed request by making another
* BatchMeterUsage call with this list as input in the BatchMeterUsageRequest.</p>
*/
inline void SetUnprocessedRecords(const Aws::Vector<UsageRecord>& value) { m_unprocessedRecords = value; }
/**
* <p>Contains all UsageRecords that were not processed by BatchMeterUsage. This is
* a list of UsageRecords. You can retry the failed request by making another
* BatchMeterUsage call with this list as input in the BatchMeterUsageRequest.</p>
*/
inline void SetUnprocessedRecords(Aws::Vector<UsageRecord>&& value) { m_unprocessedRecords = std::move(value); }
/**
* <p>Contains all UsageRecords that were not processed by BatchMeterUsage. This is
* a list of UsageRecords. You can retry the failed request by making another
* BatchMeterUsage call with this list as input in the BatchMeterUsageRequest.</p>
*/
inline BatchMeterUsageResult& WithUnprocessedRecords(const Aws::Vector<UsageRecord>& value) { SetUnprocessedRecords(value); return *this;}
/**
* <p>Contains all UsageRecords that were not processed by BatchMeterUsage. This is
* a list of UsageRecords. You can retry the failed request by making another
* BatchMeterUsage call with this list as input in the BatchMeterUsageRequest.</p>
*/
inline BatchMeterUsageResult& WithUnprocessedRecords(Aws::Vector<UsageRecord>&& value) { SetUnprocessedRecords(std::move(value)); return *this;}
/**
* <p>Contains all UsageRecords that were not processed by BatchMeterUsage. This is
* a list of UsageRecords. You can retry the failed request by making another
* BatchMeterUsage call with this list as input in the BatchMeterUsageRequest.</p>
*/
inline BatchMeterUsageResult& AddUnprocessedRecords(const UsageRecord& value) { m_unprocessedRecords.push_back(value); return *this; }
/**
* <p>Contains all UsageRecords that were not processed by BatchMeterUsage. This is
* a list of UsageRecords. You can retry the failed request by making another
* BatchMeterUsage call with this list as input in the BatchMeterUsageRequest.</p>
*/
inline BatchMeterUsageResult& AddUnprocessedRecords(UsageRecord&& value) { m_unprocessedRecords.push_back(std::move(value)); return *this; }
private:
Aws::Vector<UsageRecordResult> m_results;
Aws::Vector<UsageRecord> m_unprocessedRecords;
};
} // namespace Model
} // namespace MarketplaceMetering
} // namespace Aws

View File

@@ -0,0 +1,264 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/meteringmarketplace/MarketplaceMeteringRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/DateTime.h>
#include <utility>
namespace Aws
{
namespace MarketplaceMetering
{
namespace Model
{
/**
*/
class AWS_MARKETPLACEMETERING_API MeterUsageRequest : public MarketplaceMeteringRequest
{
public:
MeterUsageRequest();
// 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 "MeterUsage"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline const Aws::String& GetProductCode() const{ return m_productCode; }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline bool ProductCodeHasBeenSet() const { return m_productCodeHasBeenSet; }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline void SetProductCode(const Aws::String& value) { m_productCodeHasBeenSet = true; m_productCode = value; }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline void SetProductCode(Aws::String&& value) { m_productCodeHasBeenSet = true; m_productCode = std::move(value); }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline void SetProductCode(const char* value) { m_productCodeHasBeenSet = true; m_productCode.assign(value); }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline MeterUsageRequest& WithProductCode(const Aws::String& value) { SetProductCode(value); return *this;}
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline MeterUsageRequest& WithProductCode(Aws::String&& value) { SetProductCode(std::move(value)); return *this;}
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline MeterUsageRequest& WithProductCode(const char* value) { SetProductCode(value); return *this;}
/**
* <p>Timestamp, in UTC, for which the usage is being reported. Your application
* can meter usage for up to one hour in the past. Make sure the timestamp value is
* not before the start of the software usage.</p>
*/
inline const Aws::Utils::DateTime& GetTimestamp() const{ return m_timestamp; }
/**
* <p>Timestamp, in UTC, for which the usage is being reported. Your application
* can meter usage for up to one hour in the past. Make sure the timestamp value is
* not before the start of the software usage.</p>
*/
inline bool TimestampHasBeenSet() const { return m_timestampHasBeenSet; }
/**
* <p>Timestamp, in UTC, for which the usage is being reported. Your application
* can meter usage for up to one hour in the past. Make sure the timestamp value is
* not before the start of the software usage.</p>
*/
inline void SetTimestamp(const Aws::Utils::DateTime& value) { m_timestampHasBeenSet = true; m_timestamp = value; }
/**
* <p>Timestamp, in UTC, for which the usage is being reported. Your application
* can meter usage for up to one hour in the past. Make sure the timestamp value is
* not before the start of the software usage.</p>
*/
inline void SetTimestamp(Aws::Utils::DateTime&& value) { m_timestampHasBeenSet = true; m_timestamp = std::move(value); }
/**
* <p>Timestamp, in UTC, for which the usage is being reported. Your application
* can meter usage for up to one hour in the past. Make sure the timestamp value is
* not before the start of the software usage.</p>
*/
inline MeterUsageRequest& WithTimestamp(const Aws::Utils::DateTime& value) { SetTimestamp(value); return *this;}
/**
* <p>Timestamp, in UTC, for which the usage is being reported. Your application
* can meter usage for up to one hour in the past. Make sure the timestamp value is
* not before the start of the software usage.</p>
*/
inline MeterUsageRequest& WithTimestamp(Aws::Utils::DateTime&& value) { SetTimestamp(std::move(value)); return *this;}
/**
* <p>It will be one of the fcp dimension name provided during the publishing of
* the product.</p>
*/
inline const Aws::String& GetUsageDimension() const{ return m_usageDimension; }
/**
* <p>It will be one of the fcp dimension name provided during the publishing of
* the product.</p>
*/
inline bool UsageDimensionHasBeenSet() const { return m_usageDimensionHasBeenSet; }
/**
* <p>It will be one of the fcp dimension name provided during the publishing of
* the product.</p>
*/
inline void SetUsageDimension(const Aws::String& value) { m_usageDimensionHasBeenSet = true; m_usageDimension = value; }
/**
* <p>It will be one of the fcp dimension name provided during the publishing of
* the product.</p>
*/
inline void SetUsageDimension(Aws::String&& value) { m_usageDimensionHasBeenSet = true; m_usageDimension = std::move(value); }
/**
* <p>It will be one of the fcp dimension name provided during the publishing of
* the product.</p>
*/
inline void SetUsageDimension(const char* value) { m_usageDimensionHasBeenSet = true; m_usageDimension.assign(value); }
/**
* <p>It will be one of the fcp dimension name provided during the publishing of
* the product.</p>
*/
inline MeterUsageRequest& WithUsageDimension(const Aws::String& value) { SetUsageDimension(value); return *this;}
/**
* <p>It will be one of the fcp dimension name provided during the publishing of
* the product.</p>
*/
inline MeterUsageRequest& WithUsageDimension(Aws::String&& value) { SetUsageDimension(std::move(value)); return *this;}
/**
* <p>It will be one of the fcp dimension name provided during the publishing of
* the product.</p>
*/
inline MeterUsageRequest& WithUsageDimension(const char* value) { SetUsageDimension(value); return *this;}
/**
* <p>Consumption value for the hour. Defaults to <code>0</code> if not
* specified.</p>
*/
inline int GetUsageQuantity() const{ return m_usageQuantity; }
/**
* <p>Consumption value for the hour. Defaults to <code>0</code> if not
* specified.</p>
*/
inline bool UsageQuantityHasBeenSet() const { return m_usageQuantityHasBeenSet; }
/**
* <p>Consumption value for the hour. Defaults to <code>0</code> if not
* specified.</p>
*/
inline void SetUsageQuantity(int value) { m_usageQuantityHasBeenSet = true; m_usageQuantity = value; }
/**
* <p>Consumption value for the hour. Defaults to <code>0</code> if not
* specified.</p>
*/
inline MeterUsageRequest& WithUsageQuantity(int value) { SetUsageQuantity(value); return *this;}
/**
* <p>Checks whether you have the permissions required for the action, but does not
* make the request. If you have the permissions, the request returns
* DryRunOperation; otherwise, it returns UnauthorizedException. Defaults to
* <code>false</code> if not specified.</p>
*/
inline bool GetDryRun() const{ return m_dryRun; }
/**
* <p>Checks whether you have the permissions required for the action, but does not
* make the request. If you have the permissions, the request returns
* DryRunOperation; otherwise, it returns UnauthorizedException. Defaults to
* <code>false</code> if not specified.</p>
*/
inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; }
/**
* <p>Checks whether you have the permissions required for the action, but does not
* make the request. If you have the permissions, the request returns
* DryRunOperation; otherwise, it returns UnauthorizedException. Defaults to
* <code>false</code> if not specified.</p>
*/
inline void SetDryRun(bool value) { m_dryRunHasBeenSet = true; m_dryRun = value; }
/**
* <p>Checks whether you have the permissions required for the action, but does not
* make the request. If you have the permissions, the request returns
* DryRunOperation; otherwise, it returns UnauthorizedException. Defaults to
* <code>false</code> if not specified.</p>
*/
inline MeterUsageRequest& WithDryRun(bool value) { SetDryRun(value); return *this;}
private:
Aws::String m_productCode;
bool m_productCodeHasBeenSet;
Aws::Utils::DateTime m_timestamp;
bool m_timestampHasBeenSet;
Aws::String m_usageDimension;
bool m_usageDimensionHasBeenSet;
int m_usageQuantity;
bool m_usageQuantityHasBeenSet;
bool m_dryRun;
bool m_dryRunHasBeenSet;
};
} // namespace Model
} // namespace MarketplaceMetering
} // namespace Aws

View File

@@ -0,0 +1,77 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace MarketplaceMetering
{
namespace Model
{
class AWS_MARKETPLACEMETERING_API MeterUsageResult
{
public:
MeterUsageResult();
MeterUsageResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
MeterUsageResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>Metering record id.</p>
*/
inline const Aws::String& GetMeteringRecordId() const{ return m_meteringRecordId; }
/**
* <p>Metering record id.</p>
*/
inline void SetMeteringRecordId(const Aws::String& value) { m_meteringRecordId = value; }
/**
* <p>Metering record id.</p>
*/
inline void SetMeteringRecordId(Aws::String&& value) { m_meteringRecordId = std::move(value); }
/**
* <p>Metering record id.</p>
*/
inline void SetMeteringRecordId(const char* value) { m_meteringRecordId.assign(value); }
/**
* <p>Metering record id.</p>
*/
inline MeterUsageResult& WithMeteringRecordId(const Aws::String& value) { SetMeteringRecordId(value); return *this;}
/**
* <p>Metering record id.</p>
*/
inline MeterUsageResult& WithMeteringRecordId(Aws::String&& value) { SetMeteringRecordId(std::move(value)); return *this;}
/**
* <p>Metering record id.</p>
*/
inline MeterUsageResult& WithMeteringRecordId(const char* value) { SetMeteringRecordId(value); return *this;}
private:
Aws::String m_meteringRecordId;
};
} // namespace Model
} // namespace MarketplaceMetering
} // namespace Aws

View File

@@ -0,0 +1,177 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/meteringmarketplace/MarketplaceMeteringRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace MarketplaceMetering
{
namespace Model
{
/**
*/
class AWS_MARKETPLACEMETERING_API RegisterUsageRequest : public MarketplaceMeteringRequest
{
public:
RegisterUsageRequest();
// 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 "RegisterUsage"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline const Aws::String& GetProductCode() const{ return m_productCode; }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline bool ProductCodeHasBeenSet() const { return m_productCodeHasBeenSet; }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline void SetProductCode(const Aws::String& value) { m_productCodeHasBeenSet = true; m_productCode = value; }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline void SetProductCode(Aws::String&& value) { m_productCodeHasBeenSet = true; m_productCode = std::move(value); }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline void SetProductCode(const char* value) { m_productCodeHasBeenSet = true; m_productCode.assign(value); }
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline RegisterUsageRequest& WithProductCode(const Aws::String& value) { SetProductCode(value); return *this;}
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline RegisterUsageRequest& WithProductCode(Aws::String&& value) { SetProductCode(std::move(value)); return *this;}
/**
* <p>Product code is used to uniquely identify a product in AWS Marketplace. The
* product code should be the same as the one used during the publishing of a new
* product.</p>
*/
inline RegisterUsageRequest& WithProductCode(const char* value) { SetProductCode(value); return *this;}
/**
* <p>Public Key Version provided by AWS Marketplace</p>
*/
inline int GetPublicKeyVersion() const{ return m_publicKeyVersion; }
/**
* <p>Public Key Version provided by AWS Marketplace</p>
*/
inline bool PublicKeyVersionHasBeenSet() const { return m_publicKeyVersionHasBeenSet; }
/**
* <p>Public Key Version provided by AWS Marketplace</p>
*/
inline void SetPublicKeyVersion(int value) { m_publicKeyVersionHasBeenSet = true; m_publicKeyVersion = value; }
/**
* <p>Public Key Version provided by AWS Marketplace</p>
*/
inline RegisterUsageRequest& WithPublicKeyVersion(int value) { SetPublicKeyVersion(value); return *this;}
/**
* <p>(Optional) To scope down the registration to a specific running software
* instance and guard against replay attacks.</p>
*/
inline const Aws::String& GetNonce() const{ return m_nonce; }
/**
* <p>(Optional) To scope down the registration to a specific running software
* instance and guard against replay attacks.</p>
*/
inline bool NonceHasBeenSet() const { return m_nonceHasBeenSet; }
/**
* <p>(Optional) To scope down the registration to a specific running software
* instance and guard against replay attacks.</p>
*/
inline void SetNonce(const Aws::String& value) { m_nonceHasBeenSet = true; m_nonce = value; }
/**
* <p>(Optional) To scope down the registration to a specific running software
* instance and guard against replay attacks.</p>
*/
inline void SetNonce(Aws::String&& value) { m_nonceHasBeenSet = true; m_nonce = std::move(value); }
/**
* <p>(Optional) To scope down the registration to a specific running software
* instance and guard against replay attacks.</p>
*/
inline void SetNonce(const char* value) { m_nonceHasBeenSet = true; m_nonce.assign(value); }
/**
* <p>(Optional) To scope down the registration to a specific running software
* instance and guard against replay attacks.</p>
*/
inline RegisterUsageRequest& WithNonce(const Aws::String& value) { SetNonce(value); return *this;}
/**
* <p>(Optional) To scope down the registration to a specific running software
* instance and guard against replay attacks.</p>
*/
inline RegisterUsageRequest& WithNonce(Aws::String&& value) { SetNonce(std::move(value)); return *this;}
/**
* <p>(Optional) To scope down the registration to a specific running software
* instance and guard against replay attacks.</p>
*/
inline RegisterUsageRequest& WithNonce(const char* value) { SetNonce(value); return *this;}
private:
Aws::String m_productCode;
bool m_productCodeHasBeenSet;
int m_publicKeyVersion;
bool m_publicKeyVersionHasBeenSet;
Aws::String m_nonce;
bool m_nonceHasBeenSet;
};
} // namespace Model
} // namespace MarketplaceMetering
} // namespace Aws

View File

@@ -0,0 +1,106 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/core/utils/DateTime.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace MarketplaceMetering
{
namespace Model
{
class AWS_MARKETPLACEMETERING_API RegisterUsageResult
{
public:
RegisterUsageResult();
RegisterUsageResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
RegisterUsageResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>(Optional) Only included when public key version has expired</p>
*/
inline const Aws::Utils::DateTime& GetPublicKeyRotationTimestamp() const{ return m_publicKeyRotationTimestamp; }
/**
* <p>(Optional) Only included when public key version has expired</p>
*/
inline void SetPublicKeyRotationTimestamp(const Aws::Utils::DateTime& value) { m_publicKeyRotationTimestamp = value; }
/**
* <p>(Optional) Only included when public key version has expired</p>
*/
inline void SetPublicKeyRotationTimestamp(Aws::Utils::DateTime&& value) { m_publicKeyRotationTimestamp = std::move(value); }
/**
* <p>(Optional) Only included when public key version has expired</p>
*/
inline RegisterUsageResult& WithPublicKeyRotationTimestamp(const Aws::Utils::DateTime& value) { SetPublicKeyRotationTimestamp(value); return *this;}
/**
* <p>(Optional) Only included when public key version has expired</p>
*/
inline RegisterUsageResult& WithPublicKeyRotationTimestamp(Aws::Utils::DateTime&& value) { SetPublicKeyRotationTimestamp(std::move(value)); return *this;}
/**
* <p>JWT Token</p>
*/
inline const Aws::String& GetSignature() const{ return m_signature; }
/**
* <p>JWT Token</p>
*/
inline void SetSignature(const Aws::String& value) { m_signature = value; }
/**
* <p>JWT Token</p>
*/
inline void SetSignature(Aws::String&& value) { m_signature = std::move(value); }
/**
* <p>JWT Token</p>
*/
inline void SetSignature(const char* value) { m_signature.assign(value); }
/**
* <p>JWT Token</p>
*/
inline RegisterUsageResult& WithSignature(const Aws::String& value) { SetSignature(value); return *this;}
/**
* <p>JWT Token</p>
*/
inline RegisterUsageResult& WithSignature(Aws::String&& value) { SetSignature(std::move(value)); return *this;}
/**
* <p>JWT Token</p>
*/
inline RegisterUsageResult& WithSignature(const char* value) { SetSignature(value); return *this;}
private:
Aws::Utils::DateTime m_publicKeyRotationTimestamp;
Aws::String m_signature;
};
} // namespace Model
} // namespace MarketplaceMetering
} // namespace Aws

View File

@@ -0,0 +1,105 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/meteringmarketplace/MarketplaceMeteringRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace MarketplaceMetering
{
namespace Model
{
/**
* <p>Contains input to the ResolveCustomer operation.</p><p><h3>See Also:</h3>
* <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/ResolveCustomerRequest">AWS
* API Reference</a></p>
*/
class AWS_MARKETPLACEMETERING_API ResolveCustomerRequest : public MarketplaceMeteringRequest
{
public:
ResolveCustomerRequest();
// 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 "ResolveCustomer"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>When a buyer visits your website during the registration process, the buyer
* submits a registration token through the browser. The registration token is
* resolved to obtain a CustomerIdentifier and product code.</p>
*/
inline const Aws::String& GetRegistrationToken() const{ return m_registrationToken; }
/**
* <p>When a buyer visits your website during the registration process, the buyer
* submits a registration token through the browser. The registration token is
* resolved to obtain a CustomerIdentifier and product code.</p>
*/
inline bool RegistrationTokenHasBeenSet() const { return m_registrationTokenHasBeenSet; }
/**
* <p>When a buyer visits your website during the registration process, the buyer
* submits a registration token through the browser. The registration token is
* resolved to obtain a CustomerIdentifier and product code.</p>
*/
inline void SetRegistrationToken(const Aws::String& value) { m_registrationTokenHasBeenSet = true; m_registrationToken = value; }
/**
* <p>When a buyer visits your website during the registration process, the buyer
* submits a registration token through the browser. The registration token is
* resolved to obtain a CustomerIdentifier and product code.</p>
*/
inline void SetRegistrationToken(Aws::String&& value) { m_registrationTokenHasBeenSet = true; m_registrationToken = std::move(value); }
/**
* <p>When a buyer visits your website during the registration process, the buyer
* submits a registration token through the browser. The registration token is
* resolved to obtain a CustomerIdentifier and product code.</p>
*/
inline void SetRegistrationToken(const char* value) { m_registrationTokenHasBeenSet = true; m_registrationToken.assign(value); }
/**
* <p>When a buyer visits your website during the registration process, the buyer
* submits a registration token through the browser. The registration token is
* resolved to obtain a CustomerIdentifier and product code.</p>
*/
inline ResolveCustomerRequest& WithRegistrationToken(const Aws::String& value) { SetRegistrationToken(value); return *this;}
/**
* <p>When a buyer visits your website during the registration process, the buyer
* submits a registration token through the browser. The registration token is
* resolved to obtain a CustomerIdentifier and product code.</p>
*/
inline ResolveCustomerRequest& WithRegistrationToken(Aws::String&& value) { SetRegistrationToken(std::move(value)); return *this;}
/**
* <p>When a buyer visits your website during the registration process, the buyer
* submits a registration token through the browser. The registration token is
* resolved to obtain a CustomerIdentifier and product code.</p>
*/
inline ResolveCustomerRequest& WithRegistrationToken(const char* value) { SetRegistrationToken(value); return *this;}
private:
Aws::String m_registrationToken;
bool m_registrationTokenHasBeenSet;
};
} // namespace Model
} // namespace MarketplaceMetering
} // namespace Aws

View File

@@ -0,0 +1,149 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace MarketplaceMetering
{
namespace Model
{
/**
* <p>The result of the ResolveCustomer operation. Contains the CustomerIdentifier
* and product code.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/ResolveCustomerResult">AWS
* API Reference</a></p>
*/
class AWS_MARKETPLACEMETERING_API ResolveCustomerResult
{
public:
ResolveCustomerResult();
ResolveCustomerResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
ResolveCustomerResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The CustomerIdentifier is used to identify an individual customer in your
* application. Calls to BatchMeterUsage require CustomerIdentifiers for each
* UsageRecord.</p>
*/
inline const Aws::String& GetCustomerIdentifier() const{ return m_customerIdentifier; }
/**
* <p>The CustomerIdentifier is used to identify an individual customer in your
* application. Calls to BatchMeterUsage require CustomerIdentifiers for each
* UsageRecord.</p>
*/
inline void SetCustomerIdentifier(const Aws::String& value) { m_customerIdentifier = value; }
/**
* <p>The CustomerIdentifier is used to identify an individual customer in your
* application. Calls to BatchMeterUsage require CustomerIdentifiers for each
* UsageRecord.</p>
*/
inline void SetCustomerIdentifier(Aws::String&& value) { m_customerIdentifier = std::move(value); }
/**
* <p>The CustomerIdentifier is used to identify an individual customer in your
* application. Calls to BatchMeterUsage require CustomerIdentifiers for each
* UsageRecord.</p>
*/
inline void SetCustomerIdentifier(const char* value) { m_customerIdentifier.assign(value); }
/**
* <p>The CustomerIdentifier is used to identify an individual customer in your
* application. Calls to BatchMeterUsage require CustomerIdentifiers for each
* UsageRecord.</p>
*/
inline ResolveCustomerResult& WithCustomerIdentifier(const Aws::String& value) { SetCustomerIdentifier(value); return *this;}
/**
* <p>The CustomerIdentifier is used to identify an individual customer in your
* application. Calls to BatchMeterUsage require CustomerIdentifiers for each
* UsageRecord.</p>
*/
inline ResolveCustomerResult& WithCustomerIdentifier(Aws::String&& value) { SetCustomerIdentifier(std::move(value)); return *this;}
/**
* <p>The CustomerIdentifier is used to identify an individual customer in your
* application. Calls to BatchMeterUsage require CustomerIdentifiers for each
* UsageRecord.</p>
*/
inline ResolveCustomerResult& WithCustomerIdentifier(const char* value) { SetCustomerIdentifier(value); return *this;}
/**
* <p>The product code is returned to confirm that the buyer is registering for
* your product. Subsequent BatchMeterUsage calls should be made using this product
* code.</p>
*/
inline const Aws::String& GetProductCode() const{ return m_productCode; }
/**
* <p>The product code is returned to confirm that the buyer is registering for
* your product. Subsequent BatchMeterUsage calls should be made using this product
* code.</p>
*/
inline void SetProductCode(const Aws::String& value) { m_productCode = value; }
/**
* <p>The product code is returned to confirm that the buyer is registering for
* your product. Subsequent BatchMeterUsage calls should be made using this product
* code.</p>
*/
inline void SetProductCode(Aws::String&& value) { m_productCode = std::move(value); }
/**
* <p>The product code is returned to confirm that the buyer is registering for
* your product. Subsequent BatchMeterUsage calls should be made using this product
* code.</p>
*/
inline void SetProductCode(const char* value) { m_productCode.assign(value); }
/**
* <p>The product code is returned to confirm that the buyer is registering for
* your product. Subsequent BatchMeterUsage calls should be made using this product
* code.</p>
*/
inline ResolveCustomerResult& WithProductCode(const Aws::String& value) { SetProductCode(value); return *this;}
/**
* <p>The product code is returned to confirm that the buyer is registering for
* your product. Subsequent BatchMeterUsage calls should be made using this product
* code.</p>
*/
inline ResolveCustomerResult& WithProductCode(Aws::String&& value) { SetProductCode(std::move(value)); return *this;}
/**
* <p>The product code is returned to confirm that the buyer is registering for
* your product. Subsequent BatchMeterUsage calls should be made using this product
* code.</p>
*/
inline ResolveCustomerResult& WithProductCode(const char* value) { SetProductCode(value); return *this;}
private:
Aws::String m_customerIdentifier;
Aws::String m_productCode;
};
} // namespace Model
} // namespace MarketplaceMetering
} // namespace Aws

View File

@@ -0,0 +1,233 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/core/utils/DateTime.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 MarketplaceMetering
{
namespace Model
{
/**
* <p>A UsageRecord indicates a quantity of usage for a given product, customer,
* dimension and time.</p> <p>Multiple requests with the same UsageRecords as input
* will be deduplicated to prevent double charges.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/UsageRecord">AWS
* API Reference</a></p>
*/
class AWS_MARKETPLACEMETERING_API UsageRecord
{
public:
UsageRecord();
UsageRecord(Aws::Utils::Json::JsonView jsonValue);
UsageRecord& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>Timestamp, in UTC, for which the usage is being reported.</p> <p>Your
* application can meter usage for up to one hour in the past. Make sure the
* timestamp value is not before the start of the software usage.</p>
*/
inline const Aws::Utils::DateTime& GetTimestamp() const{ return m_timestamp; }
/**
* <p>Timestamp, in UTC, for which the usage is being reported.</p> <p>Your
* application can meter usage for up to one hour in the past. Make sure the
* timestamp value is not before the start of the software usage.</p>
*/
inline bool TimestampHasBeenSet() const { return m_timestampHasBeenSet; }
/**
* <p>Timestamp, in UTC, for which the usage is being reported.</p> <p>Your
* application can meter usage for up to one hour in the past. Make sure the
* timestamp value is not before the start of the software usage.</p>
*/
inline void SetTimestamp(const Aws::Utils::DateTime& value) { m_timestampHasBeenSet = true; m_timestamp = value; }
/**
* <p>Timestamp, in UTC, for which the usage is being reported.</p> <p>Your
* application can meter usage for up to one hour in the past. Make sure the
* timestamp value is not before the start of the software usage.</p>
*/
inline void SetTimestamp(Aws::Utils::DateTime&& value) { m_timestampHasBeenSet = true; m_timestamp = std::move(value); }
/**
* <p>Timestamp, in UTC, for which the usage is being reported.</p> <p>Your
* application can meter usage for up to one hour in the past. Make sure the
* timestamp value is not before the start of the software usage.</p>
*/
inline UsageRecord& WithTimestamp(const Aws::Utils::DateTime& value) { SetTimestamp(value); return *this;}
/**
* <p>Timestamp, in UTC, for which the usage is being reported.</p> <p>Your
* application can meter usage for up to one hour in the past. Make sure the
* timestamp value is not before the start of the software usage.</p>
*/
inline UsageRecord& WithTimestamp(Aws::Utils::DateTime&& value) { SetTimestamp(std::move(value)); return *this;}
/**
* <p>The CustomerIdentifier is obtained through the ResolveCustomer operation and
* represents an individual buyer in your application.</p>
*/
inline const Aws::String& GetCustomerIdentifier() const{ return m_customerIdentifier; }
/**
* <p>The CustomerIdentifier is obtained through the ResolveCustomer operation and
* represents an individual buyer in your application.</p>
*/
inline bool CustomerIdentifierHasBeenSet() const { return m_customerIdentifierHasBeenSet; }
/**
* <p>The CustomerIdentifier is obtained through the ResolveCustomer operation and
* represents an individual buyer in your application.</p>
*/
inline void SetCustomerIdentifier(const Aws::String& value) { m_customerIdentifierHasBeenSet = true; m_customerIdentifier = value; }
/**
* <p>The CustomerIdentifier is obtained through the ResolveCustomer operation and
* represents an individual buyer in your application.</p>
*/
inline void SetCustomerIdentifier(Aws::String&& value) { m_customerIdentifierHasBeenSet = true; m_customerIdentifier = std::move(value); }
/**
* <p>The CustomerIdentifier is obtained through the ResolveCustomer operation and
* represents an individual buyer in your application.</p>
*/
inline void SetCustomerIdentifier(const char* value) { m_customerIdentifierHasBeenSet = true; m_customerIdentifier.assign(value); }
/**
* <p>The CustomerIdentifier is obtained through the ResolveCustomer operation and
* represents an individual buyer in your application.</p>
*/
inline UsageRecord& WithCustomerIdentifier(const Aws::String& value) { SetCustomerIdentifier(value); return *this;}
/**
* <p>The CustomerIdentifier is obtained through the ResolveCustomer operation and
* represents an individual buyer in your application.</p>
*/
inline UsageRecord& WithCustomerIdentifier(Aws::String&& value) { SetCustomerIdentifier(std::move(value)); return *this;}
/**
* <p>The CustomerIdentifier is obtained through the ResolveCustomer operation and
* represents an individual buyer in your application.</p>
*/
inline UsageRecord& WithCustomerIdentifier(const char* value) { SetCustomerIdentifier(value); return *this;}
/**
* <p>During the process of registering a product on AWS Marketplace, up to eight
* dimensions are specified. These represent different units of value in your
* application.</p>
*/
inline const Aws::String& GetDimension() const{ return m_dimension; }
/**
* <p>During the process of registering a product on AWS Marketplace, up to eight
* dimensions are specified. These represent different units of value in your
* application.</p>
*/
inline bool DimensionHasBeenSet() const { return m_dimensionHasBeenSet; }
/**
* <p>During the process of registering a product on AWS Marketplace, up to eight
* dimensions are specified. These represent different units of value in your
* application.</p>
*/
inline void SetDimension(const Aws::String& value) { m_dimensionHasBeenSet = true; m_dimension = value; }
/**
* <p>During the process of registering a product on AWS Marketplace, up to eight
* dimensions are specified. These represent different units of value in your
* application.</p>
*/
inline void SetDimension(Aws::String&& value) { m_dimensionHasBeenSet = true; m_dimension = std::move(value); }
/**
* <p>During the process of registering a product on AWS Marketplace, up to eight
* dimensions are specified. These represent different units of value in your
* application.</p>
*/
inline void SetDimension(const char* value) { m_dimensionHasBeenSet = true; m_dimension.assign(value); }
/**
* <p>During the process of registering a product on AWS Marketplace, up to eight
* dimensions are specified. These represent different units of value in your
* application.</p>
*/
inline UsageRecord& WithDimension(const Aws::String& value) { SetDimension(value); return *this;}
/**
* <p>During the process of registering a product on AWS Marketplace, up to eight
* dimensions are specified. These represent different units of value in your
* application.</p>
*/
inline UsageRecord& WithDimension(Aws::String&& value) { SetDimension(std::move(value)); return *this;}
/**
* <p>During the process of registering a product on AWS Marketplace, up to eight
* dimensions are specified. These represent different units of value in your
* application.</p>
*/
inline UsageRecord& WithDimension(const char* value) { SetDimension(value); return *this;}
/**
* <p>The quantity of usage consumed by the customer for the given dimension and
* time. Defaults to <code>0</code> if not specified.</p>
*/
inline int GetQuantity() const{ return m_quantity; }
/**
* <p>The quantity of usage consumed by the customer for the given dimension and
* time. Defaults to <code>0</code> if not specified.</p>
*/
inline bool QuantityHasBeenSet() const { return m_quantityHasBeenSet; }
/**
* <p>The quantity of usage consumed by the customer for the given dimension and
* time. Defaults to <code>0</code> if not specified.</p>
*/
inline void SetQuantity(int value) { m_quantityHasBeenSet = true; m_quantity = value; }
/**
* <p>The quantity of usage consumed by the customer for the given dimension and
* time. Defaults to <code>0</code> if not specified.</p>
*/
inline UsageRecord& WithQuantity(int value) { SetQuantity(value); return *this;}
private:
Aws::Utils::DateTime m_timestamp;
bool m_timestampHasBeenSet;
Aws::String m_customerIdentifier;
bool m_customerIdentifierHasBeenSet;
Aws::String m_dimension;
bool m_dimensionHasBeenSet;
int m_quantity;
bool m_quantityHasBeenSet;
};
} // namespace Model
} // namespace MarketplaceMetering
} // namespace Aws

View File

@@ -0,0 +1,207 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/meteringmarketplace/model/UsageRecord.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/meteringmarketplace/model/UsageRecordResultStatus.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace MarketplaceMetering
{
namespace Model
{
/**
* <p>A UsageRecordResult indicates the status of a given UsageRecord processed by
* BatchMeterUsage.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/UsageRecordResult">AWS
* API Reference</a></p>
*/
class AWS_MARKETPLACEMETERING_API UsageRecordResult
{
public:
UsageRecordResult();
UsageRecordResult(Aws::Utils::Json::JsonView jsonValue);
UsageRecordResult& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The UsageRecord that was part of the BatchMeterUsage request.</p>
*/
inline const UsageRecord& GetUsageRecord() const{ return m_usageRecord; }
/**
* <p>The UsageRecord that was part of the BatchMeterUsage request.</p>
*/
inline bool UsageRecordHasBeenSet() const { return m_usageRecordHasBeenSet; }
/**
* <p>The UsageRecord that was part of the BatchMeterUsage request.</p>
*/
inline void SetUsageRecord(const UsageRecord& value) { m_usageRecordHasBeenSet = true; m_usageRecord = value; }
/**
* <p>The UsageRecord that was part of the BatchMeterUsage request.</p>
*/
inline void SetUsageRecord(UsageRecord&& value) { m_usageRecordHasBeenSet = true; m_usageRecord = std::move(value); }
/**
* <p>The UsageRecord that was part of the BatchMeterUsage request.</p>
*/
inline UsageRecordResult& WithUsageRecord(const UsageRecord& value) { SetUsageRecord(value); return *this;}
/**
* <p>The UsageRecord that was part of the BatchMeterUsage request.</p>
*/
inline UsageRecordResult& WithUsageRecord(UsageRecord&& value) { SetUsageRecord(std::move(value)); return *this;}
/**
* <p>The MeteringRecordId is a unique identifier for this metering event.</p>
*/
inline const Aws::String& GetMeteringRecordId() const{ return m_meteringRecordId; }
/**
* <p>The MeteringRecordId is a unique identifier for this metering event.</p>
*/
inline bool MeteringRecordIdHasBeenSet() const { return m_meteringRecordIdHasBeenSet; }
/**
* <p>The MeteringRecordId is a unique identifier for this metering event.</p>
*/
inline void SetMeteringRecordId(const Aws::String& value) { m_meteringRecordIdHasBeenSet = true; m_meteringRecordId = value; }
/**
* <p>The MeteringRecordId is a unique identifier for this metering event.</p>
*/
inline void SetMeteringRecordId(Aws::String&& value) { m_meteringRecordIdHasBeenSet = true; m_meteringRecordId = std::move(value); }
/**
* <p>The MeteringRecordId is a unique identifier for this metering event.</p>
*/
inline void SetMeteringRecordId(const char* value) { m_meteringRecordIdHasBeenSet = true; m_meteringRecordId.assign(value); }
/**
* <p>The MeteringRecordId is a unique identifier for this metering event.</p>
*/
inline UsageRecordResult& WithMeteringRecordId(const Aws::String& value) { SetMeteringRecordId(value); return *this;}
/**
* <p>The MeteringRecordId is a unique identifier for this metering event.</p>
*/
inline UsageRecordResult& WithMeteringRecordId(Aws::String&& value) { SetMeteringRecordId(std::move(value)); return *this;}
/**
* <p>The MeteringRecordId is a unique identifier for this metering event.</p>
*/
inline UsageRecordResult& WithMeteringRecordId(const char* value) { SetMeteringRecordId(value); return *this;}
/**
* <p>The UsageRecordResult Status indicates the status of an individual
* UsageRecord processed by BatchMeterUsage.</p> <ul> <li> <p> <i>Success</i>- The
* UsageRecord was accepted and honored by BatchMeterUsage.</p> </li> <li> <p>
* <i>CustomerNotSubscribed</i>- The CustomerIdentifier specified is not subscribed
* to your product. The UsageRecord was not honored. Future UsageRecords for this
* customer will fail until the customer subscribes to your product.</p> </li> <li>
* <p> <i>DuplicateRecord</i>- Indicates that the UsageRecord was invalid and not
* honored. A previously metered UsageRecord had the same customer, dimension, and
* time, but a different quantity.</p> </li> </ul>
*/
inline const UsageRecordResultStatus& GetStatus() const{ return m_status; }
/**
* <p>The UsageRecordResult Status indicates the status of an individual
* UsageRecord processed by BatchMeterUsage.</p> <ul> <li> <p> <i>Success</i>- The
* UsageRecord was accepted and honored by BatchMeterUsage.</p> </li> <li> <p>
* <i>CustomerNotSubscribed</i>- The CustomerIdentifier specified is not subscribed
* to your product. The UsageRecord was not honored. Future UsageRecords for this
* customer will fail until the customer subscribes to your product.</p> </li> <li>
* <p> <i>DuplicateRecord</i>- Indicates that the UsageRecord was invalid and not
* honored. A previously metered UsageRecord had the same customer, dimension, and
* time, but a different quantity.</p> </li> </ul>
*/
inline bool StatusHasBeenSet() const { return m_statusHasBeenSet; }
/**
* <p>The UsageRecordResult Status indicates the status of an individual
* UsageRecord processed by BatchMeterUsage.</p> <ul> <li> <p> <i>Success</i>- The
* UsageRecord was accepted and honored by BatchMeterUsage.</p> </li> <li> <p>
* <i>CustomerNotSubscribed</i>- The CustomerIdentifier specified is not subscribed
* to your product. The UsageRecord was not honored. Future UsageRecords for this
* customer will fail until the customer subscribes to your product.</p> </li> <li>
* <p> <i>DuplicateRecord</i>- Indicates that the UsageRecord was invalid and not
* honored. A previously metered UsageRecord had the same customer, dimension, and
* time, but a different quantity.</p> </li> </ul>
*/
inline void SetStatus(const UsageRecordResultStatus& value) { m_statusHasBeenSet = true; m_status = value; }
/**
* <p>The UsageRecordResult Status indicates the status of an individual
* UsageRecord processed by BatchMeterUsage.</p> <ul> <li> <p> <i>Success</i>- The
* UsageRecord was accepted and honored by BatchMeterUsage.</p> </li> <li> <p>
* <i>CustomerNotSubscribed</i>- The CustomerIdentifier specified is not subscribed
* to your product. The UsageRecord was not honored. Future UsageRecords for this
* customer will fail until the customer subscribes to your product.</p> </li> <li>
* <p> <i>DuplicateRecord</i>- Indicates that the UsageRecord was invalid and not
* honored. A previously metered UsageRecord had the same customer, dimension, and
* time, but a different quantity.</p> </li> </ul>
*/
inline void SetStatus(UsageRecordResultStatus&& value) { m_statusHasBeenSet = true; m_status = std::move(value); }
/**
* <p>The UsageRecordResult Status indicates the status of an individual
* UsageRecord processed by BatchMeterUsage.</p> <ul> <li> <p> <i>Success</i>- The
* UsageRecord was accepted and honored by BatchMeterUsage.</p> </li> <li> <p>
* <i>CustomerNotSubscribed</i>- The CustomerIdentifier specified is not subscribed
* to your product. The UsageRecord was not honored. Future UsageRecords for this
* customer will fail until the customer subscribes to your product.</p> </li> <li>
* <p> <i>DuplicateRecord</i>- Indicates that the UsageRecord was invalid and not
* honored. A previously metered UsageRecord had the same customer, dimension, and
* time, but a different quantity.</p> </li> </ul>
*/
inline UsageRecordResult& WithStatus(const UsageRecordResultStatus& value) { SetStatus(value); return *this;}
/**
* <p>The UsageRecordResult Status indicates the status of an individual
* UsageRecord processed by BatchMeterUsage.</p> <ul> <li> <p> <i>Success</i>- The
* UsageRecord was accepted and honored by BatchMeterUsage.</p> </li> <li> <p>
* <i>CustomerNotSubscribed</i>- The CustomerIdentifier specified is not subscribed
* to your product. The UsageRecord was not honored. Future UsageRecords for this
* customer will fail until the customer subscribes to your product.</p> </li> <li>
* <p> <i>DuplicateRecord</i>- Indicates that the UsageRecord was invalid and not
* honored. A previously metered UsageRecord had the same customer, dimension, and
* time, but a different quantity.</p> </li> </ul>
*/
inline UsageRecordResult& WithStatus(UsageRecordResultStatus&& value) { SetStatus(std::move(value)); return *this;}
private:
UsageRecord m_usageRecord;
bool m_usageRecordHasBeenSet;
Aws::String m_meteringRecordId;
bool m_meteringRecordIdHasBeenSet;
UsageRecordResultStatus m_status;
bool m_statusHasBeenSet;
};
} // namespace Model
} // namespace MarketplaceMetering
} // namespace Aws

View File

@@ -0,0 +1,32 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/meteringmarketplace/MarketplaceMetering_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace MarketplaceMetering
{
namespace Model
{
enum class UsageRecordResultStatus
{
NOT_SET,
Success,
CustomerNotSubscribed,
DuplicateRecord
};
namespace UsageRecordResultStatusMapper
{
AWS_MARKETPLACEMETERING_API UsageRecordResultStatus GetUsageRecordResultStatusForName(const Aws::String& name);
AWS_MARKETPLACEMETERING_API Aws::String GetNameForUsageRecordResultStatus(UsageRecordResultStatus value);
} // namespace UsageRecordResultStatusMapper
} // namespace Model
} // namespace MarketplaceMetering
} // namespace Aws