static void Main(string[] args) { // Get file as stream from Vault filebytes = VaultUtil.DownloadFileStream(out inputFileName); if (filebytes != null) { Task t = MainAsync(args); t.Wait(); } }
/// <summary> /// Check in updated file back into Vault /// </summary> /// <returns>Success or error </returns> public static async Task <dynamic> CheckintoVault(string url) { IRestClient client = new RestClient("https://developer.api.autodesk.com/"); RestRequest request = new RestRequest(url, Method.GET); request.AddHeader("Authorization", "Bearer " + InternalToken.access_token); request.AddHeader("Accept-Encoding", "gzip, deflate"); IRestResponse response = await client.ExecuteTaskAsync(request); if (response.StatusCode != System.Net.HttpStatusCode.OK) { return(new Output(Output.StatusEnum.Error, "Not able to download to local drive")); } else { VaultUtil.CheckinFileStream(response.RawBytes); return(new Output(Output.StatusEnum.Sucess, "Checked into Vault successfully")); } }