export type DeleteApiNetworkServicesV1WebhooksIdArgs = {id: string}; export type DeleteApiNetworkServicesV1WebhooksIdOptions = {baseUrl?: string | undefined, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Webhook by ID * * DELETE /network-services/v1/webhooks/{id} */ export const deleteApiNetworkServicesV1WebhooksId = async (args: DeleteApiNetworkServicesV1WebhooksIdArgs, options?: DeleteApiNetworkServicesV1WebhooksIdOptions) => { const {baseUrl = "https://sso.common.cloud.hpe.com", fetch: fetchFn = fetch, OAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2 !== undefined) headers.set('authorization', `Bearer ${OAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/network-services/v1/webhooks/${encodeURIComponent(String(args.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 undefined };