export type ResourceId = string; export type UpdateApiV2SitesSiteIdChannelsChannelIdDisableArgs = {site_id: ResourceId, channel_id: ResourceId}; export type UpdateApiV2SitesSiteIdChannelsChannelIdDisableOptions = {baseUrl?: string | undefined, v2ApiSecret?: string | undefined, fetch?: typeof fetch | undefined}; /** * Disable the channel * * PUT /v2/sites/{site_id}/channels/{channel_id}/disable/ */ export const updateApiV2SitesSiteIdChannelsChannelIdDisable = async (args: UpdateApiV2SitesSiteIdChannelsChannelIdDisableArgs, options?: UpdateApiV2SitesSiteIdChannelsChannelIdDisableOptions) => { const {baseUrl = "https://api.jwplayer.com", fetch: fetchFn = fetch, v2ApiSecret} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (v2ApiSecret !== undefined) headers.set("Authorization", v2ApiSecret) const url = `${baseUrl.replace(/\/+$/, '')}/v2/sites/${encodeURIComponent(String(args.site_id))}/channels/${encodeURIComponent(String(args.channel_id))}/disable/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };