/* * 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 * as types from "../../types/primitives.js"; import { EntityType, EntityType$inboundSchema } from "./entity-type.js"; import { FileType, FileType$inboundSchema } from "./file-type.js"; import { SDKValidationError } from "./sdk-validation-error.js"; import { Status, Status$inboundSchema } from "./status.js"; import { TaskStatus, TaskStatus$inboundSchema } from "./task-status.js"; import { TaskType, TaskType$inboundSchema } from "./task-type.js"; export type TaskResponse = { completedAt?: Date | undefined; createdAt?: Date | undefined; createdBy?: string | undefined; entityType?: EntityType | undefined; environmentId?: string | undefined; errorSummary?: string | undefined; failedAt?: Date | undefined; failedRecords?: number | undefined; fileName?: string | undefined; fileType?: FileType | undefined; fileUrl?: string | undefined; id?: string | undefined; metadata?: { [k: string]: any } | undefined; processedRecords?: number | undefined; scheduledTaskId?: string | undefined; startedAt?: Date | undefined; status?: Status | undefined; successfulRecords?: number | undefined; taskStatus?: TaskStatus | undefined; taskType?: TaskType | undefined; tenantId?: string | undefined; totalRecords?: number | undefined; updatedAt?: Date | undefined; updatedBy?: string | undefined; workflowId?: string | undefined; }; /** @internal */ export const TaskResponse$inboundSchema: z.ZodMiniType = z.pipe( z.object({ completed_at: types.optional(types.date()), created_at: types.optional(types.date()), created_by: types.optional(types.string()), entity_type: types.optional(EntityType$inboundSchema), environment_id: types.optional(types.string()), error_summary: types.optional(types.string()), failed_at: types.optional(types.date()), failed_records: types.optional(types.number()), file_name: types.optional(types.string()), file_type: types.optional(FileType$inboundSchema), file_url: types.optional(types.string()), id: types.optional(types.string()), metadata: types.optional(z.record(z.string(), z.any())), processed_records: types.optional(types.number()), scheduled_task_id: types.optional(types.string()), started_at: types.optional(types.date()), status: types.optional(Status$inboundSchema), successful_records: types.optional(types.number()), task_status: types.optional(TaskStatus$inboundSchema), task_type: types.optional(TaskType$inboundSchema), tenant_id: types.optional(types.string()), total_records: types.optional(types.number()), updated_at: types.optional(types.date()), updated_by: types.optional(types.string()), workflow_id: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "completed_at": "completedAt", "created_at": "createdAt", "created_by": "createdBy", "entity_type": "entityType", "environment_id": "environmentId", "error_summary": "errorSummary", "failed_at": "failedAt", "failed_records": "failedRecords", "file_name": "fileName", "file_type": "fileType", "file_url": "fileUrl", "processed_records": "processedRecords", "scheduled_task_id": "scheduledTaskId", "started_at": "startedAt", "successful_records": "successfulRecords", "task_status": "taskStatus", "task_type": "taskType", "tenant_id": "tenantId", "total_records": "totalRecords", "updated_at": "updatedAt", "updated_by": "updatedBy", "workflow_id": "workflowId", }); }), ); export function taskResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TaskResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskResponse' from JSON`, ); }