UNPKG

@unkey/api

Version:

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.

53 lines (47 loc) 1.39 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; export type KeysVerifyKeyRatelimit = { /** * References an existing ratelimit by its name. Key Ratelimits will take precedence over identifier-based limits. */ name: string; /** * Optionally override how expensive this operation is and how many tokens are deducted from the current limit. */ cost?: number | undefined; /** * Optionally override the maximum number of requests allowed within the specified interval. */ limit?: number | undefined; /** * Optionally override the duration of the rate limit window duration. */ duration?: number | undefined; }; /** @internal */ export type KeysVerifyKeyRatelimit$Outbound = { name: string; cost: number; limit?: number | undefined; duration?: number | undefined; }; /** @internal */ export const KeysVerifyKeyRatelimit$outboundSchema: z.ZodType< KeysVerifyKeyRatelimit$Outbound, z.ZodTypeDef, KeysVerifyKeyRatelimit > = z.object({ name: z.string(), cost: z.number().int().default(1), limit: z.number().int().optional(), duration: z.number().int().optional(), }); export function keysVerifyKeyRatelimitToJSON( keysVerifyKeyRatelimit: KeysVerifyKeyRatelimit, ): string { return JSON.stringify( KeysVerifyKeyRatelimit$outboundSchema.parse(keysVerifyKeyRatelimit), ); }