export type PBPodcastRecordingSchedule = {frequency: 'weekly' | 'monthly', daysOfWeek?: (Array<'SUN' | 'MON' | 'TUE' | 'WED' | 'THU' | 'FRI' | 'SAT'>) | undefined, daysOfMonth?: Array | undefined, startTime: string, durationMinutes: number, timezone: string, enabled?: boolean | undefined}; export type PBPodcastRecordingConfig = {streamUrl: string, recordingSchedule: PBPodcastRecordingSchedule, introAudioUrl?: string | undefined, outroAudioUrl?: string | undefined}; export type UpdateApiPodcastBotPodcastsPodcastKeyRecordingConfigArgs = {podcastKey: string, body: PBPodcastRecordingConfig}; export type UpdateApiPodcastBotPodcastsPodcastKeyRecordingConfigOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update podcast recording configuration * * PUT /podcast-bot/podcasts/{podcastKey}/recordingConfig */ export const updateApiPodcastBotPodcastsPodcastKeyRecordingConfig = async (args: UpdateApiPodcastBotPodcastsPodcastKeyRecordingConfigArgs, options?: UpdateApiPodcastBotPodcastsPodcastKeyRecordingConfigOptions) => { const {baseUrl = "https://api.zeno.fm", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/podcast-bot/podcasts/${encodeURIComponent(String(args.podcastKey))}/recordingConfig${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };