google-apis-chat_v1 0.5.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/lib/google/apis/chat_v1.rb +2 -0
- data/lib/google/apis/chat_v1/classes.rb +1490 -70
- data/lib/google/apis/chat_v1/gem_version.rb +3 -3
- data/lib/google/apis/chat_v1/representations.rb +547 -0
- data/lib/google/apis/chat_v1/service.rb +2 -0
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 443c2719c2597fa83dad696f9586b2260c9c38ac999356d81e292ba0c6917f6d
|
4
|
+
data.tar.gz: d2db8e4fb0648cb744e6864bf6f7b22d3b756867b6761fcc96bf3955f7467295
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0226412aa27aa104a047f440496643a4020409fa39f843c920b160299688befaf87afb9065adbe1ffc69af46de6242f68a2dc21ae460d0720ba4ed592cd64a8f
|
7
|
+
data.tar.gz: '079496a28874be568a950fc70bc79cd013d39c55dfdb6a18c5de5608e078d00ee93c760df241706621b560469ed9a67c73d6682adfb12a268f09ff5baacc983e'
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
# Release history for google-apis-chat_v1
|
2
2
|
|
3
|
+
### v0.10.0 (2021-06-24)
|
4
|
+
|
5
|
+
* Unspecified changes
|
6
|
+
|
7
|
+
### v0.9.0 (2021-06-11)
|
8
|
+
|
9
|
+
* Regenerated from discovery document revision 20210605
|
10
|
+
* Regenerated using generator version 0.3.0
|
11
|
+
|
12
|
+
### v0.8.0 (2021-05-28)
|
13
|
+
|
14
|
+
* Regenerated from discovery document revision 20210522
|
15
|
+
|
16
|
+
### v0.7.0 (2021-05-19)
|
17
|
+
|
18
|
+
* Regenerated from discovery document revision 20210501
|
19
|
+
|
20
|
+
### v0.6.0 (2021-04-23)
|
21
|
+
|
22
|
+
* Regenerated from discovery document revision 20210417
|
23
|
+
|
3
24
|
### v0.5.0 (2021-03-19)
|
4
25
|
|
5
26
|
* Regenerated from discovery document revision 20210314
|
data/lib/google/apis/chat_v1.rb
CHANGED
@@ -22,6 +22,8 @@ module Google
|
|
22
22
|
# Google Chat API
|
23
23
|
#
|
24
24
|
# Enables bots to fetch information and perform actions in Google Chat.
|
25
|
+
# Authentication using a service account is a prerequisite for using the Google
|
26
|
+
# Chat REST API.
|
25
27
|
#
|
26
28
|
# @see https://developers.google.com/hangouts/chat
|
27
29
|
module ChatV1
|
@@ -338,89 +338,1296 @@ module Google
|
|
338
338
|
end
|
339
339
|
end
|
340
340
|
|
341
|
+
# Widgets for chatbots to specify.
|
342
|
+
class CardWithId
|
343
|
+
include Google::Apis::Core::Hashable
|
344
|
+
|
345
|
+
# A card is a UI element that can contain UI widgets such as text and images.
|
346
|
+
# For more information, see Cards . For example, the following JSON creates a
|
347
|
+
# card that has a header with the name, position, icons, and link for a contact,
|
348
|
+
# followed by a section with contact information like email and phone number. ```
|
349
|
+
# ` "header": ` "title": "Heba Salam", "subtitle": "Software Engineer", "
|
350
|
+
# imageStyle": "ImageStyle.AVATAR", "imageUrl": "https://example.com/heba_salam.
|
351
|
+
# png", "imageAltText": "Avatar for Heba Salam" `, "sections" : [ ` "header": "
|
352
|
+
# Contact Info", "widgets": [ ` "decorated_text": ` "icon": ` "knownIcon": "
|
353
|
+
# EMAIL" `, "content": "heba.salam@example.com" ` `, ` "decoratedText": ` "icon":
|
354
|
+
# ` "knownIcon": "PERSON" `, "content": "Online" ` `, ` "decoratedText": ` "
|
355
|
+
# icon": ` "knownIcon": "PHONE" `, "content": "+1 (555) 555-1234" ` `, ` "
|
356
|
+
# buttons": [ ` "textButton": ` "text": "Share", `, "onClick": ` "openLink": ` "
|
357
|
+
# url": "https://example.com/share" ` ` `, ` "textButton": ` "text": "Edit", `, "
|
358
|
+
# onClick": ` "action": ` "function": "goToView", "parameters": [ ` "key": "
|
359
|
+
# viewType", "value": "EDIT" ` ], "loadIndicator": "LoadIndicator.SPINNER" ` ` `
|
360
|
+
# ] ` ], "collapsible": true, "uncollapsibleWidgetsCount": 3 ` ], "cardActions":
|
361
|
+
# [ ` "actionLabel": "Send Feedback", "onClick": ` "openLink": ` "url": "https://
|
362
|
+
# example.com/feedback" ` ` ` ], "name": "contact-card-K3wB6arF2H9L" ` ```
|
363
|
+
# Corresponds to the JSON property `card`
|
364
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Card]
|
365
|
+
attr_accessor :card
|
366
|
+
|
367
|
+
# Chatbot-specified identifier for this widget. Scoped within a message.
|
368
|
+
# Corresponds to the JSON property `cardId`
|
369
|
+
# @return [String]
|
370
|
+
attr_accessor :card_id
|
371
|
+
|
372
|
+
def initialize(**args)
|
373
|
+
update!(**args)
|
374
|
+
end
|
375
|
+
|
376
|
+
# Update properties of this object
|
377
|
+
def update!(**args)
|
378
|
+
@card = args[:card] if args.key?(:card)
|
379
|
+
@card_id = args[:card_id] if args.key?(:card_id)
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
383
|
+
# Represents a color in the RGBA color space. This representation is designed
|
384
|
+
# for simplicity of conversion to/from color representations in various
|
385
|
+
# languages over compactness. For example, the fields of this representation can
|
386
|
+
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
|
387
|
+
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
|
388
|
+
# method in iOS; and, with just a little work, it can be easily formatted into a
|
389
|
+
# CSS `rgba()` string in JavaScript. This reference page doesn't carry
|
390
|
+
# information about the absolute color space that should be used to interpret
|
391
|
+
# the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default,
|
392
|
+
# applications should assume the sRGB color space. When color equality needs to
|
393
|
+
# be decided, implementations, unless documented otherwise, treat two colors as
|
394
|
+
# equal if all their red, green, blue, and alpha values each differ by at most
|
395
|
+
# 1e-5. Example (Java): import com.google.type.Color; // ... public static java.
|
396
|
+
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
|
397
|
+
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
|
398
|
+
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
|
399
|
+
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
|
400
|
+
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
|
401
|
+
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
|
402
|
+
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
|
403
|
+
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
|
404
|
+
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
|
405
|
+
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
|
406
|
+
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
|
407
|
+
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
|
408
|
+
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
|
409
|
+
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
|
410
|
+
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
|
411
|
+
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
|
412
|
+
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
|
413
|
+
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
|
414
|
+
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
|
415
|
+
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
|
416
|
+
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
|
417
|
+
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
|
418
|
+
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
|
419
|
+
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
|
420
|
+
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
|
421
|
+
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
|
422
|
+
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
|
423
|
+
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
|
424
|
+
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
|
425
|
+
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
|
426
|
+
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
|
427
|
+
# / ...
|
428
|
+
class Color
|
429
|
+
include Google::Apis::Core::Hashable
|
430
|
+
|
431
|
+
# The fraction of this color that should be applied to the pixel. That is, the
|
432
|
+
# final pixel color is defined by the equation: `pixel color = alpha * (this
|
433
|
+
# color) + (1.0 - alpha) * (background color)` This means that a value of 1.0
|
434
|
+
# corresponds to a solid color, whereas a value of 0.0 corresponds to a
|
435
|
+
# completely transparent color. This uses a wrapper message rather than a simple
|
436
|
+
# float scalar so that it is possible to distinguish between a default value and
|
437
|
+
# the value being unset. If omitted, this color object is rendered as a solid
|
438
|
+
# color (as if the alpha value had been explicitly given a value of 1.0).
|
439
|
+
# Corresponds to the JSON property `alpha`
|
440
|
+
# @return [Float]
|
441
|
+
attr_accessor :alpha
|
442
|
+
|
443
|
+
# The amount of blue in the color as a value in the interval [0, 1].
|
444
|
+
# Corresponds to the JSON property `blue`
|
445
|
+
# @return [Float]
|
446
|
+
attr_accessor :blue
|
447
|
+
|
448
|
+
# The amount of green in the color as a value in the interval [0, 1].
|
449
|
+
# Corresponds to the JSON property `green`
|
450
|
+
# @return [Float]
|
451
|
+
attr_accessor :green
|
452
|
+
|
453
|
+
# The amount of red in the color as a value in the interval [0, 1].
|
454
|
+
# Corresponds to the JSON property `red`
|
455
|
+
# @return [Float]
|
456
|
+
attr_accessor :red
|
457
|
+
|
458
|
+
def initialize(**args)
|
459
|
+
update!(**args)
|
460
|
+
end
|
461
|
+
|
462
|
+
# Update properties of this object
|
463
|
+
def update!(**args)
|
464
|
+
@alpha = args[:alpha] if args.key?(:alpha)
|
465
|
+
@blue = args[:blue] if args.key?(:blue)
|
466
|
+
@green = args[:green] if args.key?(:green)
|
467
|
+
@red = args[:red] if args.key?(:red)
|
468
|
+
end
|
469
|
+
end
|
470
|
+
|
341
471
|
# Google Chat events.
|
342
472
|
class DeprecatedEvent
|
343
473
|
include Google::Apis::Core::Hashable
|
344
474
|
|
345
|
-
# A form action describes the behavior when the form is submitted. For example,
|
475
|
+
# A form action describes the behavior when the form is submitted. For example,
|
476
|
+
# an Apps Script can be invoked to handle the form.
|
477
|
+
# Corresponds to the JSON property `action`
|
478
|
+
# @return [Google::Apis::ChatV1::FormAction]
|
479
|
+
attr_accessor :action
|
480
|
+
|
481
|
+
# The URL the bot should redirect the user to after they have completed an
|
482
|
+
# authorization or configuration flow outside of Google Chat. See the [
|
483
|
+
# Authorizing access to 3p services guide](/chat/how-tos/auth-3p) for more
|
484
|
+
# information.
|
485
|
+
# Corresponds to the JSON property `configCompleteRedirectUrl`
|
486
|
+
# @return [String]
|
487
|
+
attr_accessor :config_complete_redirect_url
|
488
|
+
|
489
|
+
# The timestamp indicating when the event was dispatched.
|
490
|
+
# Corresponds to the JSON property `eventTime`
|
491
|
+
# @return [String]
|
492
|
+
attr_accessor :event_time
|
493
|
+
|
494
|
+
# A message in Hangouts Chat.
|
495
|
+
# Corresponds to the JSON property `message`
|
496
|
+
# @return [Google::Apis::ChatV1::Message]
|
497
|
+
attr_accessor :message
|
498
|
+
|
499
|
+
# A room or DM in Hangouts Chat.
|
500
|
+
# Corresponds to the JSON property `space`
|
501
|
+
# @return [Google::Apis::ChatV1::Space]
|
502
|
+
attr_accessor :space
|
503
|
+
|
504
|
+
# The bot-defined key for the thread related to the event. See the thread_key
|
505
|
+
# field of the `spaces.message.create` request for more information.
|
506
|
+
# Corresponds to the JSON property `threadKey`
|
507
|
+
# @return [String]
|
508
|
+
attr_accessor :thread_key
|
509
|
+
|
510
|
+
# A secret value that bots can use to verify if a request is from Google. The
|
511
|
+
# token is randomly generated by Google, remains static, and can be obtained
|
512
|
+
# from the Google Chat API configuration page in the Cloud Console. Developers
|
513
|
+
# can revoke/regenerate it if needed from the same page.
|
514
|
+
# Corresponds to the JSON property `token`
|
515
|
+
# @return [String]
|
516
|
+
attr_accessor :token
|
517
|
+
|
518
|
+
# The type of the event.
|
519
|
+
# Corresponds to the JSON property `type`
|
520
|
+
# @return [String]
|
521
|
+
attr_accessor :type
|
522
|
+
|
523
|
+
# A user in Google Chat.
|
524
|
+
# Corresponds to the JSON property `user`
|
525
|
+
# @return [Google::Apis::ChatV1::User]
|
526
|
+
attr_accessor :user
|
527
|
+
|
528
|
+
def initialize(**args)
|
529
|
+
update!(**args)
|
530
|
+
end
|
531
|
+
|
532
|
+
# Update properties of this object
|
533
|
+
def update!(**args)
|
534
|
+
@action = args[:action] if args.key?(:action)
|
535
|
+
@config_complete_redirect_url = args[:config_complete_redirect_url] if args.key?(:config_complete_redirect_url)
|
536
|
+
@event_time = args[:event_time] if args.key?(:event_time)
|
537
|
+
@message = args[:message] if args.key?(:message)
|
538
|
+
@space = args[:space] if args.key?(:space)
|
539
|
+
@thread_key = args[:thread_key] if args.key?(:thread_key)
|
540
|
+
@token = args[:token] if args.key?(:token)
|
541
|
+
@type = args[:type] if args.key?(:type)
|
542
|
+
@user = args[:user] if args.key?(:user)
|
543
|
+
end
|
544
|
+
end
|
545
|
+
|
546
|
+
# A reference to the data of a drive attachment.
|
547
|
+
class DriveDataRef
|
548
|
+
include Google::Apis::Core::Hashable
|
549
|
+
|
550
|
+
# The id for the drive file, for use with the Drive API.
|
551
|
+
# Corresponds to the JSON property `driveFileId`
|
552
|
+
# @return [String]
|
553
|
+
attr_accessor :drive_file_id
|
554
|
+
|
555
|
+
def initialize(**args)
|
556
|
+
update!(**args)
|
557
|
+
end
|
558
|
+
|
559
|
+
# Update properties of this object
|
560
|
+
def update!(**args)
|
561
|
+
@drive_file_id = args[:drive_file_id] if args.key?(:drive_file_id)
|
562
|
+
end
|
563
|
+
end
|
564
|
+
|
565
|
+
# A generic empty message that you can re-use to avoid defining duplicated empty
|
566
|
+
# messages in your APIs. A typical example is to use it as the request or the
|
567
|
+
# response type of an API method. For instance: service Foo ` rpc Bar(google.
|
568
|
+
# protobuf.Empty) returns (google.protobuf.Empty); ` The JSON representation for
|
569
|
+
# `Empty` is empty JSON object ````.
|
570
|
+
class Empty
|
571
|
+
include Google::Apis::Core::Hashable
|
572
|
+
|
573
|
+
def initialize(**args)
|
574
|
+
update!(**args)
|
575
|
+
end
|
576
|
+
|
577
|
+
# Update properties of this object
|
578
|
+
def update!(**args)
|
579
|
+
end
|
580
|
+
end
|
581
|
+
|
582
|
+
# A form action describes the behavior when the form is submitted. For example,
|
583
|
+
# an Apps Script can be invoked to handle the form.
|
584
|
+
class FormAction
|
585
|
+
include Google::Apis::Core::Hashable
|
586
|
+
|
587
|
+
# The method name is used to identify which part of the form triggered the form
|
588
|
+
# submission. This information is echoed back to the bot as part of the card
|
589
|
+
# click event. The same method name can be used for several elements that
|
590
|
+
# trigger a common behavior if desired.
|
591
|
+
# Corresponds to the JSON property `actionMethodName`
|
592
|
+
# @return [String]
|
593
|
+
attr_accessor :action_method_name
|
594
|
+
|
595
|
+
# List of action parameters.
|
596
|
+
# Corresponds to the JSON property `parameters`
|
597
|
+
# @return [Array<Google::Apis::ChatV1::ActionParameter>]
|
598
|
+
attr_accessor :parameters
|
599
|
+
|
600
|
+
def initialize(**args)
|
601
|
+
update!(**args)
|
602
|
+
end
|
603
|
+
|
604
|
+
# Update properties of this object
|
605
|
+
def update!(**args)
|
606
|
+
@action_method_name = args[:action_method_name] if args.key?(:action_method_name)
|
607
|
+
@parameters = args[:parameters] if args.key?(:parameters)
|
608
|
+
end
|
609
|
+
end
|
610
|
+
|
611
|
+
# An action that describes the behavior when the form is submitted. For example,
|
612
|
+
# an Apps Script can be invoked to handle the form.
|
613
|
+
class GoogleAppsCardV1Action
|
614
|
+
include Google::Apis::Core::Hashable
|
615
|
+
|
616
|
+
# Apps Script function to invoke when the containing element is clicked/
|
617
|
+
# activated.
|
618
|
+
# Corresponds to the JSON property `function`
|
619
|
+
# @return [String]
|
620
|
+
attr_accessor :function
|
621
|
+
|
622
|
+
#
|
623
|
+
# Corresponds to the JSON property `loadIndicator`
|
624
|
+
# @return [String]
|
625
|
+
attr_accessor :load_indicator
|
626
|
+
|
627
|
+
# List of action parameters.
|
628
|
+
# Corresponds to the JSON property `parameters`
|
629
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1ActionParameter>]
|
630
|
+
attr_accessor :parameters
|
631
|
+
|
632
|
+
# Indicates whether form values persist after the action. The default value is `
|
633
|
+
# false`. If `true`, form values remain after the action is triggered. When
|
634
|
+
# using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#
|
635
|
+
# loadindicator) for actions, `persist_values` = `true`is recommended, as it
|
636
|
+
# ensures that any changes made by the user after form or on change actions are
|
637
|
+
# sent to the server are not overwritten by the response. If `false`, the form
|
638
|
+
# values are cleared when the action is triggered. When `persist_values` is set
|
639
|
+
# to `false`, it is strongly recommended that the card use [LoadIndicator.
|
640
|
+
# SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
|
641
|
+
# for all actions, as this locks the UI to ensure no changes are made by the
|
642
|
+
# user while the action is being processed.
|
643
|
+
# Corresponds to the JSON property `persistValues`
|
644
|
+
# @return [Boolean]
|
645
|
+
attr_accessor :persist_values
|
646
|
+
alias_method :persist_values?, :persist_values
|
647
|
+
|
648
|
+
def initialize(**args)
|
649
|
+
update!(**args)
|
650
|
+
end
|
651
|
+
|
652
|
+
# Update properties of this object
|
653
|
+
def update!(**args)
|
654
|
+
@function = args[:function] if args.key?(:function)
|
655
|
+
@load_indicator = args[:load_indicator] if args.key?(:load_indicator)
|
656
|
+
@parameters = args[:parameters] if args.key?(:parameters)
|
657
|
+
@persist_values = args[:persist_values] if args.key?(:persist_values)
|
658
|
+
end
|
659
|
+
end
|
660
|
+
|
661
|
+
# List of string parameters to supply when the action method is invoked. For
|
662
|
+
# example, consider three snooze buttons: snooze now, snooze 1 day, snooze next
|
663
|
+
# week. You might use action method = snooze(), passing the snooze type and
|
664
|
+
# snooze time in the list of string parameters.
|
665
|
+
class GoogleAppsCardV1ActionParameter
|
666
|
+
include Google::Apis::Core::Hashable
|
667
|
+
|
668
|
+
# The name of the parameter for the action script.
|
669
|
+
# Corresponds to the JSON property `key`
|
670
|
+
# @return [String]
|
671
|
+
attr_accessor :key
|
672
|
+
|
673
|
+
# The value of the parameter.
|
674
|
+
# Corresponds to the JSON property `value`
|
675
|
+
# @return [String]
|
676
|
+
attr_accessor :value
|
677
|
+
|
678
|
+
def initialize(**args)
|
679
|
+
update!(**args)
|
680
|
+
end
|
681
|
+
|
682
|
+
# Update properties of this object
|
683
|
+
def update!(**args)
|
684
|
+
@key = args[:key] if args.key?(:key)
|
685
|
+
@value = args[:value] if args.key?(:value)
|
686
|
+
end
|
687
|
+
end
|
688
|
+
|
689
|
+
# Represents the complete border style applied to widgets.
|
690
|
+
class GoogleAppsCardV1BorderStyle
|
691
|
+
include Google::Apis::Core::Hashable
|
692
|
+
|
693
|
+
# The corner radius for the border.
|
694
|
+
# Corresponds to the JSON property `cornerRadius`
|
695
|
+
# @return [Fixnum]
|
696
|
+
attr_accessor :corner_radius
|
697
|
+
|
698
|
+
# Represents a color in the RGBA color space. This representation is designed
|
699
|
+
# for simplicity of conversion to/from color representations in various
|
700
|
+
# languages over compactness. For example, the fields of this representation can
|
701
|
+
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
|
702
|
+
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
|
703
|
+
# method in iOS; and, with just a little work, it can be easily formatted into a
|
704
|
+
# CSS `rgba()` string in JavaScript. This reference page doesn't carry
|
705
|
+
# information about the absolute color space that should be used to interpret
|
706
|
+
# the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default,
|
707
|
+
# applications should assume the sRGB color space. When color equality needs to
|
708
|
+
# be decided, implementations, unless documented otherwise, treat two colors as
|
709
|
+
# equal if all their red, green, blue, and alpha values each differ by at most
|
710
|
+
# 1e-5. Example (Java): import com.google.type.Color; // ... public static java.
|
711
|
+
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
|
712
|
+
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
|
713
|
+
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
|
714
|
+
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
|
715
|
+
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
|
716
|
+
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
|
717
|
+
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
|
718
|
+
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
|
719
|
+
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
|
720
|
+
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
|
721
|
+
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
|
722
|
+
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
|
723
|
+
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
|
724
|
+
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
|
725
|
+
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
|
726
|
+
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
|
727
|
+
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
|
728
|
+
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
|
729
|
+
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
|
730
|
+
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
|
731
|
+
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
|
732
|
+
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
|
733
|
+
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
|
734
|
+
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
|
735
|
+
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
|
736
|
+
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
|
737
|
+
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
|
738
|
+
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
|
739
|
+
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
|
740
|
+
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
|
741
|
+
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
|
742
|
+
# / ...
|
743
|
+
# Corresponds to the JSON property `strokeColor`
|
744
|
+
# @return [Google::Apis::ChatV1::Color]
|
745
|
+
attr_accessor :stroke_color
|
746
|
+
|
747
|
+
# The border type.
|
748
|
+
# Corresponds to the JSON property `type`
|
749
|
+
# @return [String]
|
750
|
+
attr_accessor :type
|
751
|
+
|
752
|
+
def initialize(**args)
|
753
|
+
update!(**args)
|
754
|
+
end
|
755
|
+
|
756
|
+
# Update properties of this object
|
757
|
+
def update!(**args)
|
758
|
+
@corner_radius = args[:corner_radius] if args.key?(:corner_radius)
|
759
|
+
@stroke_color = args[:stroke_color] if args.key?(:stroke_color)
|
760
|
+
@type = args[:type] if args.key?(:type)
|
761
|
+
end
|
762
|
+
end
|
763
|
+
|
764
|
+
# A button. Can be a text button or an image button.
|
765
|
+
class GoogleAppsCardV1Button
|
766
|
+
include Google::Apis::Core::Hashable
|
767
|
+
|
768
|
+
# The alternative text used for accessibility. Has no effect when an icon is set;
|
769
|
+
# use `icon.alt_text` instead.
|
770
|
+
# Corresponds to the JSON property `altText`
|
771
|
+
# @return [String]
|
772
|
+
attr_accessor :alt_text
|
773
|
+
|
774
|
+
# Represents a color in the RGBA color space. This representation is designed
|
775
|
+
# for simplicity of conversion to/from color representations in various
|
776
|
+
# languages over compactness. For example, the fields of this representation can
|
777
|
+
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
|
778
|
+
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
|
779
|
+
# method in iOS; and, with just a little work, it can be easily formatted into a
|
780
|
+
# CSS `rgba()` string in JavaScript. This reference page doesn't carry
|
781
|
+
# information about the absolute color space that should be used to interpret
|
782
|
+
# the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default,
|
783
|
+
# applications should assume the sRGB color space. When color equality needs to
|
784
|
+
# be decided, implementations, unless documented otherwise, treat two colors as
|
785
|
+
# equal if all their red, green, blue, and alpha values each differ by at most
|
786
|
+
# 1e-5. Example (Java): import com.google.type.Color; // ... public static java.
|
787
|
+
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
|
788
|
+
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
|
789
|
+
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
|
790
|
+
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
|
791
|
+
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
|
792
|
+
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
|
793
|
+
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
|
794
|
+
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
|
795
|
+
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
|
796
|
+
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
|
797
|
+
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
|
798
|
+
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
|
799
|
+
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
|
800
|
+
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
|
801
|
+
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
|
802
|
+
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
|
803
|
+
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
|
804
|
+
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
|
805
|
+
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
|
806
|
+
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
|
807
|
+
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
|
808
|
+
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
|
809
|
+
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
|
810
|
+
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
|
811
|
+
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
|
812
|
+
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
|
813
|
+
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
|
814
|
+
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
|
815
|
+
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
|
816
|
+
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
|
817
|
+
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
|
818
|
+
# / ...
|
819
|
+
# Corresponds to the JSON property `color`
|
820
|
+
# @return [Google::Apis::ChatV1::Color]
|
821
|
+
attr_accessor :color
|
822
|
+
|
823
|
+
# If true, the button is displayed in a disabled state and doesn't respond to
|
824
|
+
# user actions.
|
825
|
+
# Corresponds to the JSON property `disabled`
|
826
|
+
# @return [Boolean]
|
827
|
+
attr_accessor :disabled
|
828
|
+
alias_method :disabled?, :disabled
|
829
|
+
|
830
|
+
# The icon image.
|
831
|
+
# Corresponds to the JSON property `icon`
|
832
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Icon]
|
833
|
+
attr_accessor :icon
|
834
|
+
|
835
|
+
# The action to perform when the button is clicked.
|
836
|
+
# Corresponds to the JSON property `onClick`
|
837
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1OnClick]
|
838
|
+
attr_accessor :on_click
|
839
|
+
|
840
|
+
# The text of the button.
|
841
|
+
# Corresponds to the JSON property `text`
|
842
|
+
# @return [String]
|
843
|
+
attr_accessor :text
|
844
|
+
|
845
|
+
def initialize(**args)
|
846
|
+
update!(**args)
|
847
|
+
end
|
848
|
+
|
849
|
+
# Update properties of this object
|
850
|
+
def update!(**args)
|
851
|
+
@alt_text = args[:alt_text] if args.key?(:alt_text)
|
852
|
+
@color = args[:color] if args.key?(:color)
|
853
|
+
@disabled = args[:disabled] if args.key?(:disabled)
|
854
|
+
@icon = args[:icon] if args.key?(:icon)
|
855
|
+
@on_click = args[:on_click] if args.key?(:on_click)
|
856
|
+
@text = args[:text] if args.key?(:text)
|
857
|
+
end
|
858
|
+
end
|
859
|
+
|
860
|
+
# A list of buttons layed out horizontally.
|
861
|
+
class GoogleAppsCardV1ButtonList
|
862
|
+
include Google::Apis::Core::Hashable
|
863
|
+
|
864
|
+
#
|
865
|
+
# Corresponds to the JSON property `buttons`
|
866
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1Button>]
|
867
|
+
attr_accessor :buttons
|
868
|
+
|
869
|
+
def initialize(**args)
|
870
|
+
update!(**args)
|
871
|
+
end
|
872
|
+
|
873
|
+
# Update properties of this object
|
874
|
+
def update!(**args)
|
875
|
+
@buttons = args[:buttons] if args.key?(:buttons)
|
876
|
+
end
|
877
|
+
end
|
878
|
+
|
879
|
+
# A card is a UI element that can contain UI widgets such as text and images.
|
880
|
+
# For more information, see Cards . For example, the following JSON creates a
|
881
|
+
# card that has a header with the name, position, icons, and link for a contact,
|
882
|
+
# followed by a section with contact information like email and phone number. ```
|
883
|
+
# ` "header": ` "title": "Heba Salam", "subtitle": "Software Engineer", "
|
884
|
+
# imageStyle": "ImageStyle.AVATAR", "imageUrl": "https://example.com/heba_salam.
|
885
|
+
# png", "imageAltText": "Avatar for Heba Salam" `, "sections" : [ ` "header": "
|
886
|
+
# Contact Info", "widgets": [ ` "decorated_text": ` "icon": ` "knownIcon": "
|
887
|
+
# EMAIL" `, "content": "heba.salam@example.com" ` `, ` "decoratedText": ` "icon":
|
888
|
+
# ` "knownIcon": "PERSON" `, "content": "Online" ` `, ` "decoratedText": ` "
|
889
|
+
# icon": ` "knownIcon": "PHONE" `, "content": "+1 (555) 555-1234" ` `, ` "
|
890
|
+
# buttons": [ ` "textButton": ` "text": "Share", `, "onClick": ` "openLink": ` "
|
891
|
+
# url": "https://example.com/share" ` ` `, ` "textButton": ` "text": "Edit", `, "
|
892
|
+
# onClick": ` "action": ` "function": "goToView", "parameters": [ ` "key": "
|
893
|
+
# viewType", "value": "EDIT" ` ], "loadIndicator": "LoadIndicator.SPINNER" ` ` `
|
894
|
+
# ] ` ], "collapsible": true, "uncollapsibleWidgetsCount": 3 ` ], "cardActions":
|
895
|
+
# [ ` "actionLabel": "Send Feedback", "onClick": ` "openLink": ` "url": "https://
|
896
|
+
# example.com/feedback" ` ` ` ], "name": "contact-card-K3wB6arF2H9L" ` ```
|
897
|
+
class GoogleAppsCardV1Card
|
898
|
+
include Google::Apis::Core::Hashable
|
899
|
+
|
900
|
+
# The actions of this card. They are added to a card's generated toolbar menu.
|
901
|
+
# For example, the following JSON constructs a card action menu with Settings
|
902
|
+
# and Send Feedback options: ``` "card_actions": [ ` "actionLabel": "Setting", "
|
903
|
+
# onClick": ` "action": ` "functionName": "goToView", "parameters": [ ` "key": "
|
904
|
+
# viewType", "value": "SETTING" ` ], "loadIndicator": "LoadIndicator.SPINNER" ` `
|
905
|
+
# `, ` "actionLabel": "Send Feedback", "onClick": ` "openLink": ` "url": "https:
|
906
|
+
# //example.com/feedback" ` ` ` ] ```
|
907
|
+
# Corresponds to the JSON property `cardActions`
|
908
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1CardAction>]
|
909
|
+
attr_accessor :card_actions
|
910
|
+
|
911
|
+
# The display style for peekCardHeader.
|
912
|
+
# Corresponds to the JSON property `displayStyle`
|
913
|
+
# @return [String]
|
914
|
+
attr_accessor :display_style
|
915
|
+
|
916
|
+
# A persistent (sticky) footer that is added to the bottom of the card.
|
917
|
+
# Corresponds to the JSON property `fixedFooter`
|
918
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1CardFixedFooter]
|
919
|
+
attr_accessor :fixed_footer
|
920
|
+
|
921
|
+
# The header of the card. A header usually contains a title and an image.
|
922
|
+
# Corresponds to the JSON property `header`
|
923
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1CardHeader]
|
924
|
+
attr_accessor :header
|
925
|
+
|
926
|
+
# Name of the card, which is used as a identifier for the card in card
|
927
|
+
# navigation.
|
928
|
+
# Corresponds to the JSON property `name`
|
929
|
+
# @return [String]
|
930
|
+
attr_accessor :name
|
931
|
+
|
932
|
+
# When displaying contextual content, the peek card header acts as a placeholder
|
933
|
+
# so that the user can navigate forward between the homepage cards and the
|
934
|
+
# contextual cards.
|
935
|
+
# Corresponds to the JSON property `peekCardHeader`
|
936
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1CardHeader]
|
937
|
+
attr_accessor :peek_card_header
|
938
|
+
|
939
|
+
# Sections are separated by a line divider.
|
940
|
+
# Corresponds to the JSON property `sections`
|
941
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1Section>]
|
942
|
+
attr_accessor :sections
|
943
|
+
|
944
|
+
def initialize(**args)
|
945
|
+
update!(**args)
|
946
|
+
end
|
947
|
+
|
948
|
+
# Update properties of this object
|
949
|
+
def update!(**args)
|
950
|
+
@card_actions = args[:card_actions] if args.key?(:card_actions)
|
951
|
+
@display_style = args[:display_style] if args.key?(:display_style)
|
952
|
+
@fixed_footer = args[:fixed_footer] if args.key?(:fixed_footer)
|
953
|
+
@header = args[:header] if args.key?(:header)
|
954
|
+
@name = args[:name] if args.key?(:name)
|
955
|
+
@peek_card_header = args[:peek_card_header] if args.key?(:peek_card_header)
|
956
|
+
@sections = args[:sections] if args.key?(:sections)
|
957
|
+
end
|
958
|
+
end
|
959
|
+
|
960
|
+
# A card action is the action associated with the card. For example, an invoice
|
961
|
+
# card might include actions such as delete invoice, email invoice, or open the
|
962
|
+
# invoice in a browser.
|
963
|
+
class GoogleAppsCardV1CardAction
|
964
|
+
include Google::Apis::Core::Hashable
|
965
|
+
|
966
|
+
# The label that displays as the action menu item.
|
967
|
+
# Corresponds to the JSON property `actionLabel`
|
968
|
+
# @return [String]
|
969
|
+
attr_accessor :action_label
|
970
|
+
|
971
|
+
# The onclick action for this action item.
|
972
|
+
# Corresponds to the JSON property `onClick`
|
973
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1OnClick]
|
974
|
+
attr_accessor :on_click
|
975
|
+
|
976
|
+
def initialize(**args)
|
977
|
+
update!(**args)
|
978
|
+
end
|
979
|
+
|
980
|
+
# Update properties of this object
|
981
|
+
def update!(**args)
|
982
|
+
@action_label = args[:action_label] if args.key?(:action_label)
|
983
|
+
@on_click = args[:on_click] if args.key?(:on_click)
|
984
|
+
end
|
985
|
+
end
|
986
|
+
|
987
|
+
# A persistent (sticky) footer that is added to the bottom of the card.
|
988
|
+
class GoogleAppsCardV1CardFixedFooter
|
989
|
+
include Google::Apis::Core::Hashable
|
990
|
+
|
991
|
+
# A button. Can be a text button or an image button.
|
992
|
+
# Corresponds to the JSON property `primaryButton`
|
993
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Button]
|
994
|
+
attr_accessor :primary_button
|
995
|
+
|
996
|
+
# A button. Can be a text button or an image button.
|
997
|
+
# Corresponds to the JSON property `secondaryButton`
|
998
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Button]
|
999
|
+
attr_accessor :secondary_button
|
1000
|
+
|
1001
|
+
def initialize(**args)
|
1002
|
+
update!(**args)
|
1003
|
+
end
|
1004
|
+
|
1005
|
+
# Update properties of this object
|
1006
|
+
def update!(**args)
|
1007
|
+
@primary_button = args[:primary_button] if args.key?(:primary_button)
|
1008
|
+
@secondary_button = args[:secondary_button] if args.key?(:secondary_button)
|
1009
|
+
end
|
1010
|
+
end
|
1011
|
+
|
1012
|
+
#
|
1013
|
+
class GoogleAppsCardV1CardHeader
|
1014
|
+
include Google::Apis::Core::Hashable
|
1015
|
+
|
1016
|
+
# The alternative text of this image which is used for accessibility.
|
1017
|
+
# Corresponds to the JSON property `imageAltText`
|
1018
|
+
# @return [String]
|
1019
|
+
attr_accessor :image_alt_text
|
1020
|
+
|
1021
|
+
# The image's type.
|
1022
|
+
# Corresponds to the JSON property `imageType`
|
1023
|
+
# @return [String]
|
1024
|
+
attr_accessor :image_type
|
1025
|
+
|
1026
|
+
# The URL of the image in the card header.
|
1027
|
+
# Corresponds to the JSON property `imageUrl`
|
1028
|
+
# @return [String]
|
1029
|
+
attr_accessor :image_url
|
1030
|
+
|
1031
|
+
# The subtitle of the card header.
|
1032
|
+
# Corresponds to the JSON property `subtitle`
|
1033
|
+
# @return [String]
|
1034
|
+
attr_accessor :subtitle
|
1035
|
+
|
1036
|
+
# The title of the card header. The title must be specified. The header has a
|
1037
|
+
# fixed height: if both a title and subtitle are specified, each takes up one
|
1038
|
+
# line. If only the title is specified, it takes up both lines.
|
1039
|
+
# Corresponds to the JSON property `title`
|
1040
|
+
# @return [String]
|
1041
|
+
attr_accessor :title
|
1042
|
+
|
1043
|
+
def initialize(**args)
|
1044
|
+
update!(**args)
|
1045
|
+
end
|
1046
|
+
|
1047
|
+
# Update properties of this object
|
1048
|
+
def update!(**args)
|
1049
|
+
@image_alt_text = args[:image_alt_text] if args.key?(:image_alt_text)
|
1050
|
+
@image_type = args[:image_type] if args.key?(:image_type)
|
1051
|
+
@image_url = args[:image_url] if args.key?(:image_url)
|
1052
|
+
@subtitle = args[:subtitle] if args.key?(:subtitle)
|
1053
|
+
@title = args[:title] if args.key?(:title)
|
1054
|
+
end
|
1055
|
+
end
|
1056
|
+
|
1057
|
+
# The widget that lets users to specify a date and time.
|
1058
|
+
class GoogleAppsCardV1DateTimePicker
|
1059
|
+
include Google::Apis::Core::Hashable
|
1060
|
+
|
1061
|
+
# The label for the field that displays to the user.
|
1062
|
+
# Corresponds to the JSON property `label`
|
1063
|
+
# @return [String]
|
1064
|
+
attr_accessor :label
|
1065
|
+
|
1066
|
+
# The name of the text input that's used in formInput, and uniquely identifies
|
1067
|
+
# this input.
|
1068
|
+
# Corresponds to the JSON property `name`
|
1069
|
+
# @return [String]
|
1070
|
+
attr_accessor :name
|
1071
|
+
|
1072
|
+
# An action that describes the behavior when the form is submitted. For example,
|
1073
|
+
# an Apps Script can be invoked to handle the form.
|
1074
|
+
# Corresponds to the JSON property `onChangeAction`
|
1075
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Action]
|
1076
|
+
attr_accessor :on_change_action
|
1077
|
+
|
1078
|
+
# The number representing the time zone offset from UTC, in minutes. If set, the
|
1079
|
+
# `value_ms_epoch` is displayed in the specified time zone. If not set, it uses
|
1080
|
+
# the user's time zone setting on the client side.
|
1081
|
+
# Corresponds to the JSON property `timezoneOffsetDate`
|
1082
|
+
# @return [Fixnum]
|
1083
|
+
attr_accessor :timezone_offset_date
|
1084
|
+
|
1085
|
+
# The type of the date/time picker.
|
1086
|
+
# Corresponds to the JSON property `type`
|
1087
|
+
# @return [String]
|
1088
|
+
attr_accessor :type
|
1089
|
+
|
1090
|
+
# The value to display as the default value before user input or previous user
|
1091
|
+
# input. It is represented in milliseconds (Epoch time). For `DATE_AND_TIME`
|
1092
|
+
# type, the full epoch value is used. For `DATE_ONLY` type, only date of the
|
1093
|
+
# epoch time is used. For `TIME_ONLY` type, only time of the epoch time is used.
|
1094
|
+
# For example, you can set epoch time to `3 * 60 * 60 * 1000` to represent 3am.
|
1095
|
+
# Corresponds to the JSON property `valueMsEpoch`
|
1096
|
+
# @return [Fixnum]
|
1097
|
+
attr_accessor :value_ms_epoch
|
1098
|
+
|
1099
|
+
def initialize(**args)
|
1100
|
+
update!(**args)
|
1101
|
+
end
|
1102
|
+
|
1103
|
+
# Update properties of this object
|
1104
|
+
def update!(**args)
|
1105
|
+
@label = args[:label] if args.key?(:label)
|
1106
|
+
@name = args[:name] if args.key?(:name)
|
1107
|
+
@on_change_action = args[:on_change_action] if args.key?(:on_change_action)
|
1108
|
+
@timezone_offset_date = args[:timezone_offset_date] if args.key?(:timezone_offset_date)
|
1109
|
+
@type = args[:type] if args.key?(:type)
|
1110
|
+
@value_ms_epoch = args[:value_ms_epoch] if args.key?(:value_ms_epoch)
|
1111
|
+
end
|
1112
|
+
end
|
1113
|
+
|
1114
|
+
# A widget that displays text with optional decorations such as a label above or
|
1115
|
+
# below the text, an icon in front of the text, a selection widget or a button
|
1116
|
+
# after the text.
|
1117
|
+
class GoogleAppsCardV1DecoratedText
|
1118
|
+
include Google::Apis::Core::Hashable
|
1119
|
+
|
1120
|
+
# The formatted text label that shows below the main text.
|
1121
|
+
# Corresponds to the JSON property `bottomLabel`
|
1122
|
+
# @return [String]
|
1123
|
+
attr_accessor :bottom_label
|
1124
|
+
|
1125
|
+
# A button. Can be a text button or an image button.
|
1126
|
+
# Corresponds to the JSON property `button`
|
1127
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Button]
|
1128
|
+
attr_accessor :button
|
1129
|
+
|
1130
|
+
# An icon displayed after the text.
|
1131
|
+
# Corresponds to the JSON property `endIcon`
|
1132
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Icon]
|
1133
|
+
attr_accessor :end_icon
|
1134
|
+
|
1135
|
+
# Deprecated in favor of start_icon.
|
1136
|
+
# Corresponds to the JSON property `icon`
|
1137
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Icon]
|
1138
|
+
attr_accessor :icon
|
1139
|
+
|
1140
|
+
# Only the top and bottom label and content region are clickable.
|
1141
|
+
# Corresponds to the JSON property `onClick`
|
1142
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1OnClick]
|
1143
|
+
attr_accessor :on_click
|
1144
|
+
|
1145
|
+
# The icon displayed in front of the text.
|
1146
|
+
# Corresponds to the JSON property `startIcon`
|
1147
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Icon]
|
1148
|
+
attr_accessor :start_icon
|
1149
|
+
|
1150
|
+
# A switch widget can be clicked to change its state or trigger an action.
|
1151
|
+
# Corresponds to the JSON property `switchControl`
|
1152
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1SwitchControl]
|
1153
|
+
attr_accessor :switch_control
|
1154
|
+
|
1155
|
+
# Required. The main widget formatted text. See Text formatting for details.
|
1156
|
+
# Corresponds to the JSON property `text`
|
1157
|
+
# @return [String]
|
1158
|
+
attr_accessor :text
|
1159
|
+
|
1160
|
+
# The formatted text label that shows above the main text.
|
1161
|
+
# Corresponds to the JSON property `topLabel`
|
1162
|
+
# @return [String]
|
1163
|
+
attr_accessor :top_label
|
1164
|
+
|
1165
|
+
# The wrap text setting. If `true`, the text is wrapped and displayed in
|
1166
|
+
# multiline. Otherwise, the text is truncated.
|
1167
|
+
# Corresponds to the JSON property `wrapText`
|
1168
|
+
# @return [Boolean]
|
1169
|
+
attr_accessor :wrap_text
|
1170
|
+
alias_method :wrap_text?, :wrap_text
|
1171
|
+
|
1172
|
+
def initialize(**args)
|
1173
|
+
update!(**args)
|
1174
|
+
end
|
1175
|
+
|
1176
|
+
# Update properties of this object
|
1177
|
+
def update!(**args)
|
1178
|
+
@bottom_label = args[:bottom_label] if args.key?(:bottom_label)
|
1179
|
+
@button = args[:button] if args.key?(:button)
|
1180
|
+
@end_icon = args[:end_icon] if args.key?(:end_icon)
|
1181
|
+
@icon = args[:icon] if args.key?(:icon)
|
1182
|
+
@on_click = args[:on_click] if args.key?(:on_click)
|
1183
|
+
@start_icon = args[:start_icon] if args.key?(:start_icon)
|
1184
|
+
@switch_control = args[:switch_control] if args.key?(:switch_control)
|
1185
|
+
@text = args[:text] if args.key?(:text)
|
1186
|
+
@top_label = args[:top_label] if args.key?(:top_label)
|
1187
|
+
@wrap_text = args[:wrap_text] if args.key?(:wrap_text)
|
1188
|
+
end
|
1189
|
+
end
|
1190
|
+
|
1191
|
+
# A divider that appears in between widgets.
|
1192
|
+
class GoogleAppsCardV1Divider
|
1193
|
+
include Google::Apis::Core::Hashable
|
1194
|
+
|
1195
|
+
def initialize(**args)
|
1196
|
+
update!(**args)
|
1197
|
+
end
|
1198
|
+
|
1199
|
+
# Update properties of this object
|
1200
|
+
def update!(**args)
|
1201
|
+
end
|
1202
|
+
end
|
1203
|
+
|
1204
|
+
# Represents a Grid widget that displays items in a configurable grid layout.
|
1205
|
+
class GoogleAppsCardV1Grid
|
1206
|
+
include Google::Apis::Core::Hashable
|
1207
|
+
|
1208
|
+
# Represents the complete border style applied to widgets.
|
1209
|
+
# Corresponds to the JSON property `borderStyle`
|
1210
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1BorderStyle]
|
1211
|
+
attr_accessor :border_style
|
1212
|
+
|
1213
|
+
# The number of columns to display in the grid. A default value is used if this
|
1214
|
+
# field isn't specified, and that default value is different depending on where
|
1215
|
+
# the grid is shown (dialog versus companion).
|
1216
|
+
# Corresponds to the JSON property `columnCount`
|
1217
|
+
# @return [Fixnum]
|
1218
|
+
attr_accessor :column_count
|
1219
|
+
|
1220
|
+
# The items to display in the grid.
|
1221
|
+
# Corresponds to the JSON property `items`
|
1222
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1GridItem>]
|
1223
|
+
attr_accessor :items
|
1224
|
+
|
1225
|
+
# This callback is reused by each individual grid item, but with the item's
|
1226
|
+
# identifier and index in the items list added to the callback's parameters.
|
1227
|
+
# Corresponds to the JSON property `onClick`
|
1228
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1OnClick]
|
1229
|
+
attr_accessor :on_click
|
1230
|
+
|
1231
|
+
# The text that displays in the grid header.
|
1232
|
+
# Corresponds to the JSON property `title`
|
1233
|
+
# @return [String]
|
1234
|
+
attr_accessor :title
|
1235
|
+
|
1236
|
+
def initialize(**args)
|
1237
|
+
update!(**args)
|
1238
|
+
end
|
1239
|
+
|
1240
|
+
# Update properties of this object
|
1241
|
+
def update!(**args)
|
1242
|
+
@border_style = args[:border_style] if args.key?(:border_style)
|
1243
|
+
@column_count = args[:column_count] if args.key?(:column_count)
|
1244
|
+
@items = args[:items] if args.key?(:items)
|
1245
|
+
@on_click = args[:on_click] if args.key?(:on_click)
|
1246
|
+
@title = args[:title] if args.key?(:title)
|
1247
|
+
end
|
1248
|
+
end
|
1249
|
+
|
1250
|
+
# Represents a single item in the grid layout.
|
1251
|
+
class GoogleAppsCardV1GridItem
|
1252
|
+
include Google::Apis::Core::Hashable
|
1253
|
+
|
1254
|
+
# A user-specified identifier for this grid item. This identifier is returned in
|
1255
|
+
# the parent Grid's onClick callback parameters.
|
1256
|
+
# Corresponds to the JSON property `id`
|
1257
|
+
# @return [String]
|
1258
|
+
attr_accessor :id
|
1259
|
+
|
1260
|
+
# The image that displays in the grid item.
|
1261
|
+
# Corresponds to the JSON property `image`
|
1262
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1ImageComponent]
|
1263
|
+
attr_accessor :image
|
1264
|
+
|
1265
|
+
# The layout to use for the grid item.
|
1266
|
+
# Corresponds to the JSON property `layout`
|
1267
|
+
# @return [String]
|
1268
|
+
attr_accessor :layout
|
1269
|
+
|
1270
|
+
# The grid item's subtitle.
|
1271
|
+
# Corresponds to the JSON property `subtitle`
|
1272
|
+
# @return [String]
|
1273
|
+
attr_accessor :subtitle
|
1274
|
+
|
1275
|
+
# The horizontal alignment of the grid item's text.
|
1276
|
+
# Corresponds to the JSON property `textAlignment`
|
1277
|
+
# @return [String]
|
1278
|
+
attr_accessor :text_alignment
|
1279
|
+
|
1280
|
+
# The grid item's title.
|
1281
|
+
# Corresponds to the JSON property `title`
|
1282
|
+
# @return [String]
|
1283
|
+
attr_accessor :title
|
1284
|
+
|
1285
|
+
def initialize(**args)
|
1286
|
+
update!(**args)
|
1287
|
+
end
|
1288
|
+
|
1289
|
+
# Update properties of this object
|
1290
|
+
def update!(**args)
|
1291
|
+
@id = args[:id] if args.key?(:id)
|
1292
|
+
@image = args[:image] if args.key?(:image)
|
1293
|
+
@layout = args[:layout] if args.key?(:layout)
|
1294
|
+
@subtitle = args[:subtitle] if args.key?(:subtitle)
|
1295
|
+
@text_alignment = args[:text_alignment] if args.key?(:text_alignment)
|
1296
|
+
@title = args[:title] if args.key?(:title)
|
1297
|
+
end
|
1298
|
+
end
|
1299
|
+
|
1300
|
+
#
|
1301
|
+
class GoogleAppsCardV1Icon
|
1302
|
+
include Google::Apis::Core::Hashable
|
1303
|
+
|
1304
|
+
# The description of the icon, used for accessibility. The default value is
|
1305
|
+
# provided if you don't specify one.
|
1306
|
+
# Corresponds to the JSON property `altText`
|
1307
|
+
# @return [String]
|
1308
|
+
attr_accessor :alt_text
|
1309
|
+
|
1310
|
+
# The icon specified by a URL.
|
1311
|
+
# Corresponds to the JSON property `iconUrl`
|
1312
|
+
# @return [String]
|
1313
|
+
attr_accessor :icon_url
|
1314
|
+
|
1315
|
+
# The crop style applied to the image. In some cases, applying a `CIRCLE` crop
|
1316
|
+
# causes the image to be drawn larger than a standard icon.
|
1317
|
+
# Corresponds to the JSON property `imageType`
|
1318
|
+
# @return [String]
|
1319
|
+
attr_accessor :image_type
|
1320
|
+
|
1321
|
+
# The icon specified by the string name of a list of known icons
|
1322
|
+
# Corresponds to the JSON property `knownIcon`
|
1323
|
+
# @return [String]
|
1324
|
+
attr_accessor :known_icon
|
1325
|
+
|
1326
|
+
def initialize(**args)
|
1327
|
+
update!(**args)
|
1328
|
+
end
|
1329
|
+
|
1330
|
+
# Update properties of this object
|
1331
|
+
def update!(**args)
|
1332
|
+
@alt_text = args[:alt_text] if args.key?(:alt_text)
|
1333
|
+
@icon_url = args[:icon_url] if args.key?(:icon_url)
|
1334
|
+
@image_type = args[:image_type] if args.key?(:image_type)
|
1335
|
+
@known_icon = args[:known_icon] if args.key?(:known_icon)
|
1336
|
+
end
|
1337
|
+
end
|
1338
|
+
|
1339
|
+
# An image that is specified by a URL and can have an onClick action.
|
1340
|
+
class GoogleAppsCardV1Image
|
1341
|
+
include Google::Apis::Core::Hashable
|
1342
|
+
|
1343
|
+
# The alternative text of this image, used for accessibility.
|
1344
|
+
# Corresponds to the JSON property `altText`
|
1345
|
+
# @return [String]
|
1346
|
+
attr_accessor :alt_text
|
1347
|
+
|
1348
|
+
# An image URL.
|
1349
|
+
# Corresponds to the JSON property `imageUrl`
|
1350
|
+
# @return [String]
|
1351
|
+
attr_accessor :image_url
|
1352
|
+
|
1353
|
+
#
|
1354
|
+
# Corresponds to the JSON property `onClick`
|
1355
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1OnClick]
|
1356
|
+
attr_accessor :on_click
|
1357
|
+
|
1358
|
+
def initialize(**args)
|
1359
|
+
update!(**args)
|
1360
|
+
end
|
1361
|
+
|
1362
|
+
# Update properties of this object
|
1363
|
+
def update!(**args)
|
1364
|
+
@alt_text = args[:alt_text] if args.key?(:alt_text)
|
1365
|
+
@image_url = args[:image_url] if args.key?(:image_url)
|
1366
|
+
@on_click = args[:on_click] if args.key?(:on_click)
|
1367
|
+
end
|
1368
|
+
end
|
1369
|
+
|
1370
|
+
#
|
1371
|
+
class GoogleAppsCardV1ImageComponent
|
1372
|
+
include Google::Apis::Core::Hashable
|
1373
|
+
|
1374
|
+
# The accessibility label for the image.
|
1375
|
+
# Corresponds to the JSON property `altText`
|
1376
|
+
# @return [String]
|
1377
|
+
attr_accessor :alt_text
|
1378
|
+
|
1379
|
+
# Represents the complete border style applied to widgets.
|
1380
|
+
# Corresponds to the JSON property `borderStyle`
|
1381
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1BorderStyle]
|
1382
|
+
attr_accessor :border_style
|
1383
|
+
|
1384
|
+
# Represents the crop style applied to an image.
|
1385
|
+
# Corresponds to the JSON property `cropStyle`
|
1386
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1ImageCropStyle]
|
1387
|
+
attr_accessor :crop_style
|
1388
|
+
|
1389
|
+
# The image URL.
|
1390
|
+
# Corresponds to the JSON property `imageUri`
|
1391
|
+
# @return [String]
|
1392
|
+
attr_accessor :image_uri
|
1393
|
+
|
1394
|
+
def initialize(**args)
|
1395
|
+
update!(**args)
|
1396
|
+
end
|
1397
|
+
|
1398
|
+
# Update properties of this object
|
1399
|
+
def update!(**args)
|
1400
|
+
@alt_text = args[:alt_text] if args.key?(:alt_text)
|
1401
|
+
@border_style = args[:border_style] if args.key?(:border_style)
|
1402
|
+
@crop_style = args[:crop_style] if args.key?(:crop_style)
|
1403
|
+
@image_uri = args[:image_uri] if args.key?(:image_uri)
|
1404
|
+
end
|
1405
|
+
end
|
1406
|
+
|
1407
|
+
# Represents the crop style applied to an image.
|
1408
|
+
class GoogleAppsCardV1ImageCropStyle
|
1409
|
+
include Google::Apis::Core::Hashable
|
1410
|
+
|
1411
|
+
# The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`.
|
1412
|
+
# Corresponds to the JSON property `aspectRatio`
|
1413
|
+
# @return [Float]
|
1414
|
+
attr_accessor :aspect_ratio
|
1415
|
+
|
1416
|
+
# The crop type.
|
1417
|
+
# Corresponds to the JSON property `type`
|
1418
|
+
# @return [String]
|
1419
|
+
attr_accessor :type
|
1420
|
+
|
1421
|
+
def initialize(**args)
|
1422
|
+
update!(**args)
|
1423
|
+
end
|
1424
|
+
|
1425
|
+
# Update properties of this object
|
1426
|
+
def update!(**args)
|
1427
|
+
@aspect_ratio = args[:aspect_ratio] if args.key?(:aspect_ratio)
|
1428
|
+
@type = args[:type] if args.key?(:type)
|
1429
|
+
end
|
1430
|
+
end
|
1431
|
+
|
1432
|
+
#
|
1433
|
+
class GoogleAppsCardV1OnClick
|
1434
|
+
include Google::Apis::Core::Hashable
|
1435
|
+
|
1436
|
+
# An action that describes the behavior when the form is submitted. For example,
|
346
1437
|
# an Apps Script can be invoked to handle the form.
|
347
1438
|
# Corresponds to the JSON property `action`
|
348
|
-
# @return [Google::Apis::ChatV1::
|
1439
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Action]
|
349
1440
|
attr_accessor :action
|
350
1441
|
|
351
|
-
#
|
352
|
-
#
|
353
|
-
#
|
354
|
-
#
|
355
|
-
#
|
1442
|
+
# A card is a UI element that can contain UI widgets such as text and images.
|
1443
|
+
# For more information, see Cards . For example, the following JSON creates a
|
1444
|
+
# card that has a header with the name, position, icons, and link for a contact,
|
1445
|
+
# followed by a section with contact information like email and phone number. ```
|
1446
|
+
# ` "header": ` "title": "Heba Salam", "subtitle": "Software Engineer", "
|
1447
|
+
# imageStyle": "ImageStyle.AVATAR", "imageUrl": "https://example.com/heba_salam.
|
1448
|
+
# png", "imageAltText": "Avatar for Heba Salam" `, "sections" : [ ` "header": "
|
1449
|
+
# Contact Info", "widgets": [ ` "decorated_text": ` "icon": ` "knownIcon": "
|
1450
|
+
# EMAIL" `, "content": "heba.salam@example.com" ` `, ` "decoratedText": ` "icon":
|
1451
|
+
# ` "knownIcon": "PERSON" `, "content": "Online" ` `, ` "decoratedText": ` "
|
1452
|
+
# icon": ` "knownIcon": "PHONE" `, "content": "+1 (555) 555-1234" ` `, ` "
|
1453
|
+
# buttons": [ ` "textButton": ` "text": "Share", `, "onClick": ` "openLink": ` "
|
1454
|
+
# url": "https://example.com/share" ` ` `, ` "textButton": ` "text": "Edit", `, "
|
1455
|
+
# onClick": ` "action": ` "function": "goToView", "parameters": [ ` "key": "
|
1456
|
+
# viewType", "value": "EDIT" ` ], "loadIndicator": "LoadIndicator.SPINNER" ` ` `
|
1457
|
+
# ] ` ], "collapsible": true, "uncollapsibleWidgetsCount": 3 ` ], "cardActions":
|
1458
|
+
# [ ` "actionLabel": "Send Feedback", "onClick": ` "openLink": ` "url": "https://
|
1459
|
+
# example.com/feedback" ` ` ` ], "name": "contact-card-K3wB6arF2H9L" ` ```
|
1460
|
+
# Corresponds to the JSON property `card`
|
1461
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Card]
|
1462
|
+
attr_accessor :card
|
1463
|
+
|
1464
|
+
# An action that describes the behavior when the form is submitted. For example,
|
1465
|
+
# an Apps Script can be invoked to handle the form.
|
1466
|
+
# Corresponds to the JSON property `openDynamicLinkAction`
|
1467
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Action]
|
1468
|
+
attr_accessor :open_dynamic_link_action
|
1469
|
+
|
1470
|
+
# If specified, this onClick triggers an open link action.
|
1471
|
+
# Corresponds to the JSON property `openLink`
|
1472
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1OpenLink]
|
1473
|
+
attr_accessor :open_link
|
1474
|
+
|
1475
|
+
def initialize(**args)
|
1476
|
+
update!(**args)
|
1477
|
+
end
|
1478
|
+
|
1479
|
+
# Update properties of this object
|
1480
|
+
def update!(**args)
|
1481
|
+
@action = args[:action] if args.key?(:action)
|
1482
|
+
@card = args[:card] if args.key?(:card)
|
1483
|
+
@open_dynamic_link_action = args[:open_dynamic_link_action] if args.key?(:open_dynamic_link_action)
|
1484
|
+
@open_link = args[:open_link] if args.key?(:open_link)
|
1485
|
+
end
|
1486
|
+
end
|
1487
|
+
|
1488
|
+
#
|
1489
|
+
class GoogleAppsCardV1OpenLink
|
1490
|
+
include Google::Apis::Core::Hashable
|
1491
|
+
|
1492
|
+
#
|
1493
|
+
# Corresponds to the JSON property `onClose`
|
356
1494
|
# @return [String]
|
357
|
-
attr_accessor :
|
1495
|
+
attr_accessor :on_close
|
358
1496
|
|
359
|
-
#
|
360
|
-
# Corresponds to the JSON property `
|
1497
|
+
#
|
1498
|
+
# Corresponds to the JSON property `openAs`
|
361
1499
|
# @return [String]
|
362
|
-
attr_accessor :
|
1500
|
+
attr_accessor :open_as
|
363
1501
|
|
364
|
-
#
|
365
|
-
# Corresponds to the JSON property `
|
366
|
-
# @return [
|
367
|
-
attr_accessor :
|
1502
|
+
# The URL to open.
|
1503
|
+
# Corresponds to the JSON property `url`
|
1504
|
+
# @return [String]
|
1505
|
+
attr_accessor :url
|
368
1506
|
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
attr_accessor :space
|
1507
|
+
def initialize(**args)
|
1508
|
+
update!(**args)
|
1509
|
+
end
|
373
1510
|
|
374
|
-
#
|
375
|
-
|
376
|
-
|
1511
|
+
# Update properties of this object
|
1512
|
+
def update!(**args)
|
1513
|
+
@on_close = args[:on_close] if args.key?(:on_close)
|
1514
|
+
@open_as = args[:open_as] if args.key?(:open_as)
|
1515
|
+
@url = args[:url] if args.key?(:url)
|
1516
|
+
end
|
1517
|
+
end
|
1518
|
+
|
1519
|
+
# A section contains a collection of widgets that are rendered vertically in the
|
1520
|
+
# order that they are specified. Across all platforms, cards have a narrow fixed
|
1521
|
+
# width, so there is currently no need for layout properties, for example, float.
|
1522
|
+
class GoogleAppsCardV1Section
|
1523
|
+
include Google::Apis::Core::Hashable
|
1524
|
+
|
1525
|
+
# Indicates whether this section is collapsible. If a section is collapsible,
|
1526
|
+
# the description must be given.
|
1527
|
+
# Corresponds to the JSON property `collapsible`
|
1528
|
+
# @return [Boolean]
|
1529
|
+
attr_accessor :collapsible
|
1530
|
+
alias_method :collapsible?, :collapsible
|
1531
|
+
|
1532
|
+
# The header of the section. Formatted text is supported.
|
1533
|
+
# Corresponds to the JSON property `header`
|
377
1534
|
# @return [String]
|
378
|
-
attr_accessor :
|
1535
|
+
attr_accessor :header
|
379
1536
|
|
380
|
-
#
|
381
|
-
#
|
382
|
-
#
|
383
|
-
#
|
384
|
-
#
|
1537
|
+
# The number of uncollapsible widgets. For example, when a section contains five
|
1538
|
+
# widgets and the `numUncollapsibleWidget` is set to `2`, the first two widgets
|
1539
|
+
# are always shown and the last three are collapsed as default. The `
|
1540
|
+
# numUncollapsibleWidget` is taken into account only when collapsible is set to `
|
1541
|
+
# true`.
|
1542
|
+
# Corresponds to the JSON property `uncollapsibleWidgetsCount`
|
1543
|
+
# @return [Fixnum]
|
1544
|
+
attr_accessor :uncollapsible_widgets_count
|
1545
|
+
|
1546
|
+
# A section must contain at least 1 widget.
|
1547
|
+
# Corresponds to the JSON property `widgets`
|
1548
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1Widget>]
|
1549
|
+
attr_accessor :widgets
|
1550
|
+
|
1551
|
+
def initialize(**args)
|
1552
|
+
update!(**args)
|
1553
|
+
end
|
1554
|
+
|
1555
|
+
# Update properties of this object
|
1556
|
+
def update!(**args)
|
1557
|
+
@collapsible = args[:collapsible] if args.key?(:collapsible)
|
1558
|
+
@header = args[:header] if args.key?(:header)
|
1559
|
+
@uncollapsible_widgets_count = args[:uncollapsible_widgets_count] if args.key?(:uncollapsible_widgets_count)
|
1560
|
+
@widgets = args[:widgets] if args.key?(:widgets)
|
1561
|
+
end
|
1562
|
+
end
|
1563
|
+
|
1564
|
+
# A widget that creates a UI item (for example, a drop-down list) with options
|
1565
|
+
# for users to select.
|
1566
|
+
class GoogleAppsCardV1SelectionInput
|
1567
|
+
include Google::Apis::Core::Hashable
|
1568
|
+
|
1569
|
+
#
|
1570
|
+
# Corresponds to the JSON property `items`
|
1571
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1SelectionItem>]
|
1572
|
+
attr_accessor :items
|
1573
|
+
|
1574
|
+
# The label displayed ahead of the switch control.
|
1575
|
+
# Corresponds to the JSON property `label`
|
385
1576
|
# @return [String]
|
386
|
-
attr_accessor :
|
1577
|
+
attr_accessor :label
|
387
1578
|
|
388
|
-
# The
|
1579
|
+
# The name of the text input which is used in formInput.
|
1580
|
+
# Corresponds to the JSON property `name`
|
1581
|
+
# @return [String]
|
1582
|
+
attr_accessor :name
|
1583
|
+
|
1584
|
+
# An action that describes the behavior when the form is submitted. For example,
|
1585
|
+
# an Apps Script can be invoked to handle the form.
|
1586
|
+
# Corresponds to the JSON property `onChangeAction`
|
1587
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Action]
|
1588
|
+
attr_accessor :on_change_action
|
1589
|
+
|
1590
|
+
#
|
389
1591
|
# Corresponds to the JSON property `type`
|
390
1592
|
# @return [String]
|
391
1593
|
attr_accessor :type
|
392
1594
|
|
393
|
-
# A user in Google Chat.
|
394
|
-
# Corresponds to the JSON property `user`
|
395
|
-
# @return [Google::Apis::ChatV1::User]
|
396
|
-
attr_accessor :user
|
397
|
-
|
398
1595
|
def initialize(**args)
|
399
1596
|
update!(**args)
|
400
1597
|
end
|
401
1598
|
|
402
1599
|
# Update properties of this object
|
403
1600
|
def update!(**args)
|
404
|
-
@
|
405
|
-
@
|
406
|
-
@
|
407
|
-
@
|
408
|
-
@space = args[:space] if args.key?(:space)
|
409
|
-
@thread_key = args[:thread_key] if args.key?(:thread_key)
|
410
|
-
@token = args[:token] if args.key?(:token)
|
1601
|
+
@items = args[:items] if args.key?(:items)
|
1602
|
+
@label = args[:label] if args.key?(:label)
|
1603
|
+
@name = args[:name] if args.key?(:name)
|
1604
|
+
@on_change_action = args[:on_change_action] if args.key?(:on_change_action)
|
411
1605
|
@type = args[:type] if args.key?(:type)
|
412
|
-
@user = args[:user] if args.key?(:user)
|
413
1606
|
end
|
414
1607
|
end
|
415
1608
|
|
416
|
-
#
|
417
|
-
|
1609
|
+
# The item in the switch control. A radio button, at most one of the items is
|
1610
|
+
# selected.
|
1611
|
+
class GoogleAppsCardV1SelectionItem
|
418
1612
|
include Google::Apis::Core::Hashable
|
419
1613
|
|
420
|
-
#
|
421
|
-
#
|
1614
|
+
# If more than one item is selected for `RADIO_BUTTON` and `DROPDOWN`, the first
|
1615
|
+
# selected item is treated as selected and the ones after are ignored.
|
1616
|
+
# Corresponds to the JSON property `selected`
|
1617
|
+
# @return [Boolean]
|
1618
|
+
attr_accessor :selected
|
1619
|
+
alias_method :selected?, :selected
|
1620
|
+
|
1621
|
+
# The text to be displayed.
|
1622
|
+
# Corresponds to the JSON property `text`
|
422
1623
|
# @return [String]
|
423
|
-
attr_accessor :
|
1624
|
+
attr_accessor :text
|
1625
|
+
|
1626
|
+
# The value associated with this item. The client should use this as a form
|
1627
|
+
# input value.
|
1628
|
+
# Corresponds to the JSON property `value`
|
1629
|
+
# @return [String]
|
1630
|
+
attr_accessor :value
|
424
1631
|
|
425
1632
|
def initialize(**args)
|
426
1633
|
update!(**args)
|
@@ -428,44 +1635,81 @@ module Google
|
|
428
1635
|
|
429
1636
|
# Update properties of this object
|
430
1637
|
def update!(**args)
|
431
|
-
@
|
1638
|
+
@selected = args[:selected] if args.key?(:selected)
|
1639
|
+
@text = args[:text] if args.key?(:text)
|
1640
|
+
@value = args[:value] if args.key?(:value)
|
432
1641
|
end
|
433
1642
|
end
|
434
1643
|
|
435
|
-
# A
|
436
|
-
|
437
|
-
# response type of an API method. For instance: service Foo ` rpc Bar(google.
|
438
|
-
# protobuf.Empty) returns (google.protobuf.Empty); ` The JSON representation for
|
439
|
-
# `Empty` is empty JSON object ````.
|
440
|
-
class Empty
|
1644
|
+
# A suggestion item. Only supports text for now.
|
1645
|
+
class GoogleAppsCardV1SuggestionItem
|
441
1646
|
include Google::Apis::Core::Hashable
|
442
1647
|
|
1648
|
+
#
|
1649
|
+
# Corresponds to the JSON property `text`
|
1650
|
+
# @return [String]
|
1651
|
+
attr_accessor :text
|
1652
|
+
|
443
1653
|
def initialize(**args)
|
444
1654
|
update!(**args)
|
445
1655
|
end
|
446
1656
|
|
447
1657
|
# Update properties of this object
|
448
1658
|
def update!(**args)
|
1659
|
+
@text = args[:text] if args.key?(:text)
|
449
1660
|
end
|
450
1661
|
end
|
451
1662
|
|
452
|
-
# A
|
453
|
-
#
|
454
|
-
class
|
1663
|
+
# A container wrapping elements necessary for showing suggestion items used in
|
1664
|
+
# text input autocomplete.
|
1665
|
+
class GoogleAppsCardV1Suggestions
|
455
1666
|
include Google::Apis::Core::Hashable
|
456
1667
|
|
457
|
-
#
|
458
|
-
#
|
459
|
-
#
|
460
|
-
|
461
|
-
|
1668
|
+
# A list of suggestions items which will be used in are used in autocomplete.
|
1669
|
+
# Corresponds to the JSON property `items`
|
1670
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1SuggestionItem>]
|
1671
|
+
attr_accessor :items
|
1672
|
+
|
1673
|
+
def initialize(**args)
|
1674
|
+
update!(**args)
|
1675
|
+
end
|
1676
|
+
|
1677
|
+
# Update properties of this object
|
1678
|
+
def update!(**args)
|
1679
|
+
@items = args[:items] if args.key?(:items)
|
1680
|
+
end
|
1681
|
+
end
|
1682
|
+
|
1683
|
+
#
|
1684
|
+
class GoogleAppsCardV1SwitchControl
|
1685
|
+
include Google::Apis::Core::Hashable
|
1686
|
+
|
1687
|
+
# The control type, either switch or checkbox.
|
1688
|
+
# Corresponds to the JSON property `controlType`
|
462
1689
|
# @return [String]
|
463
|
-
attr_accessor :
|
1690
|
+
attr_accessor :control_type
|
464
1691
|
|
465
|
-
#
|
466
|
-
# Corresponds to the JSON property `
|
467
|
-
# @return [
|
468
|
-
attr_accessor :
|
1692
|
+
# The name of the switch widget that's used in formInput.
|
1693
|
+
# Corresponds to the JSON property `name`
|
1694
|
+
# @return [String]
|
1695
|
+
attr_accessor :name
|
1696
|
+
|
1697
|
+
# An action that describes the behavior when the form is submitted. For example,
|
1698
|
+
# an Apps Script can be invoked to handle the form.
|
1699
|
+
# Corresponds to the JSON property `onChangeAction`
|
1700
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Action]
|
1701
|
+
attr_accessor :on_change_action
|
1702
|
+
|
1703
|
+
# If the switch is selected.
|
1704
|
+
# Corresponds to the JSON property `selected`
|
1705
|
+
# @return [Boolean]
|
1706
|
+
attr_accessor :selected
|
1707
|
+
alias_method :selected?, :selected
|
1708
|
+
|
1709
|
+
# The value is what is passed back in the callback.
|
1710
|
+
# Corresponds to the JSON property `value`
|
1711
|
+
# @return [String]
|
1712
|
+
attr_accessor :value
|
469
1713
|
|
470
1714
|
def initialize(**args)
|
471
1715
|
update!(**args)
|
@@ -473,8 +1717,174 @@ module Google
|
|
473
1717
|
|
474
1718
|
# Update properties of this object
|
475
1719
|
def update!(**args)
|
476
|
-
@
|
477
|
-
@
|
1720
|
+
@control_type = args[:control_type] if args.key?(:control_type)
|
1721
|
+
@name = args[:name] if args.key?(:name)
|
1722
|
+
@on_change_action = args[:on_change_action] if args.key?(:on_change_action)
|
1723
|
+
@selected = args[:selected] if args.key?(:selected)
|
1724
|
+
@value = args[:value] if args.key?(:value)
|
1725
|
+
end
|
1726
|
+
end
|
1727
|
+
|
1728
|
+
# A text input is a UI item where users can input text. A text input can also
|
1729
|
+
# have an onChange action and suggestions.
|
1730
|
+
class GoogleAppsCardV1TextInput
|
1731
|
+
include Google::Apis::Core::Hashable
|
1732
|
+
|
1733
|
+
# An action that describes the behavior when the form is submitted. For example,
|
1734
|
+
# an Apps Script can be invoked to handle the form.
|
1735
|
+
# Corresponds to the JSON property `autoCompleteAction`
|
1736
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Action]
|
1737
|
+
attr_accessor :auto_complete_action
|
1738
|
+
|
1739
|
+
# The hint text.
|
1740
|
+
# Corresponds to the JSON property `hintText`
|
1741
|
+
# @return [String]
|
1742
|
+
attr_accessor :hint_text
|
1743
|
+
|
1744
|
+
# A container wrapping elements necessary for showing suggestion items used in
|
1745
|
+
# text input autocomplete.
|
1746
|
+
# Corresponds to the JSON property `initialSuggestions`
|
1747
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Suggestions]
|
1748
|
+
attr_accessor :initial_suggestions
|
1749
|
+
|
1750
|
+
# At least one of label and hintText must be specified.
|
1751
|
+
# Corresponds to the JSON property `label`
|
1752
|
+
# @return [String]
|
1753
|
+
attr_accessor :label
|
1754
|
+
|
1755
|
+
# The name of the text input which is used in formInput.
|
1756
|
+
# Corresponds to the JSON property `name`
|
1757
|
+
# @return [String]
|
1758
|
+
attr_accessor :name
|
1759
|
+
|
1760
|
+
# An action that describes the behavior when the form is submitted. For example,
|
1761
|
+
# an Apps Script can be invoked to handle the form.
|
1762
|
+
# Corresponds to the JSON property `onChangeAction`
|
1763
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Action]
|
1764
|
+
attr_accessor :on_change_action
|
1765
|
+
|
1766
|
+
# The style of the text, for example, a single line or multiple lines.
|
1767
|
+
# Corresponds to the JSON property `type`
|
1768
|
+
# @return [String]
|
1769
|
+
attr_accessor :type
|
1770
|
+
|
1771
|
+
# The default value when there is no input from the user.
|
1772
|
+
# Corresponds to the JSON property `value`
|
1773
|
+
# @return [String]
|
1774
|
+
attr_accessor :value
|
1775
|
+
|
1776
|
+
def initialize(**args)
|
1777
|
+
update!(**args)
|
1778
|
+
end
|
1779
|
+
|
1780
|
+
# Update properties of this object
|
1781
|
+
def update!(**args)
|
1782
|
+
@auto_complete_action = args[:auto_complete_action] if args.key?(:auto_complete_action)
|
1783
|
+
@hint_text = args[:hint_text] if args.key?(:hint_text)
|
1784
|
+
@initial_suggestions = args[:initial_suggestions] if args.key?(:initial_suggestions)
|
1785
|
+
@label = args[:label] if args.key?(:label)
|
1786
|
+
@name = args[:name] if args.key?(:name)
|
1787
|
+
@on_change_action = args[:on_change_action] if args.key?(:on_change_action)
|
1788
|
+
@type = args[:type] if args.key?(:type)
|
1789
|
+
@value = args[:value] if args.key?(:value)
|
1790
|
+
end
|
1791
|
+
end
|
1792
|
+
|
1793
|
+
# A paragraph of text that supports formatting. See [Text formatting](workspace/
|
1794
|
+
# add-ons/concepts/widgets#text_formatting") for details.
|
1795
|
+
class GoogleAppsCardV1TextParagraph
|
1796
|
+
include Google::Apis::Core::Hashable
|
1797
|
+
|
1798
|
+
# The text that's shown in the widget.
|
1799
|
+
# Corresponds to the JSON property `text`
|
1800
|
+
# @return [String]
|
1801
|
+
attr_accessor :text
|
1802
|
+
|
1803
|
+
def initialize(**args)
|
1804
|
+
update!(**args)
|
1805
|
+
end
|
1806
|
+
|
1807
|
+
# Update properties of this object
|
1808
|
+
def update!(**args)
|
1809
|
+
@text = args[:text] if args.key?(:text)
|
1810
|
+
end
|
1811
|
+
end
|
1812
|
+
|
1813
|
+
# A widget is a UI element that presents texts, images, etc.
|
1814
|
+
class GoogleAppsCardV1Widget
|
1815
|
+
include Google::Apis::Core::Hashable
|
1816
|
+
|
1817
|
+
# A list of buttons layed out horizontally.
|
1818
|
+
# Corresponds to the JSON property `buttonList`
|
1819
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1ButtonList]
|
1820
|
+
attr_accessor :button_list
|
1821
|
+
|
1822
|
+
# The widget that lets users to specify a date and time.
|
1823
|
+
# Corresponds to the JSON property `dateTimePicker`
|
1824
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1DateTimePicker]
|
1825
|
+
attr_accessor :date_time_picker
|
1826
|
+
|
1827
|
+
# A widget that displays text with optional decorations such as a label above or
|
1828
|
+
# below the text, an icon in front of the text, a selection widget or a button
|
1829
|
+
# after the text.
|
1830
|
+
# Corresponds to the JSON property `decoratedText`
|
1831
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1DecoratedText]
|
1832
|
+
attr_accessor :decorated_text
|
1833
|
+
|
1834
|
+
# A divider that appears in between widgets.
|
1835
|
+
# Corresponds to the JSON property `divider`
|
1836
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Divider]
|
1837
|
+
attr_accessor :divider
|
1838
|
+
|
1839
|
+
# Represents a Grid widget that displays items in a configurable grid layout.
|
1840
|
+
# Corresponds to the JSON property `grid`
|
1841
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Grid]
|
1842
|
+
attr_accessor :grid
|
1843
|
+
|
1844
|
+
# The horizontal alignment of this widget.
|
1845
|
+
# Corresponds to the JSON property `horizontalAlignment`
|
1846
|
+
# @return [String]
|
1847
|
+
attr_accessor :horizontal_alignment
|
1848
|
+
|
1849
|
+
# An image that is specified by a URL and can have an onClick action.
|
1850
|
+
# Corresponds to the JSON property `image`
|
1851
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Image]
|
1852
|
+
attr_accessor :image
|
1853
|
+
|
1854
|
+
# A widget that creates a UI item (for example, a drop-down list) with options
|
1855
|
+
# for users to select.
|
1856
|
+
# Corresponds to the JSON property `selectionInput`
|
1857
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1SelectionInput]
|
1858
|
+
attr_accessor :selection_input
|
1859
|
+
|
1860
|
+
# A text input is a UI item where users can input text. A text input can also
|
1861
|
+
# have an onChange action and suggestions.
|
1862
|
+
# Corresponds to the JSON property `textInput`
|
1863
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1TextInput]
|
1864
|
+
attr_accessor :text_input
|
1865
|
+
|
1866
|
+
# A paragraph of text that supports formatting. See [Text formatting](workspace/
|
1867
|
+
# add-ons/concepts/widgets#text_formatting") for details.
|
1868
|
+
# Corresponds to the JSON property `textParagraph`
|
1869
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1TextParagraph]
|
1870
|
+
attr_accessor :text_paragraph
|
1871
|
+
|
1872
|
+
def initialize(**args)
|
1873
|
+
update!(**args)
|
1874
|
+
end
|
1875
|
+
|
1876
|
+
# Update properties of this object
|
1877
|
+
def update!(**args)
|
1878
|
+
@button_list = args[:button_list] if args.key?(:button_list)
|
1879
|
+
@date_time_picker = args[:date_time_picker] if args.key?(:date_time_picker)
|
1880
|
+
@decorated_text = args[:decorated_text] if args.key?(:decorated_text)
|
1881
|
+
@divider = args[:divider] if args.key?(:divider)
|
1882
|
+
@grid = args[:grid] if args.key?(:grid)
|
1883
|
+
@horizontal_alignment = args[:horizontal_alignment] if args.key?(:horizontal_alignment)
|
1884
|
+
@image = args[:image] if args.key?(:image)
|
1885
|
+
@selection_input = args[:selection_input] if args.key?(:selection_input)
|
1886
|
+
@text_input = args[:text_input] if args.key?(:text_input)
|
1887
|
+
@text_paragraph = args[:text_paragraph] if args.key?(:text_paragraph)
|
478
1888
|
end
|
479
1889
|
end
|
480
1890
|
|
@@ -755,6 +2165,15 @@ module Google
|
|
755
2165
|
# @return [Array<Google::Apis::ChatV1::Card>]
|
756
2166
|
attr_accessor :cards
|
757
2167
|
|
2168
|
+
# Rich, formatted and interactive cards that can be used to display UI elements
|
2169
|
+
# and editable widgets, such as: formatted text, buttons, clickable images,
|
2170
|
+
# checkboxes, radio buttons. Cards are normally displayed below the plain-text
|
2171
|
+
# body of the message. This v2 allows input widgets. The string key is a unique
|
2172
|
+
# identifier among cards in the same message for identifying inputs.
|
2173
|
+
# Corresponds to the JSON property `cardsV2`
|
2174
|
+
# @return [Array<Google::Apis::ChatV1::CardWithId>]
|
2175
|
+
attr_accessor :cards_v2
|
2176
|
+
|
758
2177
|
# Output only. The time at which the message was created in Hangouts Chat server.
|
759
2178
|
# Corresponds to the JSON property `createTime`
|
760
2179
|
# @return [String]
|
@@ -814,6 +2233,7 @@ module Google
|
|
814
2233
|
@argument_text = args[:argument_text] if args.key?(:argument_text)
|
815
2234
|
@attachment = args[:attachment] if args.key?(:attachment)
|
816
2235
|
@cards = args[:cards] if args.key?(:cards)
|
2236
|
+
@cards_v2 = args[:cards_v2] if args.key?(:cards_v2)
|
817
2237
|
@create_time = args[:create_time] if args.key?(:create_time)
|
818
2238
|
@fallback_text = args[:fallback_text] if args.key?(:fallback_text)
|
819
2239
|
@name = args[:name] if args.key?(:name)
|