bizGroupToPb converts a biz.Group to a pb.Group protobuf message.
(gr *biz.Group)
| 636 | |
| 637 | // bizGroupToPb converts a biz.Group to a pb.Group protobuf message. |
| 638 | func bizGroupToPb(gr *biz.Group) *pb.Group { |
| 639 | base := &pb.Group{ |
| 640 | Id: gr.ID.String(), |
| 641 | Name: gr.Name, |
| 642 | Description: gr.Description, |
| 643 | MemberCount: int32(gr.MemberCount), |
| 644 | CreatedAt: timestamppb.New(*gr.CreatedAt), |
| 645 | UpdatedAt: timestamppb.New(*gr.UpdatedAt), |
| 646 | } |
| 647 | |
| 648 | if gr.Organization != nil { |
| 649 | base.OrganizationId = gr.Organization.ID |
| 650 | } |
| 651 | |
| 652 | return base |
| 653 | } |
| 654 | |
| 655 | // bizGroupMemberToPb converts a biz.GroupMembership to a pb.GroupMember protobuf message. |
| 656 | func bizGroupMemberToPb(m *biz.GroupMembership) *pb.GroupMember { |