export type DeleteApiV1ContextsContextIdSchedulesScheduleIdArgs = {'X-Request-Id'?: string | undefined, contextId: string, scheduleId: string}; export type DeleteApiV1ContextsContextIdSchedulesScheduleIdOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a schedule * * DELETE /v1/contexts/{contextId}/schedules/{scheduleId} */ export const deleteApiV1ContextsContextIdSchedulesScheduleId = async (args: DeleteApiV1ContextsContextIdSchedulesScheduleIdArgs, options?: DeleteApiV1ContextsContextIdSchedulesScheduleIdOptions) => { const {baseUrl = "https://identity.sandbox.lerian.net", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Request-Id'] != null) headers.set("X-Request-Id", String(args['X-Request-Id'])) if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/contexts/${encodeURIComponent(String(args.contextId))}/schedules/${encodeURIComponent(String(args.scheduleId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };