docs: @Deprecated
      public static String parseServiceName(URI endpoint) {
          String host = endpoint.getHost();
  
          // If we don't recognize the domain, throw an exception.
          if (!host.endsWith(".amazonaws.com")) {
              throw new IllegalArgumentException(
                  "Cannot parse a service name from an unrecognized endpoint ("
                  + host
                  + ").");
          }
  
          String serviceAndRegion =
              host.substring(0, host.indexOf(".amazonaws.com"));
  
          // Special cases for S3 endpoints with bucket names embedded.
          if (serviceAndRegion.endsWith(".s3")
              || S3_ENDPOINT_PATTERN.matcher(serviceAndRegion).matches()) {
              return "s3";
          }
  
          char separator = '.';
  
          // If we don't detect a separator between service name and region, then
          // assume that the region is not included in the hostname, and it's only
          // the service name (ex: "http://iam.amazonaws.com").
          if (serviceAndRegion.indexOf(separator) == -1) {
              return serviceAndRegion;
          }
  
          String service =
              serviceAndRegion.substring(0, serviceAndRegion.indexOf(separator));
  
          return service;
      }