GetUserInfo() 공개 메소드

public GetUserInfo ( int userId ) : HipchatGetUserInfoResponse
userId int
리턴 HipchatGetUserInfoResponse
예제 #1
0
        public void CanGetUserInfo()
        {
            var userId = 42494;
            var client = new HipchatClient();

            var userInfo = client.GetUserInfo(userId);

            Assert.NotNull(userInfo);
        }
예제 #2
0
        public UpdateUserTests()
        {
            HipchatApiConfig.AuthToken = TestsConfig.AuthToken;
            _client = new HipchatClient();

            try
            {
                _client.GetUserInfo(UserEmail);
            }
            catch (Exception)
            {
                 _client.CreateUser(new CreateUserRequest() {Email = UserEmail, Name = UserName});
            }
        }
        public HipchatUser GetUser(string userName)
        {
            string authToken = ConfigurationManager.AppSettings["AuthTokens.Admin"];
            try
            {
                HipchatClient client = new HipchatClient(authToken);
                var response = client.GetUserInfo(userName);

                return new HipchatUser() {Id = response.Id, MentionName = response.MentionName, Name = response.Name};
            }
            catch
            {
                return null;
            }
        }