export type DeleteApiV1FeeSchedulesScheduleIdArgs = {'X-Request-Id'?: string | undefined, scheduleId: string}; export type DeleteApiV1FeeSchedulesScheduleIdOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a fee schedule * * DELETE /v1/fee-schedules/{scheduleId} */ export const deleteApiV1FeeSchedulesScheduleId = async (args: DeleteApiV1FeeSchedulesScheduleIdArgs, options?: DeleteApiV1FeeSchedulesScheduleIdOptions) => { 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/fee-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 };