Drive files API v3 update revision does not set fields (java client) -
the following code should correctly update recent revision of document have auto-publish on within domain.
revisionlist revisions = drive.revisions() .list("file-id") .setfields("nextpagetoken,revisions(id,mimetype,modifiedtime,publishauto,published,publishedoutsidedomain)") .execute(); system.out.println(revisions.getrevisions()); final revision revision = iterables.getlast(revisions.getrevisions()); final revision written = drive.revisions() .update("file-id", revision.getid(), new revision() .setpublished(true) .setpublishauto(true) .setpublishedoutsidedomain(false) ) .setfields("id,mimetype,modifiedtime,publishauto,published,publishedoutsidedomain") .execute(); system.out.println(written); revisions = drive.revisions() .list("file-id") .setfields("nextpagetoken,revisions(id,mimetype,modifiedtime,publishauto,published,publishedoutsidedomain)") .execute(); final revision updated = iterables.getlast(revisions.getrevisions()); system.out.println(updated); asserttrue(updated.getpublished()); asserttrue(updated.getpublishauto()); assertfalse(updated.getpublishedoutsidedomain());
as can guess, fails. when @ revision, auto publish off, , outside-domain true.
any ideas?
Comments
Post a Comment