예제 #1
0
 /// <summary>
 /// Resigter user for track
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='userId'>
 /// Lykke user Id (won't be use for Chainalysis)
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IUserScoreDetails> UserByUserIdRegisterPostAsync(this IChainalysisProxyAPI operations, string userId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UserByUserIdRegisterPostWithHttpMessagesAsync(userId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #2
0
        /// <summary>
        /// Register User
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public async Task <UserScoreDetails> RegisterUser(string userId)
        {
            var result = await _service.UserByUserIdRegisterPostWithHttpMessagesAsync(userId);

            if (result.Response.IsSuccessStatusCode)
            {
                return(Mapper.Map <UserScoreDetails>(result.Body));
            }

            return(null);
        }
        /// <summary>
        /// Register User
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public async Task <UserScoreDetails> RegisterUser(string userId)
        {
            var task    = _service.UserByUserIdRegisterPostWithHttpMessagesAsync(userId);
            var resTask = await TaskWithDelay(task);

            if (resTask != task)
            {
                _log.WriteWarning(nameof(ChainalysisProxyClient), nameof(RegisterUser), $"Timeout with {userId}");
                return(null);
            }

            var result = task.Result;

            if (result.Response.IsSuccessStatusCode)
            {
                return(MapUserScoreDetails(result.Body));
            }

            return(null);
        }