class SheetsHelper {

    public void resizeSpreadSheet(String spreadsheetId, int sheetId, int columnSize) throws IllegalArgumentException, IOException {
        if (sheetId < 0) {
            throw new IllegalArgumentException("Sheet Id should be greater than or equal to 0");
        }

        if (columnSize < 1) {
            throw new IllegalArgumentException("Column size should be greater than 0");
        }

        // create grid properties with the new column size
        GridProperties gridProperties = new GridProperties().setColumnCount(columnSize);

        // create sheet properties for the first sheet in the spreadsheet
        SheetProperties sheetProperties = new SheetProperties()
                .setSheetId(sheetId)
                .setGridProperties(gridProperties);

        // Updates properties of the sheet with the specified sheetId
        UpdateSheetPropertiesRequest updateSheetPropertyRequest = new UpdateSheetPropertiesRequest()
                .setProperties(sheetProperties)
                .setFields("gridProperties.columnCount");

        // generate request
        List<Request> requests = new ArrayList<>();
        requests.add(new Request().setUpdateSheetProperties(updateSheetPropertyRequest));

        // send the API request
        sheetsService.batchUpdate(spreadsheetId, requests);
    }

      SheetsHelper(GoogleAccountCredential credential, HttpTransport transport, JsonFactory jsonFactory);
      SheetsHelper(@NonNull SheetsService sheetsService);

}