(in *pbx.GetQuery)
| 599 | } |
| 600 | |
| 601 | func pbGetQueryDeserialize(in *pbx.GetQuery) *MsgGetQuery { |
| 602 | if in == nil { |
| 603 | return nil |
| 604 | } |
| 605 | |
| 606 | msg := MsgGetQuery{ |
| 607 | What: in.GetWhat(), |
| 608 | } |
| 609 | |
| 610 | if desc := in.GetDesc(); desc != nil { |
| 611 | msg.Desc = &MsgGetOpts{ |
| 612 | IfModifiedSince: int64ToTime(desc.GetIfModifiedSince()), |
| 613 | Limit: int(desc.GetLimit()), |
| 614 | } |
| 615 | } |
| 616 | if sub := in.GetSub(); sub != nil { |
| 617 | msg.Sub = &MsgGetOpts{ |
| 618 | IfModifiedSince: int64ToTime(sub.GetIfModifiedSince()), |
| 619 | Limit: int(sub.GetLimit()), |
| 620 | } |
| 621 | } |
| 622 | if data := in.GetData(); data != nil { |
| 623 | msg.Data = &MsgGetOpts{ |
| 624 | BeforeId: int(data.GetBeforeId()), |
| 625 | SinceId: int(data.GetSinceId()), |
| 626 | Limit: int(data.GetLimit()), |
| 627 | } |
| 628 | |
| 629 | if ranges := data.GetRanges(); len(ranges) > 0 { |
| 630 | msg.Data.IdRanges = make([]MsgRange, len(ranges)) |
| 631 | for i, sr := range ranges { |
| 632 | msg.Data.IdRanges[i].LowId = int(sr.GetLow()) |
| 633 | msg.Data.IdRanges[i].HiId = int(sr.GetHi()) |
| 634 | } |
| 635 | } |
| 636 | } |
| 637 | |
| 638 | return &msg |
| 639 | } |
| 640 | |
| 641 | func pbSetDescSerialize(in *MsgSetDesc) *pbx.SetDesc { |
| 642 | if in == nil { |
no test coverage detected
searching dependent graphs…