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 Source #

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

Errors

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

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 Source #

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

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

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

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

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 Source #

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

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

The calls to the MeterUsage API are throttled.

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

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 Source #

Prism for InvalidTokenException' errors.

_ExpiredTokenException :: AsError a => Getting (First ServiceError) 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.

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

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

UsageRecordResultStatus

data UsageRecordResultStatus Source #

Instances

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

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 Source # 
Read UsageRecordResultStatus Source # 
Show UsageRecordResultStatus Source # 
Generic UsageRecordResultStatus Source # 
Hashable UsageRecordResultStatus Source # 
FromJSON UsageRecordResultStatus Source # 
NFData UsageRecordResultStatus Source # 

Methods

rnf :: UsageRecordResultStatus -> () #

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

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

See: usageRecord smart constructor.

Instances

Eq UsageRecord Source # 
Data UsageRecord Source # 

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 Source # 
Show UsageRecord Source # 
Generic UsageRecord Source # 

Associated Types

type Rep UsageRecord :: * -> * #

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

Methods

rnf :: UsageRecord -> () #

type Rep UsageRecord Source # 
type Rep UsageRecord = D1 (MetaData "UsageRecord" "Network.AWS.MarketplaceMetering.Types.Product" "amazonka-marketplace-metering-1.4.5-JZ3hVk5dvwX6ldhauCFg6l" 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 Source #

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 Source #

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 Source #

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

urDimension :: Lens' UsageRecord Text Source #

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 Source #

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

UsageRecordResult

data UsageRecordResult Source #

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

See: usageRecordResult smart constructor.

Instances

Eq UsageRecordResult Source # 
Data UsageRecordResult Source # 

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 Source # 
Show UsageRecordResult Source # 
Generic UsageRecordResult Source # 
Hashable UsageRecordResult Source # 
FromJSON UsageRecordResult Source # 
NFData UsageRecordResult Source # 

Methods

rnf :: UsageRecordResult -> () #

type Rep UsageRecordResult Source # 
type Rep UsageRecordResult = D1 (MetaData "UsageRecordResult" "Network.AWS.MarketplaceMetering.Types.Product" "amazonka-marketplace-metering-1.4.5-JZ3hVk5dvwX6ldhauCFg6l" 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 Source #

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) 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 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) Source #

The UsageRecord that was part of the BatchMeterUsage request.

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

The MeteringRecordId is a unique identifier for this metering event.