コード例 #1
0
        /// <summary>
        /// Get user asynchronously.
        /// </summary>
        /// <example>
        /// This example shows how to use the <see cref="AccountManagementApi.GetUserAsync(string)"/> method.
        /// <code>
        /// try
        /// {
        ///     var user = await accountApi.GetUser("015c3c46514802420a010b1000000000");
        ///     return user;
        /// }
        /// catch (Exception)
        /// {
        ///     throw;
        /// }
        /// </code>
        /// </example>
        /// <param name="userId">Id</param>
        /// <returns><see cref="Task"/> with <see cref="User"/></returns>
        /// <exception cref="CloudApiException">CloudApiException</exception>
        public async Task <User> GetUserAsync(string userId)
        {
            try
            {
                var user = await AdminApi.GetUserAsync(userId);

                return(User.Map(user));
            }
            catch (iam.Client.ApiException e)
            {
                return(HandleNotFound <User, iam.Client.ApiException>(e));
            }
        }