/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import * as models from "../index.js"; export type GetApiV1HistorySinceRequest = { date?: Date | undefined; eventType?: models.HistoryEventType | undefined; }; /** @internal */ export const GetApiV1HistorySinceRequest$inboundSchema: z.ZodType< GetApiV1HistorySinceRequest, z.ZodTypeDef, unknown > = z.object({ date: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), eventType: models.HistoryEventType$inboundSchema.optional(), }); /** @internal */ export type GetApiV1HistorySinceRequest$Outbound = { date?: string | undefined; eventType?: string | undefined; }; /** @internal */ export const GetApiV1HistorySinceRequest$outboundSchema: z.ZodType< GetApiV1HistorySinceRequest$Outbound, z.ZodTypeDef, GetApiV1HistorySinceRequest > = z.object({ date: z.date().transform(v => v.toISOString()).optional(), eventType: models.HistoryEventType$outboundSchema.optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV1HistorySinceRequest$ { /** @deprecated use `GetApiV1HistorySinceRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV1HistorySinceRequest$inboundSchema; /** @deprecated use `GetApiV1HistorySinceRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV1HistorySinceRequest$outboundSchema; /** @deprecated use `GetApiV1HistorySinceRequest$Outbound` instead. */ export type Outbound = GetApiV1HistorySinceRequest$Outbound; } export function getApiV1HistorySinceRequestToJSON( getApiV1HistorySinceRequest: GetApiV1HistorySinceRequest, ): string { return JSON.stringify( GetApiV1HistorySinceRequest$outboundSchema.parse( getApiV1HistorySinceRequest, ), ); } export function getApiV1HistorySinceRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV1HistorySinceRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV1HistorySinceRequest' from JSON`, ); }