Using Google API with Java for Google Docs, we can access classes like TextRun, ParagraphElement, etc. and set the values, for example, as follows:
TextRun txtRun = new TextRun();
txtRun.setContent("EXAMPLE STRING");
ParagraphElement pElem = new ParagraphElement();
pElem.setTextRun(txtRun1);
However, it’s not clear how to add the above created object to the Request Class and then post using BatchUpdate. Ideally, we can construct the document as in the above code then add it to a request with something like:
Request req = new Request();
req.setParagraphElement(pElem);
BatchUpdate...setRequests(req);
We are able to modify a Google Doc using the classes/methods available to the Request class.