code: public boolean rateLimited(GoogleJsonError e) {
      ErrorInfo errorInfo = getErrorInfo(e);
      if (errorInfo != null) {
        String domain = errorInfo.getDomain();
        String reason = errorInfo.getReason();
        boolean isRateLimitedOrGlobalDomain =
            USAGE_LIMITS_DOMAIN.equals(domain) || GLOBAL_DOMAIN.equals(domain);
        boolean isRateLimitedReason =
            RATE_LIMITED_REASON_CODE.equals(reason) || USER_RATE_LIMITED_REASON_CODE.equals(reason);
        return isRateLimitedOrGlobalDomain && isRateLimitedReason;
      }
      return false;
    }
docs: Determine if a given GoogleJsonError is caused by, and only by,
  a rate limit being applied.
  @param e The GoogleJsonError returned by the request
  @return True if the error is caused by a rate limit being applied.