/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { smartUnion } from "../../types/smartUnion.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Filter by organization ID. */ export type CustomersExportQueryParamOrganizationId = string | Array; export type CustomersExportRequest = { /** * Filter by organization ID. */ organizationId?: string | Array | null | undefined; }; export type CustomersExportResponse = any | string; /** @internal */ export type CustomersExportQueryParamOrganizationId$Outbound = | string | Array; /** @internal */ export const CustomersExportQueryParamOrganizationId$outboundSchema: z.ZodMiniType< CustomersExportQueryParamOrganizationId$Outbound, CustomersExportQueryParamOrganizationId > = smartUnion([z.string(), z.array(z.string())]); export function customersExportQueryParamOrganizationIdToJSON( customersExportQueryParamOrganizationId: CustomersExportQueryParamOrganizationId, ): string { return JSON.stringify( CustomersExportQueryParamOrganizationId$outboundSchema.parse( customersExportQueryParamOrganizationId, ), ); } /** @internal */ export type CustomersExportRequest$Outbound = { organization_id?: string | Array | null | undefined; }; /** @internal */ export const CustomersExportRequest$outboundSchema: z.ZodMiniType< CustomersExportRequest$Outbound, CustomersExportRequest > = z.pipe( z.object({ organizationId: z.optional( z.nullable(smartUnion([z.string(), z.array(z.string())])), ), }), z.transform((v) => { return remap$(v, { organizationId: "organization_id", }); }), ); export function customersExportRequestToJSON( customersExportRequest: CustomersExportRequest, ): string { return JSON.stringify( CustomersExportRequest$outboundSchema.parse(customersExportRequest), ); } /** @internal */ export const CustomersExportResponse$inboundSchema: z.ZodMiniType< CustomersExportResponse, unknown > = smartUnion([z.any(), z.string()]); export function customersExportResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomersExportResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomersExportResponse' from JSON`, ); }