amazonka-marketplace-metering-1.4.5: Amazon Marketplace Metering SDK.

Copyright(c) 2013-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.MarketplaceMetering.Types

Contents

Description

 

Synopsis

Service Configuration

marketplaceMetering :: Service #

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

Errors

_InvalidEndpointRegionException :: AsError a => Getting (First ServiceError) a ServiceError #

The endpoint being called is in a region different from your EC2 instance. The region of the Metering service endpoint and the region of the EC2 instance must match.

_InvalidProductCodeException :: AsError a => Getting (First ServiceError) a ServiceError #

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

_InvalidUsageDimensionException :: AsError a => Getting (First ServiceError) a ServiceError #

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

_DuplicateRequestException :: AsError a => Getting (First ServiceError) a ServiceError #

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

_TimestampOutOfBoundsException :: AsError a => Getting (First ServiceError) a ServiceError #

The timestamp value passed in the meterUsage() is out of allowed range.

_ThrottlingException :: AsError a => Getting (First ServiceError) a ServiceError #

The calls to the MeterUsage API are throttled.

_InternalServiceErrorException :: AsError a => Getting (First ServiceError) a ServiceError #

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

_InvalidTokenException :: AsError a => Getting (First ServiceError) a ServiceError #

Prism for InvalidTokenException' errors.

_ExpiredTokenException :: AsError a => Getting (First ServiceError) a ServiceError #

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.

_InvalidCustomerIdentifierException :: AsError a => Getting (First ServiceError) a ServiceError #

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

UsageRecordResultStatus

data UsageRecordResultStatus #

Instances

Bounded UsageRecordResultStatus # 
Enum UsageRecordResultStatus # 
Eq UsageRecordResultStatus # 
Data UsageRecordResultStatus # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UsageRecordResultStatus -> c UsageRecordResultStatus #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UsageRecordResultStatus #

toConstr :: UsageRecordResultStatus -> Constr #

dataTypeOf :: UsageRecordResultStatus -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c UsageRecordResultStatus) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UsageRecordResultStatus) #

gmapT :: (forall b. Data b => b -> b) -> UsageRecordResultStatus -> UsageRecordResultStatus #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UsageRecordResultStatus -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UsageRecordResultStatus -> r #

gmapQ :: (forall d. Data d => d -> u) -> UsageRecordResultStatus -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UsageRecordResultStatus -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UsageRecordResultStatus -> m UsageRecordResultStatus #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UsageRecordResultStatus -> m UsageRecordResultStatus #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UsageRecordResultStatus -> m UsageRecordResultStatus #

Ord UsageRecordResultStatus # 
Read UsageRecordResultStatus # 
Show UsageRecordResultStatus # 
Generic UsageRecordResultStatus # 
Hashable UsageRecordResultStatus # 
FromJSON UsageRecordResultStatus # 
NFData UsageRecordResultStatus # 

Methods

rnf :: UsageRecordResultStatus -> () #

ToQuery UsageRecordResultStatus # 
ToHeader UsageRecordResultStatus # 
ToByteString UsageRecordResultStatus # 
FromText UsageRecordResultStatus # 
ToText UsageRecordResultStatus # 
type Rep UsageRecordResultStatus # 
type Rep UsageRecordResultStatus = D1 (MetaData "UsageRecordResultStatus" "Network.AWS.MarketplaceMetering.Types.Sum" "amazonka-marketplace-metering-1.4.5-9px4Jx494it2K6FSd2bSk1" False) ((:+:) (C1 (MetaCons "CustomerNotSubscribed" PrefixI False) U1) ((:+:) (C1 (MetaCons "DuplicateRecord" PrefixI False) U1) (C1 (MetaCons "Success" PrefixI False) U1)))

UsageRecord

data UsageRecord #

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

See: usageRecord smart constructor.

Instances

Eq UsageRecord # 
Data UsageRecord # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UsageRecord -> c UsageRecord #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UsageRecord #

toConstr :: UsageRecord -> Constr #

dataTypeOf :: UsageRecord -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c UsageRecord) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UsageRecord) #

gmapT :: (forall b. Data b => b -> b) -> UsageRecord -> UsageRecord #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UsageRecord -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UsageRecord -> r #

gmapQ :: (forall d. Data d => d -> u) -> UsageRecord -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UsageRecord -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UsageRecord -> m UsageRecord #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UsageRecord -> m UsageRecord #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UsageRecord -> m UsageRecord #

Read UsageRecord # 
Show UsageRecord # 
Generic UsageRecord # 

Associated Types

type Rep UsageRecord :: * -> * #

Hashable UsageRecord # 
ToJSON UsageRecord # 
FromJSON UsageRecord # 
NFData UsageRecord # 

Methods

rnf :: UsageRecord -> () #

type Rep UsageRecord # 
type Rep UsageRecord = D1 (MetaData "UsageRecord" "Network.AWS.MarketplaceMetering.Types.Product" "amazonka-marketplace-metering-1.4.5-9px4Jx494it2K6FSd2bSk1" False) (C1 (MetaCons "UsageRecord'" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_urTimestamp") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 POSIX)) (S1 (MetaSel (Just Symbol "_urCustomerIdentifier") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))) ((:*:) (S1 (MetaSel (Just Symbol "_urDimension") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)) (S1 (MetaSel (Just Symbol "_urQuantity") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Nat)))))

usageRecord #

Creates a value of UsageRecord with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • urTimestamp - Timestamp of the hour, recorded in UTC. The seconds and milliseconds portions of the timestamp will be ignored. Your application can meter usage for up to one hour in the past.
  • urCustomerIdentifier - The CustomerIdentifier is obtained through the ResolveCustomer operation and represents an individual buyer in your application.
  • urDimension - During the process of registering a product on AWS Marketplace, up to eight dimensions are specified. These represent different units of value in your application.
  • urQuantity - The quantity of usage consumed by the customer for the given dimension and time.

urTimestamp :: Lens' UsageRecord UTCTime #

Timestamp of the hour, recorded in UTC. The seconds and milliseconds portions of the timestamp will be ignored. Your application can meter usage for up to one hour in the past.

urCustomerIdentifier :: Lens' UsageRecord Text #

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

urDimension :: Lens' UsageRecord Text #

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

urQuantity :: Lens' UsageRecord Natural #

The quantity of usage consumed by the customer for the given dimension and time.

UsageRecordResult

data UsageRecordResult #

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

See: usageRecordResult smart constructor.

Instances

Eq UsageRecordResult # 
Data UsageRecordResult # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UsageRecordResult -> c UsageRecordResult #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UsageRecordResult #

toConstr :: UsageRecordResult -> Constr #

dataTypeOf :: UsageRecordResult -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c UsageRecordResult) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UsageRecordResult) #

gmapT :: (forall b. Data b => b -> b) -> UsageRecordResult -> UsageRecordResult #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UsageRecordResult -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UsageRecordResult -> r #

gmapQ :: (forall d. Data d => d -> u) -> UsageRecordResult -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UsageRecordResult -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UsageRecordResult -> m UsageRecordResult #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UsageRecordResult -> m UsageRecordResult #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UsageRecordResult -> m UsageRecordResult #

Read UsageRecordResult # 
Show UsageRecordResult # 
Generic UsageRecordResult # 
Hashable UsageRecordResult # 
FromJSON UsageRecordResult # 
NFData UsageRecordResult # 

Methods

rnf :: UsageRecordResult -> () #

type Rep UsageRecordResult # 
type Rep UsageRecordResult = D1 (MetaData "UsageRecordResult" "Network.AWS.MarketplaceMetering.Types.Product" "amazonka-marketplace-metering-1.4.5-9px4Jx494it2K6FSd2bSk1" False) (C1 (MetaCons "UsageRecordResult'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_urrStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe UsageRecordResultStatus))) ((:*:) (S1 (MetaSel (Just Symbol "_urrUsageRecord") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe UsageRecord))) (S1 (MetaSel (Just Symbol "_urrMeteringRecordId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))))))

usageRecordResult :: UsageRecordResult #

Creates a value of UsageRecordResult with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • urrStatus - 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 subscribed to your product. The UsageRecord was not honored. Future UsageRecords for this customer will fail until the customer subscribes to your product. * 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.
  • urrUsageRecord - The UsageRecord that was part of the BatchMeterUsage request.
  • urrMeteringRecordId - The MeteringRecordId is a unique identifier for this metering event.

urrStatus :: Lens' UsageRecordResult (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 subscribed to your product. The UsageRecord was not honored. Future UsageRecords for this customer will fail until the customer subscribes to your product. * 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.

urrUsageRecord :: Lens' UsageRecordResult (Maybe UsageRecord) #

The UsageRecord that was part of the BatchMeterUsage request.

urrMeteringRecordId :: Lens' UsageRecordResult (Maybe Text) #

The MeteringRecordId is a unique identifier for this metering event.