Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, h1, h2, h3, div, span, p, pre, a { |
| 5 | margin: 0; |
| 6 | padding: 0; |
| 7 | border: 0; |
| 8 | font-weight: inherit; |
| 9 | font-style: inherit; |
| 10 | font-size: 100%; |
| 11 | font-family: inherit; |
| 12 | vertical-align: baseline; |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, h2, h3 { |
| 50 | border-bottom: solid #CCC 1px; |
| 51 | } |
| 52 | |
| 53 | .toc_element { |
| 54 | margin-top: 0.5em; |
| 55 | } |
| 56 | |
| 57 | .firstline { |
| 58 | margin-left: 2 em; |
| 59 | } |
| 60 | |
| 61 | .method { |
| 62 | margin-top: 1em; |
| 63 | border: solid 1px #CCC; |
| 64 | padding: 1em; |
| 65 | background: #EEE; |
| 66 | } |
| 67 | |
| 68 | .details { |
| 69 | font-weight: bold; |
| 70 | font-size: 14px; |
| 71 | } |
| 72 | |
| 73 | </style> |
| 74 | |
| 75 | <h1><a href="chat_v1.html">Hangouts Chat API</a> . <a href="chat_v1.spaces.html">spaces</a> . <a href="chat_v1.spaces.messages.html">messages</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 78 | <code><a href="#create">create(parent, body=None, threadKey=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 79 | <p class="firstline">Creates a message.</p> |
| 80 | <p class="toc_element"> |
| 81 | <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p> |
| 82 | <p class="firstline">Deletes a message.</p> |
| 83 | <p class="toc_element"> |
| 84 | <code><a href="#get">get(name, x__xgafv=None)</a></code></p> |
| 85 | <p class="firstline">Returns a message.</p> |
| 86 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 87 | <code><a href="#update">update(name, body=None, updateMask=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 88 | <p class="firstline">Updates a message.</p> |
| 89 | <h3>Method Details</h3> |
| 90 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 91 | <code class="details" id="create">create(parent, body=None, threadKey=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 92 | <pre>Creates a message. |
| 93 | |
| 94 | Args: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 95 | parent: string, Required. Space resource name, in the form "spaces/*". |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 96 | Example: spaces/AAAAMpdlehY (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 97 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 98 | The object takes the form of: |
| 99 | |
| 100 | { # A message in Hangouts Chat. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 101 | "cards": [ # Rich, formatted and interactive cards that can be used to display UI |
| 102 | # elements such as: formatted texts, buttons, clickable images. Cards are |
| 103 | # normally displayed below the plain-text body of the message. |
| 104 | { # A card is a UI element that can contain UI widgets such as texts, images. |
| 105 | "sections": [ # Sections are separated by a line divider. |
| 106 | { # A section contains a collection of widgets that are rendered |
| 107 | # (vertically) in the order that they are specified. Across all platforms, |
| 108 | # cards have a narrow fixed width, so |
| 109 | # there is currently no need for layout properties (e.g. float). |
| 110 | "header": "A String", # The header of the section, text formatted supported. |
| 111 | "widgets": [ # A section must contain at least 1 widget. |
| 112 | { # A widget is a UI element that presents texts, images, etc. |
| 113 | "textParagraph": { # A paragraph of text. Formatted text supported. # Display a text paragraph in this widget. |
| 114 | "text": "A String", |
| 115 | }, |
| 116 | "keyValue": { # A UI element contains a key (label) and a value (content). And this # Display a key value item in this widget. |
| 117 | # element may also contain some actions such as onclick button. |
| 118 | "topLabel": "A String", # The text of the top label. Formatted text supported. |
| 119 | "iconUrl": "A String", # The icon specified by a URL. |
| 120 | "content": "A String", # The text of the content. Formatted text supported and always required. |
| 121 | "button": { # A button. Can be a text button or an image button. # A button that can be clicked to trigger an action. |
| 122 | "textButton": { # A button with text and onclick action. # A button with text and onclick action. |
| 123 | "text": "A String", # The text of the button. |
| 124 | "onClick": { # An onclick action (e.g. open a link). # The onclick action of the button. |
| 125 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 126 | "url": "A String", # The URL to open. |
| 127 | }, |
| 128 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 129 | # For example, an Apps Script can be invoked to handle the form. |
| 130 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 131 | # form submission. This information is echoed back to the bot as part of |
| 132 | # the card click event. The same method name can be used for several |
| 133 | # elements that trigger a common behavior if desired. |
| 134 | "parameters": [ # List of action parameters. |
| 135 | { # List of string parameters to supply when the action method is invoked. |
| 136 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 137 | # snooze next week. You might use action method = snooze(), passing the |
| 138 | # snooze type and snooze time in the list of string parameters. |
| 139 | "key": "A String", # The name of the parameter for the action script. |
| 140 | "value": "A String", # The value of the parameter. |
| 141 | }, |
| 142 | ], |
| 143 | }, |
| 144 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 145 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 146 | "imageButton": { # An image button with an onclick action. # A button with image and onclick action. |
| 147 | "icon": "A String", # The icon specified by an enum that indices to an icon provided by Chat |
| 148 | # API. |
| 149 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 150 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 151 | "url": "A String", # The URL to open. |
| 152 | }, |
| 153 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 154 | # For example, an Apps Script can be invoked to handle the form. |
| 155 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 156 | # form submission. This information is echoed back to the bot as part of |
| 157 | # the card click event. The same method name can be used for several |
| 158 | # elements that trigger a common behavior if desired. |
| 159 | "parameters": [ # List of action parameters. |
| 160 | { # List of string parameters to supply when the action method is invoked. |
| 161 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 162 | # snooze next week. You might use action method = snooze(), passing the |
| 163 | # snooze type and snooze time in the list of string parameters. |
| 164 | "key": "A String", # The name of the parameter for the action script. |
| 165 | "value": "A String", # The value of the parameter. |
| 166 | }, |
| 167 | ], |
| 168 | }, |
| 169 | }, |
| 170 | "iconUrl": "A String", # The icon specified by a URL. |
| 171 | "name": "A String", # The name of this image_button which will be used for accessibility. |
| 172 | # Default value will be provided if developers don't specify. |
| 173 | }, |
| 174 | }, |
| 175 | "bottomLabel": "A String", # The text of the bottom label. Formatted text supported. |
| 176 | "icon": "A String", # An enum value that will be replaced by the Chat API with the |
| 177 | # corresponding icon image. |
| 178 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. Only the top label, bottom label and content region |
| 179 | # are clickable. |
| 180 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 181 | "url": "A String", # The URL to open. |
| 182 | }, |
| 183 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 184 | # For example, an Apps Script can be invoked to handle the form. |
| 185 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 186 | # form submission. This information is echoed back to the bot as part of |
| 187 | # the card click event. The same method name can be used for several |
| 188 | # elements that trigger a common behavior if desired. |
| 189 | "parameters": [ # List of action parameters. |
| 190 | { # List of string parameters to supply when the action method is invoked. |
| 191 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 192 | # snooze next week. You might use action method = snooze(), passing the |
| 193 | # snooze type and snooze time in the list of string parameters. |
| 194 | "key": "A String", # The name of the parameter for the action script. |
| 195 | "value": "A String", # The value of the parameter. |
| 196 | }, |
| 197 | ], |
| 198 | }, |
| 199 | }, |
| 200 | "contentMultiline": True or False, # If the content should be multiline. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 201 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 202 | "image": { # An image that is specified by a URL and can have an onclick action. # Display an image in this widget. |
| 203 | "aspectRatio": 3.14, # The aspect ratio of this image (width/height). This field allows clients |
| 204 | # to reserve the right height for the image while waiting for it to load. |
| 205 | # It's not meant to override the native aspect ratio of the image. |
| 206 | # If unset, the server fills it by prefetching the image. |
| 207 | "imageUrl": "A String", # The URL of the image. |
| 208 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 209 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 210 | "url": "A String", # The URL to open. |
| 211 | }, |
| 212 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 213 | # For example, an Apps Script can be invoked to handle the form. |
| 214 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 215 | # form submission. This information is echoed back to the bot as part of |
| 216 | # the card click event. The same method name can be used for several |
| 217 | # elements that trigger a common behavior if desired. |
| 218 | "parameters": [ # List of action parameters. |
| 219 | { # List of string parameters to supply when the action method is invoked. |
| 220 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 221 | # snooze next week. You might use action method = snooze(), passing the |
| 222 | # snooze type and snooze time in the list of string parameters. |
| 223 | "key": "A String", # The name of the parameter for the action script. |
| 224 | "value": "A String", # The value of the parameter. |
| 225 | }, |
| 226 | ], |
| 227 | }, |
| 228 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 229 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 230 | "buttons": [ # A list of buttons. Buttons is also oneof data and only one of these |
| 231 | # fields should be set. |
| 232 | { # A button. Can be a text button or an image button. |
| 233 | "textButton": { # A button with text and onclick action. # A button with text and onclick action. |
| 234 | "text": "A String", # The text of the button. |
| 235 | "onClick": { # An onclick action (e.g. open a link). # The onclick action of the button. |
| 236 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 237 | "url": "A String", # The URL to open. |
| 238 | }, |
| 239 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 240 | # For example, an Apps Script can be invoked to handle the form. |
| 241 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 242 | # form submission. This information is echoed back to the bot as part of |
| 243 | # the card click event. The same method name can be used for several |
| 244 | # elements that trigger a common behavior if desired. |
| 245 | "parameters": [ # List of action parameters. |
| 246 | { # List of string parameters to supply when the action method is invoked. |
| 247 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 248 | # snooze next week. You might use action method = snooze(), passing the |
| 249 | # snooze type and snooze time in the list of string parameters. |
| 250 | "key": "A String", # The name of the parameter for the action script. |
| 251 | "value": "A String", # The value of the parameter. |
| 252 | }, |
| 253 | ], |
| 254 | }, |
| 255 | }, |
| 256 | }, |
| 257 | "imageButton": { # An image button with an onclick action. # A button with image and onclick action. |
| 258 | "icon": "A String", # The icon specified by an enum that indices to an icon provided by Chat |
| 259 | # API. |
| 260 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 261 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 262 | "url": "A String", # The URL to open. |
| 263 | }, |
| 264 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 265 | # For example, an Apps Script can be invoked to handle the form. |
| 266 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 267 | # form submission. This information is echoed back to the bot as part of |
| 268 | # the card click event. The same method name can be used for several |
| 269 | # elements that trigger a common behavior if desired. |
| 270 | "parameters": [ # List of action parameters. |
| 271 | { # List of string parameters to supply when the action method is invoked. |
| 272 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 273 | # snooze next week. You might use action method = snooze(), passing the |
| 274 | # snooze type and snooze time in the list of string parameters. |
| 275 | "key": "A String", # The name of the parameter for the action script. |
| 276 | "value": "A String", # The value of the parameter. |
| 277 | }, |
| 278 | ], |
| 279 | }, |
| 280 | }, |
| 281 | "iconUrl": "A String", # The icon specified by a URL. |
| 282 | "name": "A String", # The name of this image_button which will be used for accessibility. |
| 283 | # Default value will be provided if developers don't specify. |
| 284 | }, |
| 285 | }, |
| 286 | ], |
| 287 | }, |
| 288 | ], |
| 289 | }, |
| 290 | ], |
| 291 | "cardActions": [ # The actions of this card. |
| 292 | { # A card action is |
| 293 | # the action associated with the card. For an invoice card, a |
| 294 | # typical action would be: delete invoice, email invoice or open the |
| 295 | # invoice in browser. |
| 296 | "actionLabel": "A String", # The label used to be displayed in the action menu item. |
| 297 | "onClick": { # An onclick action (e.g. open a link). # The onclick action for this action item. |
| 298 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 299 | "url": "A String", # The URL to open. |
| 300 | }, |
| 301 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 302 | # For example, an Apps Script can be invoked to handle the form. |
| 303 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 304 | # form submission. This information is echoed back to the bot as part of |
| 305 | # the card click event. The same method name can be used for several |
| 306 | # elements that trigger a common behavior if desired. |
| 307 | "parameters": [ # List of action parameters. |
| 308 | { # List of string parameters to supply when the action method is invoked. |
| 309 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 310 | # snooze next week. You might use action method = snooze(), passing the |
| 311 | # snooze type and snooze time in the list of string parameters. |
| 312 | "key": "A String", # The name of the parameter for the action script. |
| 313 | "value": "A String", # The value of the parameter. |
| 314 | }, |
| 315 | ], |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 316 | }, |
| 317 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 318 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 319 | ], |
| 320 | "header": { # The header of the card. A header usually contains a title and an image. |
| 321 | "subtitle": "A String", # The subtitle of the card header. |
| 322 | "imageUrl": "A String", # The URL of the image in the card header. |
| 323 | "imageStyle": "A String", # The image's type (e.g. square border or circular border). |
| 324 | "title": "A String", # The title must be specified. The header has a fixed height: if both a |
| 325 | # title and subtitle is specified, each will take up 1 line. If only the |
| 326 | # title is specified, it will take up both lines. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 327 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 328 | "name": "A String", # Name of the card. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 329 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 330 | ], |
| 331 | "sender": { # A user in Hangouts Chat. # The user who created the message. |
| 332 | "type": "A String", # User type. |
| 333 | "domainId": "A String", # Obfuscated domain information. |
| 334 | "name": "A String", # Resource name, in the format "users/*". |
| 335 | "displayName": "A String", # The user's display name. |
| 336 | }, |
| 337 | "thread": { # A thread in Hangouts Chat. # The thread the message belongs to. |
| 338 | "name": "A String", # Resource name, in the form "spaces/*/threads/*". |
| 339 | # |
| 340 | # Example: spaces/AAAAMpdlehY/threads/UMxbHmzDlr4 |
| 341 | }, |
| 342 | "annotations": [ # Output only. Annotations associated with the text in this message. |
| 343 | { # Annotations associated with the plain-text body of the message. |
| 344 | # |
| 345 | # Example plain-text message body: |
| 346 | # ``` |
| 347 | # Hello @FooBot how are you!" |
| 348 | # ``` |
| 349 | # |
| 350 | # The corresponding annotations metadata: |
| 351 | # ``` |
| 352 | # "annotations":[{ |
| 353 | # "type":"USER_MENTION", |
| 354 | # "startIndex":6, |
| 355 | # "length":7, |
| 356 | # "userMention": { |
| 357 | # "user": { |
| 358 | # "name":"users/107946847022116401880", |
| 359 | # "displayName":"FooBot", |
| 360 | # "avatarUrl":"https://goo.gl/aeDtrS", |
| 361 | # "type":"BOT" |
| 362 | # }, |
| 363 | # "type":"MENTION" |
| 364 | # } |
| 365 | # }] |
| 366 | # ``` |
| 367 | "type": "A String", # The type of this annotation. |
| 368 | "length": 42, # Length of the substring in the plain-text message body this annotation |
| 369 | # corresponds to. |
| 370 | "startIndex": 42, # Start index (0-based, inclusive) in the plain-text message body this |
| 371 | # annotation corresponds to. |
| 372 | "userMention": { # Annotation metadata for user mentions (@). # The metadata of user mention. |
| 373 | "type": "A String", # The type of user mention. |
| 374 | "user": { # A user in Hangouts Chat. # The user mentioned. |
| 375 | "type": "A String", # User type. |
| 376 | "domainId": "A String", # Obfuscated domain information. |
| 377 | "name": "A String", # Resource name, in the format "users/*". |
| 378 | "displayName": "A String", # The user's display name. |
| 379 | }, |
| 380 | }, |
| 381 | }, |
| 382 | ], |
| 383 | "name": "A String", # Resource name, in the form "spaces/*/messages/*". |
| 384 | # |
| 385 | # Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 |
| 386 | "previewText": "A String", # Text for generating preview chips. This text will not be displayed to the |
| 387 | # user, but any links to images, web pages, videos, etc. included here will |
| 388 | # generate preview chips. |
| 389 | "space": { # A room or DM in Hangouts Chat. # The space the message belongs to. |
| 390 | "type": "A String", # Output only. The type of a space. |
| 391 | # This is deprecated. Use `single_user_bot_dm` instead. |
| 392 | "singleUserBotDm": True or False, # Whether the space is a DM between a bot and a single human. |
| 393 | "name": "A String", # Resource name of the space, in the form "spaces/*". |
| 394 | # |
| 395 | # Example: spaces/AAAAMpdlehYs |
| 396 | "threaded": True or False, # Whether the messages are threaded in this space. |
| 397 | "displayName": "A String", # Output only. The display name (only if the space is a room). |
| 398 | }, |
| 399 | "text": "A String", # Plain-text body of the message. |
| 400 | "argumentText": "A String", # Plain-text body of the message with all bot mentions stripped out. |
| 401 | "fallbackText": "A String", # A plain-text description of the message's cards, used when the actual cards |
| 402 | # cannot be displayed (e.g. mobile notifications). |
| 403 | "actionResponse": { # Parameters that a bot can use to configure how it's response is posted. # Input only. Parameters that a bot can use to configure how its response is |
| 404 | # posted. |
| 405 | "type": "A String", # The type of bot response. |
| 406 | "url": "A String", # URL for users to auth or config. (Only for REQUEST_CONFIG response types.) |
| 407 | }, |
| 408 | "createTime": "A String", # Output only. The time at which the message was created in Hangouts Chat |
| 409 | # server. |
| 410 | } |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 411 | |
| 412 | threadKey: string, Opaque thread identifier string that can be specified to group messages |
| 413 | into a single thread. If this is the first message with a given thread |
| 414 | identifier, a new thread is created. Subsequent messages with the same |
| 415 | thread identifier will be posted into the same thread. This relieves bots |
| 416 | and webhooks from having to store the Hangouts Chat thread ID of a thread (created earlier by them) to post |
| 417 | further updates to it. |
| 418 | |
| 419 | Has no effect if thread field, |
| 420 | corresponding to an existing thread, is set in message. |
| 421 | x__xgafv: string, V1 error format. |
| 422 | Allowed values |
| 423 | 1 - v1 error format |
| 424 | 2 - v2 error format |
| 425 | |
| 426 | Returns: |
| 427 | An object of the form: |
| 428 | |
| 429 | { # A message in Hangouts Chat. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 430 | "cards": [ # Rich, formatted and interactive cards that can be used to display UI |
| 431 | # elements such as: formatted texts, buttons, clickable images. Cards are |
| 432 | # normally displayed below the plain-text body of the message. |
| 433 | { # A card is a UI element that can contain UI widgets such as texts, images. |
| 434 | "sections": [ # Sections are separated by a line divider. |
| 435 | { # A section contains a collection of widgets that are rendered |
| 436 | # (vertically) in the order that they are specified. Across all platforms, |
| 437 | # cards have a narrow fixed width, so |
| 438 | # there is currently no need for layout properties (e.g. float). |
| 439 | "header": "A String", # The header of the section, text formatted supported. |
| 440 | "widgets": [ # A section must contain at least 1 widget. |
| 441 | { # A widget is a UI element that presents texts, images, etc. |
| 442 | "textParagraph": { # A paragraph of text. Formatted text supported. # Display a text paragraph in this widget. |
| 443 | "text": "A String", |
| 444 | }, |
| 445 | "keyValue": { # A UI element contains a key (label) and a value (content). And this # Display a key value item in this widget. |
| 446 | # element may also contain some actions such as onclick button. |
| 447 | "topLabel": "A String", # The text of the top label. Formatted text supported. |
| 448 | "iconUrl": "A String", # The icon specified by a URL. |
| 449 | "content": "A String", # The text of the content. Formatted text supported and always required. |
| 450 | "button": { # A button. Can be a text button or an image button. # A button that can be clicked to trigger an action. |
| 451 | "textButton": { # A button with text and onclick action. # A button with text and onclick action. |
| 452 | "text": "A String", # The text of the button. |
| 453 | "onClick": { # An onclick action (e.g. open a link). # The onclick action of the button. |
| 454 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 455 | "url": "A String", # The URL to open. |
| 456 | }, |
| 457 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 458 | # For example, an Apps Script can be invoked to handle the form. |
| 459 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 460 | # form submission. This information is echoed back to the bot as part of |
| 461 | # the card click event. The same method name can be used for several |
| 462 | # elements that trigger a common behavior if desired. |
| 463 | "parameters": [ # List of action parameters. |
| 464 | { # List of string parameters to supply when the action method is invoked. |
| 465 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 466 | # snooze next week. You might use action method = snooze(), passing the |
| 467 | # snooze type and snooze time in the list of string parameters. |
| 468 | "key": "A String", # The name of the parameter for the action script. |
| 469 | "value": "A String", # The value of the parameter. |
| 470 | }, |
| 471 | ], |
| 472 | }, |
| 473 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 474 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 475 | "imageButton": { # An image button with an onclick action. # A button with image and onclick action. |
| 476 | "icon": "A String", # The icon specified by an enum that indices to an icon provided by Chat |
| 477 | # API. |
| 478 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 479 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 480 | "url": "A String", # The URL to open. |
| 481 | }, |
| 482 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 483 | # For example, an Apps Script can be invoked to handle the form. |
| 484 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 485 | # form submission. This information is echoed back to the bot as part of |
| 486 | # the card click event. The same method name can be used for several |
| 487 | # elements that trigger a common behavior if desired. |
| 488 | "parameters": [ # List of action parameters. |
| 489 | { # List of string parameters to supply when the action method is invoked. |
| 490 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 491 | # snooze next week. You might use action method = snooze(), passing the |
| 492 | # snooze type and snooze time in the list of string parameters. |
| 493 | "key": "A String", # The name of the parameter for the action script. |
| 494 | "value": "A String", # The value of the parameter. |
| 495 | }, |
| 496 | ], |
| 497 | }, |
| 498 | }, |
| 499 | "iconUrl": "A String", # The icon specified by a URL. |
| 500 | "name": "A String", # The name of this image_button which will be used for accessibility. |
| 501 | # Default value will be provided if developers don't specify. |
| 502 | }, |
| 503 | }, |
| 504 | "bottomLabel": "A String", # The text of the bottom label. Formatted text supported. |
| 505 | "icon": "A String", # An enum value that will be replaced by the Chat API with the |
| 506 | # corresponding icon image. |
| 507 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. Only the top label, bottom label and content region |
| 508 | # are clickable. |
| 509 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 510 | "url": "A String", # The URL to open. |
| 511 | }, |
| 512 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 513 | # For example, an Apps Script can be invoked to handle the form. |
| 514 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 515 | # form submission. This information is echoed back to the bot as part of |
| 516 | # the card click event. The same method name can be used for several |
| 517 | # elements that trigger a common behavior if desired. |
| 518 | "parameters": [ # List of action parameters. |
| 519 | { # List of string parameters to supply when the action method is invoked. |
| 520 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 521 | # snooze next week. You might use action method = snooze(), passing the |
| 522 | # snooze type and snooze time in the list of string parameters. |
| 523 | "key": "A String", # The name of the parameter for the action script. |
| 524 | "value": "A String", # The value of the parameter. |
| 525 | }, |
| 526 | ], |
| 527 | }, |
| 528 | }, |
| 529 | "contentMultiline": True or False, # If the content should be multiline. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 530 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 531 | "image": { # An image that is specified by a URL and can have an onclick action. # Display an image in this widget. |
| 532 | "aspectRatio": 3.14, # The aspect ratio of this image (width/height). This field allows clients |
| 533 | # to reserve the right height for the image while waiting for it to load. |
| 534 | # It's not meant to override the native aspect ratio of the image. |
| 535 | # If unset, the server fills it by prefetching the image. |
| 536 | "imageUrl": "A String", # The URL of the image. |
| 537 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 538 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 539 | "url": "A String", # The URL to open. |
| 540 | }, |
| 541 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 542 | # For example, an Apps Script can be invoked to handle the form. |
| 543 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 544 | # form submission. This information is echoed back to the bot as part of |
| 545 | # the card click event. The same method name can be used for several |
| 546 | # elements that trigger a common behavior if desired. |
| 547 | "parameters": [ # List of action parameters. |
| 548 | { # List of string parameters to supply when the action method is invoked. |
| 549 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 550 | # snooze next week. You might use action method = snooze(), passing the |
| 551 | # snooze type and snooze time in the list of string parameters. |
| 552 | "key": "A String", # The name of the parameter for the action script. |
| 553 | "value": "A String", # The value of the parameter. |
| 554 | }, |
| 555 | ], |
| 556 | }, |
| 557 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 558 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 559 | "buttons": [ # A list of buttons. Buttons is also oneof data and only one of these |
| 560 | # fields should be set. |
| 561 | { # A button. Can be a text button or an image button. |
| 562 | "textButton": { # A button with text and onclick action. # A button with text and onclick action. |
| 563 | "text": "A String", # The text of the button. |
| 564 | "onClick": { # An onclick action (e.g. open a link). # The onclick action of the button. |
| 565 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 566 | "url": "A String", # The URL to open. |
| 567 | }, |
| 568 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 569 | # For example, an Apps Script can be invoked to handle the form. |
| 570 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 571 | # form submission. This information is echoed back to the bot as part of |
| 572 | # the card click event. The same method name can be used for several |
| 573 | # elements that trigger a common behavior if desired. |
| 574 | "parameters": [ # List of action parameters. |
| 575 | { # List of string parameters to supply when the action method is invoked. |
| 576 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 577 | # snooze next week. You might use action method = snooze(), passing the |
| 578 | # snooze type and snooze time in the list of string parameters. |
| 579 | "key": "A String", # The name of the parameter for the action script. |
| 580 | "value": "A String", # The value of the parameter. |
| 581 | }, |
| 582 | ], |
| 583 | }, |
| 584 | }, |
| 585 | }, |
| 586 | "imageButton": { # An image button with an onclick action. # A button with image and onclick action. |
| 587 | "icon": "A String", # The icon specified by an enum that indices to an icon provided by Chat |
| 588 | # API. |
| 589 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 590 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 591 | "url": "A String", # The URL to open. |
| 592 | }, |
| 593 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 594 | # For example, an Apps Script can be invoked to handle the form. |
| 595 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 596 | # form submission. This information is echoed back to the bot as part of |
| 597 | # the card click event. The same method name can be used for several |
| 598 | # elements that trigger a common behavior if desired. |
| 599 | "parameters": [ # List of action parameters. |
| 600 | { # List of string parameters to supply when the action method is invoked. |
| 601 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 602 | # snooze next week. You might use action method = snooze(), passing the |
| 603 | # snooze type and snooze time in the list of string parameters. |
| 604 | "key": "A String", # The name of the parameter for the action script. |
| 605 | "value": "A String", # The value of the parameter. |
| 606 | }, |
| 607 | ], |
| 608 | }, |
| 609 | }, |
| 610 | "iconUrl": "A String", # The icon specified by a URL. |
| 611 | "name": "A String", # The name of this image_button which will be used for accessibility. |
| 612 | # Default value will be provided if developers don't specify. |
| 613 | }, |
| 614 | }, |
| 615 | ], |
| 616 | }, |
| 617 | ], |
| 618 | }, |
| 619 | ], |
| 620 | "cardActions": [ # The actions of this card. |
| 621 | { # A card action is |
| 622 | # the action associated with the card. For an invoice card, a |
| 623 | # typical action would be: delete invoice, email invoice or open the |
| 624 | # invoice in browser. |
| 625 | "actionLabel": "A String", # The label used to be displayed in the action menu item. |
| 626 | "onClick": { # An onclick action (e.g. open a link). # The onclick action for this action item. |
| 627 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 628 | "url": "A String", # The URL to open. |
| 629 | }, |
| 630 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 631 | # For example, an Apps Script can be invoked to handle the form. |
| 632 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 633 | # form submission. This information is echoed back to the bot as part of |
| 634 | # the card click event. The same method name can be used for several |
| 635 | # elements that trigger a common behavior if desired. |
| 636 | "parameters": [ # List of action parameters. |
| 637 | { # List of string parameters to supply when the action method is invoked. |
| 638 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 639 | # snooze next week. You might use action method = snooze(), passing the |
| 640 | # snooze type and snooze time in the list of string parameters. |
| 641 | "key": "A String", # The name of the parameter for the action script. |
| 642 | "value": "A String", # The value of the parameter. |
| 643 | }, |
| 644 | ], |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 645 | }, |
| 646 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 647 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 648 | ], |
| 649 | "header": { # The header of the card. A header usually contains a title and an image. |
| 650 | "subtitle": "A String", # The subtitle of the card header. |
| 651 | "imageUrl": "A String", # The URL of the image in the card header. |
| 652 | "imageStyle": "A String", # The image's type (e.g. square border or circular border). |
| 653 | "title": "A String", # The title must be specified. The header has a fixed height: if both a |
| 654 | # title and subtitle is specified, each will take up 1 line. If only the |
| 655 | # title is specified, it will take up both lines. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 656 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 657 | "name": "A String", # Name of the card. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 658 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 659 | ], |
| 660 | "sender": { # A user in Hangouts Chat. # The user who created the message. |
| 661 | "type": "A String", # User type. |
| 662 | "domainId": "A String", # Obfuscated domain information. |
| 663 | "name": "A String", # Resource name, in the format "users/*". |
| 664 | "displayName": "A String", # The user's display name. |
| 665 | }, |
| 666 | "thread": { # A thread in Hangouts Chat. # The thread the message belongs to. |
| 667 | "name": "A String", # Resource name, in the form "spaces/*/threads/*". |
| 668 | # |
| 669 | # Example: spaces/AAAAMpdlehY/threads/UMxbHmzDlr4 |
| 670 | }, |
| 671 | "annotations": [ # Output only. Annotations associated with the text in this message. |
| 672 | { # Annotations associated with the plain-text body of the message. |
| 673 | # |
| 674 | # Example plain-text message body: |
| 675 | # ``` |
| 676 | # Hello @FooBot how are you!" |
| 677 | # ``` |
| 678 | # |
| 679 | # The corresponding annotations metadata: |
| 680 | # ``` |
| 681 | # "annotations":[{ |
| 682 | # "type":"USER_MENTION", |
| 683 | # "startIndex":6, |
| 684 | # "length":7, |
| 685 | # "userMention": { |
| 686 | # "user": { |
| 687 | # "name":"users/107946847022116401880", |
| 688 | # "displayName":"FooBot", |
| 689 | # "avatarUrl":"https://goo.gl/aeDtrS", |
| 690 | # "type":"BOT" |
| 691 | # }, |
| 692 | # "type":"MENTION" |
| 693 | # } |
| 694 | # }] |
| 695 | # ``` |
| 696 | "type": "A String", # The type of this annotation. |
| 697 | "length": 42, # Length of the substring in the plain-text message body this annotation |
| 698 | # corresponds to. |
| 699 | "startIndex": 42, # Start index (0-based, inclusive) in the plain-text message body this |
| 700 | # annotation corresponds to. |
| 701 | "userMention": { # Annotation metadata for user mentions (@). # The metadata of user mention. |
| 702 | "type": "A String", # The type of user mention. |
| 703 | "user": { # A user in Hangouts Chat. # The user mentioned. |
| 704 | "type": "A String", # User type. |
| 705 | "domainId": "A String", # Obfuscated domain information. |
| 706 | "name": "A String", # Resource name, in the format "users/*". |
| 707 | "displayName": "A String", # The user's display name. |
| 708 | }, |
| 709 | }, |
| 710 | }, |
| 711 | ], |
| 712 | "name": "A String", # Resource name, in the form "spaces/*/messages/*". |
| 713 | # |
| 714 | # Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 |
| 715 | "previewText": "A String", # Text for generating preview chips. This text will not be displayed to the |
| 716 | # user, but any links to images, web pages, videos, etc. included here will |
| 717 | # generate preview chips. |
| 718 | "space": { # A room or DM in Hangouts Chat. # The space the message belongs to. |
| 719 | "type": "A String", # Output only. The type of a space. |
| 720 | # This is deprecated. Use `single_user_bot_dm` instead. |
| 721 | "singleUserBotDm": True or False, # Whether the space is a DM between a bot and a single human. |
| 722 | "name": "A String", # Resource name of the space, in the form "spaces/*". |
| 723 | # |
| 724 | # Example: spaces/AAAAMpdlehYs |
| 725 | "threaded": True or False, # Whether the messages are threaded in this space. |
| 726 | "displayName": "A String", # Output only. The display name (only if the space is a room). |
| 727 | }, |
| 728 | "text": "A String", # Plain-text body of the message. |
| 729 | "argumentText": "A String", # Plain-text body of the message with all bot mentions stripped out. |
| 730 | "fallbackText": "A String", # A plain-text description of the message's cards, used when the actual cards |
| 731 | # cannot be displayed (e.g. mobile notifications). |
| 732 | "actionResponse": { # Parameters that a bot can use to configure how it's response is posted. # Input only. Parameters that a bot can use to configure how its response is |
| 733 | # posted. |
| 734 | "type": "A String", # The type of bot response. |
| 735 | "url": "A String", # URL for users to auth or config. (Only for REQUEST_CONFIG response types.) |
| 736 | }, |
| 737 | "createTime": "A String", # Output only. The time at which the message was created in Hangouts Chat |
| 738 | # server. |
| 739 | }</pre> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 740 | </div> |
| 741 | |
| 742 | <div class="method"> |
| 743 | <code class="details" id="delete">delete(name, x__xgafv=None)</code> |
| 744 | <pre>Deletes a message. |
| 745 | |
| 746 | Args: |
| 747 | name: string, Required. Resource name of the message to be deleted, in the form |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 748 | "spaces/*/messages/*" |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 749 | |
| 750 | Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 (required) |
| 751 | x__xgafv: string, V1 error format. |
| 752 | Allowed values |
| 753 | 1 - v1 error format |
| 754 | 2 - v2 error format |
| 755 | |
| 756 | Returns: |
| 757 | An object of the form: |
| 758 | |
| 759 | { # A generic empty message that you can re-use to avoid defining duplicated |
| 760 | # empty messages in your APIs. A typical example is to use it as the request |
| 761 | # or the response type of an API method. For instance: |
| 762 | # |
| 763 | # service Foo { |
| 764 | # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 765 | # } |
| 766 | # |
| 767 | # The JSON representation for `Empty` is empty JSON object `{}`. |
| 768 | }</pre> |
| 769 | </div> |
| 770 | |
| 771 | <div class="method"> |
| 772 | <code class="details" id="get">get(name, x__xgafv=None)</code> |
| 773 | <pre>Returns a message. |
| 774 | |
| 775 | Args: |
| 776 | name: string, Required. Resource name of the message to be retrieved, in the form |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 777 | "spaces/*/messages/*". |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 778 | |
| 779 | Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 (required) |
| 780 | x__xgafv: string, V1 error format. |
| 781 | Allowed values |
| 782 | 1 - v1 error format |
| 783 | 2 - v2 error format |
| 784 | |
| 785 | Returns: |
| 786 | An object of the form: |
| 787 | |
| 788 | { # A message in Hangouts Chat. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 789 | "cards": [ # Rich, formatted and interactive cards that can be used to display UI |
| 790 | # elements such as: formatted texts, buttons, clickable images. Cards are |
| 791 | # normally displayed below the plain-text body of the message. |
| 792 | { # A card is a UI element that can contain UI widgets such as texts, images. |
| 793 | "sections": [ # Sections are separated by a line divider. |
| 794 | { # A section contains a collection of widgets that are rendered |
| 795 | # (vertically) in the order that they are specified. Across all platforms, |
| 796 | # cards have a narrow fixed width, so |
| 797 | # there is currently no need for layout properties (e.g. float). |
| 798 | "header": "A String", # The header of the section, text formatted supported. |
| 799 | "widgets": [ # A section must contain at least 1 widget. |
| 800 | { # A widget is a UI element that presents texts, images, etc. |
| 801 | "textParagraph": { # A paragraph of text. Formatted text supported. # Display a text paragraph in this widget. |
| 802 | "text": "A String", |
| 803 | }, |
| 804 | "keyValue": { # A UI element contains a key (label) and a value (content). And this # Display a key value item in this widget. |
| 805 | # element may also contain some actions such as onclick button. |
| 806 | "topLabel": "A String", # The text of the top label. Formatted text supported. |
| 807 | "iconUrl": "A String", # The icon specified by a URL. |
| 808 | "content": "A String", # The text of the content. Formatted text supported and always required. |
| 809 | "button": { # A button. Can be a text button or an image button. # A button that can be clicked to trigger an action. |
| 810 | "textButton": { # A button with text and onclick action. # A button with text and onclick action. |
| 811 | "text": "A String", # The text of the button. |
| 812 | "onClick": { # An onclick action (e.g. open a link). # The onclick action of the button. |
| 813 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 814 | "url": "A String", # The URL to open. |
| 815 | }, |
| 816 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 817 | # For example, an Apps Script can be invoked to handle the form. |
| 818 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 819 | # form submission. This information is echoed back to the bot as part of |
| 820 | # the card click event. The same method name can be used for several |
| 821 | # elements that trigger a common behavior if desired. |
| 822 | "parameters": [ # List of action parameters. |
| 823 | { # List of string parameters to supply when the action method is invoked. |
| 824 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 825 | # snooze next week. You might use action method = snooze(), passing the |
| 826 | # snooze type and snooze time in the list of string parameters. |
| 827 | "key": "A String", # The name of the parameter for the action script. |
| 828 | "value": "A String", # The value of the parameter. |
| 829 | }, |
| 830 | ], |
| 831 | }, |
| 832 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 833 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 834 | "imageButton": { # An image button with an onclick action. # A button with image and onclick action. |
| 835 | "icon": "A String", # The icon specified by an enum that indices to an icon provided by Chat |
| 836 | # API. |
| 837 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 838 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 839 | "url": "A String", # The URL to open. |
| 840 | }, |
| 841 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 842 | # For example, an Apps Script can be invoked to handle the form. |
| 843 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 844 | # form submission. This information is echoed back to the bot as part of |
| 845 | # the card click event. The same method name can be used for several |
| 846 | # elements that trigger a common behavior if desired. |
| 847 | "parameters": [ # List of action parameters. |
| 848 | { # List of string parameters to supply when the action method is invoked. |
| 849 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 850 | # snooze next week. You might use action method = snooze(), passing the |
| 851 | # snooze type and snooze time in the list of string parameters. |
| 852 | "key": "A String", # The name of the parameter for the action script. |
| 853 | "value": "A String", # The value of the parameter. |
| 854 | }, |
| 855 | ], |
| 856 | }, |
| 857 | }, |
| 858 | "iconUrl": "A String", # The icon specified by a URL. |
| 859 | "name": "A String", # The name of this image_button which will be used for accessibility. |
| 860 | # Default value will be provided if developers don't specify. |
| 861 | }, |
| 862 | }, |
| 863 | "bottomLabel": "A String", # The text of the bottom label. Formatted text supported. |
| 864 | "icon": "A String", # An enum value that will be replaced by the Chat API with the |
| 865 | # corresponding icon image. |
| 866 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. Only the top label, bottom label and content region |
| 867 | # are clickable. |
| 868 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 869 | "url": "A String", # The URL to open. |
| 870 | }, |
| 871 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 872 | # For example, an Apps Script can be invoked to handle the form. |
| 873 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 874 | # form submission. This information is echoed back to the bot as part of |
| 875 | # the card click event. The same method name can be used for several |
| 876 | # elements that trigger a common behavior if desired. |
| 877 | "parameters": [ # List of action parameters. |
| 878 | { # List of string parameters to supply when the action method is invoked. |
| 879 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 880 | # snooze next week. You might use action method = snooze(), passing the |
| 881 | # snooze type and snooze time in the list of string parameters. |
| 882 | "key": "A String", # The name of the parameter for the action script. |
| 883 | "value": "A String", # The value of the parameter. |
| 884 | }, |
| 885 | ], |
| 886 | }, |
| 887 | }, |
| 888 | "contentMultiline": True or False, # If the content should be multiline. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 889 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 890 | "image": { # An image that is specified by a URL and can have an onclick action. # Display an image in this widget. |
| 891 | "aspectRatio": 3.14, # The aspect ratio of this image (width/height). This field allows clients |
| 892 | # to reserve the right height for the image while waiting for it to load. |
| 893 | # It's not meant to override the native aspect ratio of the image. |
| 894 | # If unset, the server fills it by prefetching the image. |
| 895 | "imageUrl": "A String", # The URL of the image. |
| 896 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 897 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 898 | "url": "A String", # The URL to open. |
| 899 | }, |
| 900 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 901 | # For example, an Apps Script can be invoked to handle the form. |
| 902 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 903 | # form submission. This information is echoed back to the bot as part of |
| 904 | # the card click event. The same method name can be used for several |
| 905 | # elements that trigger a common behavior if desired. |
| 906 | "parameters": [ # List of action parameters. |
| 907 | { # List of string parameters to supply when the action method is invoked. |
| 908 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 909 | # snooze next week. You might use action method = snooze(), passing the |
| 910 | # snooze type and snooze time in the list of string parameters. |
| 911 | "key": "A String", # The name of the parameter for the action script. |
| 912 | "value": "A String", # The value of the parameter. |
| 913 | }, |
| 914 | ], |
| 915 | }, |
| 916 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 917 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 918 | "buttons": [ # A list of buttons. Buttons is also oneof data and only one of these |
| 919 | # fields should be set. |
| 920 | { # A button. Can be a text button or an image button. |
| 921 | "textButton": { # A button with text and onclick action. # A button with text and onclick action. |
| 922 | "text": "A String", # The text of the button. |
| 923 | "onClick": { # An onclick action (e.g. open a link). # The onclick action of the button. |
| 924 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 925 | "url": "A String", # The URL to open. |
| 926 | }, |
| 927 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 928 | # For example, an Apps Script can be invoked to handle the form. |
| 929 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 930 | # form submission. This information is echoed back to the bot as part of |
| 931 | # the card click event. The same method name can be used for several |
| 932 | # elements that trigger a common behavior if desired. |
| 933 | "parameters": [ # List of action parameters. |
| 934 | { # List of string parameters to supply when the action method is invoked. |
| 935 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 936 | # snooze next week. You might use action method = snooze(), passing the |
| 937 | # snooze type and snooze time in the list of string parameters. |
| 938 | "key": "A String", # The name of the parameter for the action script. |
| 939 | "value": "A String", # The value of the parameter. |
| 940 | }, |
| 941 | ], |
| 942 | }, |
| 943 | }, |
| 944 | }, |
| 945 | "imageButton": { # An image button with an onclick action. # A button with image and onclick action. |
| 946 | "icon": "A String", # The icon specified by an enum that indices to an icon provided by Chat |
| 947 | # API. |
| 948 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 949 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 950 | "url": "A String", # The URL to open. |
| 951 | }, |
| 952 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 953 | # For example, an Apps Script can be invoked to handle the form. |
| 954 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 955 | # form submission. This information is echoed back to the bot as part of |
| 956 | # the card click event. The same method name can be used for several |
| 957 | # elements that trigger a common behavior if desired. |
| 958 | "parameters": [ # List of action parameters. |
| 959 | { # List of string parameters to supply when the action method is invoked. |
| 960 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 961 | # snooze next week. You might use action method = snooze(), passing the |
| 962 | # snooze type and snooze time in the list of string parameters. |
| 963 | "key": "A String", # The name of the parameter for the action script. |
| 964 | "value": "A String", # The value of the parameter. |
| 965 | }, |
| 966 | ], |
| 967 | }, |
| 968 | }, |
| 969 | "iconUrl": "A String", # The icon specified by a URL. |
| 970 | "name": "A String", # The name of this image_button which will be used for accessibility. |
| 971 | # Default value will be provided if developers don't specify. |
| 972 | }, |
| 973 | }, |
| 974 | ], |
| 975 | }, |
| 976 | ], |
| 977 | }, |
| 978 | ], |
| 979 | "cardActions": [ # The actions of this card. |
| 980 | { # A card action is |
| 981 | # the action associated with the card. For an invoice card, a |
| 982 | # typical action would be: delete invoice, email invoice or open the |
| 983 | # invoice in browser. |
| 984 | "actionLabel": "A String", # The label used to be displayed in the action menu item. |
| 985 | "onClick": { # An onclick action (e.g. open a link). # The onclick action for this action item. |
| 986 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 987 | "url": "A String", # The URL to open. |
| 988 | }, |
| 989 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 990 | # For example, an Apps Script can be invoked to handle the form. |
| 991 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 992 | # form submission. This information is echoed back to the bot as part of |
| 993 | # the card click event. The same method name can be used for several |
| 994 | # elements that trigger a common behavior if desired. |
| 995 | "parameters": [ # List of action parameters. |
| 996 | { # List of string parameters to supply when the action method is invoked. |
| 997 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 998 | # snooze next week. You might use action method = snooze(), passing the |
| 999 | # snooze type and snooze time in the list of string parameters. |
| 1000 | "key": "A String", # The name of the parameter for the action script. |
| 1001 | "value": "A String", # The value of the parameter. |
| 1002 | }, |
| 1003 | ], |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1004 | }, |
| 1005 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1006 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1007 | ], |
| 1008 | "header": { # The header of the card. A header usually contains a title and an image. |
| 1009 | "subtitle": "A String", # The subtitle of the card header. |
| 1010 | "imageUrl": "A String", # The URL of the image in the card header. |
| 1011 | "imageStyle": "A String", # The image's type (e.g. square border or circular border). |
| 1012 | "title": "A String", # The title must be specified. The header has a fixed height: if both a |
| 1013 | # title and subtitle is specified, each will take up 1 line. If only the |
| 1014 | # title is specified, it will take up both lines. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1015 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1016 | "name": "A String", # Name of the card. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1017 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1018 | ], |
| 1019 | "sender": { # A user in Hangouts Chat. # The user who created the message. |
| 1020 | "type": "A String", # User type. |
| 1021 | "domainId": "A String", # Obfuscated domain information. |
| 1022 | "name": "A String", # Resource name, in the format "users/*". |
| 1023 | "displayName": "A String", # The user's display name. |
| 1024 | }, |
| 1025 | "thread": { # A thread in Hangouts Chat. # The thread the message belongs to. |
| 1026 | "name": "A String", # Resource name, in the form "spaces/*/threads/*". |
| 1027 | # |
| 1028 | # Example: spaces/AAAAMpdlehY/threads/UMxbHmzDlr4 |
| 1029 | }, |
| 1030 | "annotations": [ # Output only. Annotations associated with the text in this message. |
| 1031 | { # Annotations associated with the plain-text body of the message. |
| 1032 | # |
| 1033 | # Example plain-text message body: |
| 1034 | # ``` |
| 1035 | # Hello @FooBot how are you!" |
| 1036 | # ``` |
| 1037 | # |
| 1038 | # The corresponding annotations metadata: |
| 1039 | # ``` |
| 1040 | # "annotations":[{ |
| 1041 | # "type":"USER_MENTION", |
| 1042 | # "startIndex":6, |
| 1043 | # "length":7, |
| 1044 | # "userMention": { |
| 1045 | # "user": { |
| 1046 | # "name":"users/107946847022116401880", |
| 1047 | # "displayName":"FooBot", |
| 1048 | # "avatarUrl":"https://goo.gl/aeDtrS", |
| 1049 | # "type":"BOT" |
| 1050 | # }, |
| 1051 | # "type":"MENTION" |
| 1052 | # } |
| 1053 | # }] |
| 1054 | # ``` |
| 1055 | "type": "A String", # The type of this annotation. |
| 1056 | "length": 42, # Length of the substring in the plain-text message body this annotation |
| 1057 | # corresponds to. |
| 1058 | "startIndex": 42, # Start index (0-based, inclusive) in the plain-text message body this |
| 1059 | # annotation corresponds to. |
| 1060 | "userMention": { # Annotation metadata for user mentions (@). # The metadata of user mention. |
| 1061 | "type": "A String", # The type of user mention. |
| 1062 | "user": { # A user in Hangouts Chat. # The user mentioned. |
| 1063 | "type": "A String", # User type. |
| 1064 | "domainId": "A String", # Obfuscated domain information. |
| 1065 | "name": "A String", # Resource name, in the format "users/*". |
| 1066 | "displayName": "A String", # The user's display name. |
| 1067 | }, |
| 1068 | }, |
| 1069 | }, |
| 1070 | ], |
| 1071 | "name": "A String", # Resource name, in the form "spaces/*/messages/*". |
| 1072 | # |
| 1073 | # Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 |
| 1074 | "previewText": "A String", # Text for generating preview chips. This text will not be displayed to the |
| 1075 | # user, but any links to images, web pages, videos, etc. included here will |
| 1076 | # generate preview chips. |
| 1077 | "space": { # A room or DM in Hangouts Chat. # The space the message belongs to. |
| 1078 | "type": "A String", # Output only. The type of a space. |
| 1079 | # This is deprecated. Use `single_user_bot_dm` instead. |
| 1080 | "singleUserBotDm": True or False, # Whether the space is a DM between a bot and a single human. |
| 1081 | "name": "A String", # Resource name of the space, in the form "spaces/*". |
| 1082 | # |
| 1083 | # Example: spaces/AAAAMpdlehYs |
| 1084 | "threaded": True or False, # Whether the messages are threaded in this space. |
| 1085 | "displayName": "A String", # Output only. The display name (only if the space is a room). |
| 1086 | }, |
| 1087 | "text": "A String", # Plain-text body of the message. |
| 1088 | "argumentText": "A String", # Plain-text body of the message with all bot mentions stripped out. |
| 1089 | "fallbackText": "A String", # A plain-text description of the message's cards, used when the actual cards |
| 1090 | # cannot be displayed (e.g. mobile notifications). |
| 1091 | "actionResponse": { # Parameters that a bot can use to configure how it's response is posted. # Input only. Parameters that a bot can use to configure how its response is |
| 1092 | # posted. |
| 1093 | "type": "A String", # The type of bot response. |
| 1094 | "url": "A String", # URL for users to auth or config. (Only for REQUEST_CONFIG response types.) |
| 1095 | }, |
| 1096 | "createTime": "A String", # Output only. The time at which the message was created in Hangouts Chat |
| 1097 | # server. |
| 1098 | }</pre> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1099 | </div> |
| 1100 | |
| 1101 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1102 | <code class="details" id="update">update(name, body=None, updateMask=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1103 | <pre>Updates a message. |
| 1104 | |
| 1105 | Args: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1106 | name: string, Resource name, in the form "spaces/*/messages/*". |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1107 | |
| 1108 | Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1109 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1110 | The object takes the form of: |
| 1111 | |
| 1112 | { # A message in Hangouts Chat. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1113 | "cards": [ # Rich, formatted and interactive cards that can be used to display UI |
| 1114 | # elements such as: formatted texts, buttons, clickable images. Cards are |
| 1115 | # normally displayed below the plain-text body of the message. |
| 1116 | { # A card is a UI element that can contain UI widgets such as texts, images. |
| 1117 | "sections": [ # Sections are separated by a line divider. |
| 1118 | { # A section contains a collection of widgets that are rendered |
| 1119 | # (vertically) in the order that they are specified. Across all platforms, |
| 1120 | # cards have a narrow fixed width, so |
| 1121 | # there is currently no need for layout properties (e.g. float). |
| 1122 | "header": "A String", # The header of the section, text formatted supported. |
| 1123 | "widgets": [ # A section must contain at least 1 widget. |
| 1124 | { # A widget is a UI element that presents texts, images, etc. |
| 1125 | "textParagraph": { # A paragraph of text. Formatted text supported. # Display a text paragraph in this widget. |
| 1126 | "text": "A String", |
| 1127 | }, |
| 1128 | "keyValue": { # A UI element contains a key (label) and a value (content). And this # Display a key value item in this widget. |
| 1129 | # element may also contain some actions such as onclick button. |
| 1130 | "topLabel": "A String", # The text of the top label. Formatted text supported. |
| 1131 | "iconUrl": "A String", # The icon specified by a URL. |
| 1132 | "content": "A String", # The text of the content. Formatted text supported and always required. |
| 1133 | "button": { # A button. Can be a text button or an image button. # A button that can be clicked to trigger an action. |
| 1134 | "textButton": { # A button with text and onclick action. # A button with text and onclick action. |
| 1135 | "text": "A String", # The text of the button. |
| 1136 | "onClick": { # An onclick action (e.g. open a link). # The onclick action of the button. |
| 1137 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 1138 | "url": "A String", # The URL to open. |
| 1139 | }, |
| 1140 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 1141 | # For example, an Apps Script can be invoked to handle the form. |
| 1142 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 1143 | # form submission. This information is echoed back to the bot as part of |
| 1144 | # the card click event. The same method name can be used for several |
| 1145 | # elements that trigger a common behavior if desired. |
| 1146 | "parameters": [ # List of action parameters. |
| 1147 | { # List of string parameters to supply when the action method is invoked. |
| 1148 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 1149 | # snooze next week. You might use action method = snooze(), passing the |
| 1150 | # snooze type and snooze time in the list of string parameters. |
| 1151 | "key": "A String", # The name of the parameter for the action script. |
| 1152 | "value": "A String", # The value of the parameter. |
| 1153 | }, |
| 1154 | ], |
| 1155 | }, |
| 1156 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1157 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1158 | "imageButton": { # An image button with an onclick action. # A button with image and onclick action. |
| 1159 | "icon": "A String", # The icon specified by an enum that indices to an icon provided by Chat |
| 1160 | # API. |
| 1161 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 1162 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 1163 | "url": "A String", # The URL to open. |
| 1164 | }, |
| 1165 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 1166 | # For example, an Apps Script can be invoked to handle the form. |
| 1167 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 1168 | # form submission. This information is echoed back to the bot as part of |
| 1169 | # the card click event. The same method name can be used for several |
| 1170 | # elements that trigger a common behavior if desired. |
| 1171 | "parameters": [ # List of action parameters. |
| 1172 | { # List of string parameters to supply when the action method is invoked. |
| 1173 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 1174 | # snooze next week. You might use action method = snooze(), passing the |
| 1175 | # snooze type and snooze time in the list of string parameters. |
| 1176 | "key": "A String", # The name of the parameter for the action script. |
| 1177 | "value": "A String", # The value of the parameter. |
| 1178 | }, |
| 1179 | ], |
| 1180 | }, |
| 1181 | }, |
| 1182 | "iconUrl": "A String", # The icon specified by a URL. |
| 1183 | "name": "A String", # The name of this image_button which will be used for accessibility. |
| 1184 | # Default value will be provided if developers don't specify. |
| 1185 | }, |
| 1186 | }, |
| 1187 | "bottomLabel": "A String", # The text of the bottom label. Formatted text supported. |
| 1188 | "icon": "A String", # An enum value that will be replaced by the Chat API with the |
| 1189 | # corresponding icon image. |
| 1190 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. Only the top label, bottom label and content region |
| 1191 | # are clickable. |
| 1192 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 1193 | "url": "A String", # The URL to open. |
| 1194 | }, |
| 1195 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 1196 | # For example, an Apps Script can be invoked to handle the form. |
| 1197 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 1198 | # form submission. This information is echoed back to the bot as part of |
| 1199 | # the card click event. The same method name can be used for several |
| 1200 | # elements that trigger a common behavior if desired. |
| 1201 | "parameters": [ # List of action parameters. |
| 1202 | { # List of string parameters to supply when the action method is invoked. |
| 1203 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 1204 | # snooze next week. You might use action method = snooze(), passing the |
| 1205 | # snooze type and snooze time in the list of string parameters. |
| 1206 | "key": "A String", # The name of the parameter for the action script. |
| 1207 | "value": "A String", # The value of the parameter. |
| 1208 | }, |
| 1209 | ], |
| 1210 | }, |
| 1211 | }, |
| 1212 | "contentMultiline": True or False, # If the content should be multiline. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1213 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1214 | "image": { # An image that is specified by a URL and can have an onclick action. # Display an image in this widget. |
| 1215 | "aspectRatio": 3.14, # The aspect ratio of this image (width/height). This field allows clients |
| 1216 | # to reserve the right height for the image while waiting for it to load. |
| 1217 | # It's not meant to override the native aspect ratio of the image. |
| 1218 | # If unset, the server fills it by prefetching the image. |
| 1219 | "imageUrl": "A String", # The URL of the image. |
| 1220 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 1221 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 1222 | "url": "A String", # The URL to open. |
| 1223 | }, |
| 1224 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 1225 | # For example, an Apps Script can be invoked to handle the form. |
| 1226 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 1227 | # form submission. This information is echoed back to the bot as part of |
| 1228 | # the card click event. The same method name can be used for several |
| 1229 | # elements that trigger a common behavior if desired. |
| 1230 | "parameters": [ # List of action parameters. |
| 1231 | { # List of string parameters to supply when the action method is invoked. |
| 1232 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 1233 | # snooze next week. You might use action method = snooze(), passing the |
| 1234 | # snooze type and snooze time in the list of string parameters. |
| 1235 | "key": "A String", # The name of the parameter for the action script. |
| 1236 | "value": "A String", # The value of the parameter. |
| 1237 | }, |
| 1238 | ], |
| 1239 | }, |
| 1240 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1241 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1242 | "buttons": [ # A list of buttons. Buttons is also oneof data and only one of these |
| 1243 | # fields should be set. |
| 1244 | { # A button. Can be a text button or an image button. |
| 1245 | "textButton": { # A button with text and onclick action. # A button with text and onclick action. |
| 1246 | "text": "A String", # The text of the button. |
| 1247 | "onClick": { # An onclick action (e.g. open a link). # The onclick action of the button. |
| 1248 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 1249 | "url": "A String", # The URL to open. |
| 1250 | }, |
| 1251 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 1252 | # For example, an Apps Script can be invoked to handle the form. |
| 1253 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 1254 | # form submission. This information is echoed back to the bot as part of |
| 1255 | # the card click event. The same method name can be used for several |
| 1256 | # elements that trigger a common behavior if desired. |
| 1257 | "parameters": [ # List of action parameters. |
| 1258 | { # List of string parameters to supply when the action method is invoked. |
| 1259 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 1260 | # snooze next week. You might use action method = snooze(), passing the |
| 1261 | # snooze type and snooze time in the list of string parameters. |
| 1262 | "key": "A String", # The name of the parameter for the action script. |
| 1263 | "value": "A String", # The value of the parameter. |
| 1264 | }, |
| 1265 | ], |
| 1266 | }, |
| 1267 | }, |
| 1268 | }, |
| 1269 | "imageButton": { # An image button with an onclick action. # A button with image and onclick action. |
| 1270 | "icon": "A String", # The icon specified by an enum that indices to an icon provided by Chat |
| 1271 | # API. |
| 1272 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 1273 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 1274 | "url": "A String", # The URL to open. |
| 1275 | }, |
| 1276 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 1277 | # For example, an Apps Script can be invoked to handle the form. |
| 1278 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 1279 | # form submission. This information is echoed back to the bot as part of |
| 1280 | # the card click event. The same method name can be used for several |
| 1281 | # elements that trigger a common behavior if desired. |
| 1282 | "parameters": [ # List of action parameters. |
| 1283 | { # List of string parameters to supply when the action method is invoked. |
| 1284 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 1285 | # snooze next week. You might use action method = snooze(), passing the |
| 1286 | # snooze type and snooze time in the list of string parameters. |
| 1287 | "key": "A String", # The name of the parameter for the action script. |
| 1288 | "value": "A String", # The value of the parameter. |
| 1289 | }, |
| 1290 | ], |
| 1291 | }, |
| 1292 | }, |
| 1293 | "iconUrl": "A String", # The icon specified by a URL. |
| 1294 | "name": "A String", # The name of this image_button which will be used for accessibility. |
| 1295 | # Default value will be provided if developers don't specify. |
| 1296 | }, |
| 1297 | }, |
| 1298 | ], |
| 1299 | }, |
| 1300 | ], |
| 1301 | }, |
| 1302 | ], |
| 1303 | "cardActions": [ # The actions of this card. |
| 1304 | { # A card action is |
| 1305 | # the action associated with the card. For an invoice card, a |
| 1306 | # typical action would be: delete invoice, email invoice or open the |
| 1307 | # invoice in browser. |
| 1308 | "actionLabel": "A String", # The label used to be displayed in the action menu item. |
| 1309 | "onClick": { # An onclick action (e.g. open a link). # The onclick action for this action item. |
| 1310 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 1311 | "url": "A String", # The URL to open. |
| 1312 | }, |
| 1313 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 1314 | # For example, an Apps Script can be invoked to handle the form. |
| 1315 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 1316 | # form submission. This information is echoed back to the bot as part of |
| 1317 | # the card click event. The same method name can be used for several |
| 1318 | # elements that trigger a common behavior if desired. |
| 1319 | "parameters": [ # List of action parameters. |
| 1320 | { # List of string parameters to supply when the action method is invoked. |
| 1321 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 1322 | # snooze next week. You might use action method = snooze(), passing the |
| 1323 | # snooze type and snooze time in the list of string parameters. |
| 1324 | "key": "A String", # The name of the parameter for the action script. |
| 1325 | "value": "A String", # The value of the parameter. |
| 1326 | }, |
| 1327 | ], |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1328 | }, |
| 1329 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1330 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1331 | ], |
| 1332 | "header": { # The header of the card. A header usually contains a title and an image. |
| 1333 | "subtitle": "A String", # The subtitle of the card header. |
| 1334 | "imageUrl": "A String", # The URL of the image in the card header. |
| 1335 | "imageStyle": "A String", # The image's type (e.g. square border or circular border). |
| 1336 | "title": "A String", # The title must be specified. The header has a fixed height: if both a |
| 1337 | # title and subtitle is specified, each will take up 1 line. If only the |
| 1338 | # title is specified, it will take up both lines. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1339 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1340 | "name": "A String", # Name of the card. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1341 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1342 | ], |
| 1343 | "sender": { # A user in Hangouts Chat. # The user who created the message. |
| 1344 | "type": "A String", # User type. |
| 1345 | "domainId": "A String", # Obfuscated domain information. |
| 1346 | "name": "A String", # Resource name, in the format "users/*". |
| 1347 | "displayName": "A String", # The user's display name. |
| 1348 | }, |
| 1349 | "thread": { # A thread in Hangouts Chat. # The thread the message belongs to. |
| 1350 | "name": "A String", # Resource name, in the form "spaces/*/threads/*". |
| 1351 | # |
| 1352 | # Example: spaces/AAAAMpdlehY/threads/UMxbHmzDlr4 |
| 1353 | }, |
| 1354 | "annotations": [ # Output only. Annotations associated with the text in this message. |
| 1355 | { # Annotations associated with the plain-text body of the message. |
| 1356 | # |
| 1357 | # Example plain-text message body: |
| 1358 | # ``` |
| 1359 | # Hello @FooBot how are you!" |
| 1360 | # ``` |
| 1361 | # |
| 1362 | # The corresponding annotations metadata: |
| 1363 | # ``` |
| 1364 | # "annotations":[{ |
| 1365 | # "type":"USER_MENTION", |
| 1366 | # "startIndex":6, |
| 1367 | # "length":7, |
| 1368 | # "userMention": { |
| 1369 | # "user": { |
| 1370 | # "name":"users/107946847022116401880", |
| 1371 | # "displayName":"FooBot", |
| 1372 | # "avatarUrl":"https://goo.gl/aeDtrS", |
| 1373 | # "type":"BOT" |
| 1374 | # }, |
| 1375 | # "type":"MENTION" |
| 1376 | # } |
| 1377 | # }] |
| 1378 | # ``` |
| 1379 | "type": "A String", # The type of this annotation. |
| 1380 | "length": 42, # Length of the substring in the plain-text message body this annotation |
| 1381 | # corresponds to. |
| 1382 | "startIndex": 42, # Start index (0-based, inclusive) in the plain-text message body this |
| 1383 | # annotation corresponds to. |
| 1384 | "userMention": { # Annotation metadata for user mentions (@). # The metadata of user mention. |
| 1385 | "type": "A String", # The type of user mention. |
| 1386 | "user": { # A user in Hangouts Chat. # The user mentioned. |
| 1387 | "type": "A String", # User type. |
| 1388 | "domainId": "A String", # Obfuscated domain information. |
| 1389 | "name": "A String", # Resource name, in the format "users/*". |
| 1390 | "displayName": "A String", # The user's display name. |
| 1391 | }, |
| 1392 | }, |
| 1393 | }, |
| 1394 | ], |
| 1395 | "name": "A String", # Resource name, in the form "spaces/*/messages/*". |
| 1396 | # |
| 1397 | # Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 |
| 1398 | "previewText": "A String", # Text for generating preview chips. This text will not be displayed to the |
| 1399 | # user, but any links to images, web pages, videos, etc. included here will |
| 1400 | # generate preview chips. |
| 1401 | "space": { # A room or DM in Hangouts Chat. # The space the message belongs to. |
| 1402 | "type": "A String", # Output only. The type of a space. |
| 1403 | # This is deprecated. Use `single_user_bot_dm` instead. |
| 1404 | "singleUserBotDm": True or False, # Whether the space is a DM between a bot and a single human. |
| 1405 | "name": "A String", # Resource name of the space, in the form "spaces/*". |
| 1406 | # |
| 1407 | # Example: spaces/AAAAMpdlehYs |
| 1408 | "threaded": True or False, # Whether the messages are threaded in this space. |
| 1409 | "displayName": "A String", # Output only. The display name (only if the space is a room). |
| 1410 | }, |
| 1411 | "text": "A String", # Plain-text body of the message. |
| 1412 | "argumentText": "A String", # Plain-text body of the message with all bot mentions stripped out. |
| 1413 | "fallbackText": "A String", # A plain-text description of the message's cards, used when the actual cards |
| 1414 | # cannot be displayed (e.g. mobile notifications). |
| 1415 | "actionResponse": { # Parameters that a bot can use to configure how it's response is posted. # Input only. Parameters that a bot can use to configure how its response is |
| 1416 | # posted. |
| 1417 | "type": "A String", # The type of bot response. |
| 1418 | "url": "A String", # URL for users to auth or config. (Only for REQUEST_CONFIG response types.) |
| 1419 | }, |
| 1420 | "createTime": "A String", # Output only. The time at which the message was created in Hangouts Chat |
| 1421 | # server. |
| 1422 | } |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1423 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1424 | updateMask: string, Required. The field paths to be updated, comma separated if there are |
| 1425 | multiple. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1426 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1427 | Currently supported field paths: |
| 1428 | * text |
| 1429 | * cards |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1430 | x__xgafv: string, V1 error format. |
| 1431 | Allowed values |
| 1432 | 1 - v1 error format |
| 1433 | 2 - v2 error format |
| 1434 | |
| 1435 | Returns: |
| 1436 | An object of the form: |
| 1437 | |
| 1438 | { # A message in Hangouts Chat. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1439 | "cards": [ # Rich, formatted and interactive cards that can be used to display UI |
| 1440 | # elements such as: formatted texts, buttons, clickable images. Cards are |
| 1441 | # normally displayed below the plain-text body of the message. |
| 1442 | { # A card is a UI element that can contain UI widgets such as texts, images. |
| 1443 | "sections": [ # Sections are separated by a line divider. |
| 1444 | { # A section contains a collection of widgets that are rendered |
| 1445 | # (vertically) in the order that they are specified. Across all platforms, |
| 1446 | # cards have a narrow fixed width, so |
| 1447 | # there is currently no need for layout properties (e.g. float). |
| 1448 | "header": "A String", # The header of the section, text formatted supported. |
| 1449 | "widgets": [ # A section must contain at least 1 widget. |
| 1450 | { # A widget is a UI element that presents texts, images, etc. |
| 1451 | "textParagraph": { # A paragraph of text. Formatted text supported. # Display a text paragraph in this widget. |
| 1452 | "text": "A String", |
| 1453 | }, |
| 1454 | "keyValue": { # A UI element contains a key (label) and a value (content). And this # Display a key value item in this widget. |
| 1455 | # element may also contain some actions such as onclick button. |
| 1456 | "topLabel": "A String", # The text of the top label. Formatted text supported. |
| 1457 | "iconUrl": "A String", # The icon specified by a URL. |
| 1458 | "content": "A String", # The text of the content. Formatted text supported and always required. |
| 1459 | "button": { # A button. Can be a text button or an image button. # A button that can be clicked to trigger an action. |
| 1460 | "textButton": { # A button with text and onclick action. # A button with text and onclick action. |
| 1461 | "text": "A String", # The text of the button. |
| 1462 | "onClick": { # An onclick action (e.g. open a link). # The onclick action of the button. |
| 1463 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 1464 | "url": "A String", # The URL to open. |
| 1465 | }, |
| 1466 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 1467 | # For example, an Apps Script can be invoked to handle the form. |
| 1468 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 1469 | # form submission. This information is echoed back to the bot as part of |
| 1470 | # the card click event. The same method name can be used for several |
| 1471 | # elements that trigger a common behavior if desired. |
| 1472 | "parameters": [ # List of action parameters. |
| 1473 | { # List of string parameters to supply when the action method is invoked. |
| 1474 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 1475 | # snooze next week. You might use action method = snooze(), passing the |
| 1476 | # snooze type and snooze time in the list of string parameters. |
| 1477 | "key": "A String", # The name of the parameter for the action script. |
| 1478 | "value": "A String", # The value of the parameter. |
| 1479 | }, |
| 1480 | ], |
| 1481 | }, |
| 1482 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1483 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1484 | "imageButton": { # An image button with an onclick action. # A button with image and onclick action. |
| 1485 | "icon": "A String", # The icon specified by an enum that indices to an icon provided by Chat |
| 1486 | # API. |
| 1487 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 1488 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 1489 | "url": "A String", # The URL to open. |
| 1490 | }, |
| 1491 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 1492 | # For example, an Apps Script can be invoked to handle the form. |
| 1493 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 1494 | # form submission. This information is echoed back to the bot as part of |
| 1495 | # the card click event. The same method name can be used for several |
| 1496 | # elements that trigger a common behavior if desired. |
| 1497 | "parameters": [ # List of action parameters. |
| 1498 | { # List of string parameters to supply when the action method is invoked. |
| 1499 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 1500 | # snooze next week. You might use action method = snooze(), passing the |
| 1501 | # snooze type and snooze time in the list of string parameters. |
| 1502 | "key": "A String", # The name of the parameter for the action script. |
| 1503 | "value": "A String", # The value of the parameter. |
| 1504 | }, |
| 1505 | ], |
| 1506 | }, |
| 1507 | }, |
| 1508 | "iconUrl": "A String", # The icon specified by a URL. |
| 1509 | "name": "A String", # The name of this image_button which will be used for accessibility. |
| 1510 | # Default value will be provided if developers don't specify. |
| 1511 | }, |
| 1512 | }, |
| 1513 | "bottomLabel": "A String", # The text of the bottom label. Formatted text supported. |
| 1514 | "icon": "A String", # An enum value that will be replaced by the Chat API with the |
| 1515 | # corresponding icon image. |
| 1516 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. Only the top label, bottom label and content region |
| 1517 | # are clickable. |
| 1518 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 1519 | "url": "A String", # The URL to open. |
| 1520 | }, |
| 1521 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 1522 | # For example, an Apps Script can be invoked to handle the form. |
| 1523 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 1524 | # form submission. This information is echoed back to the bot as part of |
| 1525 | # the card click event. The same method name can be used for several |
| 1526 | # elements that trigger a common behavior if desired. |
| 1527 | "parameters": [ # List of action parameters. |
| 1528 | { # List of string parameters to supply when the action method is invoked. |
| 1529 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 1530 | # snooze next week. You might use action method = snooze(), passing the |
| 1531 | # snooze type and snooze time in the list of string parameters. |
| 1532 | "key": "A String", # The name of the parameter for the action script. |
| 1533 | "value": "A String", # The value of the parameter. |
| 1534 | }, |
| 1535 | ], |
| 1536 | }, |
| 1537 | }, |
| 1538 | "contentMultiline": True or False, # If the content should be multiline. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1539 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1540 | "image": { # An image that is specified by a URL and can have an onclick action. # Display an image in this widget. |
| 1541 | "aspectRatio": 3.14, # The aspect ratio of this image (width/height). This field allows clients |
| 1542 | # to reserve the right height for the image while waiting for it to load. |
| 1543 | # It's not meant to override the native aspect ratio of the image. |
| 1544 | # If unset, the server fills it by prefetching the image. |
| 1545 | "imageUrl": "A String", # The URL of the image. |
| 1546 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 1547 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 1548 | "url": "A String", # The URL to open. |
| 1549 | }, |
| 1550 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 1551 | # For example, an Apps Script can be invoked to handle the form. |
| 1552 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 1553 | # form submission. This information is echoed back to the bot as part of |
| 1554 | # the card click event. The same method name can be used for several |
| 1555 | # elements that trigger a common behavior if desired. |
| 1556 | "parameters": [ # List of action parameters. |
| 1557 | { # List of string parameters to supply when the action method is invoked. |
| 1558 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 1559 | # snooze next week. You might use action method = snooze(), passing the |
| 1560 | # snooze type and snooze time in the list of string parameters. |
| 1561 | "key": "A String", # The name of the parameter for the action script. |
| 1562 | "value": "A String", # The value of the parameter. |
| 1563 | }, |
| 1564 | ], |
| 1565 | }, |
| 1566 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1567 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1568 | "buttons": [ # A list of buttons. Buttons is also oneof data and only one of these |
| 1569 | # fields should be set. |
| 1570 | { # A button. Can be a text button or an image button. |
| 1571 | "textButton": { # A button with text and onclick action. # A button with text and onclick action. |
| 1572 | "text": "A String", # The text of the button. |
| 1573 | "onClick": { # An onclick action (e.g. open a link). # The onclick action of the button. |
| 1574 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 1575 | "url": "A String", # The URL to open. |
| 1576 | }, |
| 1577 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 1578 | # For example, an Apps Script can be invoked to handle the form. |
| 1579 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 1580 | # form submission. This information is echoed back to the bot as part of |
| 1581 | # the card click event. The same method name can be used for several |
| 1582 | # elements that trigger a common behavior if desired. |
| 1583 | "parameters": [ # List of action parameters. |
| 1584 | { # List of string parameters to supply when the action method is invoked. |
| 1585 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 1586 | # snooze next week. You might use action method = snooze(), passing the |
| 1587 | # snooze type and snooze time in the list of string parameters. |
| 1588 | "key": "A String", # The name of the parameter for the action script. |
| 1589 | "value": "A String", # The value of the parameter. |
| 1590 | }, |
| 1591 | ], |
| 1592 | }, |
| 1593 | }, |
| 1594 | }, |
| 1595 | "imageButton": { # An image button with an onclick action. # A button with image and onclick action. |
| 1596 | "icon": "A String", # The icon specified by an enum that indices to an icon provided by Chat |
| 1597 | # API. |
| 1598 | "onClick": { # An onclick action (e.g. open a link). # The onclick action. |
| 1599 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 1600 | "url": "A String", # The URL to open. |
| 1601 | }, |
| 1602 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 1603 | # For example, an Apps Script can be invoked to handle the form. |
| 1604 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 1605 | # form submission. This information is echoed back to the bot as part of |
| 1606 | # the card click event. The same method name can be used for several |
| 1607 | # elements that trigger a common behavior if desired. |
| 1608 | "parameters": [ # List of action parameters. |
| 1609 | { # List of string parameters to supply when the action method is invoked. |
| 1610 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 1611 | # snooze next week. You might use action method = snooze(), passing the |
| 1612 | # snooze type and snooze time in the list of string parameters. |
| 1613 | "key": "A String", # The name of the parameter for the action script. |
| 1614 | "value": "A String", # The value of the parameter. |
| 1615 | }, |
| 1616 | ], |
| 1617 | }, |
| 1618 | }, |
| 1619 | "iconUrl": "A String", # The icon specified by a URL. |
| 1620 | "name": "A String", # The name of this image_button which will be used for accessibility. |
| 1621 | # Default value will be provided if developers don't specify. |
| 1622 | }, |
| 1623 | }, |
| 1624 | ], |
| 1625 | }, |
| 1626 | ], |
| 1627 | }, |
| 1628 | ], |
| 1629 | "cardActions": [ # The actions of this card. |
| 1630 | { # A card action is |
| 1631 | # the action associated with the card. For an invoice card, a |
| 1632 | # typical action would be: delete invoice, email invoice or open the |
| 1633 | # invoice in browser. |
| 1634 | "actionLabel": "A String", # The label used to be displayed in the action menu item. |
| 1635 | "onClick": { # An onclick action (e.g. open a link). # The onclick action for this action item. |
| 1636 | "openLink": { # A link that opens a new window. # This onclick triggers an open link action if specified. |
| 1637 | "url": "A String", # The URL to open. |
| 1638 | }, |
| 1639 | "action": { # A form action describes the behavior when the form is submitted. # A form action will be trigger by this onclick if specified. |
| 1640 | # For example, an Apps Script can be invoked to handle the form. |
| 1641 | "actionMethodName": "A String", # The method name is used to identify which part of the form triggered the |
| 1642 | # form submission. This information is echoed back to the bot as part of |
| 1643 | # the card click event. The same method name can be used for several |
| 1644 | # elements that trigger a common behavior if desired. |
| 1645 | "parameters": [ # List of action parameters. |
| 1646 | { # List of string parameters to supply when the action method is invoked. |
| 1647 | # For example, consider three snooze buttons: snooze now, snooze 1 day, |
| 1648 | # snooze next week. You might use action method = snooze(), passing the |
| 1649 | # snooze type and snooze time in the list of string parameters. |
| 1650 | "key": "A String", # The name of the parameter for the action script. |
| 1651 | "value": "A String", # The value of the parameter. |
| 1652 | }, |
| 1653 | ], |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1654 | }, |
| 1655 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1656 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1657 | ], |
| 1658 | "header": { # The header of the card. A header usually contains a title and an image. |
| 1659 | "subtitle": "A String", # The subtitle of the card header. |
| 1660 | "imageUrl": "A String", # The URL of the image in the card header. |
| 1661 | "imageStyle": "A String", # The image's type (e.g. square border or circular border). |
| 1662 | "title": "A String", # The title must be specified. The header has a fixed height: if both a |
| 1663 | # title and subtitle is specified, each will take up 1 line. If only the |
| 1664 | # title is specified, it will take up both lines. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1665 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1666 | "name": "A String", # Name of the card. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1667 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1668 | ], |
| 1669 | "sender": { # A user in Hangouts Chat. # The user who created the message. |
| 1670 | "type": "A String", # User type. |
| 1671 | "domainId": "A String", # Obfuscated domain information. |
| 1672 | "name": "A String", # Resource name, in the format "users/*". |
| 1673 | "displayName": "A String", # The user's display name. |
| 1674 | }, |
| 1675 | "thread": { # A thread in Hangouts Chat. # The thread the message belongs to. |
| 1676 | "name": "A String", # Resource name, in the form "spaces/*/threads/*". |
| 1677 | # |
| 1678 | # Example: spaces/AAAAMpdlehY/threads/UMxbHmzDlr4 |
| 1679 | }, |
| 1680 | "annotations": [ # Output only. Annotations associated with the text in this message. |
| 1681 | { # Annotations associated with the plain-text body of the message. |
| 1682 | # |
| 1683 | # Example plain-text message body: |
| 1684 | # ``` |
| 1685 | # Hello @FooBot how are you!" |
| 1686 | # ``` |
| 1687 | # |
| 1688 | # The corresponding annotations metadata: |
| 1689 | # ``` |
| 1690 | # "annotations":[{ |
| 1691 | # "type":"USER_MENTION", |
| 1692 | # "startIndex":6, |
| 1693 | # "length":7, |
| 1694 | # "userMention": { |
| 1695 | # "user": { |
| 1696 | # "name":"users/107946847022116401880", |
| 1697 | # "displayName":"FooBot", |
| 1698 | # "avatarUrl":"https://goo.gl/aeDtrS", |
| 1699 | # "type":"BOT" |
| 1700 | # }, |
| 1701 | # "type":"MENTION" |
| 1702 | # } |
| 1703 | # }] |
| 1704 | # ``` |
| 1705 | "type": "A String", # The type of this annotation. |
| 1706 | "length": 42, # Length of the substring in the plain-text message body this annotation |
| 1707 | # corresponds to. |
| 1708 | "startIndex": 42, # Start index (0-based, inclusive) in the plain-text message body this |
| 1709 | # annotation corresponds to. |
| 1710 | "userMention": { # Annotation metadata for user mentions (@). # The metadata of user mention. |
| 1711 | "type": "A String", # The type of user mention. |
| 1712 | "user": { # A user in Hangouts Chat. # The user mentioned. |
| 1713 | "type": "A String", # User type. |
| 1714 | "domainId": "A String", # Obfuscated domain information. |
| 1715 | "name": "A String", # Resource name, in the format "users/*". |
| 1716 | "displayName": "A String", # The user's display name. |
| 1717 | }, |
| 1718 | }, |
| 1719 | }, |
| 1720 | ], |
| 1721 | "name": "A String", # Resource name, in the form "spaces/*/messages/*". |
| 1722 | # |
| 1723 | # Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 |
| 1724 | "previewText": "A String", # Text for generating preview chips. This text will not be displayed to the |
| 1725 | # user, but any links to images, web pages, videos, etc. included here will |
| 1726 | # generate preview chips. |
| 1727 | "space": { # A room or DM in Hangouts Chat. # The space the message belongs to. |
| 1728 | "type": "A String", # Output only. The type of a space. |
| 1729 | # This is deprecated. Use `single_user_bot_dm` instead. |
| 1730 | "singleUserBotDm": True or False, # Whether the space is a DM between a bot and a single human. |
| 1731 | "name": "A String", # Resource name of the space, in the form "spaces/*". |
| 1732 | # |
| 1733 | # Example: spaces/AAAAMpdlehYs |
| 1734 | "threaded": True or False, # Whether the messages are threaded in this space. |
| 1735 | "displayName": "A String", # Output only. The display name (only if the space is a room). |
| 1736 | }, |
| 1737 | "text": "A String", # Plain-text body of the message. |
| 1738 | "argumentText": "A String", # Plain-text body of the message with all bot mentions stripped out. |
| 1739 | "fallbackText": "A String", # A plain-text description of the message's cards, used when the actual cards |
| 1740 | # cannot be displayed (e.g. mobile notifications). |
| 1741 | "actionResponse": { # Parameters that a bot can use to configure how it's response is posted. # Input only. Parameters that a bot can use to configure how its response is |
| 1742 | # posted. |
| 1743 | "type": "A String", # The type of bot response. |
| 1744 | "url": "A String", # URL for users to auth or config. (Only for REQUEST_CONFIG response types.) |
| 1745 | }, |
| 1746 | "createTime": "A String", # Output only. The time at which the message was created in Hangouts Chat |
| 1747 | # server. |
| 1748 | }</pre> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1749 | </div> |
| 1750 | |
| 1751 | </body></html> |