Crates.io | google-chat-types |
lib.rs | google-chat-types |
version | 0.1.5 |
source | src |
created_at | 2022-06-12 08:30:51.10707 |
updated_at | 2022-06-13 03:57:43.041079 |
description | types collection of google chat response |
homepage | |
repository | https://github.com/sinyo-matu/google-chat-types |
max_upload_size | |
id | 604499 |
size | 55,448 |
type helper for construct Google Chat message
There two type of Google Chat message
they are all represented as a json string.
Text Message represented like
{
"text": "some text"
}
Card Message represented like
{
"cards": [
{
"sections": [
{
"widgets": [
{
"image": { "imageUrl": "https://..." }
},
{
"buttons": [
{
"textButton": {
"text": "OPEN IN GOOGLE MAPS",
"onClick": {
"openLink": {
"url": "https://..."
}
}
}
}
]
}
]
}
]
}
]
}
the relationship between elements of cards should looks like below
you should construct Cards or Text struct, then serialize them to json string as a Google Chat API(for instance incoming webhook) http request body.