export type DeleteApiIntegrationsAwsEventBridgeAwsEventBridgeIntegrationArgs = {aws_event_bridge_integration: string}; export type DeleteApiIntegrationsAwsEventBridgeAwsEventBridgeIntegrationOptions = {baseUrl?: string | undefined, APIKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete the AWS EventBridge integration * * DELETE /integrations/aws-event-bridge/{aws_event_bridge_integration} */ export const deleteApiIntegrationsAwsEventBridgeAwsEventBridgeIntegration = async (args: DeleteApiIntegrationsAwsEventBridgeAwsEventBridgeIntegrationArgs, options?: DeleteApiIntegrationsAwsEventBridgeAwsEventBridgeIntegrationOptions) => { const {baseUrl = "https://example.scalr.io/api/iacp/v3", fetch: fetchFn = fetch, APIKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIKey !== undefined) headers.set('authorization', `Bearer ${APIKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/integrations/aws-event-bridge/${encodeURIComponent(String(args.aws_event_bridge_integration))}${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 };