RestClient { public Resource patchResource(final ResourcesArgs args) throws ServerIOException, IOException { final Resource resource = cloudApi.patchResource(args.getPath(), args.getFields(), args.getBody()); if (args.getParsingHandler() != null) { parseListResponse(resource, args.getParsingHandler()); } return resource; } RestClient(final Credentials credentials);  RestClient(final Credentials credentials, final OkHttpClient client);  RestClient(final Credentials credentials, final OkHttpClient client, final String serverUrl); ApiVersion getApiVersion(); Operation getOperation(final String operationId); Operation getOperation(final Link link); Operation waitProgress(final Link link, final Runnable waiting); DiskInfo getDiskInfo(); DiskInfo getDiskInfo(final String fields); Resource getResources(final ResourcesArgs args); ResourceList getFlatResourceList(final ResourcesArgs args); ResourceList getLastUploadedResources(final ResourcesArgs args); Resource patchResource(final ResourcesArgs args); Resource listPublicResources(final ResourcesArgs args); Resource getTrashResources(final ResourcesArgs args); Link deleteFromTrash(final String path); Link restoreFromTrash(final String path, final String name, final Boolean overwrite); void downloadFile(final String path, final File saveTo, final ProgressListener progressListener); void downloadFile(final String path, final DownloadListener downloadListener); Link saveFromUrl(final String url, final String serverPath); Link getUploadLink(final String serverPath, final boolean overwrite); void uploadFile(final Link link, final boolean resumeUpload, final File localSource,
                           final ProgressListener progressListener); Link delete(final String path, final boolean permanently); Link makeFolder(final String path); Link copy(final String from, final String path, final boolean overwrite); Link move(final String from, final String path, final boolean overwrite); Link publish(final String path); Link unpublish(final String path); void downloadPublicResource(final String publicKey, final String path, final File saveTo,
                                       final ProgressListener progressListener); Link savePublicResource(final String publicKey, final String path, final String name);  }
@Test public void testPatchResource() throws Exception { Map<String,Object> fooBar = new LinkedHashMap<>(); fooBar.put("foo", 1); fooBar.put("bar", 2); Map <String, Map<String,Object>> properties = new LinkedHashMap<>(); properties.put("custom_properties", fooBar); Gson gson = new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .setPrettyPrinting() .create(); TypedOutput body = new GsonConverter(gson).toBody(properties); Resource resource = client.patchResource(new ResourcesArgs.Builder() .setPath("/0-test") .setBody(body) .build()); assertTrue("dir".equals(resource.getType())); assertEquals(resource.getPath(), new ResourcePath("disk", "/0-test")); logger.info("self: " + resource); }