export type DeleteApiPimChannelsChannelIdItemsItemIdArgs = {channel_id: string, item_id: string}; export type DeleteApiPimChannelsChannelIdItemsItemIdOptions = {baseUrl: string, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Channel Item * * DELETE /pim/channels/{channel_id}/items/{item_id} */ export const deleteApiPimChannelsChannelIdItemsItemId = async (args: DeleteApiPimChannelsChannelIdItemsItemIdArgs, options: DeleteApiPimChannelsChannelIdItemsItemIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/vnd.api+json") if (OAuth2 !== undefined) headers.set('authorization', `Bearer ${OAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/pim/channels/${encodeURIComponent(String(args.channel_id))}/items/${encodeURIComponent(String(args.item_id))}${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 (await res.json()) as unknown };