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

Synopsis

Creating a Request

data MeterUsage Source #

See: newMeterUsage smart constructor.

Constructors

MeterUsage' 

Fields

  • usageQuantity :: Maybe Natural

    Consumption value for the hour. Defaults to 0 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).

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

  • 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
Eq MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Read MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Show MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Generic MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Associated Types

type Rep MeterUsage :: Type -> Type #

NFData MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Methods

rnf :: MeterUsage -> () #

Hashable MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

ToJSON MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

AWSRequest MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Associated Types

type AWSResponse 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

type Rep MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

type Rep MeterUsage = D1 ('MetaData "MeterUsage" "Amazonka.MarketplaceMetering.MeterUsage" "libZSservicesZSamazonka-marketplace-meteringZSamazonka-marketplace-metering" 'False) (C1 ('MetaCons "MeterUsage'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "usageQuantity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: (S1 ('MetaSel ('Just "usageAllocations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (NonEmpty UsageAllocation))) :*: S1 ('MetaSel ('Just "dryRun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)))) :*: (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)))))
type AWSResponse MeterUsage Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

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:usageQuantity:MeterUsage', meterUsage_usageQuantity - Consumption value for the hour. Defaults to 0 if not specified.

$sel:usageAllocations: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: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.

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

$sel:timestamp: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_usageQuantity :: Lens' MeterUsage (Maybe Natural) Source #

Consumption value for the hour. Defaults to 0 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_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_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
Eq MeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Read MeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Show MeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Generic MeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Associated Types

type Rep MeterUsageResponse :: Type -> Type #

NFData MeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

Methods

rnf :: MeterUsageResponse -> () #

type Rep MeterUsageResponse Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.MeterUsage

type Rep MeterUsageResponse = D1 ('MetaData "MeterUsageResponse" "Amazonka.MarketplaceMetering.MeterUsage" "libZSservicesZSamazonka-marketplace-meteringZSamazonka-marketplace-metering" '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:

$sel:meteringRecordId:MeterUsageResponse', meterUsageResponse_meteringRecordId - Metering record id.

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

Response Lenses