/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; 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"; /** * The current status of the batch processing. */ export const PeopleBatchStatus = { Pending: "pending", Processing: "processing", Completed: "completed", Failed: "failed", PartialSuccess: "partial_success", } as const; /** * The current status of the batch processing. */ export type PeopleBatchStatus = ClosedEnum; /** * A batch for bulk people creation. */ export type PeopleBatch = { /** * The unique identifier of the people batch. */ uuid: string; /** * The idempotency key provided when creating the batch. */ idempotencyKey: string; /** * The current status of the batch processing. */ status: PeopleBatchStatus; /** * The action being performed on the batch. */ batchAction: string; }; /** @internal */ export const PeopleBatchStatus$inboundSchema: z.ZodNativeEnum< typeof PeopleBatchStatus > = z.nativeEnum(PeopleBatchStatus); /** @internal */ export const PeopleBatch$inboundSchema: z.ZodType< PeopleBatch, z.ZodTypeDef, unknown > = z.object({ uuid: z.string(), idempotency_key: z.string(), status: PeopleBatchStatus$inboundSchema, batch_action: z.string(), }).transform((v) => { return remap$(v, { "idempotency_key": "idempotencyKey", "batch_action": "batchAction", }); }); export function peopleBatchFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PeopleBatch$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PeopleBatch' from JSON`, ); }