/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ResendWebhookRequest = { id: string; logId: string; }; export type ResendWebhookResponse = { /** * HTTP response content type for this operation */ contentType: string; /** * HTTP response status code for this operation */ statusCode: number; /** * Raw HTTP response; suitable for custom response parsing */ rawResponse: Response; /** * Success */ webhookLog?: components.WebhookLog | undefined; /** * Error */ error?: components.ErrorT | undefined; }; /** @internal */ export const ResendWebhookRequest$inboundSchema: z.ZodType< ResendWebhookRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), logId: z.string(), }); /** @internal */ export type ResendWebhookRequest$Outbound = { id: string; logId: string; }; /** @internal */ export const ResendWebhookRequest$outboundSchema: z.ZodType< ResendWebhookRequest$Outbound, z.ZodTypeDef, ResendWebhookRequest > = z.object({ id: z.string(), logId: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ResendWebhookRequest$ { /** @deprecated use `ResendWebhookRequest$inboundSchema` instead. */ export const inboundSchema = ResendWebhookRequest$inboundSchema; /** @deprecated use `ResendWebhookRequest$outboundSchema` instead. */ export const outboundSchema = ResendWebhookRequest$outboundSchema; /** @deprecated use `ResendWebhookRequest$Outbound` instead. */ export type Outbound = ResendWebhookRequest$Outbound; } export function resendWebhookRequestToJSON( resendWebhookRequest: ResendWebhookRequest, ): string { return JSON.stringify( ResendWebhookRequest$outboundSchema.parse(resendWebhookRequest), ); } export function resendWebhookRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ResendWebhookRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResendWebhookRequest' from JSON`, ); } /** @internal */ export const ResendWebhookResponse$inboundSchema: z.ZodType< ResendWebhookResponse, z.ZodTypeDef, unknown > = z.object({ ContentType: z.string(), StatusCode: z.number().int(), RawResponse: z.instanceof(Response), "webhook-log": components.WebhookLog$inboundSchema.optional(), error: components.ErrorT$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "ContentType": "contentType", "StatusCode": "statusCode", "RawResponse": "rawResponse", "webhook-log": "webhookLog", }); }); /** @internal */ export type ResendWebhookResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; "webhook-log"?: components.WebhookLog$Outbound | undefined; error?: components.ErrorT$Outbound | undefined; }; /** @internal */ export const ResendWebhookResponse$outboundSchema: z.ZodType< ResendWebhookResponse$Outbound, z.ZodTypeDef, ResendWebhookResponse > = z.object({ contentType: z.string(), statusCode: z.number().int(), rawResponse: z.instanceof(Response).transform(() => { throw new Error("Response cannot be serialized"); }), webhookLog: components.WebhookLog$outboundSchema.optional(), error: components.ErrorT$outboundSchema.optional(), }).transform((v) => { return remap$(v, { contentType: "ContentType", statusCode: "StatusCode", rawResponse: "RawResponse", webhookLog: "webhook-log", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ResendWebhookResponse$ { /** @deprecated use `ResendWebhookResponse$inboundSchema` instead. */ export const inboundSchema = ResendWebhookResponse$inboundSchema; /** @deprecated use `ResendWebhookResponse$outboundSchema` instead. */ export const outboundSchema = ResendWebhookResponse$outboundSchema; /** @deprecated use `ResendWebhookResponse$Outbound` instead. */ export type Outbound = ResendWebhookResponse$Outbound; } export function resendWebhookResponseToJSON( resendWebhookResponse: ResendWebhookResponse, ): string { return JSON.stringify( ResendWebhookResponse$outboundSchema.parse(resendWebhookResponse), ); } export function resendWebhookResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ResendWebhookResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResendWebhookResponse' from JSON`, ); }