Copyright | (c) 2013-2021 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 |
BatchMeterUsage is called from a SaaS application listed on the AWS Marketplace to post metering records for a set of customers.
For identical requests, the API is idempotent; requests can be retried with the same records or a subset of the input records.
Every request to BatchMeterUsage is for one product. If you need to meter usage for multiple products, you must make multiple calls to BatchMeterUsage.
BatchMeterUsage can process up to 25 UsageRecords at a time.
A UsageRecord can optionally include multiple usage allocations, to provide customers with usagedata split into buckets by tags that you define (or allow the customer to define).
BatchMeterUsage requests must be less than 1MB in size.
Synopsis
- data BatchMeterUsage = BatchMeterUsage' {
- usageRecords :: [UsageRecord]
- productCode :: Text
- newBatchMeterUsage :: Text -> BatchMeterUsage
- batchMeterUsage_usageRecords :: Lens' BatchMeterUsage [UsageRecord]
- batchMeterUsage_productCode :: Lens' BatchMeterUsage Text
- data BatchMeterUsageResponse = BatchMeterUsageResponse' {}
- newBatchMeterUsageResponse :: Int -> BatchMeterUsageResponse
- batchMeterUsageResponse_results :: Lens' BatchMeterUsageResponse (Maybe [UsageRecordResult])
- batchMeterUsageResponse_unprocessedRecords :: Lens' BatchMeterUsageResponse (Maybe [UsageRecord])
- batchMeterUsageResponse_httpStatus :: Lens' BatchMeterUsageResponse Int
Creating a Request
data BatchMeterUsage Source #
A BatchMeterUsageRequest contains UsageRecords, which indicate quantities of usage within your application.
See: newBatchMeterUsage
smart constructor.
BatchMeterUsage' | |
|
Instances
Create a value of BatchMeterUsage
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:usageRecords:BatchMeterUsage'
, batchMeterUsage_usageRecords
- The set of UsageRecords to submit. BatchMeterUsage accepts up to 25
UsageRecords at a time.
$sel:productCode:BatchMeterUsage'
, batchMeterUsage_productCode
- 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.
Request Lenses
batchMeterUsage_usageRecords :: Lens' BatchMeterUsage [UsageRecord] Source #
The set of UsageRecords to submit. BatchMeterUsage accepts up to 25 UsageRecords at a time.
batchMeterUsage_productCode :: Lens' BatchMeterUsage Text Source #
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.
Destructuring the Response
data BatchMeterUsageResponse Source #
Contains the UsageRecords processed by BatchMeterUsage and any records that have failed due to transient error.
See: newBatchMeterUsageResponse
smart constructor.
BatchMeterUsageResponse' | |
|
Instances
newBatchMeterUsageResponse Source #
Create a value of BatchMeterUsageResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:results:BatchMeterUsageResponse'
, batchMeterUsageResponse_results
- Contains all UsageRecords processed by BatchMeterUsage. These records
were either honored by AWS Marketplace Metering Service or were invalid.
$sel:unprocessedRecords:BatchMeterUsageResponse'
, batchMeterUsageResponse_unprocessedRecords
- 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.
$sel:httpStatus:BatchMeterUsageResponse'
, batchMeterUsageResponse_httpStatus
- The response's http status code.
Response Lenses
batchMeterUsageResponse_results :: Lens' BatchMeterUsageResponse (Maybe [UsageRecordResult]) Source #
Contains all UsageRecords processed by BatchMeterUsage. These records were either honored by AWS Marketplace Metering Service or were invalid.
batchMeterUsageResponse_unprocessedRecords :: Lens' BatchMeterUsageResponse (Maybe [UsageRecord]) Source #
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.
batchMeterUsageResponse_httpStatus :: Lens' BatchMeterUsageResponse Int Source #
The response's http status code.