/* * 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 { ChannelPreferenceDto, ChannelPreferenceDto$inboundSchema, } from "./channelpreferencedto.js"; import { WorkflowPreferenceDto, WorkflowPreferenceDto$inboundSchema, } from "./workflowpreferencedto.js"; /** * A preference for the workflow. The values specified here will be used if no preference is specified for a channel. */ export type All = WorkflowPreferenceDto; export type WorkflowPreferencesDto = { /** * A preference for the workflow. The values specified here will be used if no preference is specified for a channel. */ all: WorkflowPreferenceDto; /** * Preferences for different communication channels */ channels: { [k: string]: ChannelPreferenceDto }; }; /** @internal */ export const All$inboundSchema: z.ZodType = WorkflowPreferenceDto$inboundSchema; export function allFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => All$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'All' from JSON`, ); } /** @internal */ export const WorkflowPreferencesDto$inboundSchema: z.ZodType< WorkflowPreferencesDto, z.ZodTypeDef, unknown > = z.object({ all: WorkflowPreferenceDto$inboundSchema, channels: z.record(ChannelPreferenceDto$inboundSchema), }); export function workflowPreferencesDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WorkflowPreferencesDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkflowPreferencesDto' from JSON`, ); }