/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const Reason = { TosViolation: "tos_violation", InappropriateContent: "inappropriate_content", FakeTraffic: "fake_traffic", Fraud: "fraud", Spam: "spam", BrandAbuse: "brand_abuse", } as const; export type Reason = ClosedEnum; export type BanPartnerRequestBody = { /** * 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; reason: Reason; }; /** * The banned partner */ export type BanPartnerResponseBody = { /** * The ID of the banned partner. */ partnerId: string; }; /** @internal */ export const Reason$outboundSchema: z.ZodNativeEnum = z .nativeEnum(Reason); /** @internal */ export type BanPartnerRequestBody$Outbound = { partnerId?: string | null | undefined; tenantId?: string | null | undefined; reason: string; }; /** @internal */ export const BanPartnerRequestBody$outboundSchema: z.ZodType< BanPartnerRequestBody$Outbound, z.ZodTypeDef, BanPartnerRequestBody > = z.object({ partnerId: z.nullable(z.string()).optional(), tenantId: z.nullable(z.string()).optional(), reason: Reason$outboundSchema, }); export function banPartnerRequestBodyToJSON( banPartnerRequestBody: BanPartnerRequestBody, ): string { return JSON.stringify( BanPartnerRequestBody$outboundSchema.parse(banPartnerRequestBody), ); } /** @internal */ export const BanPartnerResponseBody$inboundSchema: z.ZodType< BanPartnerResponseBody, z.ZodTypeDef, unknown > = z.object({ partnerId: z.string(), }); export function banPartnerResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BanPartnerResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BanPartnerResponseBody' from JSON`, ); }