From 595516dca19cbf3f23eb0a53e78164ce7aa8ce5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Mon, 31 May 2021 01:43:09 +0200 Subject: [PATCH] lists: Add structs for lists, emails and patches --- api/lists.go | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 api/lists.go diff --git a/api/lists.go b/api/lists.go new file mode 100644 index 0000000..3c17cb6 --- /dev/null +++ b/api/lists.go @@ -0,0 +1,56 @@ +package api + +type emailStruct struct { + ID int `json:"id"` + Created string `json:"created"` + Subject string `json:"subject"` + MessageID string `json:"message_id"` + ParentID *int `json:"parent_id"` + ThreadID *int `json:"thread_it"` + List listsStruct `json:"list"` + Sender *userStruct `json:"sender"` + Patchset *patchStruct `json:"patchset"` +} + +type emailPagerStruct struct { + Next *int `json:"next,string"` + Results []*emailStruct `json:"results"` + Total int `json:"total"` + ResultsPerPage int `json:"results_per_page"` +} + +type patchStruct struct { + ID int `json:"id"` + Created string `json:"created"` + Updated string `json:"updated"` + Subject string `json:"subject"` + Prefix string `json:"prefix"` + Version int `json:"version"` + Status string `json:"status"` + Submitter string `json:"submitter"` + ReplyTo *string `json:"reply_to"` + MessageID string `json:"message_id"` +} + +type listPermissions struct { + NonSubscriber []string `json:"nonsubscriber"` + Subscriber []string `json:"subscriber"` + Account []string `json:"account"` +} + +type listsStruct struct { + ID int `json:"id"` + Name string `json:"name"` + Owner userStruct `json:"owner"` + Created string `json:"created"` + Updated string `json:"updated"` + Description string `json:"description"` + Permissions listPermissions `json:"permissions"` +} + +type listsPagerStruct struct { + Next *int `json:"next,string"` + Results []*listsStruct `json:"results"` + Total int `json:"total"` + ResultsPerPage int `json:"results_per_page"` +} -- 2.44.0