15 Aug 2018

.NET Package 1.3 is live on NuGet

Default blog image

Just released the .NET package version 1.3! Here is what it includes:

1. Search folder content

Implements the Folder Search endpoint for names. Thanks to Kalleb for this PR. Here is how to use it, note the page number should start on zero.

FoldersApi foldersApi = new FoldersApi();
foldersApi.Configuration.AccessToken = access_token;

await foldersApi.SearchFolderContentsAsync(projectId, folderId, 0, new List<string> { "fileNameToSearch.dwf" });

2. Patch folder

Implemented the PATCH Folder endpoint, ideal to change folder names. Thanks to Itoni for this PR. Here is how to use it:

FoldersApi foldersApi = new FoldersApi();
foldersApi.Configuration.AccessToken = access_token;

PatchFolder patchFolder = new PatchFolder(
  new JsonApiVersionJsonapi(JsonApiVersionJsonapi.VersionEnum._0),
  new PatchFolderData(folderId, new PatchFolderDataAttributes(false, "new folder name")));

await foldersApi.PatchFolderAsync(projectId, patchFolder);

3. Derivatives webhook attributes

This was actually first introduced on version 1.2, see this previous post. Now the CreateHookAsync method accepts a 4th parameter of type dynamic, which should work fine with any JSON (e.g. JObject). Thanks again to Fredrik for this PR.

// see previous post for complete code sample
JObject hookAttributes = JObject.Parse("{\"name\":\"value\"}");
await webhook.CreateHookAsync(DerivativeWebhookEvent.ExtractionFinished, callbackUlr, workflow, hookAttributes);

 

Related Article

Posted By

Augusto Goncalves

Developer Advocate at Autodesk since 2008, working with both desktop and web/cloud apps using top technologies, like C#, JavaScript, NodeJS and any other that can solve problems and improve workflows. See my samples on Github and follow me on Twitter for updates.