amberflo-metering-typescript
Version:
Amberflo metering client for TypeScript
73 lines (72 loc) • 2.08 kB
TypeScript
import { IValidatable, INestedValidatable } from './validation';
export declare class TimeRange implements INestedValidatable {
startTimeInSeconds?: number;
endTimeInSeconds?: number;
constructor(startTimeInSeconds?: number);
validate(prefix: string): void;
}
export declare class Take implements INestedValidatable {
limit?: number;
isAscending?: boolean;
constructor(limit?: number);
validate(prefix: string): void;
}
export declare enum AggregationType {
sum = "sum",
min = "min",
max = "max",
count = "count"
}
export declare enum AggregationInterval {
hour = "hour",
day = "day",
week = "week",
month = "month"
}
export declare class UsageApiPayload implements IValidatable {
meterApiName?: string;
aggregation?: AggregationType;
timeGroupingInterval?: AggregationInterval;
timeRange?: TimeRange;
filter?: {
[key: string]: string[];
};
groupBy?: string[];
take?: Take;
constructor(meterApiName?: string, aggregation?: AggregationType, timeGroupingInterval?: AggregationInterval, timeRange?: TimeRange);
validate(): void;
}
export declare enum AllUsageGroupBy {
customerId = "customerId"
}
export declare class AllUsageApiPayload implements IValidatable {
startTimeInSeconds?: number;
endTimeInSeconds?: number;
timeGroupingInterval?: AggregationInterval;
groupBy?: AllUsageGroupBy;
customerId?: string;
constructor(startTimeInSeconds?: number, timeGroupingInterval?: AggregationInterval);
validate(): void;
}
declare class AggregationValue {
value: number;
secondsSinceEpochUtc: number;
percentageFromPrevious: number;
}
declare class AggregationGroup {
groupInfo: {
[key: string]: string;
};
}
declare class Aggregation {
group?: AggregationGroup;
groupValue: number;
values: AggregationValue[];
percentageFromPrevious: number;
}
export declare class UsageReport {
metadata: UsageApiPayload;
secondsSinceEpochIntervals: number[];
clientMeters: Aggregation[];
}
export {};