code: public DistanceMatrixApiRequest mode(TravelMode mode) {
      if (TravelMode.DRIVING.equals(mode)
          || TravelMode.WALKING.equals(mode)
          || TravelMode.BICYCLING.equals(mode)
          || TravelMode.TRANSIT.equals(mode)) {
        return param("mode", mode);
      }
      throw new IllegalArgumentException(
          "Distance Matrix API travel modes must be Driving, Transit, Walking or Bicycling");
    }
docs: Specifies the mode of transport to use when calculating directions.
  
  <p>Note that Distance Matrix requests only support {@link TravelMode#DRIVING}, {@link
  TravelMode#WALKING} and {@link TravelMode#BICYCLING}.
  
  @param mode One of the travel modes supported by the Distance Matrix API.
  @return Returns this {@code DistanceMatrixApiRequest} for call chaining.