/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { GroupPreferenceFilterDto, GroupPreferenceFilterDto$Outbound, GroupPreferenceFilterDto$outboundSchema, } from "./grouppreferencefilterdto.js"; import { WorkflowPreferenceRequestDto, WorkflowPreferenceRequestDto$Outbound, WorkflowPreferenceRequestDto$outboundSchema, } from "./workflowpreferencerequestdto.js"; export type UpdateTopicSubscriptionRequestDtoPreferences = | WorkflowPreferenceRequestDto | GroupPreferenceFilterDto | string; export type UpdateTopicSubscriptionRequestDto = { /** * The name of the subscription */ name?: string | undefined; /** * The preferences of the topic. Can be a simple workflow ID string, workflow preference object, or group filter object */ preferences?: | Array | undefined; }; /** @internal */ export type UpdateTopicSubscriptionRequestDtoPreferences$Outbound = | WorkflowPreferenceRequestDto$Outbound | GroupPreferenceFilterDto$Outbound | string; /** @internal */ export const UpdateTopicSubscriptionRequestDtoPreferences$outboundSchema: z.ZodType< UpdateTopicSubscriptionRequestDtoPreferences$Outbound, z.ZodTypeDef, UpdateTopicSubscriptionRequestDtoPreferences > = z.union([ WorkflowPreferenceRequestDto$outboundSchema, GroupPreferenceFilterDto$outboundSchema, z.string(), ]); export function updateTopicSubscriptionRequestDtoPreferencesToJSON( updateTopicSubscriptionRequestDtoPreferences: UpdateTopicSubscriptionRequestDtoPreferences, ): string { return JSON.stringify( UpdateTopicSubscriptionRequestDtoPreferences$outboundSchema.parse( updateTopicSubscriptionRequestDtoPreferences, ), ); } /** @internal */ export type UpdateTopicSubscriptionRequestDto$Outbound = { name?: string | undefined; preferences?: | Array< | WorkflowPreferenceRequestDto$Outbound | GroupPreferenceFilterDto$Outbound | string > | undefined; }; /** @internal */ export const UpdateTopicSubscriptionRequestDto$outboundSchema: z.ZodType< UpdateTopicSubscriptionRequestDto$Outbound, z.ZodTypeDef, UpdateTopicSubscriptionRequestDto > = z.object({ name: z.string().optional(), preferences: z.array( z.union([ WorkflowPreferenceRequestDto$outboundSchema, GroupPreferenceFilterDto$outboundSchema, z.string(), ]), ).optional(), }); export function updateTopicSubscriptionRequestDtoToJSON( updateTopicSubscriptionRequestDto: UpdateTopicSubscriptionRequestDto, ): string { return JSON.stringify( UpdateTopicSubscriptionRequestDto$outboundSchema.parse( updateTopicSubscriptionRequestDto, ), ); }