@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>
86 lines • 3.21 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { remap as remap$ } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import * as types from "../types/primitives.js";
export const GetBypassIpAction = {
Block: "block",
Bypass: "bypass",
};
/** @internal */
export const GetBypassIpRequest$outboundSchema = z.object({
projectId: z.string(),
limit: z.number().optional(),
sourceIp: z.string().optional(),
domain: z.string().optional(),
projectScope: z.boolean().optional(),
offset: z.string().optional(),
teamId: z.string().optional(),
slug: z.string().optional(),
});
export function getBypassIpRequestToJSON(getBypassIpRequest) {
return JSON.stringify(GetBypassIpRequest$outboundSchema.parse(getBypassIpRequest));
}
/** @internal */
export const GetBypassIpAction$inboundSchema = z.nativeEnum(GetBypassIpAction);
/** @internal */
export const GetBypassIpResult$inboundSchema = z.object({
OwnerId: types.string(),
Id: types.string(),
Domain: types.string(),
Ip: types.string(),
Action: types.optional(GetBypassIpAction$inboundSchema),
ProjectId: types.optional(types.string()),
IsProjectRule: types.optional(types.boolean()),
Note: types.optional(types.string()),
CreatedAt: types.string(),
ActorId: types.optional(types.string()),
UpdatedAt: types.string(),
UpdatedAtHour: types.string(),
DeletedAt: types.optional(types.string()),
ExpiresAt: z.nullable(types.number()).optional(),
}).transform((v) => {
return remap$(v, {
"OwnerId": "ownerId",
"Id": "id",
"Domain": "domain",
"Ip": "ip",
"Action": "action",
"ProjectId": "projectId",
"IsProjectRule": "isProjectRule",
"Note": "note",
"CreatedAt": "createdAt",
"ActorId": "actorId",
"UpdatedAt": "updatedAt",
"UpdatedAtHour": "updatedAtHour",
"DeletedAt": "deletedAt",
"ExpiresAt": "expiresAt",
});
});
export function getBypassIpResultFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetBypassIpResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetBypassIpResult' from JSON`);
}
/** @internal */
export const GetBypassIpPagination$inboundSchema = z.object({
OwnerId: types.string(),
Id: types.string(),
}).transform((v) => {
return remap$(v, {
"OwnerId": "ownerId",
"Id": "id",
});
});
export function getBypassIpPaginationFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetBypassIpPagination$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetBypassIpPagination' from JSON`);
}
/** @internal */
export const GetBypassIpResponseBody$inboundSchema = z.object({
result: z.array(z.lazy(() => GetBypassIpResult$inboundSchema)),
pagination: types.optional(z.lazy(() => GetBypassIpPagination$inboundSchema)),
});
export function getBypassIpResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetBypassIpResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetBypassIpResponseBody' from JSON`);
}
//# sourceMappingURL=getbypassipop.js.map