@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>
48 lines • 1.76 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { safeParse } from "../lib/schemas.js";
import * as types from "../types/primitives.js";
export const Type = {
Deny: "deny",
Rewrite: "rewrite",
};
/** @internal */
export const Type$inboundSchema = z.nativeEnum(Type);
/** @internal */
export const Match$inboundSchema = z
.object({
model: types.optional(types.string()),
});
export function matchFromJSON(jsonString) {
return safeParse(jsonString, (x) => Match$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Match' from JSON`);
}
/** @internal */
export const Action$inboundSchema = z
.object({
rewriteModel: types.optional(types.string()),
reason: types.optional(types.string()),
});
export function actionFromJSON(jsonString) {
return safeParse(jsonString, (x) => Action$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Action' from JSON`);
}
/** @internal */
export const AiGatewayRule$inboundSchema = z.object({
ownerId: types.string(),
ruleId: types.string(),
type: Type$inboundSchema,
match: types.optional(z.lazy(() => Match$inboundSchema)),
action: types.optional(z.lazy(() => Action$inboundSchema)),
enabled: types.boolean(),
deleted: types.optional(types.boolean()),
description: types.optional(types.string()),
createdBy: types.optional(types.string()),
updatedBy: types.optional(types.string()),
createdAt: types.number(),
updatedAt: types.number(),
});
export function aiGatewayRuleFromJSON(jsonString) {
return safeParse(jsonString, (x) => AiGatewayRule$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AiGatewayRule' from JSON`);
}
//# sourceMappingURL=aigatewayrule.js.map