export type ConditionDto = {conditionId?: string | undefined, name: 'Email Open Count' | 'Replied' | 'Reply Body Contains' | 'Link Click' | 'Prospect Outcome' | 'Last Step Completed' | 'Prospect Tag', operation: 'greater than' | 'less than' | 'greater than or equals' | 'less than or equals' | 'is' | 'is not' | 'is any' | 'is not any' | 'contains', value?: (number | boolean | Array | Array) | undefined}; export type UpdateSubsequenceDto = {scheduleId?: number | undefined, firstStepRelativeDays?: number | undefined, conditions?: Array | undefined}; export type PatchApiV1SequencesSequenceIdSubsequenceSubsequenceIdArgs = {sequenceId: string, subsequenceId: string, body: UpdateSubsequenceDto}; export type PatchApiV1SequencesSequenceIdSubsequenceSubsequenceIdOptions = {baseUrl: string, xApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update the schedule, entry delay, or conditions of a subsequence * * PATCH /v1/sequences/{sequenceId}/subsequence/{subsequenceId} */ export const patchApiV1SequencesSequenceIdSubsequenceSubsequenceId = async (args: PatchApiV1SequencesSequenceIdSubsequenceSubsequenceIdArgs, options: PatchApiV1SequencesSequenceIdSubsequenceSubsequenceIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, xApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (xApiKey !== undefined) headers.set("x-api-key", xApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/sequences/${encodeURIComponent(String(args.sequenceId))}/subsequence/${encodeURIComponent(String(args.subsequenceId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };