@unkey/api
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.
52 lines • 2.2 kB
TypeScript
import * as z from "zod";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type V2RatelimitLimitRequestBody = {
/**
* The namespace name for the rate limit.
*/
namespace: string;
/**
* The cost of the request. Defaults to 1 if not provided.
*/
cost?: number | undefined;
/**
* The duration in milliseconds for the rate limit window.
*/
duration: number;
/**
* The identifier for the rate limit.
*/
identifier: string;
/**
* The maximum number of requests allowed.
*/
limit: number;
};
/** @internal */
export declare const V2RatelimitLimitRequestBody$inboundSchema: z.ZodType<V2RatelimitLimitRequestBody, z.ZodTypeDef, unknown>;
/** @internal */
export type V2RatelimitLimitRequestBody$Outbound = {
namespace: string;
cost: number;
duration: number;
identifier: string;
limit: number;
};
/** @internal */
export declare const V2RatelimitLimitRequestBody$outboundSchema: z.ZodType<V2RatelimitLimitRequestBody$Outbound, z.ZodTypeDef, V2RatelimitLimitRequestBody>;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export declare namespace V2RatelimitLimitRequestBody$ {
/** @deprecated use `V2RatelimitLimitRequestBody$inboundSchema` instead. */
const inboundSchema: z.ZodType<V2RatelimitLimitRequestBody, z.ZodTypeDef, unknown>;
/** @deprecated use `V2RatelimitLimitRequestBody$outboundSchema` instead. */
const outboundSchema: z.ZodType<V2RatelimitLimitRequestBody$Outbound, z.ZodTypeDef, V2RatelimitLimitRequestBody>;
/** @deprecated use `V2RatelimitLimitRequestBody$Outbound` instead. */
type Outbound = V2RatelimitLimitRequestBody$Outbound;
}
export declare function v2RatelimitLimitRequestBodyToJSON(v2RatelimitLimitRequestBody: V2RatelimitLimitRequestBody): string;
export declare function v2RatelimitLimitRequestBodyFromJSON(jsonString: string): SafeParseResult<V2RatelimitLimitRequestBody, SDKValidationError>;
//# sourceMappingURL=v2ratelimitlimitrequestbody.d.ts.map