Beispiel #1
0
 /// <summary>
 /// The user renews access token and refresh token
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='renewTokenRequest'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <AccessTokenResponse> RenewTokenAsync(this IPredictiveMaintenance operations, RenewTokenRequest renewTokenRequest, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.RenewTokenWithHttpMessagesAsync(renewTokenRequest, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Consume the PredictiveMaintenance web service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='webServiceParameters'>
 /// Input parameters to the web service.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <WebServiceResult> PredictiveAsync(this IPredictiveMaintenance operations, InputParameters webServiceParameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.PredictiveWithHttpMessagesAsync(webServiceParameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #3
0
        /// <summary>
        /// Gets a specific file from an execution in PredictiveMaintenance.
        /// </summary>
        /// <param name='operations'>
        /// The operations group for this extension method.
        /// </param>
        /// <param name='executionId'>
        /// Execution id of the execution
        /// </param>
        /// <param name='index'>
        /// Index of the execution in the batch.
        /// </param>
        /// <param name='fileName'>
        /// Name of the file to be returned.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public static async Task <System.IO.Stream> GetBatchExecutionFileAsync(this IPredictiveMaintenance operations, string executionId, int index, string fileName, CancellationToken cancellationToken = default(CancellationToken))
        {
            var _result = await operations.GetBatchExecutionFileWithHttpMessagesAsync(executionId, index, fileName, null, cancellationToken).ConfigureAwait(false);

            _result.Request.Dispose();
            return(_result.Body);
        }
Beispiel #4
0
 /// <summary>
 /// Gets all files from an individual execution in PredictiveMaintenance.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='executionId'>
 /// Execution id of the execution
 /// </param>
 /// <param name='index'>
 /// Index of the execution in the batch.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <string> > GetBatchExecutionFilesAsync(this IPredictiveMaintenance operations, string executionId, int index, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetBatchExecutionFilesWithHttpMessagesAsync(executionId, index, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #5
0
 /// <summary>
 /// The user revokes a refresh token
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='refreshToken'>
 /// The refresh token to be revoked
 /// </param>
 public static AccessTokenResponse RevokeRefreshToken(this IPredictiveMaintenance operations, string refreshToken)
 {
     return(Task.Factory.StartNew(s => ((IPredictiveMaintenance)s).RevokeRefreshTokenAsync(refreshToken), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Beispiel #6
0
 /// <summary>
 /// Gets a specific file from an execution in PredictiveMaintenance.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='executionId'>
 /// Execution id of the execution
 /// </param>
 /// <param name='index'>
 /// Index of the execution in the batch.
 /// </param>
 /// <param name='fileName'>
 /// Name of the file to be returned.
 /// </param>
 public static System.IO.Stream GetBatchExecutionFile(this IPredictiveMaintenance operations, string executionId, int index, string fileName)
 {
     return(Task.Factory.StartNew(s => ((IPredictiveMaintenance)s).GetBatchExecutionFileAsync(executionId, index, fileName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Beispiel #7
0
 /// <summary>
 /// Gets all files from an individual execution in PredictiveMaintenance.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='executionId'>
 /// Execution id of the execution
 /// </param>
 /// <param name='index'>
 /// Index of the execution in the batch.
 /// </param>
 public static IList <string> GetBatchExecutionFiles(this IPredictiveMaintenance operations, string executionId, int index)
 {
     return(Task.Factory.StartNew(s => ((IPredictiveMaintenance)s).GetBatchExecutionFilesAsync(executionId, index), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Beispiel #8
0
 /// <summary>
 /// Logs the user in
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='loginRequest'>
 /// </param>
 public static AccessTokenResponse Login(this IPredictiveMaintenance operations, LoginRequest loginRequest)
 {
     return(Task.Factory.StartNew(s => ((IPredictiveMaintenance)s).LoginAsync(loginRequest), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Beispiel #9
0
 /// <summary>
 /// Gets all batch executions for PredictiveMaintenance.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='executionId'>
 /// Execution id of the execution
 /// </param>
 /// <param name='showPartialResults'>
 /// Returns the already processed results of the batch execution even if it
 /// hasn't been fully completed.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <BatchWebServiceResult> GetBatchExecutionStatusAsync(this IPredictiveMaintenance operations, string executionId, bool?showPartialResults = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetBatchExecutionStatusWithHttpMessagesAsync(executionId, showPartialResults, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #10
0
 /// <summary>
 /// Gets all batch executions for PredictiveMaintenance.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='executionId'>
 /// Execution id of the execution
 /// </param>
 /// <param name='showPartialResults'>
 /// Returns the already processed results of the batch execution even if it
 /// hasn't been fully completed.
 /// </param>
 public static BatchWebServiceResult GetBatchExecutionStatus(this IPredictiveMaintenance operations, string executionId, bool?showPartialResults = default(bool?))
 {
     return(Task.Factory.StartNew(s => ((IPredictiveMaintenance)s).GetBatchExecutionStatusAsync(executionId, showPartialResults), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Beispiel #11
0
 /// <summary>
 /// Consume the PredictiveMaintenance web service asynchronously.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='batchWebServiceParameters'>
 /// Input parameters to the web service.
 /// </param>
 /// <param name='parallelCount'>
 /// Number of threads used to process entries in the batch. Default value is
 /// 10. Please make sure not to use too high of a number because it might
 /// negatively impact performance.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <StartBatchExecutionResponse> StartBatchExecutionAsync(this IPredictiveMaintenance operations, IList <InputParameters> batchWebServiceParameters, int?parallelCount = default(int?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.StartBatchExecutionWithHttpMessagesAsync(batchWebServiceParameters, parallelCount, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #12
0
 /// <summary>
 /// Consume the PredictiveMaintenance web service asynchronously.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='batchWebServiceParameters'>
 /// Input parameters to the web service.
 /// </param>
 /// <param name='parallelCount'>
 /// Number of threads used to process entries in the batch. Default value is
 /// 10. Please make sure not to use too high of a number because it might
 /// negatively impact performance.
 /// </param>
 public static StartBatchExecutionResponse StartBatchExecution(this IPredictiveMaintenance operations, IList <InputParameters> batchWebServiceParameters, int?parallelCount = default(int?))
 {
     return(Task.Factory.StartNew(s => ((IPredictiveMaintenance)s).StartBatchExecutionAsync(batchWebServiceParameters, parallelCount), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Beispiel #13
0
 /// <summary>
 /// Consume the PredictiveMaintenance web service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='webServiceParameters'>
 /// Input parameters to the web service.
 /// </param>
 public static WebServiceResult Predictive(this IPredictiveMaintenance operations, InputParameters webServiceParameters)
 {
     return(Task.Factory.StartNew(s => ((IPredictiveMaintenance)s).PredictiveAsync(webServiceParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }