docs: @SuppressWarnings("deprecation")
      private static RestApiConfig initRestApiConfig(HazelcastProperties properties, Config config) {
          boolean isAdvancedNetwork = config.getAdvancedNetworkConfig().isEnabled();
          RestApiConfig restApiConfig = config.getNetworkConfig().getRestApiConfig();
          boolean isRestConfigPresent = isAdvancedNetwork
                  ? config.getAdvancedNetworkConfig().getEndpointConfigs().get(EndpointQualifier.REST) != null
                  : restApiConfig != null;
  
          if (isRestConfigPresent) {
              // ensure the legacy Hazelcast group properties are not provided
              ensurePropertyNotConfigured(properties, GroupProperty.REST_ENABLED);
              ensurePropertyNotConfigured(properties, GroupProperty.HTTP_HEALTHCHECK_ENABLED);
          }
  
          if (isRestConfigPresent && isAdvancedNetwork) {
              restApiConfig = new RestApiConfig();
              restApiConfig.setEnabled(true);
  
              RestServerEndpointConfig restServerEndpointConfig = config.getAdvancedNetworkConfig().getRestEndpointConfig();
              restApiConfig.setEnabledGroups(restServerEndpointConfig.getEnabledGroups());
  
          } else if (!isRestConfigPresent)  {
              restApiConfig = new RestApiConfig();
              if (checkAndLogPropertyDeprecated(properties, GroupProperty.REST_ENABLED)) {
                  restApiConfig.setEnabled(true);
                  restApiConfig.enableAllGroups();
              }
              if (checkAndLogPropertyDeprecated(properties, GroupProperty.HTTP_HEALTHCHECK_ENABLED)) {
                  restApiConfig.setEnabled(true);
                  restApiConfig.enableGroups(RestEndpointGroup.HEALTH_CHECK);
              }
          }
  
          return restApiConfig;
      }