/* * 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"; import { CreatedSubscriberDto, CreatedSubscriberDto$inboundSchema, } from "./createdsubscriberdto.js"; import { FailedOperationDto, FailedOperationDto$inboundSchema, } from "./failedoperationdto.js"; import { UpdatedSubscriberDto, UpdatedSubscriberDto$inboundSchema, } from "./updatedsubscriberdto.js"; export type BulkCreateSubscriberResponseDto = { /** * An array of subscribers that were successfully updated. */ updated: Array; /** * An array of subscribers that were successfully created. */ created: Array; /** * An array of failed operations with error messages and optional subscriber IDs. */ failed: Array; }; /** @internal */ export const BulkCreateSubscriberResponseDto$inboundSchema: z.ZodType< BulkCreateSubscriberResponseDto, z.ZodTypeDef, unknown > = z.object({ updated: z.array(UpdatedSubscriberDto$inboundSchema), created: z.array(CreatedSubscriberDto$inboundSchema), failed: z.array(FailedOperationDto$inboundSchema), }); export function bulkCreateSubscriberResponseDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BulkCreateSubscriberResponseDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BulkCreateSubscriberResponseDto' from JSON`, ); }