-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Amazon Marketplace Metering SDK.
--   
--   The types from this library are intended to be used with
--   <a>amazonka</a>, which provides mechanisms for specifying AuthN/AuthZ
--   information, sending requests, and receiving responses.
--   
--   Lenses are used for constructing and manipulating types, due to the
--   depth of nesting of AWS types and transparency regarding
--   de/serialisation into more palatable Haskell values. The provided
--   lenses should be compatible with any of the major lens libraries such
--   as <a>lens</a> or <a>lens-family-core</a>.
--   
--   See <a>Network.AWS.MarketplaceMetering</a> or <a>the AWS
--   documentation</a> to get started.
@package amazonka-marketplace-metering
@version 1.4.5


module Network.AWS.MarketplaceMetering.Types

-- | API version <tt>2016-01-14</tt> of the Amazon Marketplace Metering SDK
--   configuration.
marketplaceMetering :: Service

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

-- | The product code passed does not match the product code used for
--   publishing the product.
_InvalidProductCodeException :: AsError a => Getting (First ServiceError) a ServiceError

-- | The usage dimension does not match one of the UsageDimensions
--   associated with products.
_InvalidUsageDimensionException :: 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.
_DuplicateRequestException :: AsError a => Getting (First ServiceError) a ServiceError

-- | The timestamp value passed in the meterUsage() is out of allowed
--   range.
_TimestampOutOfBoundsException :: AsError a => Getting (First ServiceError) a ServiceError

-- | The calls to the MeterUsage API are throttled.
_ThrottlingException :: 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.
_InternalServiceErrorException :: AsError a => Getting (First ServiceError) a ServiceError

-- | Prism for InvalidTokenException' errors.
_InvalidTokenException :: 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.
_ExpiredTokenException :: AsError a => Getting (First ServiceError) a ServiceError

-- | You have metered usage for a CustomerIdentifier that does not exist.
_InvalidCustomerIdentifierException :: AsError a => Getting (First ServiceError) a ServiceError
data UsageRecordResultStatus
CustomerNotSubscribed :: UsageRecordResultStatus
DuplicateRecord :: UsageRecordResultStatus
Success :: UsageRecordResultStatus

-- | 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.
--   
--   <i>See:</i> <a>usageRecord</a> smart constructor.
data UsageRecord

-- | Creates a value of <a>UsageRecord</a> with the minimum fields required
--   to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>urTimestamp</a> - 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.</li>
--   <li><a>urCustomerIdentifier</a> - The CustomerIdentifier is obtained
--   through the ResolveCustomer operation and represents an individual
--   buyer in your application.</li>
--   <li><a>urDimension</a> - 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.</li>
--   <li><a>urQuantity</a> - The quantity of usage consumed by the customer
--   for the given dimension and time.</li>
--   </ul>
usageRecord :: UTCTime -> Text -> Text -> Natural -> UsageRecord

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

-- | The CustomerIdentifier is obtained through the ResolveCustomer
--   operation and represents an individual buyer in your application.
urCustomerIdentifier :: 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.
urDimension :: Lens' UsageRecord Text

-- | The quantity of usage consumed by the customer for the given dimension
--   and time.
urQuantity :: Lens' UsageRecord Natural

-- | A UsageRecordResult indicates the status of a given UsageRecord
--   processed by BatchMeterUsage.
--   
--   <i>See:</i> <a>usageRecordResult</a> smart constructor.
data UsageRecordResult

-- | Creates a value of <a>UsageRecordResult</a> with the minimum fields
--   required to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>urrStatus</a> - The UsageRecordResult Status indicates the
--   status of an individual UsageRecord processed by BatchMeterUsage. *
--   <i>Success</i> - The UsageRecord was accepted and honored by
--   BatchMeterUsage. * <i>CustomerNotSubscribed</i> - 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. *
--   <i>DuplicateRecord</i> - Indicates that the UsageRecord was invalid
--   and not honored. A previously metered UsageRecord had the same
--   customer, dimension, and time, but a different quantity.</li>
--   <li><a>urrUsageRecord</a> - The UsageRecord that was part of the
--   BatchMeterUsage request.</li>
--   <li><a>urrMeteringRecordId</a> - The MeteringRecordId is a unique
--   identifier for this metering event.</li>
--   </ul>
usageRecordResult :: UsageRecordResult

-- | The UsageRecordResult Status indicates the status of an individual
--   UsageRecord processed by BatchMeterUsage. * <i>Success</i> - The
--   UsageRecord was accepted and honored by BatchMeterUsage. *
--   <i>CustomerNotSubscribed</i> - 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. * <i>DuplicateRecord</i> - Indicates that the
--   UsageRecord was invalid and not honored. A previously metered
--   UsageRecord had the same customer, dimension, and time, but a
--   different quantity.
urrStatus :: Lens' UsageRecordResult (Maybe UsageRecordResultStatus)

-- | The UsageRecord that was part of the BatchMeterUsage request.
urrUsageRecord :: Lens' UsageRecordResult (Maybe UsageRecord)

-- | The MeteringRecordId is a unique identifier for this metering event.
urrMeteringRecordId :: Lens' UsageRecordResult (Maybe Text)


module Network.AWS.MarketplaceMetering.Waiters


-- | ResolveCustomer is called by a SaaS application during the
--   registration process. When a buyer visits your website during the
--   registration process, the buyer submits a registration token through
--   their browser. The registration token is resolved through this API to
--   obtain a CustomerIdentifier and product code.
module Network.AWS.MarketplaceMetering.ResolveCustomer

-- | Creates a value of <a>ResolveCustomer</a> with the minimum fields
--   required to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>rcRegistrationToken</a> - When a buyer visits your website
--   during the registration process, the buyer submits a registration
--   token through the browser. The registration token is resolved to
--   obtain a CustomerIdentifier and product code.</li>
--   </ul>
resolveCustomer :: Text -> ResolveCustomer

-- | Contains input to the ResolveCustomer operation.
--   
--   <i>See:</i> <a>resolveCustomer</a> smart constructor.
data ResolveCustomer

-- | When a buyer visits your website during the registration process, the
--   buyer submits a registration token through the browser. The
--   registration token is resolved to obtain a CustomerIdentifier and
--   product code.
rcRegistrationToken :: Lens' ResolveCustomer Text

-- | Creates a value of <a>ResolveCustomerResponse</a> with the minimum
--   fields required to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>rcrsCustomerIdentifier</a> - The CustomerIdentifier is used to
--   identify an individual customer in your application. Calls to
--   BatchMeterUsage require CustomerIdentifiers for each UsageRecord.</li>
--   <li><a>rcrsProductCode</a> - The product code is returned to confirm
--   that the buyer is registering for your product. Subsequent
--   BatchMeterUsage calls should be made using this product code.</li>
--   <li><a>rcrsResponseStatus</a> - -- | The response status code.</li>
--   </ul>
resolveCustomerResponse :: Int -> ResolveCustomerResponse

-- | The result of the ResolveCustomer operation. Contains the
--   CustomerIdentifier and product code.
--   
--   <i>See:</i> <a>resolveCustomerResponse</a> smart constructor.
data ResolveCustomerResponse

-- | The CustomerIdentifier is used to identify an individual customer in
--   your application. Calls to BatchMeterUsage require CustomerIdentifiers
--   for each UsageRecord.
rcrsCustomerIdentifier :: Lens' ResolveCustomerResponse (Maybe Text)

-- | The product code is returned to confirm that the buyer is registering
--   for your product. Subsequent BatchMeterUsage calls should be made
--   using this product code.
rcrsProductCode :: Lens' ResolveCustomerResponse (Maybe Text)

-- | <ul>
--   <li>- | The response status code.</li>
--   </ul>
rcrsResponseStatus :: Lens' ResolveCustomerResponse Int
instance GHC.Generics.Generic Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomerResponse
instance Data.Data.Data Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomerResponse
instance GHC.Show.Show Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomerResponse
instance GHC.Read.Read Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomerResponse
instance GHC.Classes.Eq Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomerResponse
instance GHC.Generics.Generic Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomer
instance Data.Data.Data Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomer
instance GHC.Show.Show Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomer
instance GHC.Read.Read Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomer
instance GHC.Classes.Eq Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomer
instance Network.AWS.Types.AWSRequest Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomer
instance Data.Hashable.Class.Hashable Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomer
instance Control.DeepSeq.NFData Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomer
instance Network.AWS.Data.Headers.ToHeaders Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomer
instance Data.Aeson.Types.ToJSON.ToJSON Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomer
instance Network.AWS.Data.Path.ToPath Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomer
instance Network.AWS.Data.Query.ToQuery Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomer
instance Control.DeepSeq.NFData Network.AWS.MarketplaceMetering.ResolveCustomer.ResolveCustomerResponse


-- | 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, generally when
--   running from an EC2 instance on the AWS Marketplace.
module Network.AWS.MarketplaceMetering.MeterUsage

-- | Creates a value of <a>MeterUsage</a> with the minimum fields required
--   to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>muProductCode</a> - 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.</li>
--   <li><a>muTimestamp</a> - Timestamp of the hour, recorded in UTC. The
--   seconds and milliseconds portions of the timestamp will be
--   ignored.</li>
--   <li><a>muUsageDimension</a> - It will be one of the fcp dimension name
--   provided during the publishing of the product.</li>
--   <li><a>muUsageQuantity</a> - Consumption value for the hour.</li>
--   <li><a>muDryRun</a> - 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.</li>
--   </ul>
meterUsage :: Text -> UTCTime -> Text -> Natural -> Bool -> MeterUsage

-- | <i>See:</i> <a>meterUsage</a> smart constructor.
data MeterUsage

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

-- | Timestamp of the hour, recorded in UTC. The seconds and milliseconds
--   portions of the timestamp will be ignored.
muTimestamp :: Lens' MeterUsage UTCTime

-- | It will be one of the fcp dimension name provided during the
--   publishing of the product.
muUsageDimension :: Lens' MeterUsage Text

-- | Consumption value for the hour.
muUsageQuantity :: Lens' MeterUsage Natural

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

-- | Creates a value of <a>MeterUsageResponse</a> with the minimum fields
--   required to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>mursMeteringRecordId</a> - Undocumented member.</li>
--   <li><a>mursResponseStatus</a> - -- | The response status code.</li>
--   </ul>
meterUsageResponse :: Int -> MeterUsageResponse

-- | <i>See:</i> <a>meterUsageResponse</a> smart constructor.
data MeterUsageResponse

-- | Undocumented member.
mursMeteringRecordId :: Lens' MeterUsageResponse (Maybe Text)

-- | <ul>
--   <li>- | The response status code.</li>
--   </ul>
mursResponseStatus :: Lens' MeterUsageResponse Int
instance GHC.Generics.Generic Network.AWS.MarketplaceMetering.MeterUsage.MeterUsageResponse
instance Data.Data.Data Network.AWS.MarketplaceMetering.MeterUsage.MeterUsageResponse
instance GHC.Show.Show Network.AWS.MarketplaceMetering.MeterUsage.MeterUsageResponse
instance GHC.Read.Read Network.AWS.MarketplaceMetering.MeterUsage.MeterUsageResponse
instance GHC.Classes.Eq Network.AWS.MarketplaceMetering.MeterUsage.MeterUsageResponse
instance GHC.Generics.Generic Network.AWS.MarketplaceMetering.MeterUsage.MeterUsage
instance Data.Data.Data Network.AWS.MarketplaceMetering.MeterUsage.MeterUsage
instance GHC.Show.Show Network.AWS.MarketplaceMetering.MeterUsage.MeterUsage
instance GHC.Read.Read Network.AWS.MarketplaceMetering.MeterUsage.MeterUsage
instance GHC.Classes.Eq Network.AWS.MarketplaceMetering.MeterUsage.MeterUsage
instance Network.AWS.Types.AWSRequest Network.AWS.MarketplaceMetering.MeterUsage.MeterUsage
instance Data.Hashable.Class.Hashable Network.AWS.MarketplaceMetering.MeterUsage.MeterUsage
instance Control.DeepSeq.NFData Network.AWS.MarketplaceMetering.MeterUsage.MeterUsage
instance Network.AWS.Data.Headers.ToHeaders Network.AWS.MarketplaceMetering.MeterUsage.MeterUsage
instance Data.Aeson.Types.ToJSON.ToJSON Network.AWS.MarketplaceMetering.MeterUsage.MeterUsage
instance Network.AWS.Data.Path.ToPath Network.AWS.MarketplaceMetering.MeterUsage.MeterUsage
instance Network.AWS.Data.Query.ToQuery Network.AWS.MarketplaceMetering.MeterUsage.MeterUsage
instance Control.DeepSeq.NFData Network.AWS.MarketplaceMetering.MeterUsage.MeterUsageResponse


-- | BatchMeterUsage is called from a SaaS application listed on the AWS
--   Marketplace to post metering records for a set of customers.
--   
--   For identical requests, the API is idempotent; requests can be retried
--   with the same records or a subset of the input records.
--   
--   Every request to BatchMeterUsage is for one product. If you need to
--   meter usage for multiple products, you must make multiple calls to
--   BatchMeterUsage.
--   
--   BatchMeterUsage can process up to 25 UsageRecords at a time.
module Network.AWS.MarketplaceMetering.BatchMeterUsage

-- | Creates a value of <a>BatchMeterUsage</a> with the minimum fields
--   required to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>bmuUsageRecords</a> - The set of UsageRecords to submit.
--   BatchMeterUsage accepts up to 25 UsageRecords at a time.</li>
--   <li><a>bmuProductCode</a> - 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.</li>
--   </ul>
batchMeterUsage :: Text -> BatchMeterUsage

-- | A BatchMeterUsageRequest contains UsageRecords, which indicate
--   quantities of usage within your application.
--   
--   <i>See:</i> <a>batchMeterUsage</a> smart constructor.
data BatchMeterUsage

-- | The set of UsageRecords to submit. BatchMeterUsage accepts up to 25
--   UsageRecords at a time.
bmuUsageRecords :: Lens' BatchMeterUsage [UsageRecord]

-- | 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.
bmuProductCode :: Lens' BatchMeterUsage Text

-- | Creates a value of <a>BatchMeterUsageResponse</a> with the minimum
--   fields required to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>bmursResults</a> - Contains all UsageRecords processed by
--   BatchMeterUsage. These records were either honored by AWS Marketplace
--   Metering Service or were invalid.</li>
--   <li><a>bmursUnprocessedRecords</a> - Contains all UsageRecords that
--   were not processed by BatchMeterUsage. This is a list of UsageRecords.
--   You can retry the failed request by making another BatchMeterUsage
--   call with this list as input in the BatchMeterUsageRequest.</li>
--   <li><a>bmursResponseStatus</a> - -- | The response status code.</li>
--   </ul>
batchMeterUsageResponse :: Int -> BatchMeterUsageResponse

-- | Contains the UsageRecords processed by BatchMeterUsage and any records
--   that have failed due to transient error.
--   
--   <i>See:</i> <a>batchMeterUsageResponse</a> smart constructor.
data BatchMeterUsageResponse

-- | Contains all UsageRecords processed by BatchMeterUsage. These records
--   were either honored by AWS Marketplace Metering Service or were
--   invalid.
bmursResults :: Lens' BatchMeterUsageResponse [UsageRecordResult]

-- | Contains all UsageRecords that were not processed by BatchMeterUsage.
--   This is a list of UsageRecords. You can retry the failed request by
--   making another BatchMeterUsage call with this list as input in the
--   BatchMeterUsageRequest.
bmursUnprocessedRecords :: Lens' BatchMeterUsageResponse [UsageRecord]

-- | <ul>
--   <li>- | The response status code.</li>
--   </ul>
bmursResponseStatus :: Lens' BatchMeterUsageResponse Int
instance GHC.Generics.Generic Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsageResponse
instance Data.Data.Data Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsageResponse
instance GHC.Show.Show Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsageResponse
instance GHC.Read.Read Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsageResponse
instance GHC.Classes.Eq Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsageResponse
instance GHC.Generics.Generic Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsage
instance Data.Data.Data Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsage
instance GHC.Show.Show Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsage
instance GHC.Read.Read Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsage
instance GHC.Classes.Eq Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsage
instance Network.AWS.Types.AWSRequest Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsage
instance Data.Hashable.Class.Hashable Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsage
instance Control.DeepSeq.NFData Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsage
instance Network.AWS.Data.Headers.ToHeaders Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsage
instance Data.Aeson.Types.ToJSON.ToJSON Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsage
instance Network.AWS.Data.Path.ToPath Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsage
instance Network.AWS.Data.Query.ToQuery Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsage
instance Control.DeepSeq.NFData Network.AWS.MarketplaceMetering.BatchMeterUsage.BatchMeterUsageResponse


-- | <b>AWS Marketplace Metering Service</b>
--   
--   This reference provides descriptions of the low-level AWS Marketplace
--   Metering Service API.
--   
--   AWS Marketplace sellers can use this API to submit usage data for
--   custom usage dimensions.
--   
--   <b>Submitting Metering Records</b>
--   
--   <ul>
--   <li><i>MeterUsage</i> - Submits the metering record for a Marketplace
--   product. MeterUsage is called from an EC2 instance.</li>
--   <li><i>BatchMeterUsage</i> - Submits the metering record for a set of
--   customers. BatchMeterUsage is called from a software-as-a-service
--   (SaaS) application.</li>
--   </ul>
--   
--   <b>Accepting New Customers</b>
--   
--   <ul>
--   <li><i>ResolveCustomer</i> - Called by a SaaS application during the
--   registration process. When a buyer visits your website during the
--   registration process, the buyer submits a Registration Token through
--   the browser. The Registration Token is resolved through this API to
--   obtain a CustomerIdentifier and Product Code.</li>
--   </ul>
module Network.AWS.MarketplaceMetering

-- | API version <tt>2016-01-14</tt> of the Amazon Marketplace Metering SDK
--   configuration.
marketplaceMetering :: Service

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

-- | The product code passed does not match the product code used for
--   publishing the product.
_InvalidProductCodeException :: AsError a => Getting (First ServiceError) a ServiceError

-- | The usage dimension does not match one of the UsageDimensions
--   associated with products.
_InvalidUsageDimensionException :: 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.
_DuplicateRequestException :: AsError a => Getting (First ServiceError) a ServiceError

-- | The timestamp value passed in the meterUsage() is out of allowed
--   range.
_TimestampOutOfBoundsException :: AsError a => Getting (First ServiceError) a ServiceError

-- | The calls to the MeterUsage API are throttled.
_ThrottlingException :: 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.
_InternalServiceErrorException :: AsError a => Getting (First ServiceError) a ServiceError

-- | Prism for InvalidTokenException' errors.
_InvalidTokenException :: 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.
_ExpiredTokenException :: AsError a => Getting (First ServiceError) a ServiceError

-- | You have metered usage for a CustomerIdentifier that does not exist.
_InvalidCustomerIdentifierException :: AsError a => Getting (First ServiceError) a ServiceError
data UsageRecordResultStatus
CustomerNotSubscribed :: UsageRecordResultStatus
DuplicateRecord :: UsageRecordResultStatus
Success :: UsageRecordResultStatus

-- | 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.
--   
--   <i>See:</i> <a>usageRecord</a> smart constructor.
data UsageRecord

-- | Creates a value of <a>UsageRecord</a> with the minimum fields required
--   to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>urTimestamp</a> - 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.</li>
--   <li><a>urCustomerIdentifier</a> - The CustomerIdentifier is obtained
--   through the ResolveCustomer operation and represents an individual
--   buyer in your application.</li>
--   <li><a>urDimension</a> - 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.</li>
--   <li><a>urQuantity</a> - The quantity of usage consumed by the customer
--   for the given dimension and time.</li>
--   </ul>
usageRecord :: UTCTime -> Text -> Text -> Natural -> UsageRecord

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

-- | The CustomerIdentifier is obtained through the ResolveCustomer
--   operation and represents an individual buyer in your application.
urCustomerIdentifier :: 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.
urDimension :: Lens' UsageRecord Text

-- | The quantity of usage consumed by the customer for the given dimension
--   and time.
urQuantity :: Lens' UsageRecord Natural

-- | A UsageRecordResult indicates the status of a given UsageRecord
--   processed by BatchMeterUsage.
--   
--   <i>See:</i> <a>usageRecordResult</a> smart constructor.
data UsageRecordResult

-- | Creates a value of <a>UsageRecordResult</a> with the minimum fields
--   required to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>urrStatus</a> - The UsageRecordResult Status indicates the
--   status of an individual UsageRecord processed by BatchMeterUsage. *
--   <i>Success</i> - The UsageRecord was accepted and honored by
--   BatchMeterUsage. * <i>CustomerNotSubscribed</i> - 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. *
--   <i>DuplicateRecord</i> - Indicates that the UsageRecord was invalid
--   and not honored. A previously metered UsageRecord had the same
--   customer, dimension, and time, but a different quantity.</li>
--   <li><a>urrUsageRecord</a> - The UsageRecord that was part of the
--   BatchMeterUsage request.</li>
--   <li><a>urrMeteringRecordId</a> - The MeteringRecordId is a unique
--   identifier for this metering event.</li>
--   </ul>
usageRecordResult :: UsageRecordResult

-- | The UsageRecordResult Status indicates the status of an individual
--   UsageRecord processed by BatchMeterUsage. * <i>Success</i> - The
--   UsageRecord was accepted and honored by BatchMeterUsage. *
--   <i>CustomerNotSubscribed</i> - 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. * <i>DuplicateRecord</i> - Indicates that the
--   UsageRecord was invalid and not honored. A previously metered
--   UsageRecord had the same customer, dimension, and time, but a
--   different quantity.
urrStatus :: Lens' UsageRecordResult (Maybe UsageRecordResultStatus)

-- | The UsageRecord that was part of the BatchMeterUsage request.
urrUsageRecord :: Lens' UsageRecordResult (Maybe UsageRecord)

-- | The MeteringRecordId is a unique identifier for this metering event.
urrMeteringRecordId :: Lens' UsageRecordResult (Maybe Text)
