/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 76b9ea763f34 */ 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 { ObjectPermissions, ObjectPermissions$inboundSchema, } from "./objectpermissions.js"; import { Person, Person$inboundSchema } from "./person.js"; export type Workflow = { /** * The name of the workflow. */ name?: string | undefined; author?: Person | undefined; /** * Server Unix timestamp of the creation time. */ createTimestamp?: number | undefined; /** * Server Unix timestamp of the last update time. */ lastUpdateTimestamp?: number | undefined; /** * Server Unix timestamp of the last time the draft was saved. */ lastDraftSavedAt?: number | undefined; lastUpdatedBy?: Person | undefined; permissions?: ObjectPermissions | undefined; /** * The ID of the workflow. */ id?: string | undefined; }; /** @internal */ export const Workflow$inboundSchema: z.ZodType< Workflow, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), author: Person$inboundSchema.optional(), createTimestamp: z.number().int().optional(), lastUpdateTimestamp: z.number().int().optional(), lastDraftSavedAt: z.number().int().optional(), lastUpdatedBy: Person$inboundSchema.optional(), permissions: ObjectPermissions$inboundSchema.optional(), id: z.string().optional(), }); export function workflowFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Workflow$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Workflow' from JSON`, ); }