-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from mautrix/feat/bb-api-helper-functions
Feat/bb api helper functions
- Loading branch information
Showing
2 changed files
with
132 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package bluebubbles | ||
|
||
type PageMetadata struct { | ||
Count int64 `json:"count"` | ||
Total int64 `json:"total"` | ||
Offset int64 `json:"offset"` | ||
Limit int64 `json:"limit"` | ||
} | ||
|
||
type QuerySort string | ||
|
||
const ( | ||
QuerySortLastMessage QuerySort = "lastmessage" | ||
) | ||
|
||
type ChatQueryRequest struct { | ||
// TODO Other Fields | ||
Limit int64 `json:"limit"` | ||
Offset int64 `json:"offset"` | ||
With []ChatQueryWith `json:"with"` | ||
Sort QuerySort `json:"sort"` | ||
} | ||
|
||
type ChatQueryWith string | ||
|
||
const ( | ||
ChatQueryWithSMS ChatQueryWith = "sms" | ||
ChatQueryWithLastMessage ChatQueryWith = "lastMessage" | ||
) | ||
|
||
type ChatQueryResponse struct { | ||
Status int64 `json:"status"` | ||
Message string `json:"message"` | ||
Data []Chat `json:"data"` | ||
Metadata PageMetadata `json:"metadata"` | ||
} | ||
|
||
type Chat struct { | ||
// TODO How to get timestamp | ||
GUID string `json:"guid"` | ||
ChatIdentifier string `json:"chatIdentifier"` | ||
GroupId string `json:"groupId"` | ||
} |