code: public HttpResponse upload(GenericUrl initiationRequestUrl) throws IOException {
      Preconditions.checkArgument(uploadState == UploadState.NOT_STARTED);
  
      if (directUploadEnabled) {
        return directUpload(initiationRequestUrl);
      }
      return resumableUpload(initiationRequestUrl);
    }
docs: Executes a direct media upload or resumable media upload conforming to the specifications
  listed <a href='https://developers.google.com/api-client-library/java/google-api-java-client/media-upload'>here.</a>
  
  <p>
  This method is not reentrant. A new instance of {@link MediaHttpUploader} must be instantiated
  before upload called be called again.
  </p>
  
  <p>
  If an error is encountered during the request execution the caller is responsible for parsing
  the response correctly. For example for JSON errors:
  </p>
  
  <pre>
  if (!response.isSuccessStatusCode()) {
  throw GoogleJsonResponseException.from(jsonFactory, response);
  }
  </pre>
  
  <p>
  Callers should call {@link HttpResponse#disconnect} when the returned HTTP response object is
  no longer needed. However, {@link HttpResponse#disconnect} does not have to be called if the
  response stream is properly closed. Example usage:
  </p>
  
  <pre>
  HttpResponse response = batch.upload(initiationRequestUrl);
  try {
  process the HTTP response object
  } finally {
  response.disconnect();
  }
  </pre>
  
  @param initiationRequestUrl The request URL where the initiation request will be sent
  @return HTTP response