@Override
    public boolean deleteBySelector(ApiClient apiClient, String selector, boolean label, String namespace, boolean wait) throws HyscaleException {
        V1DeleteOptions deleteOptions = getDeleteOptions();
        deleteOptions.setApiVersion("autoscaling/v1");
        try {
            List<V1HorizontalPodAutoscaler> horizontalPodAutoscalerList = getBySelector(apiClient, selector, label, namespace);
            if (horizontalPodAutoscalerList == null || horizontalPodAutoscalerList.isEmpty()) {
                return false;
            }
            for (V1HorizontalPodAutoscaler horizontalPodAutoscaler : horizontalPodAutoscalerList) {
                delete(apiClient, horizontalPodAutoscaler.getMetadata().getName(), namespace, wait);
            }
        } catch (HyscaleException e) {
            if (DeployerErrorCodes.RESOURCE_NOT_FOUND.equals(e.getHyscaleError())) {
                logger.error("Error while deleting HorizontalPodAutoScaler for selector {} in namespace {}, error {}", selector,
                        namespace, e.toString());
                return false;
            }
            throw e;
        }
        return true;
    }
This class is responsible for the lifecycle operations of resource
HorizontalPodAutoScaler in kubernetes cluster. It creates resource of
apiVersion: autoscaling/v1
kind: HorizontalPodAutoScaler
deployer/deployer-services/src/main/java/io/hyscale/deployer/services/handler/impl/V1HorizontalPodAutoScalerHandler.java