/* * 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 DeactivatePartnerRequestBody = { /** * The ID of the partner to create a link for. Will take precedence over `tenantId` if provided. */ partnerId?: string | null | undefined; /** * The ID of the partner in your system. If both `partnerId` and `tenantId` are not provided, an error will be thrown. */ tenantId?: string | null | undefined; }; /** * The deactivated partner */ export type DeactivatePartnerResponseBody = { /** * The ID of the deactivated partner. */ partnerId: string; }; /** @internal */ export type DeactivatePartnerRequestBody$Outbound = { partnerId?: string | null | undefined; tenantId?: string | null | undefined; }; /** @internal */ export const DeactivatePartnerRequestBody$outboundSchema: z.ZodType< DeactivatePartnerRequestBody$Outbound, z.ZodTypeDef, DeactivatePartnerRequestBody > = z.object({ partnerId: z.nullable(z.string()).optional(), tenantId: z.nullable(z.string()).optional(), }); export function deactivatePartnerRequestBodyToJSON( deactivatePartnerRequestBody: DeactivatePartnerRequestBody, ): string { return JSON.stringify( DeactivatePartnerRequestBody$outboundSchema.parse( deactivatePartnerRequestBody, ), ); } /** @internal */ export const DeactivatePartnerResponseBody$inboundSchema: z.ZodType< DeactivatePartnerResponseBody, z.ZodTypeDef, unknown > = z.object({ partnerId: z.string(), }); export function deactivatePartnerResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeactivatePartnerResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeactivatePartnerResponseBody' from JSON`, ); }