/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type DeleteCustomerRequest = { /** * The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). */ id: string; }; /** * The customer was deleted. */ export type DeleteCustomerResponseBody = { /** * The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). */ id: string; }; /** @internal */ export type DeleteCustomerRequest$Outbound = { id: string; }; /** @internal */ export const DeleteCustomerRequest$outboundSchema: z.ZodType< DeleteCustomerRequest$Outbound, z.ZodTypeDef, DeleteCustomerRequest > = z.object({ id: z.string(), }); export function deleteCustomerRequestToJSON( deleteCustomerRequest: DeleteCustomerRequest, ): string { return JSON.stringify( DeleteCustomerRequest$outboundSchema.parse(deleteCustomerRequest), ); } /** @internal */ export const DeleteCustomerResponseBody$inboundSchema: z.ZodType< DeleteCustomerResponseBody, z.ZodTypeDef, unknown > = z.object({ id: z.string(), }); export function deleteCustomerResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteCustomerResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteCustomerResponseBody' from JSON`, ); }