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