import {HttpCode, HttpStatus, applyDecorators} from '@nestjs/common';

import {ApiNoContentResponse} from '@nestjs/swagger';

export interface NoContentApiResponseOptions {
  description: string;
  type?: any;
}

/**
 * 204 response decorator for Swagger autogenerated documentation.
 */
export const NoContentApiResponse = (options: NoContentApiResponseOptions): MethodDecorator & ClassDecorator => applyDecorators(
  HttpCode(HttpStatus.NO_CONTENT),
  ApiNoContentResponse(options),
);
