public void Read(TProtocol iprot)
        {
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.List)
                    {
                        {
                            WebOnlyFriends = new List <WebOnlyFriend>();
                            TList _list108 = iprot.ReadListBegin();
                            for (int _i109 = 0; _i109 < _list108.Count; ++_i109)
                            {
                                WebOnlyFriend _elem110;
                                _elem110 = new WebOnlyFriend();
                                _elem110.Read(iprot);
                                WebOnlyFriends.Add(_elem110);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Bool)
                    {
                        HasNextPage = iprot.ReadBool();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
        public async Task<PaginatedResponse<IEnumerable<WebFriendInformationResponse>>> GetWebFriends(PaginatedRequest<string> request, SystemSession session)
        {
            var serviceRequest = new WebOnlyFriend
            {
                UserId = session.UserId,
                TargetUser = request.Data,
                PageIndex = request.PageIndex,
                PageSize = request.PageSize
            };

            var data = await Task.Factory.StartNew(() => Client.UserService.getWebOnlyFriends(serviceRequest, session.GetSession())).ConfigureAwait(false);
            var result = new PaginatedResponse<IEnumerable<WebFriendInformationResponse>>
            {
                Page = data.WebOnlyFriends.Select(x => new WebFriendInformationResponse
                {
                    UserId = x.UserId,
                    UserName = x.Username,
                    FirstName = x.FirstName,
                    LastName = x.LastName,
                    StatusTypeId = (SystemUserAvailabilityCode)x.Status,
                    MobileNumber = x.PrimaryContactNum,
                    Title = x.Title,
                    UserTypeId = (SystemUserType)x.UserTypeId,
                    Image = x.Picture,
                    FriendshipStatus = (SystemFriendshipStatus)x.IsConnected,
                    MutualFriend = x.MutualFriends,
                    Address = x.Address,
                    Email = x.Email,
                    CanMessage = x.CanMessage,
                    AllowMessageForwarding = x.AllowMsgForwarding,
                    CanReceiveConnectionRequest = x.CanReceiveConnectionReq,
                    AllowAddingInChatGroup = x.AllowAddingChatGroup
                }),
                HasNextPage = data.HasNextPage,
            };

            return result;
        }
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.List) {
           {
             WebOnlyFriends = new List<WebOnlyFriend>();
             TList _list108 = iprot.ReadListBegin();
             for( int _i109 = 0; _i109 < _list108.Count; ++_i109)
             {
               WebOnlyFriend _elem110;
               _elem110 = new WebOnlyFriend();
               _elem110.Read(iprot);
               WebOnlyFriends.Add(_elem110);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Bool) {
           HasNextPage = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
Пример #4
0
 public void send_getWebOnlyFriends(WebOnlyFriend webOnlyFriend, Session session)
 #endif
 {
   oprot_.WriteMessageBegin(new TMessage("getWebOnlyFriends", TMessageType.Call, seqid_));
   getWebOnlyFriends_args args = new getWebOnlyFriends_args();
   args.WebOnlyFriend = webOnlyFriend;
   args.Session = session;
   args.Write(oprot_);
   oprot_.WriteMessageEnd();
   #if SILVERLIGHT
   return oprot_.Transport.BeginFlush(callback, state);
   #else
   oprot_.Transport.Flush();
   #endif
 }
Пример #5
0
 public IAsyncResult send_getWebOnlyFriends(AsyncCallback callback, object state, WebOnlyFriend webOnlyFriend, Session session)
Пример #6
0
      public WebOnlyFriendResponse getWebOnlyFriends(WebOnlyFriend webOnlyFriend, Session session)
      {
        #if !SILVERLIGHT
        send_getWebOnlyFriends(webOnlyFriend, session);
        return recv_getWebOnlyFriends();

        #else
        var asyncResult = Begin_getWebOnlyFriends(null, null, webOnlyFriend, session);
        return End_getWebOnlyFriends(asyncResult);

        #endif
      }
Пример #7
0
 public IAsyncResult Begin_getWebOnlyFriends(AsyncCallback callback, object state, WebOnlyFriend webOnlyFriend, Session session)
 {
   return send_getWebOnlyFriends(callback, state, webOnlyFriend, session);
 }
Пример #8
0
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.Struct) {
           WebOnlyFriend = new WebOnlyFriend();
           WebOnlyFriend.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Struct) {
           Session = new Session();
           Session.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }