export type CreateApiV2UserChannelCatalogsChannelCatalogIdEnableArgs = {channelCatalogId: unknown}; export type CreateApiV2UserChannelCatalogsChannelCatalogIdEnableOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Enable a channel catalog * * POST /v2/user/channelCatalogs/{channelCatalogId}/enable */ export const createApiV2UserChannelCatalogsChannelCatalogIdEnable = async (args: CreateApiV2UserChannelCatalogsChannelCatalogIdEnableArgs, options?: CreateApiV2UserChannelCatalogsChannelCatalogIdEnableOptions) => { const {baseUrl = "https://api.beezup.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v2/user/channelCatalogs/${encodeURIComponent(String(args.channelCatalogId))}/enable${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };