/* * 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 DeleteLinkRequest = { /** * The id of the link to delete. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`. */ linkId: string; }; /** * The deleted link ID. */ export type DeleteLinkResponseBody = { /** * The ID of the link. */ id: string; }; /** @internal */ export type DeleteLinkRequest$Outbound = { linkId: string; }; /** @internal */ export const DeleteLinkRequest$outboundSchema: z.ZodType< DeleteLinkRequest$Outbound, z.ZodTypeDef, DeleteLinkRequest > = z.object({ linkId: z.string(), }); export function deleteLinkRequestToJSON( deleteLinkRequest: DeleteLinkRequest, ): string { return JSON.stringify( DeleteLinkRequest$outboundSchema.parse(deleteLinkRequest), ); } /** @internal */ export const DeleteLinkResponseBody$inboundSchema: z.ZodType< DeleteLinkResponseBody, z.ZodTypeDef, unknown > = z.object({ id: z.string(), }); export function deleteLinkResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteLinkResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteLinkResponseBody' from JSON`, ); }