code: private static long uploadImage(MediaServiceInterface mediaService, String url)
        throws IOException {
      // Create image.
      Image image = new Image();
      image.setType(MediaMediaType.IMAGE);
      image.setData(com.google.api.ads.common.lib.utils.Media.getMediaDataFromUrl(url));
  
      // Upload image.
      Image uploadedImage = (Image) mediaService.upload(new Media[] {image})[0];
      return uploadedImage.getMediaId();
    }
docs: Uploads the image from the specified {@code url} via {@code MediaService}.
  
  @return the {@code mediaId} of the uploaded image.