arm-delete-operation-response-codes
@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codesEnsure delete operations have the appropriate status codes.
Synchronous
Section titled “Synchronous”## Impact
- **Area:** API
The delete operation returns response codes that violate the RPC contract.
## LintDiff Equivalent
This rule corresponds to the LintDiff rule [DeleteResponseCodes](https://github.com/Azure/azure-rest-api-specs/blob/main/documentation/openapi-authoring-automated-guidelines.md).
## Synchronous
Synchronous delete operations should use the `ArmResourceDeleteSync` template. They must have 200, 204, default and no other responses.
#### ❌ Incorrect
```tsp@armResourceOperationsinterface Employees { @armResourceDelete(Employee) delete(...ApiVersionParameter): { @statusCode _: 200; result: boolean; };}✅ Correct
Section titled “✅ Correct”@armResourceOperationsinterface Employees { delete is ArmResourceDeleteSync<Employee>;}Asynchronous
Section titled “Asynchronous”Long-running (LRO) delete operations should use the ArmResourceDeleteWithoutOkAsync template. They must have 202, 204, default, and no other responses.
❌ Incorrect
Section titled “❌ Incorrect”@armResourceOperationsinterface Employees { delete is ArmResourceDeleteAsync<Employee>;}✅ Correct
Section titled “✅ Correct”@armResourceOperationsinterface Employees { delete is ArmResourceDeleteWithoutOkAsync<Employee>;}Suppression
Section titled “Suppression”Suppress only when required to match an existing API; otherwise use the standard delete operation templates.