# DeleteAclResponse

**Kind:** Interface

**Source:** [`packages/microservices/external/kafka.interface.ts`](https://github.com/nestjs/nest/blob/master/packages/microservices/external/kafka.interface.ts#L497)

**Part of:** [Microservices](subsystem-packages-microservices)

`DeleteAclResponse` represents the Kafka broker response returned after a delete-ACL request. It includes the broker-applied throttle duration and a result entry for each ACL filter submitted in the request.

## Properties

| Property | Type |
|---|---|
| `throttleTime` | `number` |
| `filterResponses` | `DeleteAclFilterResponses[]` |

## Diagram

```mermaid
graph LR
  Client[Kafka Client] --> Request[Delete ACL Request]
  Request --> Broker[Kafka Broker]
  Broker --> Response[DeleteAclResponse]
  Response --> Throttle[throttleTime: number]
  Response --> Filters[filterResponses: DeleteAclFilterResponses[]]
  Filters --> FilterResult[Per-filter deletion results]
```

## Usage

```ts
import type { DeleteAclResponse } from './kafka.interface';

function handleDeleteAclResponse(response: DeleteAclResponse): void {
  console.log(`Broker throttle time: ${response.throttleTime}ms`);

  for (const filterResponse of response.filterResponses) {
    console.log('Processed ACL deletion filter:', filterResponse);
  }
}

// Example response returned by a Kafka ACL deletion operation
const response: DeleteAclResponse = await kafkaAdmin.deleteAcls({
  filters: [
    {
      resourceType: 2,
      resourceName: 'orders',
      patternType: 3,
    },
  ],
});

handleDeleteAclResponse(response);
```

## AI Coding Instructions

- Treat `filterResponses` as a per-filter result list; preserve its ordering when correlating results with the original delete-ACL filters.
- Use `throttleTime` to respect Kafka broker rate limiting before issuing subsequent administrative requests.
- Inspect each `DeleteAclFilterResponses` entry for filter-specific errors rather than assuming the overall request succeeded.
- Keep this interface aligned with the Kafka Delete ACLs protocol response schema when upgrading Kafka client or protocol support.

## How it works

`DeleteAclResponse` is an exported TypeScript interface in a file intended to represent KafkaJS package types rather than NestJS logic. [packages/microservices/external/kafka.interface.ts:1-8](packages/microservices/external/kafka.interface.ts#L1-L8) It describes the resolved value of `Admin.deleteAcls`, whose argument is an object containing a required `filters: AclFilter[]` property. [packages/microservices/external/kafka.interface.ts:497-500](packages/microservices/external/kafka.interface.ts#L497-L500) [packages/microservices/external/kafka.interface.ts:502-560](packages/microservices/external/kafka.interface.ts#L502-L560)

- `throttleTime` is a required `number`. [packages/microservices/external/kafka.interface.ts:497-499](packages/microservices/external/kafka.interface.ts#L497-L499)
- `filterResponses` is a required array of `DeleteAclFilterResponses`. [packages/microservices/external/kafka.interface.ts:497-500](packages/microservices/external/kafka.interface.ts#L497-L500)
- Each filter response contains a required numeric `errorCode`, an optional `errorMessage`, and a required `matchingAcls` array. [packages/microservices/external/kafka.interface.ts:491-495](packages/microservices/external/kafka.interface.ts#L491-L495)
- Each matching ACL records its resource type, resource name, resource-pattern type, principal, host, operation, permission type, numeric error code, and optional error message. [packages/microservices/external/kafka.interface.ts:479-489](packages/microservices/external/kafka.interface.ts#L479-L489)

The deletion filters require `resourceType`, `resourcePatternType`, `operation`, and `permissionType`; `resourceName`, `principal`, and `host` are optional. [packages/microservices/external/kafka.interface.ts:469-477](packages/microservices/external/kafka.interface.ts#L469-L477)

This interface contains no runtime implementation, validation, thrown-error declaration, or side-effect logic; it only declares the response shape. [packages/microservices/external/kafka.interface.ts:1-8](packages/microservices/external/kafka.interface.ts#L1-L8) [packages/microservices/external/kafka.interface.ts:497-500](packages/microservices/external/kafka.interface.ts#L497-L500)
