/// <summary> /// Uploads a file for further processing/using. /// Content-Type must be multipart/form-data! /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='file'> /// Upload software package /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <object> UploadTemporaryAsync(this ISspFile operations, System.IO.Stream file, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UploadTemporaryWithHttpMessagesAsync(file, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Diposes a file which was uploaded beforehand. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='sspFileId'> /// The id for the uploaded file. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <object> DisposeFileAsync(this ISspFile operations, string sspFileId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DisposeFileWithHttpMessagesAsync(sspFileId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Uploads a file for further processing/using. /// Content-Type must be multipart/form-data! /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='file'> /// Upload software package /// </param> public static object UploadTemporary(this ISspFile operations, System.IO.Stream file) { return(Task.Factory.StartNew(s => ((ISspFile)s).UploadTemporaryAsync(file), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Diposes a file which was uploaded beforehand. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='sspFileId'> /// The id for the uploaded file. /// </param> public static object DisposeFile(this ISspFile operations, string sspFileId) { return(Task.Factory.StartNew(s => ((ISspFile)s).DisposeFileAsync(sspFileId), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }