amazonka-marketplace-metering-2.0: Amazon Marketplace Metering SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.MarketplaceMetering.MeterUsage

Description

API to emit metering records. For identical requests, the API is idempotent. It simply returns the metering record ID.

MeterUsage is authenticated on the buyer's AWS account using credentials from the EC2 instance, ECS task, or EKS pod.

MeterUsage can optionally include multiple usage allocations, to provide customers with usage data split into buckets by tags that you define (or allow the customer to define).

Usage records are expected to be submitted as quickly as possible after the event that is being recorded, and are not accepted more than 6 hours after the event.

Synopsis

Creating a Request

data MeterUsage Source #

See: newMeterUsage smart constructor.

Constructors

MeterUsage' 

Fields

  • dryRun :: Maybe Bool

    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 false if not specified.

  • usageAllocations :: Maybe (NonEmpty UsageAllocation)

    The set of UsageAllocations to submit.

    The sum of all UsageAllocation quantities must equal the UsageQuantity of the MeterUsage request, and each UsageAllocation must have a unique set of tags (include no tags).

  • usageQuantity :: Maybe Natural

    Consumption value for the hour. Defaults to 0 if not specified.

  • 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.

  • timestamp :: POSIX

    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.

  • usageDimension :: Text

    It will be one of the fcp dimension name provided during the publishing of the product.

Instances

Instances details
ToJSON MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

ToHeaders MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Methods

toHeaders :: MeterUsage -> [Header] #

ToPath MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

ToQuery MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

AWSRequest MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Associated Types

type AWSResponse MeterUsage #

Generic MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Associated Types

type Rep MeterUsage :: Type -> Type #

Read MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Show MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

NFData MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Methods

rnf :: MeterUsage -> () #

Eq MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Hashable MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

type AWSResponse MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

type Rep MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

type Rep MeterUsage = D1 ('MetaData "MeterUsage" "Amazonka.MarketplaceMetering.MeterUsage" "amazonka-marketplace-metering-2.0-8iXXI93nW7fIf59koqHJQ" 'False) (C1 ('MetaCons "MeterUsage'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "dryRun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "usageAllocations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (NonEmpty UsageAllocation))) :*: S1 ('MetaSel ('Just "usageQuantity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)))) :*: (S1 ('MetaSel ('Just "productCode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "timestamp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 POSIX) :*: S1 ('MetaSel ('Just "usageDimension") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))

newMeterUsage Source #

Create a value of MeterUsage 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:dryRun:MeterUsage', meterUsage_dryRun - 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 false if not specified.

MeterUsage, meterUsage_usageAllocations - The set of UsageAllocations to submit.

The sum of all UsageAllocation quantities must equal the UsageQuantity of the MeterUsage request, and each UsageAllocation must have a unique set of tags (include no tags).

$sel:usageQuantity:MeterUsage', meterUsage_usageQuantity - Consumption value for the hour. Defaults to 0 if not specified.

$sel:productCode:MeterUsage', meterUsage_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.

MeterUsage, meterUsage_timestamp - 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.

$sel:usageDimension:MeterUsage', meterUsage_usageDimension - It will be one of the fcp dimension name provided during the publishing of the product.

Request Lenses

meterUsage_dryRun :: Lens' MeterUsage (Maybe Bool) Source #

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 false if not specified.

meterUsage_usageAllocations :: Lens' MeterUsage (Maybe (NonEmpty UsageAllocation)) Source #

The set of UsageAllocations to submit.

The sum of all UsageAllocation quantities must equal the UsageQuantity of the MeterUsage request, and each UsageAllocation must have a unique set of tags (include no tags).

meterUsage_usageQuantity :: Lens' MeterUsage (Maybe Natural) Source #

Consumption value for the hour. Defaults to 0 if not specified.

meterUsage_productCode :: Lens' MeterUsage 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.

meterUsage_timestamp :: Lens' MeterUsage UTCTime Source #

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.

meterUsage_usageDimension :: Lens' MeterUsage Text Source #

It will be one of the fcp dimension name provided during the publishing of the product.

Destructuring the Response

data MeterUsageResponse Source #

See: newMeterUsageResponse smart constructor.

Constructors

MeterUsageResponse' 

Fields

Instances

Instances details
Generic MeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Associated Types

type Rep MeterUsageResponse :: Type -> Type #

Read MeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Show MeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

NFData MeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Methods

rnf :: MeterUsageResponse -> () #

Eq MeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

type Rep MeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

type Rep MeterUsageResponse = D1 ('MetaData "MeterUsageResponse" "Amazonka.MarketplaceMetering.MeterUsage" "amazonka-marketplace-metering-2.0-8iXXI93nW7fIf59koqHJQ" 'False) (C1 ('MetaCons "MeterUsageResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "meteringRecordId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newMeterUsageResponse Source #

Create a value of MeterUsageResponse 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:

MeterUsageResponse, meterUsageResponse_meteringRecordId - Metering record id.

$sel:httpStatus:MeterUsageResponse', meterUsageResponse_httpStatus - The response's http status code.

Response Lenses