/* * 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 { FailedWorkflowDto, FailedWorkflowDto$inboundSchema, } from "./failedworkflowdto.js"; import { ResourceTypeEnum, ResourceTypeEnum$inboundSchema, } from "./resourcetypeenum.js"; import { SkippedWorkflowDto, SkippedWorkflowDto$inboundSchema, } from "./skippedworkflowdto.js"; import { SyncedWorkflowDto, SyncedWorkflowDto$inboundSchema, } from "./syncedworkflowdto.js"; export type SyncResultDto = { /** * Type of the layout */ resourceType: ResourceTypeEnum; /** * Successfully synced resources */ successful: Array; /** * Failed resource syncs */ failed: Array; /** * Skipped resources */ skipped: Array; /** * Total number of resources processed */ totalProcessed: number; }; /** @internal */ export const SyncResultDto$inboundSchema: z.ZodType< SyncResultDto, z.ZodTypeDef, unknown > = z.object({ resourceType: ResourceTypeEnum$inboundSchema, successful: z.array(SyncedWorkflowDto$inboundSchema), failed: z.array(FailedWorkflowDto$inboundSchema), skipped: z.array(SkippedWorkflowDto$inboundSchema), totalProcessed: z.number(), }); export function syncResultDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SyncResultDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SyncResultDto' from JSON`, ); }