public static Mention FromRpcModel(this THMention mention) { return(new Mention( userId: mention.UserId, startIndex: mention.StartIdx, endIndex: mention.EndIdx, type: mention.Type )); }
public void Read(TProtocol iprot) { iprot.IncrementRecursionDepth(); try { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.String) { Id = iprot.ReadString(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 2: if (field.Type == TType.Struct) { Content = new THContent(); Content.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 3: if (field.Type == TType.Struct) { Author = new THPostAuthor(); Author.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 4: if (field.Type == TType.I32) { CreatedAt = iprot.ReadI32(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 5: if (field.Type == TType.I32) { StickyStart = iprot.ReadI32(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 6: if (field.Type == TType.I32) { StickyEnd = iprot.ReadI32(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 7: if (field.Type == TType.I32) { CommentsCount = iprot.ReadI32(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 8: if (field.Type == TType.I32) { LikesCount = iprot.ReadI32(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 9: if (field.Type == TType.Bool) { LikedByMe = iprot.ReadBool(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 10: if (field.Type == TType.String) { FeedId = iprot.ReadString(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 11: if (field.Type == TType.List) { { Mentions = new List <THMention>(); TList _list4 = iprot.ReadListBegin(); for (int _i5 = 0; _i5 < _list4.Count; ++_i5) { THMention _elem6; _elem6 = new THMention(); _elem6.Read(iprot); Mentions.Add(_elem6); } iprot.ReadListEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); } finally { iprot.DecrementRecursionDepth(); } }