/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { ChannelPreferenceDto, ChannelPreferenceDto$Outbound, ChannelPreferenceDto$outboundSchema, } from "./channelpreferencedto.js"; import { WorkflowPreferenceDto, WorkflowPreferenceDto$Outbound, WorkflowPreferenceDto$outboundSchema, } 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 UserAll = WorkflowPreferenceDto; export type UserWorkflowPreferencesDto = { /** * 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 }; }; /** * User workflow preferences */ export type User = UserWorkflowPreferencesDto; /** * A preference for the workflow. The values specified here will be used if no preference is specified for a channel. */ export type PreferencesRequestDtoAll = WorkflowPreferenceDto; /** * Workflow-specific preferences */ export type PreferencesRequestDtoWorkflow = { /** * 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 }; }; export type PreferencesRequestDto = { /** * User workflow preferences */ user?: UserWorkflowPreferencesDto | null | undefined; /** * Workflow-specific preferences */ workflow?: PreferencesRequestDtoWorkflow | null | undefined; }; /** @internal */ export type UserAll$Outbound = WorkflowPreferenceDto$Outbound; /** @internal */ export const UserAll$outboundSchema: z.ZodType< UserAll$Outbound, z.ZodTypeDef, UserAll > = WorkflowPreferenceDto$outboundSchema; export function userAllToJSON(userAll: UserAll): string { return JSON.stringify(UserAll$outboundSchema.parse(userAll)); } /** @internal */ export type UserWorkflowPreferencesDto$Outbound = { all: WorkflowPreferenceDto$Outbound; channels: { [k: string]: ChannelPreferenceDto$Outbound }; }; /** @internal */ export const UserWorkflowPreferencesDto$outboundSchema: z.ZodType< UserWorkflowPreferencesDto$Outbound, z.ZodTypeDef, UserWorkflowPreferencesDto > = z.object({ all: WorkflowPreferenceDto$outboundSchema, channels: z.record(ChannelPreferenceDto$outboundSchema), }); export function userWorkflowPreferencesDtoToJSON( userWorkflowPreferencesDto: UserWorkflowPreferencesDto, ): string { return JSON.stringify( UserWorkflowPreferencesDto$outboundSchema.parse(userWorkflowPreferencesDto), ); } /** @internal */ export type User$Outbound = UserWorkflowPreferencesDto$Outbound; /** @internal */ export const User$outboundSchema: z.ZodType = z.lazy(() => UserWorkflowPreferencesDto$outboundSchema); export function userToJSON(user: User): string { return JSON.stringify(User$outboundSchema.parse(user)); } /** @internal */ export type PreferencesRequestDtoAll$Outbound = WorkflowPreferenceDto$Outbound; /** @internal */ export const PreferencesRequestDtoAll$outboundSchema: z.ZodType< PreferencesRequestDtoAll$Outbound, z.ZodTypeDef, PreferencesRequestDtoAll > = WorkflowPreferenceDto$outboundSchema; export function preferencesRequestDtoAllToJSON( preferencesRequestDtoAll: PreferencesRequestDtoAll, ): string { return JSON.stringify( PreferencesRequestDtoAll$outboundSchema.parse(preferencesRequestDtoAll), ); } /** @internal */ export type PreferencesRequestDtoWorkflow$Outbound = { all: WorkflowPreferenceDto$Outbound; channels: { [k: string]: ChannelPreferenceDto$Outbound }; }; /** @internal */ export const PreferencesRequestDtoWorkflow$outboundSchema: z.ZodType< PreferencesRequestDtoWorkflow$Outbound, z.ZodTypeDef, PreferencesRequestDtoWorkflow > = z.object({ all: WorkflowPreferenceDto$outboundSchema, channels: z.record(ChannelPreferenceDto$outboundSchema), }); export function preferencesRequestDtoWorkflowToJSON( preferencesRequestDtoWorkflow: PreferencesRequestDtoWorkflow, ): string { return JSON.stringify( PreferencesRequestDtoWorkflow$outboundSchema.parse( preferencesRequestDtoWorkflow, ), ); } /** @internal */ export type PreferencesRequestDto$Outbound = { user?: UserWorkflowPreferencesDto$Outbound | null | undefined; workflow?: PreferencesRequestDtoWorkflow$Outbound | null | undefined; }; /** @internal */ export const PreferencesRequestDto$outboundSchema: z.ZodType< PreferencesRequestDto$Outbound, z.ZodTypeDef, PreferencesRequestDto > = z.object({ user: z.nullable(z.lazy(() => UserWorkflowPreferencesDto$outboundSchema)) .optional(), workflow: z.nullable( z.lazy(() => PreferencesRequestDtoWorkflow$outboundSchema), ).optional(), }); export function preferencesRequestDtoToJSON( preferencesRequestDto: PreferencesRequestDto, ): string { return JSON.stringify( PreferencesRequestDto$outboundSchema.parse(preferencesRequestDto), ); }