/// <summary>
 /// Polls TWAIN Cloud infrastucture for registration completion.
 /// </summary>
 /// <param name="pollUrl">The poll URL.</param>
 /// <returns>Polling reponse.</returns>
 public async Task <PollResponse> Poll(string pollUrl)
 {
     using (Logger.StartActivity($"Polling scanner registration: {pollUrl}"))
     {
         return(await _client.Get <PollResponse>(pollUrl));
     }
 }
Exemple #2
0
        /// <summary>
        /// Connects specified scanner to TWAIN Cloud infrastructure.
        /// </summary>
        /// <param name="scannerId">The scanner identifier.</param>
        /// <returns></returns>
        public async Task Connect()
        {
            using (Logger.StartActivity("Connecting to cloud infrastructure"))
            {
                var scannerInfo = await _client.Get <ScannerStatusResponse>($"scanners/{_scannerId}");

                _cloudTopicName = scannerInfo.ResponseTopic;

                await base.Connect(scannerInfo.Url);

                await base.Subscribe(scannerInfo.RequestTopic);
            }
        }
 public async Task <UserInformation> GetUserInformation()
 {
     return(await _client.Get <UserInformation>("user"));
 }