/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Webhook, Webhook$inboundSchema, Webhook$Outbound, Webhook$outboundSchema, } from "./webhook.js"; /** * Webhooks */ export type DeleteWebhookResponse = { /** * HTTP Response Status Code */ statusCode: number; /** * HTTP Response Status */ status: string; data: Webhook; }; /** @internal */ export const DeleteWebhookResponse$inboundSchema: z.ZodType< DeleteWebhookResponse, z.ZodTypeDef, unknown > = z.object({ status_code: z.number().int(), status: z.string(), data: Webhook$inboundSchema, }).transform((v) => { return remap$(v, { "status_code": "statusCode", }); }); /** @internal */ export type DeleteWebhookResponse$Outbound = { status_code: number; status: string; data: Webhook$Outbound; }; /** @internal */ export const DeleteWebhookResponse$outboundSchema: z.ZodType< DeleteWebhookResponse$Outbound, z.ZodTypeDef, DeleteWebhookResponse > = z.object({ statusCode: z.number().int(), status: z.string(), data: Webhook$outboundSchema, }).transform((v) => { return remap$(v, { statusCode: "status_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace DeleteWebhookResponse$ { /** @deprecated use `DeleteWebhookResponse$inboundSchema` instead. */ export const inboundSchema = DeleteWebhookResponse$inboundSchema; /** @deprecated use `DeleteWebhookResponse$outboundSchema` instead. */ export const outboundSchema = DeleteWebhookResponse$outboundSchema; /** @deprecated use `DeleteWebhookResponse$Outbound` instead. */ export type Outbound = DeleteWebhookResponse$Outbound; } export function deleteWebhookResponseToJSON( deleteWebhookResponse: DeleteWebhookResponse, ): string { return JSON.stringify( DeleteWebhookResponse$outboundSchema.parse(deleteWebhookResponse), ); } export function deleteWebhookResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteWebhookResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteWebhookResponse' from JSON`, ); }