Copyright | (c) 2013-2018 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Network.AWS.MarketplaceMetering
Description
AWS Marketplace Metering Service
This reference provides descriptions of the low-level AWS Marketplace Metering Service API.
AWS Marketplace sellers can use this API to submit usage data for custom usage dimensions.
Submitting Metering Records
- MeterUsage - Submits the metering record for a Marketplace product. MeterUsage is called from an EC2 instance.
- BatchMeterUsage - Submits the metering record for a set of customers. BatchMeterUsage is called from a software-as-a-service (SaaS) application.
Accepting New Customers
- ResolveCustomer - 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.
Synopsis
- marketplaceMetering :: Service
- _InvalidEndpointRegionException :: AsError a => Getting (First ServiceError) a ServiceError
- _InvalidProductCodeException :: AsError a => Getting (First ServiceError) a ServiceError
- _InvalidUsageDimensionException :: AsError a => Getting (First ServiceError) a ServiceError
- _DuplicateRequestException :: AsError a => Getting (First ServiceError) a ServiceError
- _TimestampOutOfBoundsException :: AsError a => Getting (First ServiceError) a ServiceError
- _ThrottlingException :: AsError a => Getting (First ServiceError) a ServiceError
- _InternalServiceErrorException :: AsError a => Getting (First ServiceError) a ServiceError
- _InvalidTokenException :: AsError a => Getting (First ServiceError) a ServiceError
- _ExpiredTokenException :: AsError a => Getting (First ServiceError) a ServiceError
- _InvalidCustomerIdentifierException :: AsError a => Getting (First ServiceError) a ServiceError
- module Network.AWS.MarketplaceMetering.BatchMeterUsage
- module Network.AWS.MarketplaceMetering.ResolveCustomer
- module Network.AWS.MarketplaceMetering.MeterUsage
- data UsageRecordResultStatus
- data UsageRecord
- usageRecord :: UTCTime -> Text -> Text -> Natural -> UsageRecord
- urTimestamp :: Lens' UsageRecord UTCTime
- urCustomerIdentifier :: Lens' UsageRecord Text
- urDimension :: Lens' UsageRecord Text
- urQuantity :: Lens' UsageRecord Natural
- data UsageRecordResult
- usageRecordResult :: UsageRecordResult
- urrStatus :: Lens' UsageRecordResult (Maybe UsageRecordResultStatus)
- urrUsageRecord :: Lens' UsageRecordResult (Maybe UsageRecord)
- urrMeteringRecordId :: Lens' UsageRecordResult (Maybe Text)
Service Configuration
marketplaceMetering :: Service Source #
API version 2016-01-14
of the Amazon Marketplace Metering SDK configuration.
Errors
Error matchers are designed for use with the functions provided by
Control.Exception.Lens.
This allows catching (and rethrowing) service specific errors returned
by MarketplaceMetering
.
InvalidEndpointRegionException
_InvalidEndpointRegionException :: AsError a => Getting (First ServiceError) a ServiceError Source #
The endpoint being called is in a region different from your EC2 instance. The region of the Metering service endpoint and the region of the EC2 instance must match.
InvalidProductCodeException
_InvalidProductCodeException :: AsError a => Getting (First ServiceError) a ServiceError Source #
The product code passed does not match the product code used for publishing the product.
InvalidUsageDimensionException
_InvalidUsageDimensionException :: AsError a => Getting (First ServiceError) a ServiceError Source #
The usage dimension does not match one of the UsageDimensions associated with products.
DuplicateRequestException
_DuplicateRequestException :: AsError a => Getting (First ServiceError) a ServiceError Source #
A metering record has already been emitted by the same EC2 instance for the given {usageDimension, timestamp} with a different usageQuantity.
TimestampOutOfBoundsException
_TimestampOutOfBoundsException :: AsError a => Getting (First ServiceError) a ServiceError Source #
The timestamp value passed in the meterUsage() is out of allowed range.
ThrottlingException
_ThrottlingException :: AsError a => Getting (First ServiceError) a ServiceError Source #
The calls to the MeterUsage API are throttled.
InternalServiceErrorException
_InternalServiceErrorException :: AsError a => Getting (First ServiceError) a ServiceError Source #
An internal error has occurred. Retry your request. If the problem persists, post a message with details on the AWS forums.
InvalidTokenException
_InvalidTokenException :: AsError a => Getting (First ServiceError) a ServiceError Source #
Prism for InvalidTokenException' errors.
ExpiredTokenException
_ExpiredTokenException :: AsError a => Getting (First ServiceError) a ServiceError Source #
The submitted registration token has expired. This can happen if the buyer's browser takes too long to redirect to your page, the buyer has resubmitted the registration token, or your application has held on to the registration token for too long. Your SaaS registration website should redeem this token as soon as it is submitted by the buyer's browser.
InvalidCustomerIdentifierException
_InvalidCustomerIdentifierException :: AsError a => Getting (First ServiceError) a ServiceError Source #
You have metered usage for a CustomerIdentifier that does not exist.
Waiters
Waiters poll by repeatedly sending a request until some remote success condition
configured by the Wait
specification is fulfilled. The Wait
specification
determines how many attempts should be made, in addition to delay and retry strategies.
Operations
Some AWS operations return results that are incomplete and require subsequent
requests in order to obtain the entire result set. The process of sending
subsequent requests to continue where a previous request left off is called
pagination. For example, the ListObjects
operation of Amazon S3 returns up to
1000 objects at a time, and you must send subsequent requests with the
appropriate Marker in order to retrieve the next page of results.
Operations that have an AWSPager
instance can transparently perform subsequent
requests, correctly setting Markers and other request facets to iterate through
the entire result set of a truncated API operation. Operations which support
this have an additional note in the documentation.
Many operations have the ability to filter results on the server side. See the individual operation parameters for details.
BatchMeterUsage
ResolveCustomer
MeterUsage
Types
UsageRecordResultStatus
data UsageRecordResultStatus Source #
Constructors
CustomerNotSubscribed | |
DuplicateRecord | |
Success |
Instances
UsageRecord
data UsageRecord Source #
A UsageRecord indicates a quantity of usage for a given product, customer, dimension and time.
Multiple requests with the same UsageRecords as input will be deduplicated to prevent double charges.
See: usageRecord
smart constructor.
Instances
Arguments
:: UTCTime | |
-> Text | |
-> Text | |
-> Natural | |
-> UsageRecord |
Creates a value of UsageRecord
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
urTimestamp
- Timestamp of the hour, recorded in UTC. The seconds and milliseconds portions of the timestamp will be ignored. Your application can meter usage for up to one hour in the past.urCustomerIdentifier
- The CustomerIdentifier is obtained through the ResolveCustomer operation and represents an individual buyer in your application.urDimension
- 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.urQuantity
- The quantity of usage consumed by the customer for the given dimension and time.
urTimestamp :: Lens' UsageRecord UTCTime Source #
Timestamp of the hour, recorded in UTC. The seconds and milliseconds portions of the timestamp will be ignored. Your application can meter usage for up to one hour in the past.
urCustomerIdentifier :: Lens' UsageRecord Text Source #
The CustomerIdentifier is obtained through the ResolveCustomer operation and represents an individual buyer in your application.
urDimension :: Lens' UsageRecord Text Source #
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.
urQuantity :: Lens' UsageRecord Natural Source #
The quantity of usage consumed by the customer for the given dimension and time.
UsageRecordResult
data UsageRecordResult Source #
A UsageRecordResult indicates the status of a given UsageRecord processed by BatchMeterUsage.
See: usageRecordResult
smart constructor.
Instances
usageRecordResult :: UsageRecordResult Source #
Creates a value of UsageRecordResult
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
urrStatus
- The UsageRecordResult Status indicates the status of an individual UsageRecord processed by BatchMeterUsage. * Success - The UsageRecord was accepted and honored by BatchMeterUsage. * CustomerNotSubscribed - 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. * DuplicateRecord - Indicates that the UsageRecord was invalid and not honored. A previously metered UsageRecord had the same customer, dimension, and time, but a different quantity.urrUsageRecord
- The UsageRecord that was part of the BatchMeterUsage request.urrMeteringRecordId
- The MeteringRecordId is a unique identifier for this metering event.
urrStatus :: Lens' UsageRecordResult (Maybe UsageRecordResultStatus) Source #
The UsageRecordResult Status indicates the status of an individual UsageRecord processed by BatchMeterUsage. * Success - The UsageRecord was accepted and honored by BatchMeterUsage. * CustomerNotSubscribed - 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. * DuplicateRecord - Indicates that the UsageRecord was invalid and not honored. A previously metered UsageRecord had the same customer, dimension, and time, but a different quantity.
urrUsageRecord :: Lens' UsageRecordResult (Maybe UsageRecord) Source #
The UsageRecord that was part of the BatchMeterUsage request.
urrMeteringRecordId :: Lens' UsageRecordResult (Maybe Text) Source #
The MeteringRecordId is a unique identifier for this metering event.