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

Description

 
Synopsis

Service Configuration

defaultService :: Service Source #

API version 2016-01-14 of the Amazon Marketplace Metering SDK configuration.

Errors

_CustomerNotEntitledException :: AsError a => Fold a ServiceError Source #

Exception thrown when the customer does not have a valid subscription for the product.

_DisabledApiException :: AsError a => Fold a ServiceError Source #

The API is disabled in the Region.

_DuplicateRequestException :: AsError a => Fold a ServiceError Source #

A metering record has already been emitted by the same EC2 instance, ECS task, or EKS pod for the given {usageDimension, timestamp} with a different usageQuantity.

_ExpiredTokenException :: AsError a => Fold 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.

_InternalServiceErrorException :: AsError a => Fold a ServiceError Source #

An internal error has occurred. Retry your request. If the problem persists, post a message with details on the AWS forums.

_InvalidCustomerIdentifierException :: AsError a => Fold a ServiceError Source #

You have metered usage for a CustomerIdentifier that does not exist.

_InvalidEndpointRegionException :: AsError a => Fold a ServiceError Source #

The endpoint being called is in a AWS Region different from your EC2 instance, ECS task, or EKS pod. The Region of the Metering Service endpoint and the AWS Region of the resource must match.

_InvalidProductCodeException :: AsError a => Fold a ServiceError Source #

The product code passed does not match the product code used for publishing the product.

_InvalidPublicKeyVersionException :: AsError a => Fold a ServiceError Source #

Public Key version is invalid.

_InvalidRegionException :: AsError a => Fold a ServiceError Source #

RegisterUsage must be called in the same AWS Region the ECS task was launched in. This prevents a container from hardcoding a Region (e.g. withRegion(“us-east-1”) when calling RegisterUsage.

_InvalidTagException :: AsError a => Fold a ServiceError Source #

The tag is invalid, or the number of tags is greater than 5.

_InvalidTokenException :: AsError a => Fold a ServiceError Source #

Registration token is invalid.

_InvalidUsageAllocationsException :: AsError a => Fold a ServiceError Source #

The usage allocation objects are invalid, or the number of allocations is greater than 500 for a single usage record.

_InvalidUsageDimensionException :: AsError a => Fold a ServiceError Source #

The usage dimension does not match one of the UsageDimensions associated with products.

_PlatformNotSupportedException :: AsError a => Fold a ServiceError Source #

AWS Marketplace does not support metering usage from the underlying platform. Currently, Amazon ECS, Amazon EKS, and AWS Fargate are supported.

_ThrottlingException :: AsError a => Fold a ServiceError Source #

The calls to the API are throttled.

_TimestampOutOfBoundsException :: AsError a => Fold a ServiceError Source #

The timestamp value passed in the UsageRecord is out of allowed range.

For BatchMeterUsage, if any of the records are outside of the allowed range, the entire batch is not processed. You must remove invalid records and try again.

UsageRecordResultStatus

newtype UsageRecordResultStatus Source #

Instances

Instances details
FromJSON UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

FromJSONKey UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

ToJSON UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

ToJSONKey UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

ToByteString UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

ToHeader UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

ToLog UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

ToQuery UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

FromText UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

ToText UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

FromXML UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

ToXML UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

Generic UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

Associated Types

type Rep UsageRecordResultStatus :: Type -> Type #

Read UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

Show UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

NFData UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

Methods

rnf :: UsageRecordResultStatus -> () #

Eq UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

Ord UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

Hashable UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

type Rep UsageRecordResultStatus Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus

type Rep UsageRecordResultStatus = D1 ('MetaData "UsageRecordResultStatus" "Amazonka.MarketplaceMetering.Types.UsageRecordResultStatus" "amazonka-marketplace-metering-2.0-8iXXI93nW7fIf59koqHJQ" 'True) (C1 ('MetaCons "UsageRecordResultStatus'" 'PrefixI 'True) (S1 ('MetaSel ('Just "fromUsageRecordResultStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Tag

data Tag Source #

Metadata assigned to an allocation. Each tag is made up of a key and a value.

See: newTag smart constructor.

Constructors

Tag' 

Fields

  • key :: Text

    One part of a key-value pair that makes up a tag. A key is a label that acts like a category for the specific tag values.

  • value :: Text

    One part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null.

Instances

Instances details
FromJSON Tag Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.Tag

ToJSON Tag Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.Tag

Generic Tag Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.Tag

Associated Types

type Rep Tag :: Type -> Type #

Methods

from :: Tag -> Rep Tag x #

to :: Rep Tag x -> Tag #

Read Tag Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.Tag

Show Tag Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.Tag

Methods

showsPrec :: Int -> Tag -> ShowS #

show :: Tag -> String #

showList :: [Tag] -> ShowS #

NFData Tag Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.Tag

Methods

rnf :: Tag -> () #

Eq Tag Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.Tag

Methods

(==) :: Tag -> Tag -> Bool #

(/=) :: Tag -> Tag -> Bool #

Hashable Tag Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.Tag

Methods

hashWithSalt :: Int -> Tag -> Int #

hash :: Tag -> Int #

type Rep Tag Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.Tag

type Rep Tag = D1 ('MetaData "Tag" "Amazonka.MarketplaceMetering.Types.Tag" "amazonka-marketplace-metering-2.0-8iXXI93nW7fIf59koqHJQ" 'False) (C1 ('MetaCons "Tag'" 'PrefixI 'True) (S1 ('MetaSel ('Just "key") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "value") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))

newTag Source #

Create a value of Tag 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:key:Tag', tag_key - One part of a key-value pair that makes up a tag. A key is a label that acts like a category for the specific tag values.

$sel:value:Tag', tag_value - One part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null.

tag_key :: Lens' Tag Text Source #

One part of a key-value pair that makes up a tag. A key is a label that acts like a category for the specific tag values.

tag_value :: Lens' Tag Text Source #

One part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null.

UsageAllocation

data UsageAllocation Source #

Usage allocations allow you to split usage into buckets by tags.

Each UsageAllocation indicates the usage quantity for a specific set of tags.

See: newUsageAllocation smart constructor.

Constructors

UsageAllocation' 

Fields

Instances

Instances details
FromJSON UsageAllocation Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageAllocation

ToJSON UsageAllocation Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageAllocation

Generic UsageAllocation Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageAllocation

Associated Types

type Rep UsageAllocation :: Type -> Type #

Read UsageAllocation Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageAllocation

Show UsageAllocation Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageAllocation

NFData UsageAllocation Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageAllocation

Methods

rnf :: UsageAllocation -> () #

Eq UsageAllocation Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageAllocation

Hashable UsageAllocation Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageAllocation

type Rep UsageAllocation Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageAllocation

type Rep UsageAllocation = D1 ('MetaData "UsageAllocation" "Amazonka.MarketplaceMetering.Types.UsageAllocation" "amazonka-marketplace-metering-2.0-8iXXI93nW7fIf59koqHJQ" 'False) (C1 ('MetaCons "UsageAllocation'" 'PrefixI 'True) (S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (NonEmpty Tag))) :*: S1 ('MetaSel ('Just "allocatedUsageQuantity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Natural)))

newUsageAllocation Source #

Create a value of UsageAllocation 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:tags:UsageAllocation', usageAllocation_tags - The set of tags that define the bucket of usage. For the bucket of items with no tags, this parameter can be left out.

$sel:allocatedUsageQuantity:UsageAllocation', usageAllocation_allocatedUsageQuantity - The total quantity allocated to this bucket of usage.

usageAllocation_tags :: Lens' UsageAllocation (Maybe (NonEmpty Tag)) Source #

The set of tags that define the bucket of usage. For the bucket of items with no tags, this parameter can be left out.

usageAllocation_allocatedUsageQuantity :: Lens' UsageAllocation Natural Source #

The total quantity allocated to this bucket of usage.

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 de-duplicated to prevent double charges.

See: newUsageRecord smart constructor.

Constructors

UsageRecord' 

Fields

  • quantity :: Maybe Natural

    The quantity of usage consumed by the customer for the given dimension and time. 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 Quantity of the UsageRecord.

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

  • customerIdentifier :: Text

    The CustomerIdentifier is obtained through the ResolveCustomer operation and represents an individual buyer in your application.

  • dimension :: Text

    During the process of registering a product on AWS Marketplace, dimensions are specified. These represent different units of value in your application.

Instances

Instances details
FromJSON UsageRecord Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecord

ToJSON UsageRecord Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecord

Generic UsageRecord Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecord

Associated Types

type Rep UsageRecord :: Type -> Type #

Read UsageRecord Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecord

Show UsageRecord Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecord

NFData UsageRecord Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecord

Methods

rnf :: UsageRecord -> () #

Eq UsageRecord Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecord

Hashable UsageRecord Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecord

type Rep UsageRecord Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecord

type Rep UsageRecord = D1 ('MetaData "UsageRecord" "Amazonka.MarketplaceMetering.Types.UsageRecord" "amazonka-marketplace-metering-2.0-8iXXI93nW7fIf59koqHJQ" 'False) (C1 ('MetaCons "UsageRecord'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "quantity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "usageAllocations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (NonEmpty UsageAllocation)))) :*: (S1 ('MetaSel ('Just "timestamp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 POSIX) :*: (S1 ('MetaSel ('Just "customerIdentifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "dimension") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))

newUsageRecord Source #

Create a value of UsageRecord 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:quantity:UsageRecord', usageRecord_quantity - The quantity of usage consumed by the customer for the given dimension and time. Defaults to 0 if not specified.

$sel:usageAllocations:UsageRecord', usageRecord_usageAllocations - The set of UsageAllocations to submit. The sum of all UsageAllocation quantities must equal the Quantity of the UsageRecord.

$sel:timestamp:UsageRecord', usageRecord_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:customerIdentifier:UsageRecord', usageRecord_customerIdentifier - The CustomerIdentifier is obtained through the ResolveCustomer operation and represents an individual buyer in your application.

$sel:dimension:UsageRecord', usageRecord_dimension - During the process of registering a product on AWS Marketplace, dimensions are specified. These represent different units of value in your application.

usageRecord_quantity :: Lens' UsageRecord (Maybe Natural) Source #

The quantity of usage consumed by the customer for the given dimension and time. Defaults to 0 if not specified.

usageRecord_usageAllocations :: Lens' UsageRecord (Maybe (NonEmpty UsageAllocation)) Source #

The set of UsageAllocations to submit. The sum of all UsageAllocation quantities must equal the Quantity of the UsageRecord.

usageRecord_timestamp :: Lens' UsageRecord 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.

usageRecord_customerIdentifier :: Lens' UsageRecord Text Source #

The CustomerIdentifier is obtained through the ResolveCustomer operation and represents an individual buyer in your application.

usageRecord_dimension :: Lens' UsageRecord Text Source #

During the process of registering a product on AWS Marketplace, dimensions are specified. These represent different units of value in your application.

UsageRecordResult

data UsageRecordResult Source #

A UsageRecordResult indicates the status of a given UsageRecord processed by BatchMeterUsage.

See: newUsageRecordResult smart constructor.

Constructors

UsageRecordResult' 

Fields

  • meteringRecordId :: Maybe Text

    The MeteringRecordId is a unique identifier for this metering event.

  • status :: Maybe UsageRecordResultStatus

    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 able to use your product. The UsageRecord was not honored. There are three causes for this result:

      • The customer identifier is invalid.
      • The customer identifier provided in the metering record does not have an active agreement or subscription with this product. Future UsageRecords for this customer will fail until the customer subscribes to your product.
      • The customer's AWS account was suspended.
    • 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.
  • usageRecord :: Maybe UsageRecord

    The UsageRecord that was part of the BatchMeterUsage request.

Instances

Instances details
FromJSON UsageRecordResult Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResult

Generic UsageRecordResult Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResult

Associated Types

type Rep UsageRecordResult :: Type -> Type #

Read UsageRecordResult Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResult

Show UsageRecordResult Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResult

NFData UsageRecordResult Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResult

Methods

rnf :: UsageRecordResult -> () #

Eq UsageRecordResult Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResult

Hashable UsageRecordResult Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResult

type Rep UsageRecordResult Source # 
Instance details

Defined in Amazonka.MarketplaceMetering.Types.UsageRecordResult

type Rep UsageRecordResult = D1 ('MetaData "UsageRecordResult" "Amazonka.MarketplaceMetering.Types.UsageRecordResult" "amazonka-marketplace-metering-2.0-8iXXI93nW7fIf59koqHJQ" 'False) (C1 ('MetaCons "UsageRecordResult'" 'PrefixI 'True) (S1 ('MetaSel ('Just "meteringRecordId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "status") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe UsageRecordResultStatus)) :*: S1 ('MetaSel ('Just "usageRecord") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe UsageRecord)))))

newUsageRecordResult :: UsageRecordResult Source #

Create a value of UsageRecordResult 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:UsageRecordResult', usageRecordResult_meteringRecordId - The MeteringRecordId is a unique identifier for this metering event.

$sel:status:UsageRecordResult', usageRecordResult_status - 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 able to use your product. The UsageRecord was not honored. There are three causes for this result:

    • The customer identifier is invalid.
    • The customer identifier provided in the metering record does not have an active agreement or subscription with this product. Future UsageRecords for this customer will fail until the customer subscribes to your product.
    • The customer's AWS account was suspended.
  • 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.

$sel:usageRecord:UsageRecordResult', usageRecordResult_usageRecord - The UsageRecord that was part of the BatchMeterUsage request.

usageRecordResult_meteringRecordId :: Lens' UsageRecordResult (Maybe Text) Source #

The MeteringRecordId is a unique identifier for this metering event.

usageRecordResult_status :: 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 able to use your product. The UsageRecord was not honored. There are three causes for this result:

    • The customer identifier is invalid.
    • The customer identifier provided in the metering record does not have an active agreement or subscription with this product. Future UsageRecords for this customer will fail until the customer subscribes to your product.
    • The customer's AWS account was suspended.
  • 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.

usageRecordResult_usageRecord :: Lens' UsageRecordResult (Maybe UsageRecord) Source #

The UsageRecord that was part of the BatchMeterUsage request.