UNPKG

@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>

114 lines (102 loc) 3.15 kB
/* * 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 { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetSecurityFirewallEventsRequest = { projectId: string; startTimestamp?: number | undefined; endTimestamp?: number | undefined; hosts?: string | undefined; }; export type GetSecurityFirewallEventsActions = { startTime: string; endTime: string; isActive: boolean; actionType: string; host: string; publicIp: string; count: number; }; export type GetSecurityFirewallEventsResponseBody = { actions: Array<GetSecurityFirewallEventsActions>; }; /** @internal */ export type GetSecurityFirewallEventsRequest$Outbound = { projectId: string; startTimestamp?: number | undefined; endTimestamp?: number | undefined; hosts?: string | undefined; }; /** @internal */ export const GetSecurityFirewallEventsRequest$outboundSchema: z.ZodType< GetSecurityFirewallEventsRequest$Outbound, z.ZodTypeDef, GetSecurityFirewallEventsRequest > = z.object({ projectId: z.string(), startTimestamp: z.number().optional(), endTimestamp: z.number().optional(), hosts: z.string().optional(), }); export function getSecurityFirewallEventsRequestToJSON( getSecurityFirewallEventsRequest: GetSecurityFirewallEventsRequest, ): string { return JSON.stringify( GetSecurityFirewallEventsRequest$outboundSchema.parse( getSecurityFirewallEventsRequest, ), ); } /** @internal */ export const GetSecurityFirewallEventsActions$inboundSchema: z.ZodType< GetSecurityFirewallEventsActions, z.ZodTypeDef, unknown > = z.object({ startTime: types.string(), endTime: types.string(), isActive: types.boolean(), action_type: types.string(), host: types.string(), public_ip: types.string(), count: types.number(), }).transform((v) => { return remap$(v, { "action_type": "actionType", "public_ip": "publicIp", }); }); export function getSecurityFirewallEventsActionsFromJSON( jsonString: string, ): SafeParseResult<GetSecurityFirewallEventsActions, SDKValidationError> { return safeParse( jsonString, (x) => GetSecurityFirewallEventsActions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetSecurityFirewallEventsActions' from JSON`, ); } /** @internal */ export const GetSecurityFirewallEventsResponseBody$inboundSchema: z.ZodType< GetSecurityFirewallEventsResponseBody, z.ZodTypeDef, unknown > = z.object({ actions: z.array( z.lazy(() => GetSecurityFirewallEventsActions$inboundSchema), ), }); export function getSecurityFirewallEventsResponseBodyFromJSON( jsonString: string, ): SafeParseResult<GetSecurityFirewallEventsResponseBody, SDKValidationError> { return safeParse( jsonString, (x) => GetSecurityFirewallEventsResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetSecurityFirewallEventsResponseBody' from JSON`, ); }