@Test public void testCreateSlide() throws IOException { String presentationId = this.createTestPresentation(); BatchUpdatePresentationResponse response = this.snippets.createSlide(presentationId); assertNotNull(response); assertEquals(1, response.getReplies().size()); String pageId = response.getReplies().get(0).getCreateSlide().getObjectId(); assertNotNull(pageId); }
public BatchUpdatePresentationResponse createSlide(String presentationId) throws IOException { Slides slidesService = this.service; List<Request> requests = new ArrayList<>(); String slideId = "MyNewSlide_001"; requests.add(new Request() .setCreateSlide(new CreateSlideRequest() .setObjectId(slideId) .setInsertionIndex(1) .setSlideLayoutReference(new LayoutReference() .setPredefinedLayout("TITLE_AND_TWO_COLUMNS")))); BatchUpdatePresentationRequest body = new BatchUpdatePresentationRequest().setRequests(requests); BatchUpdatePresentationResponse response = slidesService.presentations().batchUpdate(presentationId, body).execute(); CreateSlideResponse createSlideResponse = response.getReplies().get(0).getCreateSlide(); System.out.println("Created slide with ID: " + createSlideResponse.getObjectId()); return response; }
Snippets { public BatchUpdatePresentationResponse createSlide(String presentationId) throws IOException { Slides slidesService = this.service; List<Request> requests = new ArrayList<>(); String slideId = "MyNewSlide_001"; requests.add(new Request() .setCreateSlide(new CreateSlideRequest() .setObjectId(slideId) .setInsertionIndex(1) .setSlideLayoutReference(new LayoutReference() .setPredefinedLayout("TITLE_AND_TWO_COLUMNS")))); BatchUpdatePresentationRequest body = new BatchUpdatePresentationRequest().setRequests(requests); BatchUpdatePresentationResponse response = slidesService.presentations().batchUpdate(presentationId, body).execute(); CreateSlideResponse createSlideResponse = response.getReplies().get(0).getCreateSlide(); System.out.println("Created slide with ID: " + createSlideResponse.getObjectId()); return response; } }
Snippets { public BatchUpdatePresentationResponse createSlide(String presentationId) throws IOException { Slides slidesService = this.service; List<Request> requests = new ArrayList<>(); String slideId = "MyNewSlide_001"; requests.add(new Request() .setCreateSlide(new CreateSlideRequest() .setObjectId(slideId) .setInsertionIndex(1) .setSlideLayoutReference(new LayoutReference() .setPredefinedLayout("TITLE_AND_TWO_COLUMNS")))); BatchUpdatePresentationRequest body = new BatchUpdatePresentationRequest().setRequests(requests); BatchUpdatePresentationResponse response = slidesService.presentations().batchUpdate(presentationId, body).execute(); CreateSlideResponse createSlideResponse = response.getReplies().get(0).getCreateSlide(); System.out.println("Created slide with ID: " + createSlideResponse.getObjectId()); return response; } Snippets(Slides service, Drive driveService, Sheets sheetsService); }
Snippets { public BatchUpdatePresentationResponse createSlide(String presentationId) throws IOException { Slides slidesService = this.service; List<Request> requests = new ArrayList<>(); String slideId = "MyNewSlide_001"; requests.add(new Request() .setCreateSlide(new CreateSlideRequest() .setObjectId(slideId) .setInsertionIndex(1) .setSlideLayoutReference(new LayoutReference() .setPredefinedLayout("TITLE_AND_TWO_COLUMNS")))); BatchUpdatePresentationRequest body = new BatchUpdatePresentationRequest().setRequests(requests); BatchUpdatePresentationResponse response = slidesService.presentations().batchUpdate(presentationId, body).execute(); CreateSlideResponse createSlideResponse = response.getReplies().get(0).getCreateSlide(); System.out.println("Created slide with ID: " + createSlideResponse.getObjectId()); return response; } Snippets(Slides service, Drive driveService, Sheets sheetsService); String createPresentation(String title); String copyPresentation(String presentationId, String copyTitle); BatchUpdatePresentationResponse createSlide(String presentationId); BatchUpdatePresentationResponse createTextBoxWithText(
            String presentationId, String slideId); BatchUpdatePresentationResponse createImage(String presentationId,
                                                       String slideId,
                                                       GoogleCredential credential); List<BatchUpdatePresentationResponse> textMerging(
            String templatePresentationId, String dataSpreadsheetId); BatchUpdatePresentationResponse imageMerging(String templatePresentationId,
                                                        String imageUrl,
                                                        String customerName); BatchUpdatePresentationResponse simpleTextReplace(
            String presentationId, String shapeId, String replacementText); BatchUpdatePresentationResponse textStyleUpdate(String presentationId, String shapeId); BatchUpdatePresentationResponse createBulletedText(String presentationId,
                                                              String shapeId); BatchUpdatePresentationResponse createSheetsChart(
            String presentationId, String pageId, String spreadsheetId, Integer sheetChartId); BatchUpdatePresentationResponse refreshSheetsChart(
            String presentationId, String presentationChartId); }
Snippets { public BatchUpdatePresentationResponse createSlide(String presentationId) throws IOException { Slides slidesService = this.service; List<Request> requests = new ArrayList<>(); String slideId = "MyNewSlide_001"; requests.add(new Request() .setCreateSlide(new CreateSlideRequest() .setObjectId(slideId) .setInsertionIndex(1) .setSlideLayoutReference(new LayoutReference() .setPredefinedLayout("TITLE_AND_TWO_COLUMNS")))); BatchUpdatePresentationRequest body = new BatchUpdatePresentationRequest().setRequests(requests); BatchUpdatePresentationResponse response = slidesService.presentations().batchUpdate(presentationId, body).execute(); CreateSlideResponse createSlideResponse = response.getReplies().get(0).getCreateSlide(); System.out.println("Created slide with ID: " + createSlideResponse.getObjectId()); return response; } Snippets(Slides service, Drive driveService, Sheets sheetsService); String createPresentation(String title); String copyPresentation(String presentationId, String copyTitle); BatchUpdatePresentationResponse createSlide(String presentationId); BatchUpdatePresentationResponse createTextBoxWithText(
            String presentationId, String slideId); BatchUpdatePresentationResponse createImage(String presentationId,
                                                       String slideId,
                                                       GoogleCredential credential); List<BatchUpdatePresentationResponse> textMerging(
            String templatePresentationId, String dataSpreadsheetId); BatchUpdatePresentationResponse imageMerging(String templatePresentationId,
                                                        String imageUrl,
                                                        String customerName); BatchUpdatePresentationResponse simpleTextReplace(
            String presentationId, String shapeId, String replacementText); BatchUpdatePresentationResponse textStyleUpdate(String presentationId, String shapeId); BatchUpdatePresentationResponse createBulletedText(String presentationId,
                                                              String shapeId); BatchUpdatePresentationResponse createSheetsChart(
            String presentationId, String pageId, String spreadsheetId, Integer sheetChartId); BatchUpdatePresentationResponse refreshSheetsChart(
            String presentationId, String presentationChartId);  }