marketplacemetering.d.ts (9622B)
1 import {Request} from '../lib/request'; 2 import {Response} from '../lib/response'; 3 import {AWSError} from '../lib/error'; 4 import {Service} from '../lib/service'; 5 import {ServiceConfigurationOptions} from '../lib/service'; 6 import {ConfigBase as Config} from '../lib/config'; 7 interface Blob {} 8 declare class MarketplaceMetering extends Service { 9 /** 10 * Constructs a service object. This object has one method for each API operation. 11 */ 12 constructor(options?: MarketplaceMetering.Types.ClientConfiguration) 13 config: Config & MarketplaceMetering.Types.ClientConfiguration; 14 /** 15 * 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. 16 */ 17 batchMeterUsage(params: MarketplaceMetering.Types.BatchMeterUsageRequest, callback?: (err: AWSError, data: MarketplaceMetering.Types.BatchMeterUsageResult) => void): Request<MarketplaceMetering.Types.BatchMeterUsageResult, AWSError>; 18 /** 19 * 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. 20 */ 21 batchMeterUsage(callback?: (err: AWSError, data: MarketplaceMetering.Types.BatchMeterUsageResult) => void): Request<MarketplaceMetering.Types.BatchMeterUsageResult, AWSError>; 22 /** 23 * 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. 24 */ 25 meterUsage(params: MarketplaceMetering.Types.MeterUsageRequest, callback?: (err: AWSError, data: MarketplaceMetering.Types.MeterUsageResult) => void): Request<MarketplaceMetering.Types.MeterUsageResult, AWSError>; 26 /** 27 * 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. 28 */ 29 meterUsage(callback?: (err: AWSError, data: MarketplaceMetering.Types.MeterUsageResult) => void): Request<MarketplaceMetering.Types.MeterUsageResult, AWSError>; 30 /** 31 * 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. 32 */ 33 resolveCustomer(params: MarketplaceMetering.Types.ResolveCustomerRequest, callback?: (err: AWSError, data: MarketplaceMetering.Types.ResolveCustomerResult) => void): Request<MarketplaceMetering.Types.ResolveCustomerResult, AWSError>; 34 /** 35 * 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. 36 */ 37 resolveCustomer(callback?: (err: AWSError, data: MarketplaceMetering.Types.ResolveCustomerResult) => void): Request<MarketplaceMetering.Types.ResolveCustomerResult, AWSError>; 38 } 39 declare namespace MarketplaceMetering.Types { 40 export interface BatchMeterUsageRequest { 41 /** 42 * The set of UsageRecords to submit. BatchMeterUsage accepts up to 25 UsageRecords at a time. 43 */ 44 UsageRecords: UsageRecordList; 45 /** 46 * 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. 47 */ 48 ProductCode: ProductCode; 49 } 50 export interface BatchMeterUsageResult { 51 /** 52 * Contains all UsageRecords processed by BatchMeterUsage. These records were either honored by AWS Marketplace Metering Service or were invalid. 53 */ 54 Results?: UsageRecordResultList; 55 /** 56 * 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. 57 */ 58 UnprocessedRecords?: UsageRecordList; 59 } 60 export type Boolean = boolean; 61 export type CustomerIdentifier = string; 62 export interface MeterUsageRequest { 63 /** 64 * 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. 65 */ 66 ProductCode: ProductCode; 67 /** 68 * Timestamp of the hour, recorded in UTC. The seconds and milliseconds portions of the timestamp will be ignored. 69 */ 70 Timestamp: Timestamp; 71 /** 72 * It will be one of the fcp dimension name provided during the publishing of the product. 73 */ 74 UsageDimension: UsageDimension; 75 /** 76 * Consumption value for the hour. 77 */ 78 UsageQuantity: UsageQuantity; 79 /** 80 * 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. 81 */ 82 DryRun: Boolean; 83 } 84 export interface MeterUsageResult { 85 MeteringRecordId?: String; 86 } 87 export type NonEmptyString = string; 88 export type ProductCode = string; 89 export interface ResolveCustomerRequest { 90 /** 91 * 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. 92 */ 93 RegistrationToken: NonEmptyString; 94 } 95 export interface ResolveCustomerResult { 96 /** 97 * The CustomerIdentifier is used to identify an individual customer in your application. Calls to BatchMeterUsage require CustomerIdentifiers for each UsageRecord. 98 */ 99 CustomerIdentifier?: CustomerIdentifier; 100 /** 101 * 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. 102 */ 103 ProductCode?: ProductCode; 104 } 105 export type String = string; 106 export type Timestamp = Date; 107 export type UsageDimension = string; 108 export type UsageQuantity = number; 109 export interface UsageRecord { 110 /** 111 * 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. 112 */ 113 Timestamp: Timestamp; 114 /** 115 * The CustomerIdentifier is obtained through the ResolveCustomer operation and represents an individual buyer in your application. 116 */ 117 CustomerIdentifier: CustomerIdentifier; 118 /** 119 * 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. 120 */ 121 Dimension: UsageDimension; 122 /** 123 * The quantity of usage consumed by the customer for the given dimension and time. 124 */ 125 Quantity: UsageQuantity; 126 } 127 export type UsageRecordList = UsageRecord[]; 128 export interface UsageRecordResult { 129 /** 130 * The UsageRecord that was part of the BatchMeterUsage request. 131 */ 132 UsageRecord?: UsageRecord; 133 /** 134 * The MeteringRecordId is a unique identifier for this metering event. 135 */ 136 MeteringRecordId?: String; 137 /** 138 * 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. 139 */ 140 Status?: UsageRecordResultStatus; 141 } 142 export type UsageRecordResultList = UsageRecordResult[]; 143 export type UsageRecordResultStatus = "Success"|"CustomerNotSubscribed"|"DuplicateRecord"|string; 144 export type errorMessage = string; 145 /** 146 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version. 147 */ 148 export type apiVersion = "2016-01-14"|"latest"|string; 149 export interface ClientApiVersions { 150 /** 151 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version. 152 */ 153 apiVersion?: apiVersion; 154 } 155 export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions; 156 } 157 export = MarketplaceMetering;