blob: 840d1c09058809d77625b75a28149e4d2fa7cc42 [file] [log] [blame]
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<h1><a href="chat_v1.html">Google Chat API</a> . <a href="chat_v1.dms.html">dms</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="chat_v1.dms.conversations.html">conversations()</a></code>
</p>
<p class="firstline">Returns the conversations Resource.</p>
<p class="toc_element">
<code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
<code><a href="#messages">messages(parent, body=None, requestId=None, threadKey=None, x__xgafv=None)</a></code></p>
<p class="firstline">Legacy path for creating message. Calling these will result in a BadRequest response.</p>
<p class="toc_element">
<code><a href="#webhooks">webhooks(parent, body=None, requestId=None, threadKey=None, x__xgafv=None)</a></code></p>
<p class="firstline">Legacy path for creating message. Calling these will result in a BadRequest response.</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="close">close()</code>
<pre>Close httplib2 connections.</pre>
</div>
<div class="method">
<code class="details" id="messages">messages(parent, body=None, requestId=None, threadKey=None, x__xgafv=None)</code>
<pre>Legacy path for creating message. Calling these will result in a BadRequest response.
Args:
parent: string, Required. Space resource name, in the form &quot;spaces/*&quot;. Example: spaces/AAAAMpdlehY (required)
body: object, The request body.
The object takes the form of:
{ # A message in Google Chat.
&quot;actionResponse&quot;: { # Parameters that a bot can use to configure how it&#x27;s response is posted. # Input only. Parameters that a bot can use to configure how its response is posted.
&quot;dialogAction&quot;: { # Contains dialog if present as well as the ActionStatus for the request sent from user. # This response is for Dialog related events and must be accompanied by ResponseType.Dialog
&quot;actionStatus&quot;: { # ActionStatus represents status of a request from the bot developer&#x27;s side. In specific, for each request a bot gets, the bot developer will set both fields below in relation to what the response status and message related to status should be. # Status for either invoke dialog or submit dialog requests. This will be used to display a status and message to user if needed. For example in case of an error or success.
&quot;statusCode&quot;: &quot;A String&quot;, # The status code.
&quot;userFacingMessage&quot;: &quot;A String&quot;, # This message will be the corresponding string to the above status_code. If unset, an appropriate generic message based on the status_code will be shown to the user. If this field is set then the message will be surfaced to the user for both successes and errors.
},
&quot;dialog&quot;: { # Wrapper around the card body of the dialog. # Dialog for the request.
&quot;body&quot;: { # A card is a UI element that can contain UI widgets such as text and images. For more information, see Cards . For example, the following JSON creates a card that has a header with the name, position, icons, and link for a contact, followed by a section with contact information like email and phone number. ``` { &quot;header&quot;: { &quot;title&quot;: &quot;Heba Salam&quot;, &quot;subtitle&quot;: &quot;Software Engineer&quot;, &quot;imageStyle&quot;: &quot;ImageStyle.AVATAR&quot;, &quot;imageUrl&quot;: &quot;https://example.com/heba_salam.png&quot;, &quot;imageAltText&quot;: &quot;Avatar for Heba Salam&quot; }, &quot;sections&quot; : [ { &quot;header&quot;: &quot;Contact Info&quot;, &quot;widgets&quot;: [ { &quot;decorated_text&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;EMAIL&quot; }, &quot;content&quot;: &quot;heba.salam@example.com&quot; } }, { &quot;decoratedText&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;PERSON&quot; }, &quot;content&quot;: &quot;Online&quot; } }, { &quot;decoratedText&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;PHONE&quot; }, &quot;content&quot;: &quot;+1 (555) 555-1234&quot; } }, { &quot;buttons&quot;: [ { &quot;textButton&quot;: { &quot;text&quot;: &quot;Share&quot;, }, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/share&quot; } } }, { &quot;textButton&quot;: { &quot;text&quot;: &quot;Edit&quot;, }, &quot;onClick&quot;: { &quot;action&quot;: { &quot;function&quot;: &quot;goToView&quot;, &quot;parameters&quot;: [ { &quot;key&quot;: &quot;viewType&quot;, &quot;value&quot;: &quot;EDIT&quot; } ], &quot;loadIndicator&quot;: &quot;LoadIndicator.SPINNER&quot; } } } ] } ], &quot;collapsible&quot;: true, &quot;uncollapsibleWidgetsCount&quot;: 3 } ], &quot;cardActions&quot;: [ { &quot;actionLabel&quot;: &quot;Send Feedback&quot;, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/feedback&quot; } } } ], &quot;name&quot;: &quot;contact-card-K3wB6arF2H9L&quot; } ``` # Body of the dialog, which will be rendered in a modal. NOTE: The following fields within the objects are not supported: google.apps.card.v1.Widget.date_time_picker google.apps.card.v1.DecoratedText.SwitchControl.on_change_action google.apps.card.v1.TextInput.on_change_action google.apps.card.v1.SelectionInput.on_change_action google.apps.card.v1.DateTimePicker.on_change_action Setting the fields above will have no effect on the dialog.
&quot;cardActions&quot;: [ # The actions of this card. They are added to a card&#x27;s generated toolbar menu. For example, the following JSON constructs a card action menu with Settings and Send Feedback options: ``` &quot;card_actions&quot;: [ { &quot;actionLabel&quot;: &quot;Setting&quot;, &quot;onClick&quot;: { &quot;action&quot;: { &quot;functionName&quot;: &quot;goToView&quot;, &quot;parameters&quot;: [ { &quot;key&quot;: &quot;viewType&quot;, &quot;value&quot;: &quot;SETTING&quot; } ], &quot;loadIndicator&quot;: &quot;LoadIndicator.SPINNER&quot; } } }, { &quot;actionLabel&quot;: &quot;Send Feedback&quot;, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/feedback&quot; } } } ] ```
{ # A card action is the action associated with the card. For example, an invoice card might include actions such as delete invoice, email invoice, or open the invoice in a browser.
&quot;actionLabel&quot;: &quot;A String&quot;, # The label that displays as the action menu item.
&quot;onClick&quot;: { # The onclick action for this action item.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
],
&quot;displayStyle&quot;: &quot;A String&quot;, # The display style for peekCardHeader.
&quot;fixedFooter&quot;: { # A persistent (sticky) footer that is added to the bottom of the card. # The fixed footer shown at the bottom of this card.
&quot;primaryButton&quot;: { # A button. Can be a text button or an image button. # The primary button of the fixed footer. The button must be a text button with text and color set.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
&quot;secondaryButton&quot;: { # A button. Can be a text button or an image button. # The secondary button of the fixed footer. The button must be a text button with text and color set. `primaryButton` must be set if `secondaryButton` is set.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
},
&quot;header&quot;: { # The header of the card. A header usually contains a title and an image.
&quot;imageAltText&quot;: &quot;A String&quot;, # The alternative text of this image which is used for accessibility.
&quot;imageType&quot;: &quot;A String&quot;, # The image&#x27;s type.
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image in the card header.
&quot;subtitle&quot;: &quot;A String&quot;, # The subtitle of the card header.
&quot;title&quot;: &quot;A String&quot;, # The title of the card header. The title must be specified. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines.
},
&quot;name&quot;: &quot;A String&quot;, # Name of the card, which is used as a identifier for the card in card navigation.
&quot;peekCardHeader&quot;: { # When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards.
&quot;imageAltText&quot;: &quot;A String&quot;, # The alternative text of this image which is used for accessibility.
&quot;imageType&quot;: &quot;A String&quot;, # The image&#x27;s type.
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image in the card header.
&quot;subtitle&quot;: &quot;A String&quot;, # The subtitle of the card header.
&quot;title&quot;: &quot;A String&quot;, # The title of the card header. The title must be specified. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines.
},
&quot;sections&quot;: [ # Sections are separated by a line divider.
{ # A section contains a collection of widgets that are rendered vertically in the order that they are specified. Across all platforms, cards have a narrow fixed width, so there is currently no need for layout properties, for example, float.
&quot;collapsible&quot;: True or False, # Indicates whether this section is collapsible. If a section is collapsible, the description must be given.
&quot;header&quot;: &quot;A String&quot;, # The header of the section. Formatted text is supported.
&quot;uncollapsibleWidgetsCount&quot;: 42, # The number of uncollapsible widgets. For example, when a section contains five widgets and the `numUncollapsibleWidget` is set to `2`, the first two widgets are always shown and the last three are collapsed as default. The `numUncollapsibleWidget` is taken into account only when collapsible is set to `true`.
&quot;widgets&quot;: [ # A section must contain at least 1 widget.
{ # A widget is a UI element that presents texts, images, etc.
&quot;buttonList&quot;: { # A list of buttons layed out horizontally. # A list of buttons. For example, the following JSON creates two buttons. The first is a filled text button and the second is an image button that opens a link: ``` &quot;buttonList&quot;: { &quot;buttons&quot;: [ &quot;button&quot;: { &quot;text&quot;: &quot;Edit&quot;, &quot;Color&quot;: { &quot;Red&quot;: 255 &quot;Green&quot;: 255 &quot;Blue&quot;: 255 } &quot;disabled&quot;: true }, &quot;button&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;INVITE&quot; &quot;altText&quot;: &quot;check calendar&quot; }, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/calendar&quot; } } }, ] } ```
&quot;buttons&quot;: [
{ # A button. Can be a text button or an image button.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
],
},
&quot;dateTimePicker&quot;: { # The widget that lets users to specify a date and time. # Displays a selection/input widget for date/time. For example, the following JSON creates a date/time picker for an appointment time: ``` &quot;date_time_picker&quot;: { &quot;name&quot;: &quot;appointment_time&quot;, &quot;label&quot;: &quot;Book your appointment at:&quot;, &quot;type&quot;: &quot;DateTimePickerType.DATE_AND_TIME&quot;, &quot;valueMsEpoch&quot;: &quot;796435200000&quot; } ```
&quot;label&quot;: &quot;A String&quot;, # The label for the field that displays to the user.
&quot;name&quot;: &quot;A String&quot;, # The name of the text input that&#x27;s used in formInput, and uniquely identifies this input.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # Triggered when the user clicks Save or Clear from the date/time picker dialog. This is only triggered if the value changed as a result of the Save/Clear operation.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;timezoneOffsetDate&quot;: 42, # The number representing the time zone offset from UTC, in minutes. If set, the `value_ms_epoch` is displayed in the specified time zone. If not set, it uses the user&#x27;s time zone setting on the client side.
&quot;type&quot;: &quot;A String&quot;, # The type of the date/time picker.
&quot;valueMsEpoch&quot;: &quot;A String&quot;, # The value to display as the default value before user input or previous user input. It is represented in milliseconds (Epoch time). For `DATE_AND_TIME` type, the full epoch value is used. For `DATE_ONLY` type, only date of the epoch time is used. For `TIME_ONLY` type, only time of the epoch time is used. For example, you can set epoch time to `3 * 60 * 60 * 1000` to represent 3am.
},
&quot;decoratedText&quot;: { # A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget or a button after the text. # Displays a decorated text item in this widget. For example, the following JSON creates a decorated text widget showing email address: ``` &quot;decoratedText&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;EMAIL&quot; }, &quot;topLabel&quot;: &quot;Email Address&quot;, &quot;content&quot;: &quot;heba.salam@example.com&quot;, &quot;bottomLabel&quot;: &quot;This is a new Email address!&quot;, &quot;switchWidget&quot;: { &quot;name&quot;: &quot;has_send_welcome_email_to_heba_salam&quot;, &quot;selected&quot;: false, &quot;controlType&quot;: &quot;ControlType.CHECKBOX&quot; } } ```
&quot;bottomLabel&quot;: &quot;A String&quot;, # The formatted text label that shows below the main text.
&quot;button&quot;: { # A button. Can be a text button or an image button. # A button that can be clicked to trigger an action.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
&quot;endIcon&quot;: { # An icon displayed after the text.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;icon&quot;: { # Deprecated in favor of start_icon.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # Only the top and bottom label and content region are clickable.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;startIcon&quot;: { # The icon displayed in front of the text.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;switchControl&quot;: { # A switch widget can be clicked to change its state or trigger an action.
&quot;controlType&quot;: &quot;A String&quot;, # The control type, either switch or checkbox.
&quot;name&quot;: &quot;A String&quot;, # The name of the switch widget that&#x27;s used in formInput.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # The action when the switch state is changed.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;selected&quot;: True or False, # If the switch is selected.
&quot;value&quot;: &quot;A String&quot;, # The value is what is passed back in the callback.
},
&quot;text&quot;: &quot;A String&quot;, # Required. The main widget formatted text. See Text formatting for details.
&quot;topLabel&quot;: &quot;A String&quot;, # The formatted text label that shows above the main text.
&quot;wrapText&quot;: True or False, # The wrap text setting. If `true`, the text is wrapped and displayed in multiline. Otherwise, the text is truncated.
},
&quot;divider&quot;: { # A divider that appears in between widgets. # Displays a divider. For example, the following JSON creates a divider: ``` &quot;divider&quot;: { } ```
},
&quot;grid&quot;: { # Represents a Grid widget that displays items in a configurable grid layout. # Displays a grid with a collection of items. For example, the following JSON creates a 2 column grid with a single item: ``` &quot;grid&quot;: { &quot;title&quot;: &quot;A fine collection of items&quot;, &quot;numColumns&quot;: 2, &quot;borderStyle&quot;: { &quot;type&quot;: &quot;STROKE&quot;, &quot;cornerRadius&quot;: 4.0 }, &quot;items&quot;: [ &quot;image&quot;: { &quot;imageUri&quot;: &quot;https://www.example.com/image.png&quot;, &quot;cropStyle&quot;: { &quot;type&quot;: &quot;SQUARE&quot; }, &quot;borderStyle&quot;: { &quot;type&quot;: &quot;STROKE&quot; } }, &quot;title&quot;: &quot;An item&quot;, &quot;textAlignment&quot;: &quot;CENTER&quot; ], &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;:&quot;https://www.example.com&quot; } } } ```
&quot;borderStyle&quot;: { # Represents the complete border style applied to widgets. # The border style to apply to each grid item.
&quot;cornerRadius&quot;: 42, # The corner radius for the border.
&quot;strokeColor&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # The colors to use when the type is `BORDER_TYPE_STROKE`.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;type&quot;: &quot;A String&quot;, # The border type.
},
&quot;columnCount&quot;: 42, # The number of columns to display in the grid. A default value is used if this field isn&#x27;t specified, and that default value is different depending on where the grid is shown (dialog versus companion).
&quot;items&quot;: [ # The items to display in the grid.
{ # Represents a single item in the grid layout.
&quot;id&quot;: &quot;A String&quot;, # A user-specified identifier for this grid item. This identifier is returned in the parent Grid&#x27;s onClick callback parameters.
&quot;image&quot;: { # The image that displays in the grid item.
&quot;altText&quot;: &quot;A String&quot;, # The accessibility label for the image.
&quot;borderStyle&quot;: { # Represents the complete border style applied to widgets. # The border style to apply to the image.
&quot;cornerRadius&quot;: 42, # The corner radius for the border.
&quot;strokeColor&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # The colors to use when the type is `BORDER_TYPE_STROKE`.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;type&quot;: &quot;A String&quot;, # The border type.
},
&quot;cropStyle&quot;: { # Represents the crop style applied to an image. # The crop style to apply to the image.
&quot;aspectRatio&quot;: 3.14, # The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`.
&quot;type&quot;: &quot;A String&quot;, # The crop type.
},
&quot;imageUri&quot;: &quot;A String&quot;, # The image URL.
},
&quot;layout&quot;: &quot;A String&quot;, # The layout to use for the grid item.
&quot;subtitle&quot;: &quot;A String&quot;, # The grid item&#x27;s subtitle.
&quot;textAlignment&quot;: &quot;A String&quot;, # The horizontal alignment of the grid item&#x27;s text.
&quot;title&quot;: &quot;A String&quot;, # The grid item&#x27;s title.
},
],
&quot;onClick&quot;: { # This callback is reused by each individual grid item, but with the item&#x27;s identifier and index in the items list added to the callback&#x27;s parameters.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;title&quot;: &quot;A String&quot;, # The text that displays in the grid header.
},
&quot;horizontalAlignment&quot;: &quot;A String&quot;, # The horizontal alignment of this widget.
&quot;image&quot;: { # An image that is specified by a URL and can have an onClick action. # Displays an image in this widget. For example, the following JSON creates an image with alternative text: ``` &quot;image&quot;: { &quot;imageUrl&quot;: &quot;https://example.com/heba_salam.png&quot; &quot;altText&quot;: &quot;Avatar for Heba Salam&quot; } ```
&quot;altText&quot;: &quot;A String&quot;, # The alternative text of this image, used for accessibility.
&quot;imageUrl&quot;: &quot;A String&quot;, # An image URL.
&quot;onClick&quot;: {
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;selectionInput&quot;: { # A widget that creates a UI item (for example, a drop-down list) with options for users to select. # Displays a switch control in this widget. For example, the following JSON creates a dropdown selection for size: ``` &quot;switchControl&quot;: { &quot;name&quot;: &quot;size&quot;, &quot;label&quot;: &quot;Size&quot; &quot;type&quot;: &quot;SelectionType.DROPDOWN&quot;, &quot;items&quot;: [ { &quot;text&quot;: &quot;S&quot;, &quot;value&quot;: &quot;small&quot;, &quot;selected&quot;: false }, { &quot;text&quot;: &quot;M&quot;, &quot;value&quot;: &quot;medium&quot;, &quot;selected&quot;: true }, { &quot;text&quot;: &quot;L&quot;, &quot;value&quot;: &quot;large&quot;, &quot;selected&quot;: false }, { &quot;text&quot;: &quot;XL&quot;, &quot;value&quot;: &quot;extra_large&quot;, &quot;selected&quot;: false } ] } ```
&quot;items&quot;: [
{ # The item in the switch control. A radio button, at most one of the items is selected.
&quot;selected&quot;: True or False, # If more than one item is selected for `RADIO_BUTTON` and `DROPDOWN`, the first selected item is treated as selected and the ones after are ignored.
&quot;text&quot;: &quot;A String&quot;, # The text to be displayed.
&quot;value&quot;: &quot;A String&quot;, # The value associated with this item. The client should use this as a form input value.
},
],
&quot;label&quot;: &quot;A String&quot;, # The label displayed ahead of the switch control.
&quot;name&quot;: &quot;A String&quot;, # The name of the text input which is used in formInput.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, the form is submitted when the selection changes. If not specified, you must specify a separate button.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;type&quot;: &quot;A String&quot;,
},
&quot;textInput&quot;: { # A text input is a UI item where users can input text. A text input can also have an onChange action and suggestions. # Displays a text input in this widget. For example, the following JSON creates a text input for mail address: ``` &quot;textInput&quot;: { &quot;name&quot;: &quot;mailing_address&quot;, &quot;label&quot;: &quot;Mailing Address&quot; } ``` As another example, the following JSON creates a text input for programming language with static suggestions: ``` &quot;textInput&quot;: { &quot;name&quot;: &quot;preferred_programing_language&quot;, &quot;label&quot;: &quot;Preferred Language&quot;, &quot;initialSuggestions&quot;: { &quot;items&quot;: [ { &quot;text&quot;: &quot;C++&quot; }, { &quot;text&quot;: &quot;Java&quot; }, { &quot;text&quot;: &quot;JavaScript&quot; }, { &quot;text&quot;: &quot;Python&quot; } ] } } ```
&quot;autoCompleteAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # The refresh function that returns suggestions based on the user&#x27;s input text. If the callback is not specified, autocomplete is done in client side based on the initial suggestion items.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;hintText&quot;: &quot;A String&quot;, # The hint text.
&quot;initialSuggestions&quot;: { # A container wrapping elements necessary for showing suggestion items used in text input autocomplete. # The initial suggestions made before any user input.
&quot;items&quot;: [ # A list of suggestions items which will be used in are used in autocomplete.
{ # A suggestion item. Only supports text for now.
&quot;text&quot;: &quot;A String&quot;,
},
],
},
&quot;label&quot;: &quot;A String&quot;, # At least one of label and hintText must be specified.
&quot;name&quot;: &quot;A String&quot;, # The name of the text input which is used in formInput.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # The onChange action, for example, invoke a function.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;type&quot;: &quot;A String&quot;, # The style of the text, for example, a single line or multiple lines.
&quot;value&quot;: &quot;A String&quot;, # The default value when there is no input from the user.
},
&quot;textParagraph&quot;: { # A paragraph of text that supports formatting. See [Text formatting](workspace/add-ons/concepts/widgets#text_formatting&quot;) for details. # Displays a text paragraph in this widget. For example, the following JSON creates a bolded text: ``` &quot;textParagraph&quot;: { &quot;text&quot;: &quot; *bold text*&quot; } ```
&quot;text&quot;: &quot;A String&quot;, # The text that&#x27;s shown in the widget.
},
},
],
},
],
},
},
},
&quot;type&quot;: &quot;A String&quot;, # The type of bot response.
&quot;url&quot;: &quot;A String&quot;, # URL for users to auth or config. (Only for REQUEST_CONFIG response types.)
},
&quot;annotations&quot;: [ # Output only. Annotations associated with the text in this message.
{ # Annotations associated with the plain-text body of the message. Example plain-text message body: ``` Hello @FooBot how are you!&quot; ``` The corresponding annotations metadata: ``` &quot;annotations&quot;:[{ &quot;type&quot;:&quot;USER_MENTION&quot;, &quot;startIndex&quot;:6, &quot;length&quot;:7, &quot;userMention&quot;: { &quot;user&quot;: { &quot;name&quot;:&quot;users/107946847022116401880&quot;, &quot;displayName&quot;:&quot;FooBot&quot;, &quot;avatarUrl&quot;:&quot;https://goo.gl/aeDtrS&quot;, &quot;type&quot;:&quot;BOT&quot; }, &quot;type&quot;:&quot;MENTION&quot; } }] ```
&quot;length&quot;: 42, # Length of the substring in the plain-text message body this annotation corresponds to.
&quot;slashCommand&quot;: { # Annotation metadata for slash commands (/). # The metadata for a slash command.
&quot;bot&quot;: { # A user in Google Chat. # The bot whose command was invoked.
&quot;displayName&quot;: &quot;A String&quot;, # The user&#x27;s display name.
&quot;domainId&quot;: &quot;A String&quot;, # Obfuscated domain information.
&quot;isAnonymous&quot;: True or False, # True when the user is deleted or the user&#x27;s profile is not visible.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the format &quot;users/*&quot;.
&quot;type&quot;: &quot;A String&quot;, # User type.
},
&quot;commandId&quot;: &quot;A String&quot;, # The command id of the invoked slash command.
&quot;commandName&quot;: &quot;A String&quot;, # The name of the invoked slash command.
&quot;triggersDialog&quot;: True or False, # Indicating whether the slash command is for a dialog.
&quot;type&quot;: &quot;A String&quot;, # The type of slash command.
},
&quot;startIndex&quot;: 42, # Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
&quot;type&quot;: &quot;A String&quot;, # The type of this annotation.
&quot;userMention&quot;: { # Annotation metadata for user mentions (@). # The metadata of user mention.
&quot;type&quot;: &quot;A String&quot;, # The type of user mention.
&quot;user&quot;: { # A user in Google Chat. # The user mentioned.
&quot;displayName&quot;: &quot;A String&quot;, # The user&#x27;s display name.
&quot;domainId&quot;: &quot;A String&quot;, # Obfuscated domain information.
&quot;isAnonymous&quot;: True or False, # True when the user is deleted or the user&#x27;s profile is not visible.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the format &quot;users/*&quot;.
&quot;type&quot;: &quot;A String&quot;, # User type.
},
},
},
],
&quot;argumentText&quot;: &quot;A String&quot;, # Plain-text body of the message with all bot mentions stripped out.
&quot;attachment&quot;: [ # User uploaded attachment.
{ # An attachment in Google Chat.
&quot;attachmentDataRef&quot;: { # A reference to the data of an attachment. # A reference to the attachment data. This is used with the media API to download the attachment data.
&quot;resourceName&quot;: &quot;A String&quot;, # The resource name of the attachment data. This is used with the media API to download the attachment data.
},
&quot;contentName&quot;: &quot;A String&quot;, # The original file name for the content, not the full path.
&quot;contentType&quot;: &quot;A String&quot;, # The content type (MIME type) of the file.
&quot;downloadUri&quot;: &quot;A String&quot;, # Output only. The download URL which should be used to allow a human user to download the attachment. Bots should not use this URL to download attachment content.
&quot;driveDataRef&quot;: { # A reference to the data of a drive attachment. # A reference to the drive attachment. This is used with the Drive API.
&quot;driveFileId&quot;: &quot;A String&quot;, # The id for the drive file, for use with the Drive API.
},
&quot;name&quot;: &quot;A String&quot;, # Resource name of the attachment, in the form &quot;spaces/*/messages/*/attachments/*&quot;.
&quot;source&quot;: &quot;A String&quot;, # The source of the attachment.
&quot;thumbnailUri&quot;: &quot;A String&quot;, # Output only. The thumbnail URL which should be used to preview the attachment to a human user. Bots should not use this URL to download attachment content.
},
],
&quot;cards&quot;: [ # Rich, formatted and interactive cards that can be used to display UI elements such as: formatted texts, buttons, clickable images. Cards are normally displayed below the plain-text body of the message.
{ # A card is a UI element that can contain UI widgets such as texts, images.
&quot;cardActions&quot;: [ # The actions of this card.
{ # A card action is the action associated with the card. For an invoice card, a typical action would be: delete invoice, email invoice or open the invoice in browser.
&quot;actionLabel&quot;: &quot;A String&quot;, # The label used to be displayed in the action menu item.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action for this action item.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
],
&quot;header&quot;: { # The header of the card. A header usually contains a title and an image.
&quot;imageStyle&quot;: &quot;A String&quot;, # The image&#x27;s type (e.g. square border or circular border).
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image in the card header.
&quot;subtitle&quot;: &quot;A String&quot;, # The subtitle of the card header.
&quot;title&quot;: &quot;A String&quot;, # The title must be specified. The header has a fixed height: if both a title and subtitle is specified, each will take up 1 line. If only the title is specified, it will take up both lines.
},
&quot;name&quot;: &quot;A String&quot;, # Name of the card.
&quot;sections&quot;: [ # Sections are separated by a line divider.
{ # A section contains a collection of widgets that are rendered (vertically) in the order that they are specified. Across all platforms, cards have a narrow fixed width, so there is currently no need for layout properties (e.g. float).
&quot;header&quot;: &quot;A String&quot;, # The header of the section, text formatted supported.
&quot;widgets&quot;: [ # A section must contain at least 1 widget.
{ # A widget is a UI element that presents texts, images, etc.
&quot;buttons&quot;: [ # A list of buttons. Buttons is also oneof data and only one of these fields should be set.
{ # A button. Can be a text button or an image button.
&quot;imageButton&quot;: { # An image button with an onclick action. # A button with image and onclick action.
&quot;icon&quot;: &quot;A String&quot;, # The icon specified by an enum that indices to an icon provided by Chat API.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;name&quot;: &quot;A String&quot;, # The name of this image_button which will be used for accessibility. Default value will be provided if developers don&#x27;t specify.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;textButton&quot;: { # A button with text and onclick action. # A button with text and onclick action.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action of the button.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
},
],
&quot;image&quot;: { # An image that is specified by a URL and can have an onclick action. # Display an image in this widget.
&quot;aspectRatio&quot;: 3.14, # The aspect ratio of this image (width/height). This field allows clients to reserve the right height for the image while waiting for it to load. It&#x27;s not meant to override the native aspect ratio of the image. If unset, the server fills it by prefetching the image.
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;keyValue&quot;: { # A UI element contains a key (label) and a value (content). And this element may also contain some actions such as onclick button. # Display a key value item in this widget.
&quot;bottomLabel&quot;: &quot;A String&quot;, # The text of the bottom label. Formatted text supported.
&quot;button&quot;: { # A button. Can be a text button or an image button. # A button that can be clicked to trigger an action.
&quot;imageButton&quot;: { # An image button with an onclick action. # A button with image and onclick action.
&quot;icon&quot;: &quot;A String&quot;, # The icon specified by an enum that indices to an icon provided by Chat API.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;name&quot;: &quot;A String&quot;, # The name of this image_button which will be used for accessibility. Default value will be provided if developers don&#x27;t specify.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;textButton&quot;: { # A button with text and onclick action. # A button with text and onclick action.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action of the button.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
},
&quot;content&quot;: &quot;A String&quot;, # The text of the content. Formatted text supported and always required.
&quot;contentMultiline&quot;: True or False, # If the content should be multiline.
&quot;icon&quot;: &quot;A String&quot;, # An enum value that will be replaced by the Chat API with the corresponding icon image.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action. Only the top label, bottom label and content region are clickable.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;topLabel&quot;: &quot;A String&quot;, # The text of the top label. Formatted text supported.
},
&quot;textParagraph&quot;: { # A paragraph of text. Formatted text supported. # Display a text paragraph in this widget.
&quot;text&quot;: &quot;A String&quot;,
},
},
],
},
],
},
],
&quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the message was created in Google Chat server.
&quot;fallbackText&quot;: &quot;A String&quot;, # A plain-text description of the message&#x27;s cards, used when the actual cards cannot be displayed (e.g. mobile notifications).
&quot;lastUpdateTime&quot;: &quot;A String&quot;, # Output only. The time at which the message was last updated in Google Chat server. If the message was never updated, this field will be same as create_time.
&quot;name&quot;: &quot;A String&quot;, # Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4`
&quot;previewText&quot;: &quot;A String&quot;, # Text for generating preview chips. This text will not be displayed to the user, but any links to images, web pages, videos, etc. included here will generate preview chips.
&quot;sender&quot;: { # A user in Google Chat. # The user who created the message.
&quot;displayName&quot;: &quot;A String&quot;, # The user&#x27;s display name.
&quot;domainId&quot;: &quot;A String&quot;, # Obfuscated domain information.
&quot;isAnonymous&quot;: True or False, # True when the user is deleted or the user&#x27;s profile is not visible.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the format &quot;users/*&quot;.
&quot;type&quot;: &quot;A String&quot;, # User type.
},
&quot;slashCommand&quot;: { # A Slash Command in Chat. # Slash command information, if applicable.
&quot;commandId&quot;: &quot;A String&quot;, # The id of the slash command invoked.
},
&quot;space&quot;: { # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat bot. # The space the message belongs to.
&quot;displayName&quot;: &quot;A String&quot;, # Output only. The display name (only if the space is of type `ROOM`). Please note that this field might not be populated in direct messages between humans.
&quot;name&quot;: &quot;A String&quot;, # Resource name of the space, in the form &quot;spaces/*&quot;. Example: spaces/AAAAAAAAAAAA
&quot;singleUserBotDm&quot;: True or False, # Whether the space is a DM between a bot and a single human.
&quot;threaded&quot;: True or False, # Whether the messages are threaded in this space.
&quot;type&quot;: &quot;A String&quot;, # Output only. The type of a space. This is deprecated. Use `single_user_bot_dm` instead.
},
&quot;text&quot;: &quot;A String&quot;, # Plain-text body of the message.
&quot;thread&quot;: { # A thread in Google Chat. # The thread the message belongs to.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the form &quot;spaces/*/threads/*&quot;. Example: spaces/AAAAMpdlehY/threads/UMxbHmzDlr4
},
}
requestId: string, Optional. A unique request ID for this message. If a message has already been created in the space with this request ID, the subsequent request will return the existing message and no new message will be created.
threadKey: string, Optional. Opaque thread identifier string that can be specified to group messages into a single thread. If this is the first message with a given thread identifier, a new thread is created. Subsequent messages with the same thread identifier will be posted into the same thread. This relieves bots and webhooks from having to store the Google Chat thread ID of a thread (created earlier by them) to post further updates to it. Has no effect if thread field, corresponding to an existing thread, is set in message.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # A message in Google Chat.
&quot;actionResponse&quot;: { # Parameters that a bot can use to configure how it&#x27;s response is posted. # Input only. Parameters that a bot can use to configure how its response is posted.
&quot;dialogAction&quot;: { # Contains dialog if present as well as the ActionStatus for the request sent from user. # This response is for Dialog related events and must be accompanied by ResponseType.Dialog
&quot;actionStatus&quot;: { # ActionStatus represents status of a request from the bot developer&#x27;s side. In specific, for each request a bot gets, the bot developer will set both fields below in relation to what the response status and message related to status should be. # Status for either invoke dialog or submit dialog requests. This will be used to display a status and message to user if needed. For example in case of an error or success.
&quot;statusCode&quot;: &quot;A String&quot;, # The status code.
&quot;userFacingMessage&quot;: &quot;A String&quot;, # This message will be the corresponding string to the above status_code. If unset, an appropriate generic message based on the status_code will be shown to the user. If this field is set then the message will be surfaced to the user for both successes and errors.
},
&quot;dialog&quot;: { # Wrapper around the card body of the dialog. # Dialog for the request.
&quot;body&quot;: { # A card is a UI element that can contain UI widgets such as text and images. For more information, see Cards . For example, the following JSON creates a card that has a header with the name, position, icons, and link for a contact, followed by a section with contact information like email and phone number. ``` { &quot;header&quot;: { &quot;title&quot;: &quot;Heba Salam&quot;, &quot;subtitle&quot;: &quot;Software Engineer&quot;, &quot;imageStyle&quot;: &quot;ImageStyle.AVATAR&quot;, &quot;imageUrl&quot;: &quot;https://example.com/heba_salam.png&quot;, &quot;imageAltText&quot;: &quot;Avatar for Heba Salam&quot; }, &quot;sections&quot; : [ { &quot;header&quot;: &quot;Contact Info&quot;, &quot;widgets&quot;: [ { &quot;decorated_text&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;EMAIL&quot; }, &quot;content&quot;: &quot;heba.salam@example.com&quot; } }, { &quot;decoratedText&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;PERSON&quot; }, &quot;content&quot;: &quot;Online&quot; } }, { &quot;decoratedText&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;PHONE&quot; }, &quot;content&quot;: &quot;+1 (555) 555-1234&quot; } }, { &quot;buttons&quot;: [ { &quot;textButton&quot;: { &quot;text&quot;: &quot;Share&quot;, }, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/share&quot; } } }, { &quot;textButton&quot;: { &quot;text&quot;: &quot;Edit&quot;, }, &quot;onClick&quot;: { &quot;action&quot;: { &quot;function&quot;: &quot;goToView&quot;, &quot;parameters&quot;: [ { &quot;key&quot;: &quot;viewType&quot;, &quot;value&quot;: &quot;EDIT&quot; } ], &quot;loadIndicator&quot;: &quot;LoadIndicator.SPINNER&quot; } } } ] } ], &quot;collapsible&quot;: true, &quot;uncollapsibleWidgetsCount&quot;: 3 } ], &quot;cardActions&quot;: [ { &quot;actionLabel&quot;: &quot;Send Feedback&quot;, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/feedback&quot; } } } ], &quot;name&quot;: &quot;contact-card-K3wB6arF2H9L&quot; } ``` # Body of the dialog, which will be rendered in a modal. NOTE: The following fields within the objects are not supported: google.apps.card.v1.Widget.date_time_picker google.apps.card.v1.DecoratedText.SwitchControl.on_change_action google.apps.card.v1.TextInput.on_change_action google.apps.card.v1.SelectionInput.on_change_action google.apps.card.v1.DateTimePicker.on_change_action Setting the fields above will have no effect on the dialog.
&quot;cardActions&quot;: [ # The actions of this card. They are added to a card&#x27;s generated toolbar menu. For example, the following JSON constructs a card action menu with Settings and Send Feedback options: ``` &quot;card_actions&quot;: [ { &quot;actionLabel&quot;: &quot;Setting&quot;, &quot;onClick&quot;: { &quot;action&quot;: { &quot;functionName&quot;: &quot;goToView&quot;, &quot;parameters&quot;: [ { &quot;key&quot;: &quot;viewType&quot;, &quot;value&quot;: &quot;SETTING&quot; } ], &quot;loadIndicator&quot;: &quot;LoadIndicator.SPINNER&quot; } } }, { &quot;actionLabel&quot;: &quot;Send Feedback&quot;, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/feedback&quot; } } } ] ```
{ # A card action is the action associated with the card. For example, an invoice card might include actions such as delete invoice, email invoice, or open the invoice in a browser.
&quot;actionLabel&quot;: &quot;A String&quot;, # The label that displays as the action menu item.
&quot;onClick&quot;: { # The onclick action for this action item.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
],
&quot;displayStyle&quot;: &quot;A String&quot;, # The display style for peekCardHeader.
&quot;fixedFooter&quot;: { # A persistent (sticky) footer that is added to the bottom of the card. # The fixed footer shown at the bottom of this card.
&quot;primaryButton&quot;: { # A button. Can be a text button or an image button. # The primary button of the fixed footer. The button must be a text button with text and color set.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
&quot;secondaryButton&quot;: { # A button. Can be a text button or an image button. # The secondary button of the fixed footer. The button must be a text button with text and color set. `primaryButton` must be set if `secondaryButton` is set.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
},
&quot;header&quot;: { # The header of the card. A header usually contains a title and an image.
&quot;imageAltText&quot;: &quot;A String&quot;, # The alternative text of this image which is used for accessibility.
&quot;imageType&quot;: &quot;A String&quot;, # The image&#x27;s type.
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image in the card header.
&quot;subtitle&quot;: &quot;A String&quot;, # The subtitle of the card header.
&quot;title&quot;: &quot;A String&quot;, # The title of the card header. The title must be specified. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines.
},
&quot;name&quot;: &quot;A String&quot;, # Name of the card, which is used as a identifier for the card in card navigation.
&quot;peekCardHeader&quot;: { # When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards.
&quot;imageAltText&quot;: &quot;A String&quot;, # The alternative text of this image which is used for accessibility.
&quot;imageType&quot;: &quot;A String&quot;, # The image&#x27;s type.
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image in the card header.
&quot;subtitle&quot;: &quot;A String&quot;, # The subtitle of the card header.
&quot;title&quot;: &quot;A String&quot;, # The title of the card header. The title must be specified. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines.
},
&quot;sections&quot;: [ # Sections are separated by a line divider.
{ # A section contains a collection of widgets that are rendered vertically in the order that they are specified. Across all platforms, cards have a narrow fixed width, so there is currently no need for layout properties, for example, float.
&quot;collapsible&quot;: True or False, # Indicates whether this section is collapsible. If a section is collapsible, the description must be given.
&quot;header&quot;: &quot;A String&quot;, # The header of the section. Formatted text is supported.
&quot;uncollapsibleWidgetsCount&quot;: 42, # The number of uncollapsible widgets. For example, when a section contains five widgets and the `numUncollapsibleWidget` is set to `2`, the first two widgets are always shown and the last three are collapsed as default. The `numUncollapsibleWidget` is taken into account only when collapsible is set to `true`.
&quot;widgets&quot;: [ # A section must contain at least 1 widget.
{ # A widget is a UI element that presents texts, images, etc.
&quot;buttonList&quot;: { # A list of buttons layed out horizontally. # A list of buttons. For example, the following JSON creates two buttons. The first is a filled text button and the second is an image button that opens a link: ``` &quot;buttonList&quot;: { &quot;buttons&quot;: [ &quot;button&quot;: { &quot;text&quot;: &quot;Edit&quot;, &quot;Color&quot;: { &quot;Red&quot;: 255 &quot;Green&quot;: 255 &quot;Blue&quot;: 255 } &quot;disabled&quot;: true }, &quot;button&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;INVITE&quot; &quot;altText&quot;: &quot;check calendar&quot; }, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/calendar&quot; } } }, ] } ```
&quot;buttons&quot;: [
{ # A button. Can be a text button or an image button.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
],
},
&quot;dateTimePicker&quot;: { # The widget that lets users to specify a date and time. # Displays a selection/input widget for date/time. For example, the following JSON creates a date/time picker for an appointment time: ``` &quot;date_time_picker&quot;: { &quot;name&quot;: &quot;appointment_time&quot;, &quot;label&quot;: &quot;Book your appointment at:&quot;, &quot;type&quot;: &quot;DateTimePickerType.DATE_AND_TIME&quot;, &quot;valueMsEpoch&quot;: &quot;796435200000&quot; } ```
&quot;label&quot;: &quot;A String&quot;, # The label for the field that displays to the user.
&quot;name&quot;: &quot;A String&quot;, # The name of the text input that&#x27;s used in formInput, and uniquely identifies this input.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # Triggered when the user clicks Save or Clear from the date/time picker dialog. This is only triggered if the value changed as a result of the Save/Clear operation.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;timezoneOffsetDate&quot;: 42, # The number representing the time zone offset from UTC, in minutes. If set, the `value_ms_epoch` is displayed in the specified time zone. If not set, it uses the user&#x27;s time zone setting on the client side.
&quot;type&quot;: &quot;A String&quot;, # The type of the date/time picker.
&quot;valueMsEpoch&quot;: &quot;A String&quot;, # The value to display as the default value before user input or previous user input. It is represented in milliseconds (Epoch time). For `DATE_AND_TIME` type, the full epoch value is used. For `DATE_ONLY` type, only date of the epoch time is used. For `TIME_ONLY` type, only time of the epoch time is used. For example, you can set epoch time to `3 * 60 * 60 * 1000` to represent 3am.
},
&quot;decoratedText&quot;: { # A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget or a button after the text. # Displays a decorated text item in this widget. For example, the following JSON creates a decorated text widget showing email address: ``` &quot;decoratedText&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;EMAIL&quot; }, &quot;topLabel&quot;: &quot;Email Address&quot;, &quot;content&quot;: &quot;heba.salam@example.com&quot;, &quot;bottomLabel&quot;: &quot;This is a new Email address!&quot;, &quot;switchWidget&quot;: { &quot;name&quot;: &quot;has_send_welcome_email_to_heba_salam&quot;, &quot;selected&quot;: false, &quot;controlType&quot;: &quot;ControlType.CHECKBOX&quot; } } ```
&quot;bottomLabel&quot;: &quot;A String&quot;, # The formatted text label that shows below the main text.
&quot;button&quot;: { # A button. Can be a text button or an image button. # A button that can be clicked to trigger an action.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
&quot;endIcon&quot;: { # An icon displayed after the text.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;icon&quot;: { # Deprecated in favor of start_icon.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # Only the top and bottom label and content region are clickable.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;startIcon&quot;: { # The icon displayed in front of the text.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;switchControl&quot;: { # A switch widget can be clicked to change its state or trigger an action.
&quot;controlType&quot;: &quot;A String&quot;, # The control type, either switch or checkbox.
&quot;name&quot;: &quot;A String&quot;, # The name of the switch widget that&#x27;s used in formInput.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # The action when the switch state is changed.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;selected&quot;: True or False, # If the switch is selected.
&quot;value&quot;: &quot;A String&quot;, # The value is what is passed back in the callback.
},
&quot;text&quot;: &quot;A String&quot;, # Required. The main widget formatted text. See Text formatting for details.
&quot;topLabel&quot;: &quot;A String&quot;, # The formatted text label that shows above the main text.
&quot;wrapText&quot;: True or False, # The wrap text setting. If `true`, the text is wrapped and displayed in multiline. Otherwise, the text is truncated.
},
&quot;divider&quot;: { # A divider that appears in between widgets. # Displays a divider. For example, the following JSON creates a divider: ``` &quot;divider&quot;: { } ```
},
&quot;grid&quot;: { # Represents a Grid widget that displays items in a configurable grid layout. # Displays a grid with a collection of items. For example, the following JSON creates a 2 column grid with a single item: ``` &quot;grid&quot;: { &quot;title&quot;: &quot;A fine collection of items&quot;, &quot;numColumns&quot;: 2, &quot;borderStyle&quot;: { &quot;type&quot;: &quot;STROKE&quot;, &quot;cornerRadius&quot;: 4.0 }, &quot;items&quot;: [ &quot;image&quot;: { &quot;imageUri&quot;: &quot;https://www.example.com/image.png&quot;, &quot;cropStyle&quot;: { &quot;type&quot;: &quot;SQUARE&quot; }, &quot;borderStyle&quot;: { &quot;type&quot;: &quot;STROKE&quot; } }, &quot;title&quot;: &quot;An item&quot;, &quot;textAlignment&quot;: &quot;CENTER&quot; ], &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;:&quot;https://www.example.com&quot; } } } ```
&quot;borderStyle&quot;: { # Represents the complete border style applied to widgets. # The border style to apply to each grid item.
&quot;cornerRadius&quot;: 42, # The corner radius for the border.
&quot;strokeColor&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # The colors to use when the type is `BORDER_TYPE_STROKE`.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;type&quot;: &quot;A String&quot;, # The border type.
},
&quot;columnCount&quot;: 42, # The number of columns to display in the grid. A default value is used if this field isn&#x27;t specified, and that default value is different depending on where the grid is shown (dialog versus companion).
&quot;items&quot;: [ # The items to display in the grid.
{ # Represents a single item in the grid layout.
&quot;id&quot;: &quot;A String&quot;, # A user-specified identifier for this grid item. This identifier is returned in the parent Grid&#x27;s onClick callback parameters.
&quot;image&quot;: { # The image that displays in the grid item.
&quot;altText&quot;: &quot;A String&quot;, # The accessibility label for the image.
&quot;borderStyle&quot;: { # Represents the complete border style applied to widgets. # The border style to apply to the image.
&quot;cornerRadius&quot;: 42, # The corner radius for the border.
&quot;strokeColor&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # The colors to use when the type is `BORDER_TYPE_STROKE`.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;type&quot;: &quot;A String&quot;, # The border type.
},
&quot;cropStyle&quot;: { # Represents the crop style applied to an image. # The crop style to apply to the image.
&quot;aspectRatio&quot;: 3.14, # The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`.
&quot;type&quot;: &quot;A String&quot;, # The crop type.
},
&quot;imageUri&quot;: &quot;A String&quot;, # The image URL.
},
&quot;layout&quot;: &quot;A String&quot;, # The layout to use for the grid item.
&quot;subtitle&quot;: &quot;A String&quot;, # The grid item&#x27;s subtitle.
&quot;textAlignment&quot;: &quot;A String&quot;, # The horizontal alignment of the grid item&#x27;s text.
&quot;title&quot;: &quot;A String&quot;, # The grid item&#x27;s title.
},
],
&quot;onClick&quot;: { # This callback is reused by each individual grid item, but with the item&#x27;s identifier and index in the items list added to the callback&#x27;s parameters.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;title&quot;: &quot;A String&quot;, # The text that displays in the grid header.
},
&quot;horizontalAlignment&quot;: &quot;A String&quot;, # The horizontal alignment of this widget.
&quot;image&quot;: { # An image that is specified by a URL and can have an onClick action. # Displays an image in this widget. For example, the following JSON creates an image with alternative text: ``` &quot;image&quot;: { &quot;imageUrl&quot;: &quot;https://example.com/heba_salam.png&quot; &quot;altText&quot;: &quot;Avatar for Heba Salam&quot; } ```
&quot;altText&quot;: &quot;A String&quot;, # The alternative text of this image, used for accessibility.
&quot;imageUrl&quot;: &quot;A String&quot;, # An image URL.
&quot;onClick&quot;: {
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;selectionInput&quot;: { # A widget that creates a UI item (for example, a drop-down list) with options for users to select. # Displays a switch control in this widget. For example, the following JSON creates a dropdown selection for size: ``` &quot;switchControl&quot;: { &quot;name&quot;: &quot;size&quot;, &quot;label&quot;: &quot;Size&quot; &quot;type&quot;: &quot;SelectionType.DROPDOWN&quot;, &quot;items&quot;: [ { &quot;text&quot;: &quot;S&quot;, &quot;value&quot;: &quot;small&quot;, &quot;selected&quot;: false }, { &quot;text&quot;: &quot;M&quot;, &quot;value&quot;: &quot;medium&quot;, &quot;selected&quot;: true }, { &quot;text&quot;: &quot;L&quot;, &quot;value&quot;: &quot;large&quot;, &quot;selected&quot;: false }, { &quot;text&quot;: &quot;XL&quot;, &quot;value&quot;: &quot;extra_large&quot;, &quot;selected&quot;: false } ] } ```
&quot;items&quot;: [
{ # The item in the switch control. A radio button, at most one of the items is selected.
&quot;selected&quot;: True or False, # If more than one item is selected for `RADIO_BUTTON` and `DROPDOWN`, the first selected item is treated as selected and the ones after are ignored.
&quot;text&quot;: &quot;A String&quot;, # The text to be displayed.
&quot;value&quot;: &quot;A String&quot;, # The value associated with this item. The client should use this as a form input value.
},
],
&quot;label&quot;: &quot;A String&quot;, # The label displayed ahead of the switch control.
&quot;name&quot;: &quot;A String&quot;, # The name of the text input which is used in formInput.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, the form is submitted when the selection changes. If not specified, you must specify a separate button.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;type&quot;: &quot;A String&quot;,
},
&quot;textInput&quot;: { # A text input is a UI item where users can input text. A text input can also have an onChange action and suggestions. # Displays a text input in this widget. For example, the following JSON creates a text input for mail address: ``` &quot;textInput&quot;: { &quot;name&quot;: &quot;mailing_address&quot;, &quot;label&quot;: &quot;Mailing Address&quot; } ``` As another example, the following JSON creates a text input for programming language with static suggestions: ``` &quot;textInput&quot;: { &quot;name&quot;: &quot;preferred_programing_language&quot;, &quot;label&quot;: &quot;Preferred Language&quot;, &quot;initialSuggestions&quot;: { &quot;items&quot;: [ { &quot;text&quot;: &quot;C++&quot; }, { &quot;text&quot;: &quot;Java&quot; }, { &quot;text&quot;: &quot;JavaScript&quot; }, { &quot;text&quot;: &quot;Python&quot; } ] } } ```
&quot;autoCompleteAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # The refresh function that returns suggestions based on the user&#x27;s input text. If the callback is not specified, autocomplete is done in client side based on the initial suggestion items.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;hintText&quot;: &quot;A String&quot;, # The hint text.
&quot;initialSuggestions&quot;: { # A container wrapping elements necessary for showing suggestion items used in text input autocomplete. # The initial suggestions made before any user input.
&quot;items&quot;: [ # A list of suggestions items which will be used in are used in autocomplete.
{ # A suggestion item. Only supports text for now.
&quot;text&quot;: &quot;A String&quot;,
},
],
},
&quot;label&quot;: &quot;A String&quot;, # At least one of label and hintText must be specified.
&quot;name&quot;: &quot;A String&quot;, # The name of the text input which is used in formInput.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # The onChange action, for example, invoke a function.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;type&quot;: &quot;A String&quot;, # The style of the text, for example, a single line or multiple lines.
&quot;value&quot;: &quot;A String&quot;, # The default value when there is no input from the user.
},
&quot;textParagraph&quot;: { # A paragraph of text that supports formatting. See [Text formatting](workspace/add-ons/concepts/widgets#text_formatting&quot;) for details. # Displays a text paragraph in this widget. For example, the following JSON creates a bolded text: ``` &quot;textParagraph&quot;: { &quot;text&quot;: &quot; *bold text*&quot; } ```
&quot;text&quot;: &quot;A String&quot;, # The text that&#x27;s shown in the widget.
},
},
],
},
],
},
},
},
&quot;type&quot;: &quot;A String&quot;, # The type of bot response.
&quot;url&quot;: &quot;A String&quot;, # URL for users to auth or config. (Only for REQUEST_CONFIG response types.)
},
&quot;annotations&quot;: [ # Output only. Annotations associated with the text in this message.
{ # Annotations associated with the plain-text body of the message. Example plain-text message body: ``` Hello @FooBot how are you!&quot; ``` The corresponding annotations metadata: ``` &quot;annotations&quot;:[{ &quot;type&quot;:&quot;USER_MENTION&quot;, &quot;startIndex&quot;:6, &quot;length&quot;:7, &quot;userMention&quot;: { &quot;user&quot;: { &quot;name&quot;:&quot;users/107946847022116401880&quot;, &quot;displayName&quot;:&quot;FooBot&quot;, &quot;avatarUrl&quot;:&quot;https://goo.gl/aeDtrS&quot;, &quot;type&quot;:&quot;BOT&quot; }, &quot;type&quot;:&quot;MENTION&quot; } }] ```
&quot;length&quot;: 42, # Length of the substring in the plain-text message body this annotation corresponds to.
&quot;slashCommand&quot;: { # Annotation metadata for slash commands (/). # The metadata for a slash command.
&quot;bot&quot;: { # A user in Google Chat. # The bot whose command was invoked.
&quot;displayName&quot;: &quot;A String&quot;, # The user&#x27;s display name.
&quot;domainId&quot;: &quot;A String&quot;, # Obfuscated domain information.
&quot;isAnonymous&quot;: True or False, # True when the user is deleted or the user&#x27;s profile is not visible.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the format &quot;users/*&quot;.
&quot;type&quot;: &quot;A String&quot;, # User type.
},
&quot;commandId&quot;: &quot;A String&quot;, # The command id of the invoked slash command.
&quot;commandName&quot;: &quot;A String&quot;, # The name of the invoked slash command.
&quot;triggersDialog&quot;: True or False, # Indicating whether the slash command is for a dialog.
&quot;type&quot;: &quot;A String&quot;, # The type of slash command.
},
&quot;startIndex&quot;: 42, # Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
&quot;type&quot;: &quot;A String&quot;, # The type of this annotation.
&quot;userMention&quot;: { # Annotation metadata for user mentions (@). # The metadata of user mention.
&quot;type&quot;: &quot;A String&quot;, # The type of user mention.
&quot;user&quot;: { # A user in Google Chat. # The user mentioned.
&quot;displayName&quot;: &quot;A String&quot;, # The user&#x27;s display name.
&quot;domainId&quot;: &quot;A String&quot;, # Obfuscated domain information.
&quot;isAnonymous&quot;: True or False, # True when the user is deleted or the user&#x27;s profile is not visible.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the format &quot;users/*&quot;.
&quot;type&quot;: &quot;A String&quot;, # User type.
},
},
},
],
&quot;argumentText&quot;: &quot;A String&quot;, # Plain-text body of the message with all bot mentions stripped out.
&quot;attachment&quot;: [ # User uploaded attachment.
{ # An attachment in Google Chat.
&quot;attachmentDataRef&quot;: { # A reference to the data of an attachment. # A reference to the attachment data. This is used with the media API to download the attachment data.
&quot;resourceName&quot;: &quot;A String&quot;, # The resource name of the attachment data. This is used with the media API to download the attachment data.
},
&quot;contentName&quot;: &quot;A String&quot;, # The original file name for the content, not the full path.
&quot;contentType&quot;: &quot;A String&quot;, # The content type (MIME type) of the file.
&quot;downloadUri&quot;: &quot;A String&quot;, # Output only. The download URL which should be used to allow a human user to download the attachment. Bots should not use this URL to download attachment content.
&quot;driveDataRef&quot;: { # A reference to the data of a drive attachment. # A reference to the drive attachment. This is used with the Drive API.
&quot;driveFileId&quot;: &quot;A String&quot;, # The id for the drive file, for use with the Drive API.
},
&quot;name&quot;: &quot;A String&quot;, # Resource name of the attachment, in the form &quot;spaces/*/messages/*/attachments/*&quot;.
&quot;source&quot;: &quot;A String&quot;, # The source of the attachment.
&quot;thumbnailUri&quot;: &quot;A String&quot;, # Output only. The thumbnail URL which should be used to preview the attachment to a human user. Bots should not use this URL to download attachment content.
},
],
&quot;cards&quot;: [ # Rich, formatted and interactive cards that can be used to display UI elements such as: formatted texts, buttons, clickable images. Cards are normally displayed below the plain-text body of the message.
{ # A card is a UI element that can contain UI widgets such as texts, images.
&quot;cardActions&quot;: [ # The actions of this card.
{ # A card action is the action associated with the card. For an invoice card, a typical action would be: delete invoice, email invoice or open the invoice in browser.
&quot;actionLabel&quot;: &quot;A String&quot;, # The label used to be displayed in the action menu item.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action for this action item.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
],
&quot;header&quot;: { # The header of the card. A header usually contains a title and an image.
&quot;imageStyle&quot;: &quot;A String&quot;, # The image&#x27;s type (e.g. square border or circular border).
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image in the card header.
&quot;subtitle&quot;: &quot;A String&quot;, # The subtitle of the card header.
&quot;title&quot;: &quot;A String&quot;, # The title must be specified. The header has a fixed height: if both a title and subtitle is specified, each will take up 1 line. If only the title is specified, it will take up both lines.
},
&quot;name&quot;: &quot;A String&quot;, # Name of the card.
&quot;sections&quot;: [ # Sections are separated by a line divider.
{ # A section contains a collection of widgets that are rendered (vertically) in the order that they are specified. Across all platforms, cards have a narrow fixed width, so there is currently no need for layout properties (e.g. float).
&quot;header&quot;: &quot;A String&quot;, # The header of the section, text formatted supported.
&quot;widgets&quot;: [ # A section must contain at least 1 widget.
{ # A widget is a UI element that presents texts, images, etc.
&quot;buttons&quot;: [ # A list of buttons. Buttons is also oneof data and only one of these fields should be set.
{ # A button. Can be a text button or an image button.
&quot;imageButton&quot;: { # An image button with an onclick action. # A button with image and onclick action.
&quot;icon&quot;: &quot;A String&quot;, # The icon specified by an enum that indices to an icon provided by Chat API.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;name&quot;: &quot;A String&quot;, # The name of this image_button which will be used for accessibility. Default value will be provided if developers don&#x27;t specify.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;textButton&quot;: { # A button with text and onclick action. # A button with text and onclick action.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action of the button.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
},
],
&quot;image&quot;: { # An image that is specified by a URL and can have an onclick action. # Display an image in this widget.
&quot;aspectRatio&quot;: 3.14, # The aspect ratio of this image (width/height). This field allows clients to reserve the right height for the image while waiting for it to load. It&#x27;s not meant to override the native aspect ratio of the image. If unset, the server fills it by prefetching the image.
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;keyValue&quot;: { # A UI element contains a key (label) and a value (content). And this element may also contain some actions such as onclick button. # Display a key value item in this widget.
&quot;bottomLabel&quot;: &quot;A String&quot;, # The text of the bottom label. Formatted text supported.
&quot;button&quot;: { # A button. Can be a text button or an image button. # A button that can be clicked to trigger an action.
&quot;imageButton&quot;: { # An image button with an onclick action. # A button with image and onclick action.
&quot;icon&quot;: &quot;A String&quot;, # The icon specified by an enum that indices to an icon provided by Chat API.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;name&quot;: &quot;A String&quot;, # The name of this image_button which will be used for accessibility. Default value will be provided if developers don&#x27;t specify.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;textButton&quot;: { # A button with text and onclick action. # A button with text and onclick action.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action of the button.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
},
&quot;content&quot;: &quot;A String&quot;, # The text of the content. Formatted text supported and always required.
&quot;contentMultiline&quot;: True or False, # If the content should be multiline.
&quot;icon&quot;: &quot;A String&quot;, # An enum value that will be replaced by the Chat API with the corresponding icon image.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action. Only the top label, bottom label and content region are clickable.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;topLabel&quot;: &quot;A String&quot;, # The text of the top label. Formatted text supported.
},
&quot;textParagraph&quot;: { # A paragraph of text. Formatted text supported. # Display a text paragraph in this widget.
&quot;text&quot;: &quot;A String&quot;,
},
},
],
},
],
},
],
&quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the message was created in Google Chat server.
&quot;fallbackText&quot;: &quot;A String&quot;, # A plain-text description of the message&#x27;s cards, used when the actual cards cannot be displayed (e.g. mobile notifications).
&quot;lastUpdateTime&quot;: &quot;A String&quot;, # Output only. The time at which the message was last updated in Google Chat server. If the message was never updated, this field will be same as create_time.
&quot;name&quot;: &quot;A String&quot;, # Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4`
&quot;previewText&quot;: &quot;A String&quot;, # Text for generating preview chips. This text will not be displayed to the user, but any links to images, web pages, videos, etc. included here will generate preview chips.
&quot;sender&quot;: { # A user in Google Chat. # The user who created the message.
&quot;displayName&quot;: &quot;A String&quot;, # The user&#x27;s display name.
&quot;domainId&quot;: &quot;A String&quot;, # Obfuscated domain information.
&quot;isAnonymous&quot;: True or False, # True when the user is deleted or the user&#x27;s profile is not visible.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the format &quot;users/*&quot;.
&quot;type&quot;: &quot;A String&quot;, # User type.
},
&quot;slashCommand&quot;: { # A Slash Command in Chat. # Slash command information, if applicable.
&quot;commandId&quot;: &quot;A String&quot;, # The id of the slash command invoked.
},
&quot;space&quot;: { # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat bot. # The space the message belongs to.
&quot;displayName&quot;: &quot;A String&quot;, # Output only. The display name (only if the space is of type `ROOM`). Please note that this field might not be populated in direct messages between humans.
&quot;name&quot;: &quot;A String&quot;, # Resource name of the space, in the form &quot;spaces/*&quot;. Example: spaces/AAAAAAAAAAAA
&quot;singleUserBotDm&quot;: True or False, # Whether the space is a DM between a bot and a single human.
&quot;threaded&quot;: True or False, # Whether the messages are threaded in this space.
&quot;type&quot;: &quot;A String&quot;, # Output only. The type of a space. This is deprecated. Use `single_user_bot_dm` instead.
},
&quot;text&quot;: &quot;A String&quot;, # Plain-text body of the message.
&quot;thread&quot;: { # A thread in Google Chat. # The thread the message belongs to.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the form &quot;spaces/*/threads/*&quot;. Example: spaces/AAAAMpdlehY/threads/UMxbHmzDlr4
},
}</pre>
</div>
<div class="method">
<code class="details" id="webhooks">webhooks(parent, body=None, requestId=None, threadKey=None, x__xgafv=None)</code>
<pre>Legacy path for creating message. Calling these will result in a BadRequest response.
Args:
parent: string, Required. Space resource name, in the form &quot;spaces/*&quot;. Example: spaces/AAAAMpdlehY (required)
body: object, The request body.
The object takes the form of:
{ # A message in Google Chat.
&quot;actionResponse&quot;: { # Parameters that a bot can use to configure how it&#x27;s response is posted. # Input only. Parameters that a bot can use to configure how its response is posted.
&quot;dialogAction&quot;: { # Contains dialog if present as well as the ActionStatus for the request sent from user. # This response is for Dialog related events and must be accompanied by ResponseType.Dialog
&quot;actionStatus&quot;: { # ActionStatus represents status of a request from the bot developer&#x27;s side. In specific, for each request a bot gets, the bot developer will set both fields below in relation to what the response status and message related to status should be. # Status for either invoke dialog or submit dialog requests. This will be used to display a status and message to user if needed. For example in case of an error or success.
&quot;statusCode&quot;: &quot;A String&quot;, # The status code.
&quot;userFacingMessage&quot;: &quot;A String&quot;, # This message will be the corresponding string to the above status_code. If unset, an appropriate generic message based on the status_code will be shown to the user. If this field is set then the message will be surfaced to the user for both successes and errors.
},
&quot;dialog&quot;: { # Wrapper around the card body of the dialog. # Dialog for the request.
&quot;body&quot;: { # A card is a UI element that can contain UI widgets such as text and images. For more information, see Cards . For example, the following JSON creates a card that has a header with the name, position, icons, and link for a contact, followed by a section with contact information like email and phone number. ``` { &quot;header&quot;: { &quot;title&quot;: &quot;Heba Salam&quot;, &quot;subtitle&quot;: &quot;Software Engineer&quot;, &quot;imageStyle&quot;: &quot;ImageStyle.AVATAR&quot;, &quot;imageUrl&quot;: &quot;https://example.com/heba_salam.png&quot;, &quot;imageAltText&quot;: &quot;Avatar for Heba Salam&quot; }, &quot;sections&quot; : [ { &quot;header&quot;: &quot;Contact Info&quot;, &quot;widgets&quot;: [ { &quot;decorated_text&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;EMAIL&quot; }, &quot;content&quot;: &quot;heba.salam@example.com&quot; } }, { &quot;decoratedText&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;PERSON&quot; }, &quot;content&quot;: &quot;Online&quot; } }, { &quot;decoratedText&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;PHONE&quot; }, &quot;content&quot;: &quot;+1 (555) 555-1234&quot; } }, { &quot;buttons&quot;: [ { &quot;textButton&quot;: { &quot;text&quot;: &quot;Share&quot;, }, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/share&quot; } } }, { &quot;textButton&quot;: { &quot;text&quot;: &quot;Edit&quot;, }, &quot;onClick&quot;: { &quot;action&quot;: { &quot;function&quot;: &quot;goToView&quot;, &quot;parameters&quot;: [ { &quot;key&quot;: &quot;viewType&quot;, &quot;value&quot;: &quot;EDIT&quot; } ], &quot;loadIndicator&quot;: &quot;LoadIndicator.SPINNER&quot; } } } ] } ], &quot;collapsible&quot;: true, &quot;uncollapsibleWidgetsCount&quot;: 3 } ], &quot;cardActions&quot;: [ { &quot;actionLabel&quot;: &quot;Send Feedback&quot;, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/feedback&quot; } } } ], &quot;name&quot;: &quot;contact-card-K3wB6arF2H9L&quot; } ``` # Body of the dialog, which will be rendered in a modal. NOTE: The following fields within the objects are not supported: google.apps.card.v1.Widget.date_time_picker google.apps.card.v1.DecoratedText.SwitchControl.on_change_action google.apps.card.v1.TextInput.on_change_action google.apps.card.v1.SelectionInput.on_change_action google.apps.card.v1.DateTimePicker.on_change_action Setting the fields above will have no effect on the dialog.
&quot;cardActions&quot;: [ # The actions of this card. They are added to a card&#x27;s generated toolbar menu. For example, the following JSON constructs a card action menu with Settings and Send Feedback options: ``` &quot;card_actions&quot;: [ { &quot;actionLabel&quot;: &quot;Setting&quot;, &quot;onClick&quot;: { &quot;action&quot;: { &quot;functionName&quot;: &quot;goToView&quot;, &quot;parameters&quot;: [ { &quot;key&quot;: &quot;viewType&quot;, &quot;value&quot;: &quot;SETTING&quot; } ], &quot;loadIndicator&quot;: &quot;LoadIndicator.SPINNER&quot; } } }, { &quot;actionLabel&quot;: &quot;Send Feedback&quot;, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/feedback&quot; } } } ] ```
{ # A card action is the action associated with the card. For example, an invoice card might include actions such as delete invoice, email invoice, or open the invoice in a browser.
&quot;actionLabel&quot;: &quot;A String&quot;, # The label that displays as the action menu item.
&quot;onClick&quot;: { # The onclick action for this action item.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
],
&quot;displayStyle&quot;: &quot;A String&quot;, # The display style for peekCardHeader.
&quot;fixedFooter&quot;: { # A persistent (sticky) footer that is added to the bottom of the card. # The fixed footer shown at the bottom of this card.
&quot;primaryButton&quot;: { # A button. Can be a text button or an image button. # The primary button of the fixed footer. The button must be a text button with text and color set.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
&quot;secondaryButton&quot;: { # A button. Can be a text button or an image button. # The secondary button of the fixed footer. The button must be a text button with text and color set. `primaryButton` must be set if `secondaryButton` is set.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
},
&quot;header&quot;: { # The header of the card. A header usually contains a title and an image.
&quot;imageAltText&quot;: &quot;A String&quot;, # The alternative text of this image which is used for accessibility.
&quot;imageType&quot;: &quot;A String&quot;, # The image&#x27;s type.
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image in the card header.
&quot;subtitle&quot;: &quot;A String&quot;, # The subtitle of the card header.
&quot;title&quot;: &quot;A String&quot;, # The title of the card header. The title must be specified. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines.
},
&quot;name&quot;: &quot;A String&quot;, # Name of the card, which is used as a identifier for the card in card navigation.
&quot;peekCardHeader&quot;: { # When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards.
&quot;imageAltText&quot;: &quot;A String&quot;, # The alternative text of this image which is used for accessibility.
&quot;imageType&quot;: &quot;A String&quot;, # The image&#x27;s type.
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image in the card header.
&quot;subtitle&quot;: &quot;A String&quot;, # The subtitle of the card header.
&quot;title&quot;: &quot;A String&quot;, # The title of the card header. The title must be specified. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines.
},
&quot;sections&quot;: [ # Sections are separated by a line divider.
{ # A section contains a collection of widgets that are rendered vertically in the order that they are specified. Across all platforms, cards have a narrow fixed width, so there is currently no need for layout properties, for example, float.
&quot;collapsible&quot;: True or False, # Indicates whether this section is collapsible. If a section is collapsible, the description must be given.
&quot;header&quot;: &quot;A String&quot;, # The header of the section. Formatted text is supported.
&quot;uncollapsibleWidgetsCount&quot;: 42, # The number of uncollapsible widgets. For example, when a section contains five widgets and the `numUncollapsibleWidget` is set to `2`, the first two widgets are always shown and the last three are collapsed as default. The `numUncollapsibleWidget` is taken into account only when collapsible is set to `true`.
&quot;widgets&quot;: [ # A section must contain at least 1 widget.
{ # A widget is a UI element that presents texts, images, etc.
&quot;buttonList&quot;: { # A list of buttons layed out horizontally. # A list of buttons. For example, the following JSON creates two buttons. The first is a filled text button and the second is an image button that opens a link: ``` &quot;buttonList&quot;: { &quot;buttons&quot;: [ &quot;button&quot;: { &quot;text&quot;: &quot;Edit&quot;, &quot;Color&quot;: { &quot;Red&quot;: 255 &quot;Green&quot;: 255 &quot;Blue&quot;: 255 } &quot;disabled&quot;: true }, &quot;button&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;INVITE&quot; &quot;altText&quot;: &quot;check calendar&quot; }, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/calendar&quot; } } }, ] } ```
&quot;buttons&quot;: [
{ # A button. Can be a text button or an image button.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
],
},
&quot;dateTimePicker&quot;: { # The widget that lets users to specify a date and time. # Displays a selection/input widget for date/time. For example, the following JSON creates a date/time picker for an appointment time: ``` &quot;date_time_picker&quot;: { &quot;name&quot;: &quot;appointment_time&quot;, &quot;label&quot;: &quot;Book your appointment at:&quot;, &quot;type&quot;: &quot;DateTimePickerType.DATE_AND_TIME&quot;, &quot;valueMsEpoch&quot;: &quot;796435200000&quot; } ```
&quot;label&quot;: &quot;A String&quot;, # The label for the field that displays to the user.
&quot;name&quot;: &quot;A String&quot;, # The name of the text input that&#x27;s used in formInput, and uniquely identifies this input.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # Triggered when the user clicks Save or Clear from the date/time picker dialog. This is only triggered if the value changed as a result of the Save/Clear operation.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;timezoneOffsetDate&quot;: 42, # The number representing the time zone offset from UTC, in minutes. If set, the `value_ms_epoch` is displayed in the specified time zone. If not set, it uses the user&#x27;s time zone setting on the client side.
&quot;type&quot;: &quot;A String&quot;, # The type of the date/time picker.
&quot;valueMsEpoch&quot;: &quot;A String&quot;, # The value to display as the default value before user input or previous user input. It is represented in milliseconds (Epoch time). For `DATE_AND_TIME` type, the full epoch value is used. For `DATE_ONLY` type, only date of the epoch time is used. For `TIME_ONLY` type, only time of the epoch time is used. For example, you can set epoch time to `3 * 60 * 60 * 1000` to represent 3am.
},
&quot;decoratedText&quot;: { # A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget or a button after the text. # Displays a decorated text item in this widget. For example, the following JSON creates a decorated text widget showing email address: ``` &quot;decoratedText&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;EMAIL&quot; }, &quot;topLabel&quot;: &quot;Email Address&quot;, &quot;content&quot;: &quot;heba.salam@example.com&quot;, &quot;bottomLabel&quot;: &quot;This is a new Email address!&quot;, &quot;switchWidget&quot;: { &quot;name&quot;: &quot;has_send_welcome_email_to_heba_salam&quot;, &quot;selected&quot;: false, &quot;controlType&quot;: &quot;ControlType.CHECKBOX&quot; } } ```
&quot;bottomLabel&quot;: &quot;A String&quot;, # The formatted text label that shows below the main text.
&quot;button&quot;: { # A button. Can be a text button or an image button. # A button that can be clicked to trigger an action.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
&quot;endIcon&quot;: { # An icon displayed after the text.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;icon&quot;: { # Deprecated in favor of start_icon.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # Only the top and bottom label and content region are clickable.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;startIcon&quot;: { # The icon displayed in front of the text.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;switchControl&quot;: { # A switch widget can be clicked to change its state or trigger an action.
&quot;controlType&quot;: &quot;A String&quot;, # The control type, either switch or checkbox.
&quot;name&quot;: &quot;A String&quot;, # The name of the switch widget that&#x27;s used in formInput.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # The action when the switch state is changed.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;selected&quot;: True or False, # If the switch is selected.
&quot;value&quot;: &quot;A String&quot;, # The value is what is passed back in the callback.
},
&quot;text&quot;: &quot;A String&quot;, # Required. The main widget formatted text. See Text formatting for details.
&quot;topLabel&quot;: &quot;A String&quot;, # The formatted text label that shows above the main text.
&quot;wrapText&quot;: True or False, # The wrap text setting. If `true`, the text is wrapped and displayed in multiline. Otherwise, the text is truncated.
},
&quot;divider&quot;: { # A divider that appears in between widgets. # Displays a divider. For example, the following JSON creates a divider: ``` &quot;divider&quot;: { } ```
},
&quot;grid&quot;: { # Represents a Grid widget that displays items in a configurable grid layout. # Displays a grid with a collection of items. For example, the following JSON creates a 2 column grid with a single item: ``` &quot;grid&quot;: { &quot;title&quot;: &quot;A fine collection of items&quot;, &quot;numColumns&quot;: 2, &quot;borderStyle&quot;: { &quot;type&quot;: &quot;STROKE&quot;, &quot;cornerRadius&quot;: 4.0 }, &quot;items&quot;: [ &quot;image&quot;: { &quot;imageUri&quot;: &quot;https://www.example.com/image.png&quot;, &quot;cropStyle&quot;: { &quot;type&quot;: &quot;SQUARE&quot; }, &quot;borderStyle&quot;: { &quot;type&quot;: &quot;STROKE&quot; } }, &quot;title&quot;: &quot;An item&quot;, &quot;textAlignment&quot;: &quot;CENTER&quot; ], &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;:&quot;https://www.example.com&quot; } } } ```
&quot;borderStyle&quot;: { # Represents the complete border style applied to widgets. # The border style to apply to each grid item.
&quot;cornerRadius&quot;: 42, # The corner radius for the border.
&quot;strokeColor&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # The colors to use when the type is `BORDER_TYPE_STROKE`.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;type&quot;: &quot;A String&quot;, # The border type.
},
&quot;columnCount&quot;: 42, # The number of columns to display in the grid. A default value is used if this field isn&#x27;t specified, and that default value is different depending on where the grid is shown (dialog versus companion).
&quot;items&quot;: [ # The items to display in the grid.
{ # Represents a single item in the grid layout.
&quot;id&quot;: &quot;A String&quot;, # A user-specified identifier for this grid item. This identifier is returned in the parent Grid&#x27;s onClick callback parameters.
&quot;image&quot;: { # The image that displays in the grid item.
&quot;altText&quot;: &quot;A String&quot;, # The accessibility label for the image.
&quot;borderStyle&quot;: { # Represents the complete border style applied to widgets. # The border style to apply to the image.
&quot;cornerRadius&quot;: 42, # The corner radius for the border.
&quot;strokeColor&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # The colors to use when the type is `BORDER_TYPE_STROKE`.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;type&quot;: &quot;A String&quot;, # The border type.
},
&quot;cropStyle&quot;: { # Represents the crop style applied to an image. # The crop style to apply to the image.
&quot;aspectRatio&quot;: 3.14, # The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`.
&quot;type&quot;: &quot;A String&quot;, # The crop type.
},
&quot;imageUri&quot;: &quot;A String&quot;, # The image URL.
},
&quot;layout&quot;: &quot;A String&quot;, # The layout to use for the grid item.
&quot;subtitle&quot;: &quot;A String&quot;, # The grid item&#x27;s subtitle.
&quot;textAlignment&quot;: &quot;A String&quot;, # The horizontal alignment of the grid item&#x27;s text.
&quot;title&quot;: &quot;A String&quot;, # The grid item&#x27;s title.
},
],
&quot;onClick&quot;: { # This callback is reused by each individual grid item, but with the item&#x27;s identifier and index in the items list added to the callback&#x27;s parameters.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;title&quot;: &quot;A String&quot;, # The text that displays in the grid header.
},
&quot;horizontalAlignment&quot;: &quot;A String&quot;, # The horizontal alignment of this widget.
&quot;image&quot;: { # An image that is specified by a URL and can have an onClick action. # Displays an image in this widget. For example, the following JSON creates an image with alternative text: ``` &quot;image&quot;: { &quot;imageUrl&quot;: &quot;https://example.com/heba_salam.png&quot; &quot;altText&quot;: &quot;Avatar for Heba Salam&quot; } ```
&quot;altText&quot;: &quot;A String&quot;, # The alternative text of this image, used for accessibility.
&quot;imageUrl&quot;: &quot;A String&quot;, # An image URL.
&quot;onClick&quot;: {
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;selectionInput&quot;: { # A widget that creates a UI item (for example, a drop-down list) with options for users to select. # Displays a switch control in this widget. For example, the following JSON creates a dropdown selection for size: ``` &quot;switchControl&quot;: { &quot;name&quot;: &quot;size&quot;, &quot;label&quot;: &quot;Size&quot; &quot;type&quot;: &quot;SelectionType.DROPDOWN&quot;, &quot;items&quot;: [ { &quot;text&quot;: &quot;S&quot;, &quot;value&quot;: &quot;small&quot;, &quot;selected&quot;: false }, { &quot;text&quot;: &quot;M&quot;, &quot;value&quot;: &quot;medium&quot;, &quot;selected&quot;: true }, { &quot;text&quot;: &quot;L&quot;, &quot;value&quot;: &quot;large&quot;, &quot;selected&quot;: false }, { &quot;text&quot;: &quot;XL&quot;, &quot;value&quot;: &quot;extra_large&quot;, &quot;selected&quot;: false } ] } ```
&quot;items&quot;: [
{ # The item in the switch control. A radio button, at most one of the items is selected.
&quot;selected&quot;: True or False, # If more than one item is selected for `RADIO_BUTTON` and `DROPDOWN`, the first selected item is treated as selected and the ones after are ignored.
&quot;text&quot;: &quot;A String&quot;, # The text to be displayed.
&quot;value&quot;: &quot;A String&quot;, # The value associated with this item. The client should use this as a form input value.
},
],
&quot;label&quot;: &quot;A String&quot;, # The label displayed ahead of the switch control.
&quot;name&quot;: &quot;A String&quot;, # The name of the text input which is used in formInput.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, the form is submitted when the selection changes. If not specified, you must specify a separate button.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;type&quot;: &quot;A String&quot;,
},
&quot;textInput&quot;: { # A text input is a UI item where users can input text. A text input can also have an onChange action and suggestions. # Displays a text input in this widget. For example, the following JSON creates a text input for mail address: ``` &quot;textInput&quot;: { &quot;name&quot;: &quot;mailing_address&quot;, &quot;label&quot;: &quot;Mailing Address&quot; } ``` As another example, the following JSON creates a text input for programming language with static suggestions: ``` &quot;textInput&quot;: { &quot;name&quot;: &quot;preferred_programing_language&quot;, &quot;label&quot;: &quot;Preferred Language&quot;, &quot;initialSuggestions&quot;: { &quot;items&quot;: [ { &quot;text&quot;: &quot;C++&quot; }, { &quot;text&quot;: &quot;Java&quot; }, { &quot;text&quot;: &quot;JavaScript&quot; }, { &quot;text&quot;: &quot;Python&quot; } ] } } ```
&quot;autoCompleteAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # The refresh function that returns suggestions based on the user&#x27;s input text. If the callback is not specified, autocomplete is done in client side based on the initial suggestion items.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;hintText&quot;: &quot;A String&quot;, # The hint text.
&quot;initialSuggestions&quot;: { # A container wrapping elements necessary for showing suggestion items used in text input autocomplete. # The initial suggestions made before any user input.
&quot;items&quot;: [ # A list of suggestions items which will be used in are used in autocomplete.
{ # A suggestion item. Only supports text for now.
&quot;text&quot;: &quot;A String&quot;,
},
],
},
&quot;label&quot;: &quot;A String&quot;, # At least one of label and hintText must be specified.
&quot;name&quot;: &quot;A String&quot;, # The name of the text input which is used in formInput.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # The onChange action, for example, invoke a function.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;type&quot;: &quot;A String&quot;, # The style of the text, for example, a single line or multiple lines.
&quot;value&quot;: &quot;A String&quot;, # The default value when there is no input from the user.
},
&quot;textParagraph&quot;: { # A paragraph of text that supports formatting. See [Text formatting](workspace/add-ons/concepts/widgets#text_formatting&quot;) for details. # Displays a text paragraph in this widget. For example, the following JSON creates a bolded text: ``` &quot;textParagraph&quot;: { &quot;text&quot;: &quot; *bold text*&quot; } ```
&quot;text&quot;: &quot;A String&quot;, # The text that&#x27;s shown in the widget.
},
},
],
},
],
},
},
},
&quot;type&quot;: &quot;A String&quot;, # The type of bot response.
&quot;url&quot;: &quot;A String&quot;, # URL for users to auth or config. (Only for REQUEST_CONFIG response types.)
},
&quot;annotations&quot;: [ # Output only. Annotations associated with the text in this message.
{ # Annotations associated with the plain-text body of the message. Example plain-text message body: ``` Hello @FooBot how are you!&quot; ``` The corresponding annotations metadata: ``` &quot;annotations&quot;:[{ &quot;type&quot;:&quot;USER_MENTION&quot;, &quot;startIndex&quot;:6, &quot;length&quot;:7, &quot;userMention&quot;: { &quot;user&quot;: { &quot;name&quot;:&quot;users/107946847022116401880&quot;, &quot;displayName&quot;:&quot;FooBot&quot;, &quot;avatarUrl&quot;:&quot;https://goo.gl/aeDtrS&quot;, &quot;type&quot;:&quot;BOT&quot; }, &quot;type&quot;:&quot;MENTION&quot; } }] ```
&quot;length&quot;: 42, # Length of the substring in the plain-text message body this annotation corresponds to.
&quot;slashCommand&quot;: { # Annotation metadata for slash commands (/). # The metadata for a slash command.
&quot;bot&quot;: { # A user in Google Chat. # The bot whose command was invoked.
&quot;displayName&quot;: &quot;A String&quot;, # The user&#x27;s display name.
&quot;domainId&quot;: &quot;A String&quot;, # Obfuscated domain information.
&quot;isAnonymous&quot;: True or False, # True when the user is deleted or the user&#x27;s profile is not visible.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the format &quot;users/*&quot;.
&quot;type&quot;: &quot;A String&quot;, # User type.
},
&quot;commandId&quot;: &quot;A String&quot;, # The command id of the invoked slash command.
&quot;commandName&quot;: &quot;A String&quot;, # The name of the invoked slash command.
&quot;triggersDialog&quot;: True or False, # Indicating whether the slash command is for a dialog.
&quot;type&quot;: &quot;A String&quot;, # The type of slash command.
},
&quot;startIndex&quot;: 42, # Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
&quot;type&quot;: &quot;A String&quot;, # The type of this annotation.
&quot;userMention&quot;: { # Annotation metadata for user mentions (@). # The metadata of user mention.
&quot;type&quot;: &quot;A String&quot;, # The type of user mention.
&quot;user&quot;: { # A user in Google Chat. # The user mentioned.
&quot;displayName&quot;: &quot;A String&quot;, # The user&#x27;s display name.
&quot;domainId&quot;: &quot;A String&quot;, # Obfuscated domain information.
&quot;isAnonymous&quot;: True or False, # True when the user is deleted or the user&#x27;s profile is not visible.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the format &quot;users/*&quot;.
&quot;type&quot;: &quot;A String&quot;, # User type.
},
},
},
],
&quot;argumentText&quot;: &quot;A String&quot;, # Plain-text body of the message with all bot mentions stripped out.
&quot;attachment&quot;: [ # User uploaded attachment.
{ # An attachment in Google Chat.
&quot;attachmentDataRef&quot;: { # A reference to the data of an attachment. # A reference to the attachment data. This is used with the media API to download the attachment data.
&quot;resourceName&quot;: &quot;A String&quot;, # The resource name of the attachment data. This is used with the media API to download the attachment data.
},
&quot;contentName&quot;: &quot;A String&quot;, # The original file name for the content, not the full path.
&quot;contentType&quot;: &quot;A String&quot;, # The content type (MIME type) of the file.
&quot;downloadUri&quot;: &quot;A String&quot;, # Output only. The download URL which should be used to allow a human user to download the attachment. Bots should not use this URL to download attachment content.
&quot;driveDataRef&quot;: { # A reference to the data of a drive attachment. # A reference to the drive attachment. This is used with the Drive API.
&quot;driveFileId&quot;: &quot;A String&quot;, # The id for the drive file, for use with the Drive API.
},
&quot;name&quot;: &quot;A String&quot;, # Resource name of the attachment, in the form &quot;spaces/*/messages/*/attachments/*&quot;.
&quot;source&quot;: &quot;A String&quot;, # The source of the attachment.
&quot;thumbnailUri&quot;: &quot;A String&quot;, # Output only. The thumbnail URL which should be used to preview the attachment to a human user. Bots should not use this URL to download attachment content.
},
],
&quot;cards&quot;: [ # Rich, formatted and interactive cards that can be used to display UI elements such as: formatted texts, buttons, clickable images. Cards are normally displayed below the plain-text body of the message.
{ # A card is a UI element that can contain UI widgets such as texts, images.
&quot;cardActions&quot;: [ # The actions of this card.
{ # A card action is the action associated with the card. For an invoice card, a typical action would be: delete invoice, email invoice or open the invoice in browser.
&quot;actionLabel&quot;: &quot;A String&quot;, # The label used to be displayed in the action menu item.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action for this action item.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
],
&quot;header&quot;: { # The header of the card. A header usually contains a title and an image.
&quot;imageStyle&quot;: &quot;A String&quot;, # The image&#x27;s type (e.g. square border or circular border).
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image in the card header.
&quot;subtitle&quot;: &quot;A String&quot;, # The subtitle of the card header.
&quot;title&quot;: &quot;A String&quot;, # The title must be specified. The header has a fixed height: if both a title and subtitle is specified, each will take up 1 line. If only the title is specified, it will take up both lines.
},
&quot;name&quot;: &quot;A String&quot;, # Name of the card.
&quot;sections&quot;: [ # Sections are separated by a line divider.
{ # A section contains a collection of widgets that are rendered (vertically) in the order that they are specified. Across all platforms, cards have a narrow fixed width, so there is currently no need for layout properties (e.g. float).
&quot;header&quot;: &quot;A String&quot;, # The header of the section, text formatted supported.
&quot;widgets&quot;: [ # A section must contain at least 1 widget.
{ # A widget is a UI element that presents texts, images, etc.
&quot;buttons&quot;: [ # A list of buttons. Buttons is also oneof data and only one of these fields should be set.
{ # A button. Can be a text button or an image button.
&quot;imageButton&quot;: { # An image button with an onclick action. # A button with image and onclick action.
&quot;icon&quot;: &quot;A String&quot;, # The icon specified by an enum that indices to an icon provided by Chat API.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;name&quot;: &quot;A String&quot;, # The name of this image_button which will be used for accessibility. Default value will be provided if developers don&#x27;t specify.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;textButton&quot;: { # A button with text and onclick action. # A button with text and onclick action.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action of the button.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
},
],
&quot;image&quot;: { # An image that is specified by a URL and can have an onclick action. # Display an image in this widget.
&quot;aspectRatio&quot;: 3.14, # The aspect ratio of this image (width/height). This field allows clients to reserve the right height for the image while waiting for it to load. It&#x27;s not meant to override the native aspect ratio of the image. If unset, the server fills it by prefetching the image.
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;keyValue&quot;: { # A UI element contains a key (label) and a value (content). And this element may also contain some actions such as onclick button. # Display a key value item in this widget.
&quot;bottomLabel&quot;: &quot;A String&quot;, # The text of the bottom label. Formatted text supported.
&quot;button&quot;: { # A button. Can be a text button or an image button. # A button that can be clicked to trigger an action.
&quot;imageButton&quot;: { # An image button with an onclick action. # A button with image and onclick action.
&quot;icon&quot;: &quot;A String&quot;, # The icon specified by an enum that indices to an icon provided by Chat API.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;name&quot;: &quot;A String&quot;, # The name of this image_button which will be used for accessibility. Default value will be provided if developers don&#x27;t specify.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;textButton&quot;: { # A button with text and onclick action. # A button with text and onclick action.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action of the button.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
},
&quot;content&quot;: &quot;A String&quot;, # The text of the content. Formatted text supported and always required.
&quot;contentMultiline&quot;: True or False, # If the content should be multiline.
&quot;icon&quot;: &quot;A String&quot;, # An enum value that will be replaced by the Chat API with the corresponding icon image.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action. Only the top label, bottom label and content region are clickable.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;topLabel&quot;: &quot;A String&quot;, # The text of the top label. Formatted text supported.
},
&quot;textParagraph&quot;: { # A paragraph of text. Formatted text supported. # Display a text paragraph in this widget.
&quot;text&quot;: &quot;A String&quot;,
},
},
],
},
],
},
],
&quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the message was created in Google Chat server.
&quot;fallbackText&quot;: &quot;A String&quot;, # A plain-text description of the message&#x27;s cards, used when the actual cards cannot be displayed (e.g. mobile notifications).
&quot;lastUpdateTime&quot;: &quot;A String&quot;, # Output only. The time at which the message was last updated in Google Chat server. If the message was never updated, this field will be same as create_time.
&quot;name&quot;: &quot;A String&quot;, # Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4`
&quot;previewText&quot;: &quot;A String&quot;, # Text for generating preview chips. This text will not be displayed to the user, but any links to images, web pages, videos, etc. included here will generate preview chips.
&quot;sender&quot;: { # A user in Google Chat. # The user who created the message.
&quot;displayName&quot;: &quot;A String&quot;, # The user&#x27;s display name.
&quot;domainId&quot;: &quot;A String&quot;, # Obfuscated domain information.
&quot;isAnonymous&quot;: True or False, # True when the user is deleted or the user&#x27;s profile is not visible.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the format &quot;users/*&quot;.
&quot;type&quot;: &quot;A String&quot;, # User type.
},
&quot;slashCommand&quot;: { # A Slash Command in Chat. # Slash command information, if applicable.
&quot;commandId&quot;: &quot;A String&quot;, # The id of the slash command invoked.
},
&quot;space&quot;: { # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat bot. # The space the message belongs to.
&quot;displayName&quot;: &quot;A String&quot;, # Output only. The display name (only if the space is of type `ROOM`). Please note that this field might not be populated in direct messages between humans.
&quot;name&quot;: &quot;A String&quot;, # Resource name of the space, in the form &quot;spaces/*&quot;. Example: spaces/AAAAAAAAAAAA
&quot;singleUserBotDm&quot;: True or False, # Whether the space is a DM between a bot and a single human.
&quot;threaded&quot;: True or False, # Whether the messages are threaded in this space.
&quot;type&quot;: &quot;A String&quot;, # Output only. The type of a space. This is deprecated. Use `single_user_bot_dm` instead.
},
&quot;text&quot;: &quot;A String&quot;, # Plain-text body of the message.
&quot;thread&quot;: { # A thread in Google Chat. # The thread the message belongs to.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the form &quot;spaces/*/threads/*&quot;. Example: spaces/AAAAMpdlehY/threads/UMxbHmzDlr4
},
}
requestId: string, Optional. A unique request ID for this message. If a message has already been created in the space with this request ID, the subsequent request will return the existing message and no new message will be created.
threadKey: string, Optional. Opaque thread identifier string that can be specified to group messages into a single thread. If this is the first message with a given thread identifier, a new thread is created. Subsequent messages with the same thread identifier will be posted into the same thread. This relieves bots and webhooks from having to store the Google Chat thread ID of a thread (created earlier by them) to post further updates to it. Has no effect if thread field, corresponding to an existing thread, is set in message.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # A message in Google Chat.
&quot;actionResponse&quot;: { # Parameters that a bot can use to configure how it&#x27;s response is posted. # Input only. Parameters that a bot can use to configure how its response is posted.
&quot;dialogAction&quot;: { # Contains dialog if present as well as the ActionStatus for the request sent from user. # This response is for Dialog related events and must be accompanied by ResponseType.Dialog
&quot;actionStatus&quot;: { # ActionStatus represents status of a request from the bot developer&#x27;s side. In specific, for each request a bot gets, the bot developer will set both fields below in relation to what the response status and message related to status should be. # Status for either invoke dialog or submit dialog requests. This will be used to display a status and message to user if needed. For example in case of an error or success.
&quot;statusCode&quot;: &quot;A String&quot;, # The status code.
&quot;userFacingMessage&quot;: &quot;A String&quot;, # This message will be the corresponding string to the above status_code. If unset, an appropriate generic message based on the status_code will be shown to the user. If this field is set then the message will be surfaced to the user for both successes and errors.
},
&quot;dialog&quot;: { # Wrapper around the card body of the dialog. # Dialog for the request.
&quot;body&quot;: { # A card is a UI element that can contain UI widgets such as text and images. For more information, see Cards . For example, the following JSON creates a card that has a header with the name, position, icons, and link for a contact, followed by a section with contact information like email and phone number. ``` { &quot;header&quot;: { &quot;title&quot;: &quot;Heba Salam&quot;, &quot;subtitle&quot;: &quot;Software Engineer&quot;, &quot;imageStyle&quot;: &quot;ImageStyle.AVATAR&quot;, &quot;imageUrl&quot;: &quot;https://example.com/heba_salam.png&quot;, &quot;imageAltText&quot;: &quot;Avatar for Heba Salam&quot; }, &quot;sections&quot; : [ { &quot;header&quot;: &quot;Contact Info&quot;, &quot;widgets&quot;: [ { &quot;decorated_text&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;EMAIL&quot; }, &quot;content&quot;: &quot;heba.salam@example.com&quot; } }, { &quot;decoratedText&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;PERSON&quot; }, &quot;content&quot;: &quot;Online&quot; } }, { &quot;decoratedText&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;PHONE&quot; }, &quot;content&quot;: &quot;+1 (555) 555-1234&quot; } }, { &quot;buttons&quot;: [ { &quot;textButton&quot;: { &quot;text&quot;: &quot;Share&quot;, }, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/share&quot; } } }, { &quot;textButton&quot;: { &quot;text&quot;: &quot;Edit&quot;, }, &quot;onClick&quot;: { &quot;action&quot;: { &quot;function&quot;: &quot;goToView&quot;, &quot;parameters&quot;: [ { &quot;key&quot;: &quot;viewType&quot;, &quot;value&quot;: &quot;EDIT&quot; } ], &quot;loadIndicator&quot;: &quot;LoadIndicator.SPINNER&quot; } } } ] } ], &quot;collapsible&quot;: true, &quot;uncollapsibleWidgetsCount&quot;: 3 } ], &quot;cardActions&quot;: [ { &quot;actionLabel&quot;: &quot;Send Feedback&quot;, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/feedback&quot; } } } ], &quot;name&quot;: &quot;contact-card-K3wB6arF2H9L&quot; } ``` # Body of the dialog, which will be rendered in a modal. NOTE: The following fields within the objects are not supported: google.apps.card.v1.Widget.date_time_picker google.apps.card.v1.DecoratedText.SwitchControl.on_change_action google.apps.card.v1.TextInput.on_change_action google.apps.card.v1.SelectionInput.on_change_action google.apps.card.v1.DateTimePicker.on_change_action Setting the fields above will have no effect on the dialog.
&quot;cardActions&quot;: [ # The actions of this card. They are added to a card&#x27;s generated toolbar menu. For example, the following JSON constructs a card action menu with Settings and Send Feedback options: ``` &quot;card_actions&quot;: [ { &quot;actionLabel&quot;: &quot;Setting&quot;, &quot;onClick&quot;: { &quot;action&quot;: { &quot;functionName&quot;: &quot;goToView&quot;, &quot;parameters&quot;: [ { &quot;key&quot;: &quot;viewType&quot;, &quot;value&quot;: &quot;SETTING&quot; } ], &quot;loadIndicator&quot;: &quot;LoadIndicator.SPINNER&quot; } } }, { &quot;actionLabel&quot;: &quot;Send Feedback&quot;, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/feedback&quot; } } } ] ```
{ # A card action is the action associated with the card. For example, an invoice card might include actions such as delete invoice, email invoice, or open the invoice in a browser.
&quot;actionLabel&quot;: &quot;A String&quot;, # The label that displays as the action menu item.
&quot;onClick&quot;: { # The onclick action for this action item.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
],
&quot;displayStyle&quot;: &quot;A String&quot;, # The display style for peekCardHeader.
&quot;fixedFooter&quot;: { # A persistent (sticky) footer that is added to the bottom of the card. # The fixed footer shown at the bottom of this card.
&quot;primaryButton&quot;: { # A button. Can be a text button or an image button. # The primary button of the fixed footer. The button must be a text button with text and color set.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
&quot;secondaryButton&quot;: { # A button. Can be a text button or an image button. # The secondary button of the fixed footer. The button must be a text button with text and color set. `primaryButton` must be set if `secondaryButton` is set.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
},
&quot;header&quot;: { # The header of the card. A header usually contains a title and an image.
&quot;imageAltText&quot;: &quot;A String&quot;, # The alternative text of this image which is used for accessibility.
&quot;imageType&quot;: &quot;A String&quot;, # The image&#x27;s type.
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image in the card header.
&quot;subtitle&quot;: &quot;A String&quot;, # The subtitle of the card header.
&quot;title&quot;: &quot;A String&quot;, # The title of the card header. The title must be specified. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines.
},
&quot;name&quot;: &quot;A String&quot;, # Name of the card, which is used as a identifier for the card in card navigation.
&quot;peekCardHeader&quot;: { # When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards.
&quot;imageAltText&quot;: &quot;A String&quot;, # The alternative text of this image which is used for accessibility.
&quot;imageType&quot;: &quot;A String&quot;, # The image&#x27;s type.
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image in the card header.
&quot;subtitle&quot;: &quot;A String&quot;, # The subtitle of the card header.
&quot;title&quot;: &quot;A String&quot;, # The title of the card header. The title must be specified. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines.
},
&quot;sections&quot;: [ # Sections are separated by a line divider.
{ # A section contains a collection of widgets that are rendered vertically in the order that they are specified. Across all platforms, cards have a narrow fixed width, so there is currently no need for layout properties, for example, float.
&quot;collapsible&quot;: True or False, # Indicates whether this section is collapsible. If a section is collapsible, the description must be given.
&quot;header&quot;: &quot;A String&quot;, # The header of the section. Formatted text is supported.
&quot;uncollapsibleWidgetsCount&quot;: 42, # The number of uncollapsible widgets. For example, when a section contains five widgets and the `numUncollapsibleWidget` is set to `2`, the first two widgets are always shown and the last three are collapsed as default. The `numUncollapsibleWidget` is taken into account only when collapsible is set to `true`.
&quot;widgets&quot;: [ # A section must contain at least 1 widget.
{ # A widget is a UI element that presents texts, images, etc.
&quot;buttonList&quot;: { # A list of buttons layed out horizontally. # A list of buttons. For example, the following JSON creates two buttons. The first is a filled text button and the second is an image button that opens a link: ``` &quot;buttonList&quot;: { &quot;buttons&quot;: [ &quot;button&quot;: { &quot;text&quot;: &quot;Edit&quot;, &quot;Color&quot;: { &quot;Red&quot;: 255 &quot;Green&quot;: 255 &quot;Blue&quot;: 255 } &quot;disabled&quot;: true }, &quot;button&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;INVITE&quot; &quot;altText&quot;: &quot;check calendar&quot; }, &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;: &quot;https://example.com/calendar&quot; } } }, ] } ```
&quot;buttons&quot;: [
{ # A button. Can be a text button or an image button.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
],
},
&quot;dateTimePicker&quot;: { # The widget that lets users to specify a date and time. # Displays a selection/input widget for date/time. For example, the following JSON creates a date/time picker for an appointment time: ``` &quot;date_time_picker&quot;: { &quot;name&quot;: &quot;appointment_time&quot;, &quot;label&quot;: &quot;Book your appointment at:&quot;, &quot;type&quot;: &quot;DateTimePickerType.DATE_AND_TIME&quot;, &quot;valueMsEpoch&quot;: &quot;796435200000&quot; } ```
&quot;label&quot;: &quot;A String&quot;, # The label for the field that displays to the user.
&quot;name&quot;: &quot;A String&quot;, # The name of the text input that&#x27;s used in formInput, and uniquely identifies this input.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # Triggered when the user clicks Save or Clear from the date/time picker dialog. This is only triggered if the value changed as a result of the Save/Clear operation.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;timezoneOffsetDate&quot;: 42, # The number representing the time zone offset from UTC, in minutes. If set, the `value_ms_epoch` is displayed in the specified time zone. If not set, it uses the user&#x27;s time zone setting on the client side.
&quot;type&quot;: &quot;A String&quot;, # The type of the date/time picker.
&quot;valueMsEpoch&quot;: &quot;A String&quot;, # The value to display as the default value before user input or previous user input. It is represented in milliseconds (Epoch time). For `DATE_AND_TIME` type, the full epoch value is used. For `DATE_ONLY` type, only date of the epoch time is used. For `TIME_ONLY` type, only time of the epoch time is used. For example, you can set epoch time to `3 * 60 * 60 * 1000` to represent 3am.
},
&quot;decoratedText&quot;: { # A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget or a button after the text. # Displays a decorated text item in this widget. For example, the following JSON creates a decorated text widget showing email address: ``` &quot;decoratedText&quot;: { &quot;icon&quot;: { &quot;knownIcon&quot;: &quot;EMAIL&quot; }, &quot;topLabel&quot;: &quot;Email Address&quot;, &quot;content&quot;: &quot;heba.salam@example.com&quot;, &quot;bottomLabel&quot;: &quot;This is a new Email address!&quot;, &quot;switchWidget&quot;: { &quot;name&quot;: &quot;has_send_welcome_email_to_heba_salam&quot;, &quot;selected&quot;: false, &quot;controlType&quot;: &quot;ControlType.CHECKBOX&quot; } } ```
&quot;bottomLabel&quot;: &quot;A String&quot;, # The formatted text label that shows below the main text.
&quot;button&quot;: { # A button. Can be a text button or an image button. # A button that can be clicked to trigger an action.
&quot;altText&quot;: &quot;A String&quot;, # The alternative text used for accessibility. Has no effect when an icon is set; use `icon.alt_text` instead.
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # If set, the button is filled with a solid background.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;disabled&quot;: True or False, # If true, the button is displayed in a disabled state and doesn&#x27;t respond to user actions.
&quot;icon&quot;: { # The icon image.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # The action to perform when the button is clicked.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
&quot;endIcon&quot;: { # An icon displayed after the text.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;icon&quot;: { # Deprecated in favor of start_icon.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;onClick&quot;: { # Only the top and bottom label and content region are clickable.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;startIcon&quot;: { # The icon displayed in front of the text.
&quot;altText&quot;: &quot;A String&quot;, # The description of the icon, used for accessibility. The default value is provided if you don&#x27;t specify one.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;imageType&quot;: &quot;A String&quot;, # The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon.
&quot;knownIcon&quot;: &quot;A String&quot;, # The icon specified by the string name of a list of known icons
},
&quot;switchControl&quot;: { # A switch widget can be clicked to change its state or trigger an action.
&quot;controlType&quot;: &quot;A String&quot;, # The control type, either switch or checkbox.
&quot;name&quot;: &quot;A String&quot;, # The name of the switch widget that&#x27;s used in formInput.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # The action when the switch state is changed.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;selected&quot;: True or False, # If the switch is selected.
&quot;value&quot;: &quot;A String&quot;, # The value is what is passed back in the callback.
},
&quot;text&quot;: &quot;A String&quot;, # Required. The main widget formatted text. See Text formatting for details.
&quot;topLabel&quot;: &quot;A String&quot;, # The formatted text label that shows above the main text.
&quot;wrapText&quot;: True or False, # The wrap text setting. If `true`, the text is wrapped and displayed in multiline. Otherwise, the text is truncated.
},
&quot;divider&quot;: { # A divider that appears in between widgets. # Displays a divider. For example, the following JSON creates a divider: ``` &quot;divider&quot;: { } ```
},
&quot;grid&quot;: { # Represents a Grid widget that displays items in a configurable grid layout. # Displays a grid with a collection of items. For example, the following JSON creates a 2 column grid with a single item: ``` &quot;grid&quot;: { &quot;title&quot;: &quot;A fine collection of items&quot;, &quot;numColumns&quot;: 2, &quot;borderStyle&quot;: { &quot;type&quot;: &quot;STROKE&quot;, &quot;cornerRadius&quot;: 4.0 }, &quot;items&quot;: [ &quot;image&quot;: { &quot;imageUri&quot;: &quot;https://www.example.com/image.png&quot;, &quot;cropStyle&quot;: { &quot;type&quot;: &quot;SQUARE&quot; }, &quot;borderStyle&quot;: { &quot;type&quot;: &quot;STROKE&quot; } }, &quot;title&quot;: &quot;An item&quot;, &quot;textAlignment&quot;: &quot;CENTER&quot; ], &quot;onClick&quot;: { &quot;openLink&quot;: { &quot;url&quot;:&quot;https://www.example.com&quot; } } } ```
&quot;borderStyle&quot;: { # Represents the complete border style applied to widgets. # The border style to apply to each grid item.
&quot;cornerRadius&quot;: 42, # The corner radius for the border.
&quot;strokeColor&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # The colors to use when the type is `BORDER_TYPE_STROKE`.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;type&quot;: &quot;A String&quot;, # The border type.
},
&quot;columnCount&quot;: 42, # The number of columns to display in the grid. A default value is used if this field isn&#x27;t specified, and that default value is different depending on where the grid is shown (dialog versus companion).
&quot;items&quot;: [ # The items to display in the grid.
{ # Represents a single item in the grid layout.
&quot;id&quot;: &quot;A String&quot;, # A user-specified identifier for this grid item. This identifier is returned in the parent Grid&#x27;s onClick callback parameters.
&quot;image&quot;: { # The image that displays in the grid item.
&quot;altText&quot;: &quot;A String&quot;, # The accessibility label for the image.
&quot;borderStyle&quot;: { # Represents the complete border style applied to widgets. # The border style to apply to the image.
&quot;cornerRadius&quot;: 42, # The corner radius for the border.
&quot;strokeColor&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # The colors to use when the type is `BORDER_TYPE_STROKE`.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
},
&quot;type&quot;: &quot;A String&quot;, # The border type.
},
&quot;cropStyle&quot;: { # Represents the crop style applied to an image. # The crop style to apply to the image.
&quot;aspectRatio&quot;: 3.14, # The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`.
&quot;type&quot;: &quot;A String&quot;, # The crop type.
},
&quot;imageUri&quot;: &quot;A String&quot;, # The image URL.
},
&quot;layout&quot;: &quot;A String&quot;, # The layout to use for the grid item.
&quot;subtitle&quot;: &quot;A String&quot;, # The grid item&#x27;s subtitle.
&quot;textAlignment&quot;: &quot;A String&quot;, # The horizontal alignment of the grid item&#x27;s text.
&quot;title&quot;: &quot;A String&quot;, # The grid item&#x27;s title.
},
],
&quot;onClick&quot;: { # This callback is reused by each individual grid item, but with the item&#x27;s identifier and index in the items list added to the callback&#x27;s parameters.
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;title&quot;: &quot;A String&quot;, # The text that displays in the grid header.
},
&quot;horizontalAlignment&quot;: &quot;A String&quot;, # The horizontal alignment of this widget.
&quot;image&quot;: { # An image that is specified by a URL and can have an onClick action. # Displays an image in this widget. For example, the following JSON creates an image with alternative text: ``` &quot;image&quot;: { &quot;imageUrl&quot;: &quot;https://example.com/heba_salam.png&quot; &quot;altText&quot;: &quot;Avatar for Heba Salam&quot; } ```
&quot;altText&quot;: &quot;A String&quot;, # The alternative text of this image, used for accessibility.
&quot;imageUrl&quot;: &quot;A String&quot;, # An image URL.
&quot;onClick&quot;: {
&quot;action&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, an action is triggered by this onClick.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;card&quot;: # Object with schema name: GoogleAppsCardV1Card # A new card is pushed to the card stack after clicking if specified.
&quot;openDynamicLinkAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;openLink&quot;: { # If specified, this onClick triggers an open link action.
&quot;onClose&quot;: &quot;A String&quot;,
&quot;openAs&quot;: &quot;A String&quot;,
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;selectionInput&quot;: { # A widget that creates a UI item (for example, a drop-down list) with options for users to select. # Displays a switch control in this widget. For example, the following JSON creates a dropdown selection for size: ``` &quot;switchControl&quot;: { &quot;name&quot;: &quot;size&quot;, &quot;label&quot;: &quot;Size&quot; &quot;type&quot;: &quot;SelectionType.DROPDOWN&quot;, &quot;items&quot;: [ { &quot;text&quot;: &quot;S&quot;, &quot;value&quot;: &quot;small&quot;, &quot;selected&quot;: false }, { &quot;text&quot;: &quot;M&quot;, &quot;value&quot;: &quot;medium&quot;, &quot;selected&quot;: true }, { &quot;text&quot;: &quot;L&quot;, &quot;value&quot;: &quot;large&quot;, &quot;selected&quot;: false }, { &quot;text&quot;: &quot;XL&quot;, &quot;value&quot;: &quot;extra_large&quot;, &quot;selected&quot;: false } ] } ```
&quot;items&quot;: [
{ # The item in the switch control. A radio button, at most one of the items is selected.
&quot;selected&quot;: True or False, # If more than one item is selected for `RADIO_BUTTON` and `DROPDOWN`, the first selected item is treated as selected and the ones after are ignored.
&quot;text&quot;: &quot;A String&quot;, # The text to be displayed.
&quot;value&quot;: &quot;A String&quot;, # The value associated with this item. The client should use this as a form input value.
},
],
&quot;label&quot;: &quot;A String&quot;, # The label displayed ahead of the switch control.
&quot;name&quot;: &quot;A String&quot;, # The name of the text input which is used in formInput.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # If specified, the form is submitted when the selection changes. If not specified, you must specify a separate button.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;type&quot;: &quot;A String&quot;,
},
&quot;textInput&quot;: { # A text input is a UI item where users can input text. A text input can also have an onChange action and suggestions. # Displays a text input in this widget. For example, the following JSON creates a text input for mail address: ``` &quot;textInput&quot;: { &quot;name&quot;: &quot;mailing_address&quot;, &quot;label&quot;: &quot;Mailing Address&quot; } ``` As another example, the following JSON creates a text input for programming language with static suggestions: ``` &quot;textInput&quot;: { &quot;name&quot;: &quot;preferred_programing_language&quot;, &quot;label&quot;: &quot;Preferred Language&quot;, &quot;initialSuggestions&quot;: { &quot;items&quot;: [ { &quot;text&quot;: &quot;C++&quot; }, { &quot;text&quot;: &quot;Java&quot; }, { &quot;text&quot;: &quot;JavaScript&quot; }, { &quot;text&quot;: &quot;Python&quot; } ] } } ```
&quot;autoCompleteAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # The refresh function that returns suggestions based on the user&#x27;s input text. If the callback is not specified, autocomplete is done in client side based on the initial suggestion items.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;hintText&quot;: &quot;A String&quot;, # The hint text.
&quot;initialSuggestions&quot;: { # A container wrapping elements necessary for showing suggestion items used in text input autocomplete. # The initial suggestions made before any user input.
&quot;items&quot;: [ # A list of suggestions items which will be used in are used in autocomplete.
{ # A suggestion item. Only supports text for now.
&quot;text&quot;: &quot;A String&quot;,
},
],
},
&quot;label&quot;: &quot;A String&quot;, # At least one of label and hintText must be specified.
&quot;name&quot;: &quot;A String&quot;, # The name of the text input which is used in formInput.
&quot;onChangeAction&quot;: { # An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # The onChange action, for example, invoke a function.
&quot;function&quot;: &quot;A String&quot;, # Apps Script function to invoke when the containing element is clicked/activated.
&quot;loadIndicator&quot;: &quot;A String&quot;,
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
&quot;persistValues&quot;: True or False, # Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed.
},
&quot;type&quot;: &quot;A String&quot;, # The style of the text, for example, a single line or multiple lines.
&quot;value&quot;: &quot;A String&quot;, # The default value when there is no input from the user.
},
&quot;textParagraph&quot;: { # A paragraph of text that supports formatting. See [Text formatting](workspace/add-ons/concepts/widgets#text_formatting&quot;) for details. # Displays a text paragraph in this widget. For example, the following JSON creates a bolded text: ``` &quot;textParagraph&quot;: { &quot;text&quot;: &quot; *bold text*&quot; } ```
&quot;text&quot;: &quot;A String&quot;, # The text that&#x27;s shown in the widget.
},
},
],
},
],
},
},
},
&quot;type&quot;: &quot;A String&quot;, # The type of bot response.
&quot;url&quot;: &quot;A String&quot;, # URL for users to auth or config. (Only for REQUEST_CONFIG response types.)
},
&quot;annotations&quot;: [ # Output only. Annotations associated with the text in this message.
{ # Annotations associated with the plain-text body of the message. Example plain-text message body: ``` Hello @FooBot how are you!&quot; ``` The corresponding annotations metadata: ``` &quot;annotations&quot;:[{ &quot;type&quot;:&quot;USER_MENTION&quot;, &quot;startIndex&quot;:6, &quot;length&quot;:7, &quot;userMention&quot;: { &quot;user&quot;: { &quot;name&quot;:&quot;users/107946847022116401880&quot;, &quot;displayName&quot;:&quot;FooBot&quot;, &quot;avatarUrl&quot;:&quot;https://goo.gl/aeDtrS&quot;, &quot;type&quot;:&quot;BOT&quot; }, &quot;type&quot;:&quot;MENTION&quot; } }] ```
&quot;length&quot;: 42, # Length of the substring in the plain-text message body this annotation corresponds to.
&quot;slashCommand&quot;: { # Annotation metadata for slash commands (/). # The metadata for a slash command.
&quot;bot&quot;: { # A user in Google Chat. # The bot whose command was invoked.
&quot;displayName&quot;: &quot;A String&quot;, # The user&#x27;s display name.
&quot;domainId&quot;: &quot;A String&quot;, # Obfuscated domain information.
&quot;isAnonymous&quot;: True or False, # True when the user is deleted or the user&#x27;s profile is not visible.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the format &quot;users/*&quot;.
&quot;type&quot;: &quot;A String&quot;, # User type.
},
&quot;commandId&quot;: &quot;A String&quot;, # The command id of the invoked slash command.
&quot;commandName&quot;: &quot;A String&quot;, # The name of the invoked slash command.
&quot;triggersDialog&quot;: True or False, # Indicating whether the slash command is for a dialog.
&quot;type&quot;: &quot;A String&quot;, # The type of slash command.
},
&quot;startIndex&quot;: 42, # Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
&quot;type&quot;: &quot;A String&quot;, # The type of this annotation.
&quot;userMention&quot;: { # Annotation metadata for user mentions (@). # The metadata of user mention.
&quot;type&quot;: &quot;A String&quot;, # The type of user mention.
&quot;user&quot;: { # A user in Google Chat. # The user mentioned.
&quot;displayName&quot;: &quot;A String&quot;, # The user&#x27;s display name.
&quot;domainId&quot;: &quot;A String&quot;, # Obfuscated domain information.
&quot;isAnonymous&quot;: True or False, # True when the user is deleted or the user&#x27;s profile is not visible.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the format &quot;users/*&quot;.
&quot;type&quot;: &quot;A String&quot;, # User type.
},
},
},
],
&quot;argumentText&quot;: &quot;A String&quot;, # Plain-text body of the message with all bot mentions stripped out.
&quot;attachment&quot;: [ # User uploaded attachment.
{ # An attachment in Google Chat.
&quot;attachmentDataRef&quot;: { # A reference to the data of an attachment. # A reference to the attachment data. This is used with the media API to download the attachment data.
&quot;resourceName&quot;: &quot;A String&quot;, # The resource name of the attachment data. This is used with the media API to download the attachment data.
},
&quot;contentName&quot;: &quot;A String&quot;, # The original file name for the content, not the full path.
&quot;contentType&quot;: &quot;A String&quot;, # The content type (MIME type) of the file.
&quot;downloadUri&quot;: &quot;A String&quot;, # Output only. The download URL which should be used to allow a human user to download the attachment. Bots should not use this URL to download attachment content.
&quot;driveDataRef&quot;: { # A reference to the data of a drive attachment. # A reference to the drive attachment. This is used with the Drive API.
&quot;driveFileId&quot;: &quot;A String&quot;, # The id for the drive file, for use with the Drive API.
},
&quot;name&quot;: &quot;A String&quot;, # Resource name of the attachment, in the form &quot;spaces/*/messages/*/attachments/*&quot;.
&quot;source&quot;: &quot;A String&quot;, # The source of the attachment.
&quot;thumbnailUri&quot;: &quot;A String&quot;, # Output only. The thumbnail URL which should be used to preview the attachment to a human user. Bots should not use this URL to download attachment content.
},
],
&quot;cards&quot;: [ # Rich, formatted and interactive cards that can be used to display UI elements such as: formatted texts, buttons, clickable images. Cards are normally displayed below the plain-text body of the message.
{ # A card is a UI element that can contain UI widgets such as texts, images.
&quot;cardActions&quot;: [ # The actions of this card.
{ # A card action is the action associated with the card. For an invoice card, a typical action would be: delete invoice, email invoice or open the invoice in browser.
&quot;actionLabel&quot;: &quot;A String&quot;, # The label used to be displayed in the action menu item.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action for this action item.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
],
&quot;header&quot;: { # The header of the card. A header usually contains a title and an image.
&quot;imageStyle&quot;: &quot;A String&quot;, # The image&#x27;s type (e.g. square border or circular border).
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image in the card header.
&quot;subtitle&quot;: &quot;A String&quot;, # The subtitle of the card header.
&quot;title&quot;: &quot;A String&quot;, # The title must be specified. The header has a fixed height: if both a title and subtitle is specified, each will take up 1 line. If only the title is specified, it will take up both lines.
},
&quot;name&quot;: &quot;A String&quot;, # Name of the card.
&quot;sections&quot;: [ # Sections are separated by a line divider.
{ # A section contains a collection of widgets that are rendered (vertically) in the order that they are specified. Across all platforms, cards have a narrow fixed width, so there is currently no need for layout properties (e.g. float).
&quot;header&quot;: &quot;A String&quot;, # The header of the section, text formatted supported.
&quot;widgets&quot;: [ # A section must contain at least 1 widget.
{ # A widget is a UI element that presents texts, images, etc.
&quot;buttons&quot;: [ # A list of buttons. Buttons is also oneof data and only one of these fields should be set.
{ # A button. Can be a text button or an image button.
&quot;imageButton&quot;: { # An image button with an onclick action. # A button with image and onclick action.
&quot;icon&quot;: &quot;A String&quot;, # The icon specified by an enum that indices to an icon provided by Chat API.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;name&quot;: &quot;A String&quot;, # The name of this image_button which will be used for accessibility. Default value will be provided if developers don&#x27;t specify.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;textButton&quot;: { # A button with text and onclick action. # A button with text and onclick action.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action of the button.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
},
],
&quot;image&quot;: { # An image that is specified by a URL and can have an onclick action. # Display an image in this widget.
&quot;aspectRatio&quot;: 3.14, # The aspect ratio of this image (width/height). This field allows clients to reserve the right height for the image while waiting for it to load. It&#x27;s not meant to override the native aspect ratio of the image. If unset, the server fills it by prefetching the image.
&quot;imageUrl&quot;: &quot;A String&quot;, # The URL of the image.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;keyValue&quot;: { # A UI element contains a key (label) and a value (content). And this element may also contain some actions such as onclick button. # Display a key value item in this widget.
&quot;bottomLabel&quot;: &quot;A String&quot;, # The text of the bottom label. Formatted text supported.
&quot;button&quot;: { # A button. Can be a text button or an image button. # A button that can be clicked to trigger an action.
&quot;imageButton&quot;: { # An image button with an onclick action. # A button with image and onclick action.
&quot;icon&quot;: &quot;A String&quot;, # The icon specified by an enum that indices to an icon provided by Chat API.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;name&quot;: &quot;A String&quot;, # The name of this image_button which will be used for accessibility. Default value will be provided if developers don&#x27;t specify.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
},
&quot;textButton&quot;: { # A button with text and onclick action. # A button with text and onclick action.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action of the button.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;text&quot;: &quot;A String&quot;, # The text of the button.
},
},
&quot;content&quot;: &quot;A String&quot;, # The text of the content. Formatted text supported and always required.
&quot;contentMultiline&quot;: True or False, # If the content should be multiline.
&quot;icon&quot;: &quot;A String&quot;, # An enum value that will be replaced by the Chat API with the corresponding icon image.
&quot;iconUrl&quot;: &quot;A String&quot;, # The icon specified by a URL.
&quot;onClick&quot;: { # An onclick action (e.g. open a link). # The onclick action. Only the top label, bottom label and content region are clickable.
&quot;action&quot;: { # A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. # A form action will be triggered by this onclick if specified.
&quot;actionMethodName&quot;: &quot;A String&quot;, # The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the bot as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired.
&quot;parameters&quot;: [ # List of action parameters.
{ # List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.
&quot;key&quot;: &quot;A String&quot;, # The name of the parameter for the action script.
&quot;value&quot;: &quot;A String&quot;, # The value of the parameter.
},
],
},
&quot;openLink&quot;: { # A link that opens a new window. # This onclick triggers an open link action if specified.
&quot;url&quot;: &quot;A String&quot;, # The URL to open.
},
},
&quot;topLabel&quot;: &quot;A String&quot;, # The text of the top label. Formatted text supported.
},
&quot;textParagraph&quot;: { # A paragraph of text. Formatted text supported. # Display a text paragraph in this widget.
&quot;text&quot;: &quot;A String&quot;,
},
},
],
},
],
},
],
&quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the message was created in Google Chat server.
&quot;fallbackText&quot;: &quot;A String&quot;, # A plain-text description of the message&#x27;s cards, used when the actual cards cannot be displayed (e.g. mobile notifications).
&quot;lastUpdateTime&quot;: &quot;A String&quot;, # Output only. The time at which the message was last updated in Google Chat server. If the message was never updated, this field will be same as create_time.
&quot;name&quot;: &quot;A String&quot;, # Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4`
&quot;previewText&quot;: &quot;A String&quot;, # Text for generating preview chips. This text will not be displayed to the user, but any links to images, web pages, videos, etc. included here will generate preview chips.
&quot;sender&quot;: { # A user in Google Chat. # The user who created the message.
&quot;displayName&quot;: &quot;A String&quot;, # The user&#x27;s display name.
&quot;domainId&quot;: &quot;A String&quot;, # Obfuscated domain information.
&quot;isAnonymous&quot;: True or False, # True when the user is deleted or the user&#x27;s profile is not visible.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the format &quot;users/*&quot;.
&quot;type&quot;: &quot;A String&quot;, # User type.
},
&quot;slashCommand&quot;: { # A Slash Command in Chat. # Slash command information, if applicable.
&quot;commandId&quot;: &quot;A String&quot;, # The id of the slash command invoked.
},
&quot;space&quot;: { # A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat bot. # The space the message belongs to.
&quot;displayName&quot;: &quot;A String&quot;, # Output only. The display name (only if the space is of type `ROOM`). Please note that this field might not be populated in direct messages between humans.
&quot;name&quot;: &quot;A String&quot;, # Resource name of the space, in the form &quot;spaces/*&quot;. Example: spaces/AAAAAAAAAAAA
&quot;singleUserBotDm&quot;: True or False, # Whether the space is a DM between a bot and a single human.
&quot;threaded&quot;: True or False, # Whether the messages are threaded in this space.
&quot;type&quot;: &quot;A String&quot;, # Output only. The type of a space. This is deprecated. Use `single_user_bot_dm` instead.
},
&quot;text&quot;: &quot;A String&quot;, # Plain-text body of the message.
&quot;thread&quot;: { # A thread in Google Chat. # The thread the message belongs to.
&quot;name&quot;: &quot;A String&quot;, # Resource name, in the form &quot;spaces/*/threads/*&quot;. Example: spaces/AAAAMpdlehY/threads/UMxbHmzDlr4
},
}</pre>
</div>
</body></html>