private <T> T makeGetRequest(
      String baseUrl, Optional<Map<String, String>> parameters, Class<T> clazz)
      throws IOException, InvalidTokenException, PermissionDeniedException {
    HttpRequestFactory requestFactory = httpTransport.createRequestFactory();
    HttpRequest getRequest =
        requestFactory.buildGetRequest(
            new GenericUrl(baseUrl + "?" + generateParamsString(parameters)));

    HttpResponse response;
    try {
      response = getRequest.execute();
    } catch (HttpResponseException e) {
      response =
          handleHttpResponseException(
              () ->
                  requestFactory.buildGetRequest(
                      new GenericUrl(baseUrl + "?" + generateParamsString(parameters))),
              e);
    }

    Preconditions.checkState(response.getStatusCode() == 200);
    String result = CharStreams.toString(new InputStreamReader(response.getContent(), UTF_8));
    // Replace objectMapper with Gson due to limitation of parsing nested object through jackson package.
    // Please refer to baeldung.com/jackson-nested-values
    Gson gson = new Gson();
    return gson.fromJson(result, clazz);
  }
GoogleMusicHttpApi makes HTTP requests to read and write to the public Google Music's "Music
Library" APIs, following its documentation at
https://developers.google.com/youtube/mediaconnect.

<p>Note that this is the lowest level of Google Music interaction - that is, you probably don't
want to use this class and are better off using something like a bit higher level like the Google
Music DTP Exporter and Importer instead.
extensions/data-transfer/portability-data-transfer-google/src/main/java/org/datatransferproject/datatransfer/google/music/GoogleMusicHttpApi.java