libZSservicesZSamazonka-marketplace-meteringZSamazonka-marketplace-metering
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.MarketplaceMetering.BatchMeterUsage

Description

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

Creating a Request

data BatchMeterUsage Source #

A BatchMeterUsageRequest contains UsageRecords, which indicate quantities of usage within your application.

See: newBatchMeterUsage smart constructor.

Constructors

BatchMeterUsage' 

Fields

  • usageRecords :: [UsageRecord]

    The set of UsageRecords to submit. BatchMeterUsage accepts up to 25 UsageRecords at a time.

  • productCode :: Text

    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.

Instances

Instances details
Eq BatchMeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

Read BatchMeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

Show BatchMeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

Generic BatchMeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

Associated Types

type Rep BatchMeterUsage :: Type -> Type #

NFData BatchMeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

Methods

rnf :: BatchMeterUsage -> () #

Hashable BatchMeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

ToJSON BatchMeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

AWSRequest BatchMeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

Associated Types

type AWSResponse BatchMeterUsage #

ToHeaders BatchMeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

ToPath BatchMeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

ToQuery BatchMeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

type Rep BatchMeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

type Rep BatchMeterUsage = D1 ('MetaData "BatchMeterUsage" "Amazonka.MarketplaceMetering.BatchMeterUsage" "libZSservicesZSamazonka-marketplace-meteringZSamazonka-marketplace-metering" 'False) (C1 ('MetaCons "BatchMeterUsage'" 'PrefixI 'True) (S1 ('MetaSel ('Just "usageRecords") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [UsageRecord]) :*: S1 ('MetaSel ('Just "productCode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))
type AWSResponse BatchMeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

newBatchMeterUsage Source #

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.

Constructors

BatchMeterUsageResponse' 

Fields

  • results :: Maybe [UsageRecordResult]

    Contains all UsageRecords processed by BatchMeterUsage. These records were either honored by AWS Marketplace Metering Service or were invalid.

  • unprocessedRecords :: Maybe [UsageRecord]

    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.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Eq BatchMeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

Read BatchMeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

Show BatchMeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

Generic BatchMeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

Associated Types

type Rep BatchMeterUsageResponse :: Type -> Type #

NFData BatchMeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

Methods

rnf :: BatchMeterUsageResponse -> () #

type Rep BatchMeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.BatchMeterUsage

type Rep BatchMeterUsageResponse = D1 ('MetaData "BatchMeterUsageResponse" "Amazonka.MarketplaceMetering.BatchMeterUsage" "libZSservicesZSamazonka-marketplace-meteringZSamazonka-marketplace-metering" 'False) (C1 ('MetaCons "BatchMeterUsageResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "results") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [UsageRecordResult])) :*: (S1 ('MetaSel ('Just "unprocessedRecords") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [UsageRecord])) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

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.