@vercel/sdk
Version:
<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>
309 lines • 9.56 kB
TypeScript
import * as z from "zod/v3";
import { ClosedEnum } from "../types/enums.js";
/**
* Period for the billing cycle. The period end date cannot be older than 24 hours earlier than our current server's time.
*/
export type Period = {
start: Date;
end: Date;
};
export type BillingItems = {
/**
* Partner's billing plan ID.
*/
billingPlanId: string;
/**
* Partner's resource ID.
*/
resourceId?: string | undefined;
/**
* Start and end are only needed if different from the period's start/end.
*/
start?: Date | undefined;
/**
* Start and end are only needed if different from the period's start/end.
*/
end?: Date | undefined;
/**
* Line item name.
*/
name: string;
/**
* Line item details.
*/
details?: string | undefined;
/**
* Price per unit.
*/
price: string;
/**
* Quantity of units.
*/
quantity: number;
/**
* Units of the quantity.
*/
units: string;
/**
* Total amount.
*/
total: string;
};
export type Discounts = {
/**
* Partner's billing plan ID.
*/
billingPlanId: string;
/**
* Partner's resource ID.
*/
resourceId?: string | undefined;
/**
* Start and end are only needed if different from the period's start/end.
*/
start?: Date | undefined;
/**
* Start and end are only needed if different from the period's start/end.
*/
end?: Date | undefined;
/**
* Discount name.
*/
name: string;
/**
* Discount details.
*/
details?: string | undefined;
/**
* Discount amount.
*/
amount: string;
};
export type Billing2 = {
items: Array<BillingItems>;
discounts?: Array<Discounts> | undefined;
};
export type Billing1 = {
/**
* Partner's billing plan ID.
*/
billingPlanId: string;
/**
* Partner's resource ID.
*/
resourceId?: string | undefined;
/**
* Start and end are only needed if different from the period's start/end.
*/
start?: Date | undefined;
/**
* Start and end are only needed if different from the period's start/end.
*/
end?: Date | undefined;
/**
* Line item name.
*/
name: string;
/**
* Line item details.
*/
details?: string | undefined;
/**
* Price per unit.
*/
price: string;
/**
* Quantity of units.
*/
quantity: number;
/**
* Units of the quantity.
*/
units: string;
/**
* Total amount.
*/
total: string;
};
/**
* Billing data (interim invoicing data).
*/
export type SubmitBillingDataBilling = Billing2 | Array<Billing1>;
/**
* @remarks
* Type of the metric.
* - total: measured total value, such as Database size
* - interval: usage during the period, such as i/o or number of queries.
* - rate: rate of usage, such as queries per second.
*/
export declare const SubmitBillingDataType: {
readonly Total: "total";
readonly Interval: "interval";
readonly Rate: "rate";
};
/**
* @remarks
* Type of the metric.
* - total: measured total value, such as Database size
* - interval: usage during the period, such as i/o or number of queries.
* - rate: rate of usage, such as queries per second.
*/
export type SubmitBillingDataType = ClosedEnum<typeof SubmitBillingDataType>;
export type Usage = {
/**
* Partner's resource ID.
*/
resourceId?: string | undefined;
/**
* Metric name.
*/
name: string;
/**
* @remarks
* Type of the metric.
* - total: measured total value, such as Database size
* - interval: usage during the period, such as i/o or number of queries.
* - rate: rate of usage, such as queries per second.
*/
type: SubmitBillingDataType;
/**
* Metric units. Example: "GB"
*/
units: string;
/**
* Metric value for the day. Could be a final or an interim value for the day.
*/
dayValue: number;
/**
* Metric value for the billing period. Could be a final or an interim value for the period.
*/
periodValue: number;
/**
* The limit value of the metric for a billing period, if a limit is defined by the plan.
*/
planValue?: number | undefined;
};
export type SubmitBillingDataRequestBody = {
/**
* Server time of your integration, used to determine the most recent data for race conditions & updates. Only the latest usage data for a given day, week, and month will be kept.
*/
timestamp: Date;
/**
* End of Day, the UTC datetime for when the end of the billing/usage day is in UTC time. This tells us which day the usage data is for, and also allows for your "end of day" to be different from UTC 00:00:00. eod must be within the period dates, and cannot be older than 24h earlier from our server's current time.
*/
eod: Date;
/**
* Period for the billing cycle. The period end date cannot be older than 24 hours earlier than our current server's time.
*/
period: Period;
/**
* Billing data (interim invoicing data).
*/
billing: Billing2 | Array<Billing1>;
usage: Array<Usage>;
};
export type SubmitBillingDataRequest = {
integrationConfigurationId: string;
requestBody: SubmitBillingDataRequestBody;
};
/** @internal */
export type Period$Outbound = {
start: string;
end: string;
};
/** @internal */
export declare const Period$outboundSchema: z.ZodType<Period$Outbound, z.ZodTypeDef, Period>;
export declare function periodToJSON(period: Period): string;
/** @internal */
export type BillingItems$Outbound = {
billingPlanId: string;
resourceId?: string | undefined;
start?: string | undefined;
end?: string | undefined;
name: string;
details?: string | undefined;
price: string;
quantity: number;
units: string;
total: string;
};
/** @internal */
export declare const BillingItems$outboundSchema: z.ZodType<BillingItems$Outbound, z.ZodTypeDef, BillingItems>;
export declare function billingItemsToJSON(billingItems: BillingItems): string;
/** @internal */
export type Discounts$Outbound = {
billingPlanId: string;
resourceId?: string | undefined;
start?: string | undefined;
end?: string | undefined;
name: string;
details?: string | undefined;
amount: string;
};
/** @internal */
export declare const Discounts$outboundSchema: z.ZodType<Discounts$Outbound, z.ZodTypeDef, Discounts>;
export declare function discountsToJSON(discounts: Discounts): string;
/** @internal */
export type Billing2$Outbound = {
items: Array<BillingItems$Outbound>;
discounts?: Array<Discounts$Outbound> | undefined;
};
/** @internal */
export declare const Billing2$outboundSchema: z.ZodType<Billing2$Outbound, z.ZodTypeDef, Billing2>;
export declare function billing2ToJSON(billing2: Billing2): string;
/** @internal */
export type Billing1$Outbound = {
billingPlanId: string;
resourceId?: string | undefined;
start?: string | undefined;
end?: string | undefined;
name: string;
details?: string | undefined;
price: string;
quantity: number;
units: string;
total: string;
};
/** @internal */
export declare const Billing1$outboundSchema: z.ZodType<Billing1$Outbound, z.ZodTypeDef, Billing1>;
export declare function billing1ToJSON(billing1: Billing1): string;
/** @internal */
export type SubmitBillingDataBilling$Outbound = Billing2$Outbound | Array<Billing1$Outbound>;
/** @internal */
export declare const SubmitBillingDataBilling$outboundSchema: z.ZodType<SubmitBillingDataBilling$Outbound, z.ZodTypeDef, SubmitBillingDataBilling>;
export declare function submitBillingDataBillingToJSON(submitBillingDataBilling: SubmitBillingDataBilling): string;
/** @internal */
export declare const SubmitBillingDataType$outboundSchema: z.ZodNativeEnum<typeof SubmitBillingDataType>;
/** @internal */
export type Usage$Outbound = {
resourceId?: string | undefined;
name: string;
type: string;
units: string;
dayValue: number;
periodValue: number;
planValue?: number | undefined;
};
/** @internal */
export declare const Usage$outboundSchema: z.ZodType<Usage$Outbound, z.ZodTypeDef, Usage>;
export declare function usageToJSON(usage: Usage): string;
/** @internal */
export type SubmitBillingDataRequestBody$Outbound = {
timestamp: string;
eod: string;
period: Period$Outbound;
billing: Billing2$Outbound | Array<Billing1$Outbound>;
usage: Array<Usage$Outbound>;
};
/** @internal */
export declare const SubmitBillingDataRequestBody$outboundSchema: z.ZodType<SubmitBillingDataRequestBody$Outbound, z.ZodTypeDef, SubmitBillingDataRequestBody>;
export declare function submitBillingDataRequestBodyToJSON(submitBillingDataRequestBody: SubmitBillingDataRequestBody): string;
/** @internal */
export type SubmitBillingDataRequest$Outbound = {
integrationConfigurationId: string;
RequestBody: SubmitBillingDataRequestBody$Outbound;
};
/** @internal */
export declare const SubmitBillingDataRequest$outboundSchema: z.ZodType<SubmitBillingDataRequest$Outbound, z.ZodTypeDef, SubmitBillingDataRequest>;
export declare function submitBillingDataRequestToJSON(submitBillingDataRequest: SubmitBillingDataRequest): string;
//# sourceMappingURL=submitbillingdataop.d.ts.map