export type DeleteApiAppsAppIdEndpointsEndpointIdArgs = {appId: string, endpointId: string}; export type DeleteApiAppsAppIdEndpointsEndpointIdOptions = {baseUrl?: string | undefined, AccessKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete application endpoint * * DELETE /apps/{appId}/endpoints/{endpointId} */ export const deleteApiAppsAppIdEndpointsEndpointId = async (args: DeleteApiAppsAppIdEndpointsEndpointIdArgs, options?: DeleteApiAppsAppIdEndpointsEndpointIdOptions) => { const {baseUrl = "https://api.bunny.net/mc", fetch: fetchFn = fetch, AccessKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (AccessKey !== undefined) headers.set("AccessKey", AccessKey) const url = `${baseUrl.replace(/\/+$/, '')}/apps/${encodeURIComponent(String(args.appId))}/endpoints/${encodeURIComponent(String(args.endpointId))}${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 };