google-apis-chat_v1 0.12.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/OVERVIEW.md +2 -2
- data/lib/google/apis/chat_v1/classes.rb +1889 -162
- data/lib/google/apis/chat_v1/gem_version.rb +2 -2
- data/lib/google/apis/chat_v1/representations.rb +691 -0
- data/lib/google/apis/chat_v1/service.rb +101 -58
- metadata +5 -5
@@ -54,6 +54,12 @@ module Google
|
|
54
54
|
class ActionResponse
|
55
55
|
include Google::Apis::Core::Hashable
|
56
56
|
|
57
|
+
# Contains dialog if present as well as the ActionStatus for the request sent
|
58
|
+
# from user.
|
59
|
+
# Corresponds to the JSON property `dialogAction`
|
60
|
+
# @return [Google::Apis::ChatV1::DialogAction]
|
61
|
+
attr_accessor :dialog_action
|
62
|
+
|
57
63
|
# The type of bot response.
|
58
64
|
# Corresponds to the JSON property `type`
|
59
65
|
# @return [String]
|
@@ -70,11 +76,43 @@ module Google
|
|
70
76
|
|
71
77
|
# Update properties of this object
|
72
78
|
def update!(**args)
|
79
|
+
@dialog_action = args[:dialog_action] if args.key?(:dialog_action)
|
73
80
|
@type = args[:type] if args.key?(:type)
|
74
81
|
@url = args[:url] if args.key?(:url)
|
75
82
|
end
|
76
83
|
end
|
77
84
|
|
85
|
+
# ActionStatus represents status of a request from the bot developer's side. In
|
86
|
+
# specific, for each request a bot gets, the bot developer will set both fields
|
87
|
+
# below in relation to what the response status and message related to status
|
88
|
+
# should be.
|
89
|
+
class ActionStatus
|
90
|
+
include Google::Apis::Core::Hashable
|
91
|
+
|
92
|
+
# The status code.
|
93
|
+
# Corresponds to the JSON property `statusCode`
|
94
|
+
# @return [String]
|
95
|
+
attr_accessor :status_code
|
96
|
+
|
97
|
+
# This message will be the corresponding string to the above status_code. If
|
98
|
+
# unset, an appropriate generic message based on the status_code will be shown
|
99
|
+
# to the user. If this field is set then the message will be surfaced to the
|
100
|
+
# user for both successes and errors.
|
101
|
+
# Corresponds to the JSON property `userFacingMessage`
|
102
|
+
# @return [String]
|
103
|
+
attr_accessor :user_facing_message
|
104
|
+
|
105
|
+
def initialize(**args)
|
106
|
+
update!(**args)
|
107
|
+
end
|
108
|
+
|
109
|
+
# Update properties of this object
|
110
|
+
def update!(**args)
|
111
|
+
@status_code = args[:status_code] if args.key?(:status_code)
|
112
|
+
@user_facing_message = args[:user_facing_message] if args.key?(:user_facing_message)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
78
116
|
# Annotations associated with the plain-text body of the message. Example plain-
|
79
117
|
# text message body: ``` Hello @FooBot how are you!" ``` The corresponding
|
80
118
|
# annotations metadata: ``` "annotations":[` "type":"USER_MENTION", "startIndex":
|
@@ -125,7 +163,7 @@ module Google
|
|
125
163
|
end
|
126
164
|
end
|
127
165
|
|
128
|
-
# An attachment in
|
166
|
+
# An attachment in Google Chat.
|
129
167
|
class Attachment
|
130
168
|
include Google::Apis::Core::Hashable
|
131
169
|
|
@@ -219,10 +257,1571 @@ module Google
|
|
219
257
|
# @return [Google::Apis::ChatV1::ImageButton]
|
220
258
|
attr_accessor :image_button
|
221
259
|
|
222
|
-
# A button with text and onclick action.
|
223
|
-
# Corresponds to the JSON property `textButton`
|
224
|
-
# @return [Google::Apis::ChatV1::TextButton]
|
225
|
-
attr_accessor :text_button
|
260
|
+
# A button with text and onclick action.
|
261
|
+
# Corresponds to the JSON property `textButton`
|
262
|
+
# @return [Google::Apis::ChatV1::TextButton]
|
263
|
+
attr_accessor :text_button
|
264
|
+
|
265
|
+
def initialize(**args)
|
266
|
+
update!(**args)
|
267
|
+
end
|
268
|
+
|
269
|
+
# Update properties of this object
|
270
|
+
def update!(**args)
|
271
|
+
@image_button = args[:image_button] if args.key?(:image_button)
|
272
|
+
@text_button = args[:text_button] if args.key?(:text_button)
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
# A card is a UI element that can contain UI widgets such as texts, images.
|
277
|
+
class Card
|
278
|
+
include Google::Apis::Core::Hashable
|
279
|
+
|
280
|
+
# The actions of this card.
|
281
|
+
# Corresponds to the JSON property `cardActions`
|
282
|
+
# @return [Array<Google::Apis::ChatV1::CardAction>]
|
283
|
+
attr_accessor :card_actions
|
284
|
+
|
285
|
+
# The header of the card. A header usually contains a title and an image.
|
286
|
+
# Corresponds to the JSON property `header`
|
287
|
+
# @return [Google::Apis::ChatV1::CardHeader]
|
288
|
+
attr_accessor :header
|
289
|
+
|
290
|
+
# Name of the card.
|
291
|
+
# Corresponds to the JSON property `name`
|
292
|
+
# @return [String]
|
293
|
+
attr_accessor :name
|
294
|
+
|
295
|
+
# Sections are separated by a line divider.
|
296
|
+
# Corresponds to the JSON property `sections`
|
297
|
+
# @return [Array<Google::Apis::ChatV1::Section>]
|
298
|
+
attr_accessor :sections
|
299
|
+
|
300
|
+
def initialize(**args)
|
301
|
+
update!(**args)
|
302
|
+
end
|
303
|
+
|
304
|
+
# Update properties of this object
|
305
|
+
def update!(**args)
|
306
|
+
@card_actions = args[:card_actions] if args.key?(:card_actions)
|
307
|
+
@header = args[:header] if args.key?(:header)
|
308
|
+
@name = args[:name] if args.key?(:name)
|
309
|
+
@sections = args[:sections] if args.key?(:sections)
|
310
|
+
end
|
311
|
+
end
|
312
|
+
|
313
|
+
# A card action is the action associated with the card. For an invoice card, a
|
314
|
+
# typical action would be: delete invoice, email invoice or open the invoice in
|
315
|
+
# browser.
|
316
|
+
class CardAction
|
317
|
+
include Google::Apis::Core::Hashable
|
318
|
+
|
319
|
+
# The label used to be displayed in the action menu item.
|
320
|
+
# Corresponds to the JSON property `actionLabel`
|
321
|
+
# @return [String]
|
322
|
+
attr_accessor :action_label
|
323
|
+
|
324
|
+
# An onclick action (e.g. open a link).
|
325
|
+
# Corresponds to the JSON property `onClick`
|
326
|
+
# @return [Google::Apis::ChatV1::OnClick]
|
327
|
+
attr_accessor :on_click
|
328
|
+
|
329
|
+
def initialize(**args)
|
330
|
+
update!(**args)
|
331
|
+
end
|
332
|
+
|
333
|
+
# Update properties of this object
|
334
|
+
def update!(**args)
|
335
|
+
@action_label = args[:action_label] if args.key?(:action_label)
|
336
|
+
@on_click = args[:on_click] if args.key?(:on_click)
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
340
|
+
#
|
341
|
+
class CardHeader
|
342
|
+
include Google::Apis::Core::Hashable
|
343
|
+
|
344
|
+
# The image's type (e.g. square border or circular border).
|
345
|
+
# Corresponds to the JSON property `imageStyle`
|
346
|
+
# @return [String]
|
347
|
+
attr_accessor :image_style
|
348
|
+
|
349
|
+
# The URL of the image in the card header.
|
350
|
+
# Corresponds to the JSON property `imageUrl`
|
351
|
+
# @return [String]
|
352
|
+
attr_accessor :image_url
|
353
|
+
|
354
|
+
# The subtitle of the card header.
|
355
|
+
# Corresponds to the JSON property `subtitle`
|
356
|
+
# @return [String]
|
357
|
+
attr_accessor :subtitle
|
358
|
+
|
359
|
+
# The title must be specified. The header has a fixed height: if both a title
|
360
|
+
# and subtitle is specified, each will take up 1 line. If only the title is
|
361
|
+
# specified, it will take up both lines.
|
362
|
+
# Corresponds to the JSON property `title`
|
363
|
+
# @return [String]
|
364
|
+
attr_accessor :title
|
365
|
+
|
366
|
+
def initialize(**args)
|
367
|
+
update!(**args)
|
368
|
+
end
|
369
|
+
|
370
|
+
# Update properties of this object
|
371
|
+
def update!(**args)
|
372
|
+
@image_style = args[:image_style] if args.key?(:image_style)
|
373
|
+
@image_url = args[:image_url] if args.key?(:image_url)
|
374
|
+
@subtitle = args[:subtitle] if args.key?(:subtitle)
|
375
|
+
@title = args[:title] if args.key?(:title)
|
376
|
+
end
|
377
|
+
end
|
378
|
+
|
379
|
+
# Represents a color in the RGBA color space. This representation is designed
|
380
|
+
# for simplicity of conversion to/from color representations in various
|
381
|
+
# languages over compactness. For example, the fields of this representation can
|
382
|
+
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
|
383
|
+
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
|
384
|
+
# method in iOS; and, with just a little work, it can be easily formatted into a
|
385
|
+
# CSS `rgba()` string in JavaScript. This reference page doesn't carry
|
386
|
+
# information about the absolute color space that should be used to interpret
|
387
|
+
# the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default,
|
388
|
+
# applications should assume the sRGB color space. When color equality needs to
|
389
|
+
# be decided, implementations, unless documented otherwise, treat two colors as
|
390
|
+
# equal if all their red, green, blue, and alpha values each differ by at most
|
391
|
+
# 1e-5. Example (Java): import com.google.type.Color; // ... public static java.
|
392
|
+
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
|
393
|
+
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
|
394
|
+
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
|
395
|
+
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
|
396
|
+
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
|
397
|
+
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
|
398
|
+
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
|
399
|
+
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
|
400
|
+
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
|
401
|
+
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
|
402
|
+
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
|
403
|
+
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
|
404
|
+
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
|
405
|
+
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
|
406
|
+
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
|
407
|
+
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
|
408
|
+
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
|
409
|
+
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
|
410
|
+
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
|
411
|
+
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
|
412
|
+
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
|
413
|
+
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
|
414
|
+
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
|
415
|
+
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
|
416
|
+
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
|
417
|
+
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
|
418
|
+
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
|
419
|
+
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
|
420
|
+
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
|
421
|
+
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
|
422
|
+
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
|
423
|
+
# / ...
|
424
|
+
class Color
|
425
|
+
include Google::Apis::Core::Hashable
|
426
|
+
|
427
|
+
# The fraction of this color that should be applied to the pixel. That is, the
|
428
|
+
# final pixel color is defined by the equation: `pixel color = alpha * (this
|
429
|
+
# color) + (1.0 - alpha) * (background color)` This means that a value of 1.0
|
430
|
+
# corresponds to a solid color, whereas a value of 0.0 corresponds to a
|
431
|
+
# completely transparent color. This uses a wrapper message rather than a simple
|
432
|
+
# float scalar so that it is possible to distinguish between a default value and
|
433
|
+
# the value being unset. If omitted, this color object is rendered as a solid
|
434
|
+
# color (as if the alpha value had been explicitly given a value of 1.0).
|
435
|
+
# Corresponds to the JSON property `alpha`
|
436
|
+
# @return [Float]
|
437
|
+
attr_accessor :alpha
|
438
|
+
|
439
|
+
# The amount of blue in the color as a value in the interval [0, 1].
|
440
|
+
# Corresponds to the JSON property `blue`
|
441
|
+
# @return [Float]
|
442
|
+
attr_accessor :blue
|
443
|
+
|
444
|
+
# The amount of green in the color as a value in the interval [0, 1].
|
445
|
+
# Corresponds to the JSON property `green`
|
446
|
+
# @return [Float]
|
447
|
+
attr_accessor :green
|
448
|
+
|
449
|
+
# The amount of red in the color as a value in the interval [0, 1].
|
450
|
+
# Corresponds to the JSON property `red`
|
451
|
+
# @return [Float]
|
452
|
+
attr_accessor :red
|
453
|
+
|
454
|
+
def initialize(**args)
|
455
|
+
update!(**args)
|
456
|
+
end
|
457
|
+
|
458
|
+
# Update properties of this object
|
459
|
+
def update!(**args)
|
460
|
+
@alpha = args[:alpha] if args.key?(:alpha)
|
461
|
+
@blue = args[:blue] if args.key?(:blue)
|
462
|
+
@green = args[:green] if args.key?(:green)
|
463
|
+
@red = args[:red] if args.key?(:red)
|
464
|
+
end
|
465
|
+
end
|
466
|
+
|
467
|
+
# Next available ID = 8
|
468
|
+
class CommonEventObject
|
469
|
+
include Google::Apis::Core::Hashable
|
470
|
+
|
471
|
+
# The keys are the string IDs associated with the widget and the values are
|
472
|
+
# inputs with a widget in the card.
|
473
|
+
# Corresponds to the JSON property `formInputs`
|
474
|
+
# @return [Hash<String,Google::Apis::ChatV1::Inputs>]
|
475
|
+
attr_accessor :form_inputs
|
476
|
+
|
477
|
+
# The hostApp enum which indicates the app the add-on is invoked from
|
478
|
+
# Corresponds to the JSON property `hostApp`
|
479
|
+
# @return [String]
|
480
|
+
attr_accessor :host_app
|
481
|
+
|
482
|
+
# Name of the invoked function associated with the widget. This field is
|
483
|
+
# currently only set for chat.
|
484
|
+
# Corresponds to the JSON property `invokedFunction`
|
485
|
+
# @return [String]
|
486
|
+
attr_accessor :invoked_function
|
487
|
+
|
488
|
+
# Any additional parameters.
|
489
|
+
# Corresponds to the JSON property `parameters`
|
490
|
+
# @return [Hash<String,String>]
|
491
|
+
attr_accessor :parameters
|
492
|
+
|
493
|
+
# The platform enum which indicates the platform where the add-on is running.
|
494
|
+
# Corresponds to the JSON property `platform`
|
495
|
+
# @return [String]
|
496
|
+
attr_accessor :platform
|
497
|
+
|
498
|
+
# The timezone id and offset. The id is the tz database time zones such as "
|
499
|
+
# America/Toronto". The user timezone offset, in milliseconds, from Coordinated
|
500
|
+
# Universal Time (UTC).
|
501
|
+
# Corresponds to the JSON property `timeZone`
|
502
|
+
# @return [Google::Apis::ChatV1::TimeZone]
|
503
|
+
attr_accessor :time_zone
|
504
|
+
|
505
|
+
# The full locale.displayName in the format of [ISO 639 language code]-[ISO 3166
|
506
|
+
# country/region code] such as "en-US"
|
507
|
+
# Corresponds to the JSON property `userLocale`
|
508
|
+
# @return [String]
|
509
|
+
attr_accessor :user_locale
|
510
|
+
|
511
|
+
def initialize(**args)
|
512
|
+
update!(**args)
|
513
|
+
end
|
514
|
+
|
515
|
+
# Update properties of this object
|
516
|
+
def update!(**args)
|
517
|
+
@form_inputs = args[:form_inputs] if args.key?(:form_inputs)
|
518
|
+
@host_app = args[:host_app] if args.key?(:host_app)
|
519
|
+
@invoked_function = args[:invoked_function] if args.key?(:invoked_function)
|
520
|
+
@parameters = args[:parameters] if args.key?(:parameters)
|
521
|
+
@platform = args[:platform] if args.key?(:platform)
|
522
|
+
@time_zone = args[:time_zone] if args.key?(:time_zone)
|
523
|
+
@user_locale = args[:user_locale] if args.key?(:user_locale)
|
524
|
+
end
|
525
|
+
end
|
526
|
+
|
527
|
+
# Input Parameter for Date Picker widget.
|
528
|
+
class DateInput
|
529
|
+
include Google::Apis::Core::Hashable
|
530
|
+
|
531
|
+
#
|
532
|
+
# Corresponds to the JSON property `msSinceEpoch`
|
533
|
+
# @return [Fixnum]
|
534
|
+
attr_accessor :ms_since_epoch
|
535
|
+
|
536
|
+
def initialize(**args)
|
537
|
+
update!(**args)
|
538
|
+
end
|
539
|
+
|
540
|
+
# Update properties of this object
|
541
|
+
def update!(**args)
|
542
|
+
@ms_since_epoch = args[:ms_since_epoch] if args.key?(:ms_since_epoch)
|
543
|
+
end
|
544
|
+
end
|
545
|
+
|
546
|
+
# Input Parameter for Date and Time Picker widget.
|
547
|
+
class DateTimeInput
|
548
|
+
include Google::Apis::Core::Hashable
|
549
|
+
|
550
|
+
#
|
551
|
+
# Corresponds to the JSON property `hasDate`
|
552
|
+
# @return [Boolean]
|
553
|
+
attr_accessor :has_date
|
554
|
+
alias_method :has_date?, :has_date
|
555
|
+
|
556
|
+
#
|
557
|
+
# Corresponds to the JSON property `hasTime`
|
558
|
+
# @return [Boolean]
|
559
|
+
attr_accessor :has_time
|
560
|
+
alias_method :has_time?, :has_time
|
561
|
+
|
562
|
+
#
|
563
|
+
# Corresponds to the JSON property `msSinceEpoch`
|
564
|
+
# @return [Fixnum]
|
565
|
+
attr_accessor :ms_since_epoch
|
566
|
+
|
567
|
+
def initialize(**args)
|
568
|
+
update!(**args)
|
569
|
+
end
|
570
|
+
|
571
|
+
# Update properties of this object
|
572
|
+
def update!(**args)
|
573
|
+
@has_date = args[:has_date] if args.key?(:has_date)
|
574
|
+
@has_time = args[:has_time] if args.key?(:has_time)
|
575
|
+
@ms_since_epoch = args[:ms_since_epoch] if args.key?(:ms_since_epoch)
|
576
|
+
end
|
577
|
+
end
|
578
|
+
|
579
|
+
# Google Chat events.
|
580
|
+
class DeprecatedEvent
|
581
|
+
include Google::Apis::Core::Hashable
|
582
|
+
|
583
|
+
# A form action describes the behavior when the form is submitted. For example,
|
584
|
+
# an Apps Script can be invoked to handle the form.
|
585
|
+
# Corresponds to the JSON property `action`
|
586
|
+
# @return [Google::Apis::ChatV1::FormAction]
|
587
|
+
attr_accessor :action
|
588
|
+
|
589
|
+
# Next available ID = 8
|
590
|
+
# Corresponds to the JSON property `common`
|
591
|
+
# @return [Google::Apis::ChatV1::CommonEventObject]
|
592
|
+
attr_accessor :common
|
593
|
+
|
594
|
+
# The URL the bot should redirect the user to after they have completed an
|
595
|
+
# authorization or configuration flow outside of Google Chat. See the [
|
596
|
+
# Authorizing access to 3p services guide](/chat/how-tos/auth-3p) for more
|
597
|
+
# information.
|
598
|
+
# Corresponds to the JSON property `configCompleteRedirectUrl`
|
599
|
+
# @return [String]
|
600
|
+
attr_accessor :config_complete_redirect_url
|
601
|
+
|
602
|
+
# The type of dialog event we have received.
|
603
|
+
# Corresponds to the JSON property `dialogEventType`
|
604
|
+
# @return [String]
|
605
|
+
attr_accessor :dialog_event_type
|
606
|
+
|
607
|
+
# The timestamp indicating when the event was dispatched.
|
608
|
+
# Corresponds to the JSON property `eventTime`
|
609
|
+
# @return [String]
|
610
|
+
attr_accessor :event_time
|
611
|
+
|
612
|
+
# Whether or not this event is related to dialogs request, submit or cancel.
|
613
|
+
# This will be set to true when we want a request/submit/cancel event.
|
614
|
+
# Corresponds to the JSON property `isDialogEvent`
|
615
|
+
# @return [Boolean]
|
616
|
+
attr_accessor :is_dialog_event
|
617
|
+
alias_method :is_dialog_event?, :is_dialog_event
|
618
|
+
|
619
|
+
# A message in Google Chat.
|
620
|
+
# Corresponds to the JSON property `message`
|
621
|
+
# @return [Google::Apis::ChatV1::Message]
|
622
|
+
attr_accessor :message
|
623
|
+
|
624
|
+
# A space in Google Chat. Spaces are conversations between two or more users or
|
625
|
+
# 1:1 messages between a user and a Chat bot.
|
626
|
+
# Corresponds to the JSON property `space`
|
627
|
+
# @return [Google::Apis::ChatV1::Space]
|
628
|
+
attr_accessor :space
|
629
|
+
|
630
|
+
# The bot-defined key for the thread related to the event. See the thread_key
|
631
|
+
# field of the `spaces.message.create` request for more information.
|
632
|
+
# Corresponds to the JSON property `threadKey`
|
633
|
+
# @return [String]
|
634
|
+
attr_accessor :thread_key
|
635
|
+
|
636
|
+
# A secret value that bots can use to verify if a request is from Google. The
|
637
|
+
# token is randomly generated by Google, remains static, and can be obtained
|
638
|
+
# from the Google Chat API configuration page in the Cloud Console. Developers
|
639
|
+
# can revoke/regenerate it if needed from the same page.
|
640
|
+
# Corresponds to the JSON property `token`
|
641
|
+
# @return [String]
|
642
|
+
attr_accessor :token
|
643
|
+
|
644
|
+
# The type of the event.
|
645
|
+
# Corresponds to the JSON property `type`
|
646
|
+
# @return [String]
|
647
|
+
attr_accessor :type
|
648
|
+
|
649
|
+
# A user in Google Chat.
|
650
|
+
# Corresponds to the JSON property `user`
|
651
|
+
# @return [Google::Apis::ChatV1::User]
|
652
|
+
attr_accessor :user
|
653
|
+
|
654
|
+
def initialize(**args)
|
655
|
+
update!(**args)
|
656
|
+
end
|
657
|
+
|
658
|
+
# Update properties of this object
|
659
|
+
def update!(**args)
|
660
|
+
@action = args[:action] if args.key?(:action)
|
661
|
+
@common = args[:common] if args.key?(:common)
|
662
|
+
@config_complete_redirect_url = args[:config_complete_redirect_url] if args.key?(:config_complete_redirect_url)
|
663
|
+
@dialog_event_type = args[:dialog_event_type] if args.key?(:dialog_event_type)
|
664
|
+
@event_time = args[:event_time] if args.key?(:event_time)
|
665
|
+
@is_dialog_event = args[:is_dialog_event] if args.key?(:is_dialog_event)
|
666
|
+
@message = args[:message] if args.key?(:message)
|
667
|
+
@space = args[:space] if args.key?(:space)
|
668
|
+
@thread_key = args[:thread_key] if args.key?(:thread_key)
|
669
|
+
@token = args[:token] if args.key?(:token)
|
670
|
+
@type = args[:type] if args.key?(:type)
|
671
|
+
@user = args[:user] if args.key?(:user)
|
672
|
+
end
|
673
|
+
end
|
674
|
+
|
675
|
+
# Wrapper around the card body of the dialog.
|
676
|
+
class Dialog
|
677
|
+
include Google::Apis::Core::Hashable
|
678
|
+
|
679
|
+
# A card is a UI element that can contain UI widgets such as text and images.
|
680
|
+
# For more information, see Cards . For example, the following JSON creates a
|
681
|
+
# card that has a header with the name, position, icons, and link for a contact,
|
682
|
+
# followed by a section with contact information like email and phone number. ```
|
683
|
+
# ` "header": ` "title": "Heba Salam", "subtitle": "Software Engineer", "
|
684
|
+
# imageStyle": "ImageStyle.AVATAR", "imageUrl": "https://example.com/heba_salam.
|
685
|
+
# png", "imageAltText": "Avatar for Heba Salam" `, "sections" : [ ` "header": "
|
686
|
+
# Contact Info", "widgets": [ ` "decorated_text": ` "icon": ` "knownIcon": "
|
687
|
+
# EMAIL" `, "content": "heba.salam@example.com" ` `, ` "decoratedText": ` "icon":
|
688
|
+
# ` "knownIcon": "PERSON" `, "content": "Online" ` `, ` "decoratedText": ` "
|
689
|
+
# icon": ` "knownIcon": "PHONE" `, "content": "+1 (555) 555-1234" ` `, ` "
|
690
|
+
# buttons": [ ` "textButton": ` "text": "Share", `, "onClick": ` "openLink": ` "
|
691
|
+
# url": "https://example.com/share" ` ` `, ` "textButton": ` "text": "Edit", `, "
|
692
|
+
# onClick": ` "action": ` "function": "goToView", "parameters": [ ` "key": "
|
693
|
+
# viewType", "value": "EDIT" ` ], "loadIndicator": "LoadIndicator.SPINNER" ` ` `
|
694
|
+
# ] ` ], "collapsible": true, "uncollapsibleWidgetsCount": 3 ` ], "cardActions":
|
695
|
+
# [ ` "actionLabel": "Send Feedback", "onClick": ` "openLink": ` "url": "https://
|
696
|
+
# example.com/feedback" ` ` ` ], "name": "contact-card-K3wB6arF2H9L" ` ```
|
697
|
+
# Corresponds to the JSON property `body`
|
698
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Card]
|
699
|
+
attr_accessor :body
|
700
|
+
|
701
|
+
def initialize(**args)
|
702
|
+
update!(**args)
|
703
|
+
end
|
704
|
+
|
705
|
+
# Update properties of this object
|
706
|
+
def update!(**args)
|
707
|
+
@body = args[:body] if args.key?(:body)
|
708
|
+
end
|
709
|
+
end
|
710
|
+
|
711
|
+
# Contains dialog if present as well as the ActionStatus for the request sent
|
712
|
+
# from user.
|
713
|
+
class DialogAction
|
714
|
+
include Google::Apis::Core::Hashable
|
715
|
+
|
716
|
+
# ActionStatus represents status of a request from the bot developer's side. In
|
717
|
+
# specific, for each request a bot gets, the bot developer will set both fields
|
718
|
+
# below in relation to what the response status and message related to status
|
719
|
+
# should be.
|
720
|
+
# Corresponds to the JSON property `actionStatus`
|
721
|
+
# @return [Google::Apis::ChatV1::ActionStatus]
|
722
|
+
attr_accessor :action_status
|
723
|
+
|
724
|
+
# Wrapper around the card body of the dialog.
|
725
|
+
# Corresponds to the JSON property `dialog`
|
726
|
+
# @return [Google::Apis::ChatV1::Dialog]
|
727
|
+
attr_accessor :dialog
|
728
|
+
|
729
|
+
def initialize(**args)
|
730
|
+
update!(**args)
|
731
|
+
end
|
732
|
+
|
733
|
+
# Update properties of this object
|
734
|
+
def update!(**args)
|
735
|
+
@action_status = args[:action_status] if args.key?(:action_status)
|
736
|
+
@dialog = args[:dialog] if args.key?(:dialog)
|
737
|
+
end
|
738
|
+
end
|
739
|
+
|
740
|
+
# A reference to the data of a drive attachment.
|
741
|
+
class DriveDataRef
|
742
|
+
include Google::Apis::Core::Hashable
|
743
|
+
|
744
|
+
# The id for the drive file, for use with the Drive API.
|
745
|
+
# Corresponds to the JSON property `driveFileId`
|
746
|
+
# @return [String]
|
747
|
+
attr_accessor :drive_file_id
|
748
|
+
|
749
|
+
def initialize(**args)
|
750
|
+
update!(**args)
|
751
|
+
end
|
752
|
+
|
753
|
+
# Update properties of this object
|
754
|
+
def update!(**args)
|
755
|
+
@drive_file_id = args[:drive_file_id] if args.key?(:drive_file_id)
|
756
|
+
end
|
757
|
+
end
|
758
|
+
|
759
|
+
# A generic empty message that you can re-use to avoid defining duplicated empty
|
760
|
+
# messages in your APIs. A typical example is to use it as the request or the
|
761
|
+
# response type of an API method. For instance: service Foo ` rpc Bar(google.
|
762
|
+
# protobuf.Empty) returns (google.protobuf.Empty); ` The JSON representation for
|
763
|
+
# `Empty` is empty JSON object ````.
|
764
|
+
class Empty
|
765
|
+
include Google::Apis::Core::Hashable
|
766
|
+
|
767
|
+
def initialize(**args)
|
768
|
+
update!(**args)
|
769
|
+
end
|
770
|
+
|
771
|
+
# Update properties of this object
|
772
|
+
def update!(**args)
|
773
|
+
end
|
774
|
+
end
|
775
|
+
|
776
|
+
# A form action describes the behavior when the form is submitted. For example,
|
777
|
+
# an Apps Script can be invoked to handle the form.
|
778
|
+
class FormAction
|
779
|
+
include Google::Apis::Core::Hashable
|
780
|
+
|
781
|
+
# The method name is used to identify which part of the form triggered the form
|
782
|
+
# submission. This information is echoed back to the bot as part of the card
|
783
|
+
# click event. The same method name can be used for several elements that
|
784
|
+
# trigger a common behavior if desired.
|
785
|
+
# Corresponds to the JSON property `actionMethodName`
|
786
|
+
# @return [String]
|
787
|
+
attr_accessor :action_method_name
|
788
|
+
|
789
|
+
# List of action parameters.
|
790
|
+
# Corresponds to the JSON property `parameters`
|
791
|
+
# @return [Array<Google::Apis::ChatV1::ActionParameter>]
|
792
|
+
attr_accessor :parameters
|
793
|
+
|
794
|
+
def initialize(**args)
|
795
|
+
update!(**args)
|
796
|
+
end
|
797
|
+
|
798
|
+
# Update properties of this object
|
799
|
+
def update!(**args)
|
800
|
+
@action_method_name = args[:action_method_name] if args.key?(:action_method_name)
|
801
|
+
@parameters = args[:parameters] if args.key?(:parameters)
|
802
|
+
end
|
803
|
+
end
|
804
|
+
|
805
|
+
# An action that describes the behavior when the form is submitted. For example,
|
806
|
+
# an Apps Script can be invoked to handle the form.
|
807
|
+
class GoogleAppsCardV1Action
|
808
|
+
include Google::Apis::Core::Hashable
|
809
|
+
|
810
|
+
# Apps Script function to invoke when the containing element is clicked/
|
811
|
+
# activated.
|
812
|
+
# Corresponds to the JSON property `function`
|
813
|
+
# @return [String]
|
814
|
+
attr_accessor :function
|
815
|
+
|
816
|
+
#
|
817
|
+
# Corresponds to the JSON property `loadIndicator`
|
818
|
+
# @return [String]
|
819
|
+
attr_accessor :load_indicator
|
820
|
+
|
821
|
+
# List of action parameters.
|
822
|
+
# Corresponds to the JSON property `parameters`
|
823
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1ActionParameter>]
|
824
|
+
attr_accessor :parameters
|
825
|
+
|
826
|
+
# Indicates whether form values persist after the action. The default value is `
|
827
|
+
# false`. If `true`, form values remain after the action is triggered. When
|
828
|
+
# using [LoadIndicator.NONE](workspace/add-ons/reference/rpc/google.apps.card.v1#
|
829
|
+
# loadindicator) for actions, `persist_values` = `true`is recommended, as it
|
830
|
+
# ensures that any changes made by the user after form or on change actions are
|
831
|
+
# sent to the server are not overwritten by the response. If `false`, the form
|
832
|
+
# values are cleared when the action is triggered. When `persist_values` is set
|
833
|
+
# to `false`, it is strongly recommended that the card use [LoadIndicator.
|
834
|
+
# SPINNER](workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
|
835
|
+
# for all actions, as this locks the UI to ensure no changes are made by the
|
836
|
+
# user while the action is being processed.
|
837
|
+
# Corresponds to the JSON property `persistValues`
|
838
|
+
# @return [Boolean]
|
839
|
+
attr_accessor :persist_values
|
840
|
+
alias_method :persist_values?, :persist_values
|
841
|
+
|
842
|
+
def initialize(**args)
|
843
|
+
update!(**args)
|
844
|
+
end
|
845
|
+
|
846
|
+
# Update properties of this object
|
847
|
+
def update!(**args)
|
848
|
+
@function = args[:function] if args.key?(:function)
|
849
|
+
@load_indicator = args[:load_indicator] if args.key?(:load_indicator)
|
850
|
+
@parameters = args[:parameters] if args.key?(:parameters)
|
851
|
+
@persist_values = args[:persist_values] if args.key?(:persist_values)
|
852
|
+
end
|
853
|
+
end
|
854
|
+
|
855
|
+
# List of string parameters to supply when the action method is invoked. For
|
856
|
+
# example, consider three snooze buttons: snooze now, snooze 1 day, snooze next
|
857
|
+
# week. You might use action method = snooze(), passing the snooze type and
|
858
|
+
# snooze time in the list of string parameters.
|
859
|
+
class GoogleAppsCardV1ActionParameter
|
860
|
+
include Google::Apis::Core::Hashable
|
861
|
+
|
862
|
+
# The name of the parameter for the action script.
|
863
|
+
# Corresponds to the JSON property `key`
|
864
|
+
# @return [String]
|
865
|
+
attr_accessor :key
|
866
|
+
|
867
|
+
# The value of the parameter.
|
868
|
+
# Corresponds to the JSON property `value`
|
869
|
+
# @return [String]
|
870
|
+
attr_accessor :value
|
871
|
+
|
872
|
+
def initialize(**args)
|
873
|
+
update!(**args)
|
874
|
+
end
|
875
|
+
|
876
|
+
# Update properties of this object
|
877
|
+
def update!(**args)
|
878
|
+
@key = args[:key] if args.key?(:key)
|
879
|
+
@value = args[:value] if args.key?(:value)
|
880
|
+
end
|
881
|
+
end
|
882
|
+
|
883
|
+
# Represents the complete border style applied to widgets.
|
884
|
+
class GoogleAppsCardV1BorderStyle
|
885
|
+
include Google::Apis::Core::Hashable
|
886
|
+
|
887
|
+
# The corner radius for the border.
|
888
|
+
# Corresponds to the JSON property `cornerRadius`
|
889
|
+
# @return [Fixnum]
|
890
|
+
attr_accessor :corner_radius
|
891
|
+
|
892
|
+
# Represents a color in the RGBA color space. This representation is designed
|
893
|
+
# for simplicity of conversion to/from color representations in various
|
894
|
+
# languages over compactness. For example, the fields of this representation can
|
895
|
+
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
|
896
|
+
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
|
897
|
+
# method in iOS; and, with just a little work, it can be easily formatted into a
|
898
|
+
# CSS `rgba()` string in JavaScript. This reference page doesn't carry
|
899
|
+
# information about the absolute color space that should be used to interpret
|
900
|
+
# the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default,
|
901
|
+
# applications should assume the sRGB color space. When color equality needs to
|
902
|
+
# be decided, implementations, unless documented otherwise, treat two colors as
|
903
|
+
# equal if all their red, green, blue, and alpha values each differ by at most
|
904
|
+
# 1e-5. Example (Java): import com.google.type.Color; // ... public static java.
|
905
|
+
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
|
906
|
+
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
|
907
|
+
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
|
908
|
+
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
|
909
|
+
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
|
910
|
+
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
|
911
|
+
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
|
912
|
+
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
|
913
|
+
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
|
914
|
+
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
|
915
|
+
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
|
916
|
+
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
|
917
|
+
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
|
918
|
+
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
|
919
|
+
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
|
920
|
+
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
|
921
|
+
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
|
922
|
+
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
|
923
|
+
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
|
924
|
+
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
|
925
|
+
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
|
926
|
+
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
|
927
|
+
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
|
928
|
+
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
|
929
|
+
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
|
930
|
+
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
|
931
|
+
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
|
932
|
+
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
|
933
|
+
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
|
934
|
+
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
|
935
|
+
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
|
936
|
+
# / ...
|
937
|
+
# Corresponds to the JSON property `strokeColor`
|
938
|
+
# @return [Google::Apis::ChatV1::Color]
|
939
|
+
attr_accessor :stroke_color
|
940
|
+
|
941
|
+
# The border type.
|
942
|
+
# Corresponds to the JSON property `type`
|
943
|
+
# @return [String]
|
944
|
+
attr_accessor :type
|
945
|
+
|
946
|
+
def initialize(**args)
|
947
|
+
update!(**args)
|
948
|
+
end
|
949
|
+
|
950
|
+
# Update properties of this object
|
951
|
+
def update!(**args)
|
952
|
+
@corner_radius = args[:corner_radius] if args.key?(:corner_radius)
|
953
|
+
@stroke_color = args[:stroke_color] if args.key?(:stroke_color)
|
954
|
+
@type = args[:type] if args.key?(:type)
|
955
|
+
end
|
956
|
+
end
|
957
|
+
|
958
|
+
# A button. Can be a text button or an image button.
|
959
|
+
class GoogleAppsCardV1Button
|
960
|
+
include Google::Apis::Core::Hashable
|
961
|
+
|
962
|
+
# The alternative text used for accessibility. Has no effect when an icon is set;
|
963
|
+
# use `icon.alt_text` instead.
|
964
|
+
# Corresponds to the JSON property `altText`
|
965
|
+
# @return [String]
|
966
|
+
attr_accessor :alt_text
|
967
|
+
|
968
|
+
# Represents a color in the RGBA color space. This representation is designed
|
969
|
+
# for simplicity of conversion to/from color representations in various
|
970
|
+
# languages over compactness. For example, the fields of this representation can
|
971
|
+
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
|
972
|
+
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
|
973
|
+
# method in iOS; and, with just a little work, it can be easily formatted into a
|
974
|
+
# CSS `rgba()` string in JavaScript. This reference page doesn't carry
|
975
|
+
# information about the absolute color space that should be used to interpret
|
976
|
+
# the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default,
|
977
|
+
# applications should assume the sRGB color space. When color equality needs to
|
978
|
+
# be decided, implementations, unless documented otherwise, treat two colors as
|
979
|
+
# equal if all their red, green, blue, and alpha values each differ by at most
|
980
|
+
# 1e-5. Example (Java): import com.google.type.Color; // ... public static java.
|
981
|
+
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
|
982
|
+
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
|
983
|
+
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
|
984
|
+
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
|
985
|
+
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
|
986
|
+
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
|
987
|
+
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
|
988
|
+
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
|
989
|
+
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
|
990
|
+
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
|
991
|
+
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
|
992
|
+
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
|
993
|
+
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
|
994
|
+
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
|
995
|
+
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
|
996
|
+
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
|
997
|
+
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
|
998
|
+
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
|
999
|
+
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
|
1000
|
+
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
|
1001
|
+
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
|
1002
|
+
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
|
1003
|
+
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
|
1004
|
+
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
|
1005
|
+
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
|
1006
|
+
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
|
1007
|
+
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
|
1008
|
+
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
|
1009
|
+
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
|
1010
|
+
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
|
1011
|
+
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
|
1012
|
+
# / ...
|
1013
|
+
# Corresponds to the JSON property `color`
|
1014
|
+
# @return [Google::Apis::ChatV1::Color]
|
1015
|
+
attr_accessor :color
|
1016
|
+
|
1017
|
+
# If true, the button is displayed in a disabled state and doesn't respond to
|
1018
|
+
# user actions.
|
1019
|
+
# Corresponds to the JSON property `disabled`
|
1020
|
+
# @return [Boolean]
|
1021
|
+
attr_accessor :disabled
|
1022
|
+
alias_method :disabled?, :disabled
|
1023
|
+
|
1024
|
+
# The icon image.
|
1025
|
+
# Corresponds to the JSON property `icon`
|
1026
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Icon]
|
1027
|
+
attr_accessor :icon
|
1028
|
+
|
1029
|
+
# The action to perform when the button is clicked.
|
1030
|
+
# Corresponds to the JSON property `onClick`
|
1031
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1OnClick]
|
1032
|
+
attr_accessor :on_click
|
1033
|
+
|
1034
|
+
# The text of the button.
|
1035
|
+
# Corresponds to the JSON property `text`
|
1036
|
+
# @return [String]
|
1037
|
+
attr_accessor :text
|
1038
|
+
|
1039
|
+
def initialize(**args)
|
1040
|
+
update!(**args)
|
1041
|
+
end
|
1042
|
+
|
1043
|
+
# Update properties of this object
|
1044
|
+
def update!(**args)
|
1045
|
+
@alt_text = args[:alt_text] if args.key?(:alt_text)
|
1046
|
+
@color = args[:color] if args.key?(:color)
|
1047
|
+
@disabled = args[:disabled] if args.key?(:disabled)
|
1048
|
+
@icon = args[:icon] if args.key?(:icon)
|
1049
|
+
@on_click = args[:on_click] if args.key?(:on_click)
|
1050
|
+
@text = args[:text] if args.key?(:text)
|
1051
|
+
end
|
1052
|
+
end
|
1053
|
+
|
1054
|
+
# A list of buttons layed out horizontally.
|
1055
|
+
class GoogleAppsCardV1ButtonList
|
1056
|
+
include Google::Apis::Core::Hashable
|
1057
|
+
|
1058
|
+
#
|
1059
|
+
# Corresponds to the JSON property `buttons`
|
1060
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1Button>]
|
1061
|
+
attr_accessor :buttons
|
1062
|
+
|
1063
|
+
def initialize(**args)
|
1064
|
+
update!(**args)
|
1065
|
+
end
|
1066
|
+
|
1067
|
+
# Update properties of this object
|
1068
|
+
def update!(**args)
|
1069
|
+
@buttons = args[:buttons] if args.key?(:buttons)
|
1070
|
+
end
|
1071
|
+
end
|
1072
|
+
|
1073
|
+
# A card is a UI element that can contain UI widgets such as text and images.
|
1074
|
+
# For more information, see Cards . For example, the following JSON creates a
|
1075
|
+
# card that has a header with the name, position, icons, and link for a contact,
|
1076
|
+
# followed by a section with contact information like email and phone number. ```
|
1077
|
+
# ` "header": ` "title": "Heba Salam", "subtitle": "Software Engineer", "
|
1078
|
+
# imageStyle": "ImageStyle.AVATAR", "imageUrl": "https://example.com/heba_salam.
|
1079
|
+
# png", "imageAltText": "Avatar for Heba Salam" `, "sections" : [ ` "header": "
|
1080
|
+
# Contact Info", "widgets": [ ` "decorated_text": ` "icon": ` "knownIcon": "
|
1081
|
+
# EMAIL" `, "content": "heba.salam@example.com" ` `, ` "decoratedText": ` "icon":
|
1082
|
+
# ` "knownIcon": "PERSON" `, "content": "Online" ` `, ` "decoratedText": ` "
|
1083
|
+
# icon": ` "knownIcon": "PHONE" `, "content": "+1 (555) 555-1234" ` `, ` "
|
1084
|
+
# buttons": [ ` "textButton": ` "text": "Share", `, "onClick": ` "openLink": ` "
|
1085
|
+
# url": "https://example.com/share" ` ` `, ` "textButton": ` "text": "Edit", `, "
|
1086
|
+
# onClick": ` "action": ` "function": "goToView", "parameters": [ ` "key": "
|
1087
|
+
# viewType", "value": "EDIT" ` ], "loadIndicator": "LoadIndicator.SPINNER" ` ` `
|
1088
|
+
# ] ` ], "collapsible": true, "uncollapsibleWidgetsCount": 3 ` ], "cardActions":
|
1089
|
+
# [ ` "actionLabel": "Send Feedback", "onClick": ` "openLink": ` "url": "https://
|
1090
|
+
# example.com/feedback" ` ` ` ], "name": "contact-card-K3wB6arF2H9L" ` ```
|
1091
|
+
class GoogleAppsCardV1Card
|
1092
|
+
include Google::Apis::Core::Hashable
|
1093
|
+
|
1094
|
+
# The actions of this card. They are added to a card's generated toolbar menu.
|
1095
|
+
# For example, the following JSON constructs a card action menu with Settings
|
1096
|
+
# and Send Feedback options: ``` "card_actions": [ ` "actionLabel": "Setting", "
|
1097
|
+
# onClick": ` "action": ` "functionName": "goToView", "parameters": [ ` "key": "
|
1098
|
+
# viewType", "value": "SETTING" ` ], "loadIndicator": "LoadIndicator.SPINNER" ` `
|
1099
|
+
# `, ` "actionLabel": "Send Feedback", "onClick": ` "openLink": ` "url": "https:
|
1100
|
+
# //example.com/feedback" ` ` ` ] ```
|
1101
|
+
# Corresponds to the JSON property `cardActions`
|
1102
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1CardAction>]
|
1103
|
+
attr_accessor :card_actions
|
1104
|
+
|
1105
|
+
# The display style for peekCardHeader.
|
1106
|
+
# Corresponds to the JSON property `displayStyle`
|
1107
|
+
# @return [String]
|
1108
|
+
attr_accessor :display_style
|
1109
|
+
|
1110
|
+
# A persistent (sticky) footer that is added to the bottom of the card.
|
1111
|
+
# Corresponds to the JSON property `fixedFooter`
|
1112
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1CardFixedFooter]
|
1113
|
+
attr_accessor :fixed_footer
|
1114
|
+
|
1115
|
+
# The header of the card. A header usually contains a title and an image.
|
1116
|
+
# Corresponds to the JSON property `header`
|
1117
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1CardHeader]
|
1118
|
+
attr_accessor :header
|
1119
|
+
|
1120
|
+
# Name of the card, which is used as a identifier for the card in card
|
1121
|
+
# navigation.
|
1122
|
+
# Corresponds to the JSON property `name`
|
1123
|
+
# @return [String]
|
1124
|
+
attr_accessor :name
|
1125
|
+
|
1126
|
+
# When displaying contextual content, the peek card header acts as a placeholder
|
1127
|
+
# so that the user can navigate forward between the homepage cards and the
|
1128
|
+
# contextual cards.
|
1129
|
+
# Corresponds to the JSON property `peekCardHeader`
|
1130
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1CardHeader]
|
1131
|
+
attr_accessor :peek_card_header
|
1132
|
+
|
1133
|
+
# Sections are separated by a line divider.
|
1134
|
+
# Corresponds to the JSON property `sections`
|
1135
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1Section>]
|
1136
|
+
attr_accessor :sections
|
1137
|
+
|
1138
|
+
def initialize(**args)
|
1139
|
+
update!(**args)
|
1140
|
+
end
|
1141
|
+
|
1142
|
+
# Update properties of this object
|
1143
|
+
def update!(**args)
|
1144
|
+
@card_actions = args[:card_actions] if args.key?(:card_actions)
|
1145
|
+
@display_style = args[:display_style] if args.key?(:display_style)
|
1146
|
+
@fixed_footer = args[:fixed_footer] if args.key?(:fixed_footer)
|
1147
|
+
@header = args[:header] if args.key?(:header)
|
1148
|
+
@name = args[:name] if args.key?(:name)
|
1149
|
+
@peek_card_header = args[:peek_card_header] if args.key?(:peek_card_header)
|
1150
|
+
@sections = args[:sections] if args.key?(:sections)
|
1151
|
+
end
|
1152
|
+
end
|
1153
|
+
|
1154
|
+
# A card action is the action associated with the card. For example, an invoice
|
1155
|
+
# card might include actions such as delete invoice, email invoice, or open the
|
1156
|
+
# invoice in a browser.
|
1157
|
+
class GoogleAppsCardV1CardAction
|
1158
|
+
include Google::Apis::Core::Hashable
|
1159
|
+
|
1160
|
+
# The label that displays as the action menu item.
|
1161
|
+
# Corresponds to the JSON property `actionLabel`
|
1162
|
+
# @return [String]
|
1163
|
+
attr_accessor :action_label
|
1164
|
+
|
1165
|
+
# The onclick action for this action item.
|
1166
|
+
# Corresponds to the JSON property `onClick`
|
1167
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1OnClick]
|
1168
|
+
attr_accessor :on_click
|
1169
|
+
|
1170
|
+
def initialize(**args)
|
1171
|
+
update!(**args)
|
1172
|
+
end
|
1173
|
+
|
1174
|
+
# Update properties of this object
|
1175
|
+
def update!(**args)
|
1176
|
+
@action_label = args[:action_label] if args.key?(:action_label)
|
1177
|
+
@on_click = args[:on_click] if args.key?(:on_click)
|
1178
|
+
end
|
1179
|
+
end
|
1180
|
+
|
1181
|
+
# A persistent (sticky) footer that is added to the bottom of the card.
|
1182
|
+
class GoogleAppsCardV1CardFixedFooter
|
1183
|
+
include Google::Apis::Core::Hashable
|
1184
|
+
|
1185
|
+
# A button. Can be a text button or an image button.
|
1186
|
+
# Corresponds to the JSON property `primaryButton`
|
1187
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Button]
|
1188
|
+
attr_accessor :primary_button
|
1189
|
+
|
1190
|
+
# A button. Can be a text button or an image button.
|
1191
|
+
# Corresponds to the JSON property `secondaryButton`
|
1192
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Button]
|
1193
|
+
attr_accessor :secondary_button
|
1194
|
+
|
1195
|
+
def initialize(**args)
|
1196
|
+
update!(**args)
|
1197
|
+
end
|
1198
|
+
|
1199
|
+
# Update properties of this object
|
1200
|
+
def update!(**args)
|
1201
|
+
@primary_button = args[:primary_button] if args.key?(:primary_button)
|
1202
|
+
@secondary_button = args[:secondary_button] if args.key?(:secondary_button)
|
1203
|
+
end
|
1204
|
+
end
|
1205
|
+
|
1206
|
+
#
|
1207
|
+
class GoogleAppsCardV1CardHeader
|
1208
|
+
include Google::Apis::Core::Hashable
|
1209
|
+
|
1210
|
+
# The alternative text of this image which is used for accessibility.
|
1211
|
+
# Corresponds to the JSON property `imageAltText`
|
1212
|
+
# @return [String]
|
1213
|
+
attr_accessor :image_alt_text
|
1214
|
+
|
1215
|
+
# The image's type.
|
1216
|
+
# Corresponds to the JSON property `imageType`
|
1217
|
+
# @return [String]
|
1218
|
+
attr_accessor :image_type
|
1219
|
+
|
1220
|
+
# The URL of the image in the card header.
|
1221
|
+
# Corresponds to the JSON property `imageUrl`
|
1222
|
+
# @return [String]
|
1223
|
+
attr_accessor :image_url
|
1224
|
+
|
1225
|
+
# The subtitle of the card header.
|
1226
|
+
# Corresponds to the JSON property `subtitle`
|
1227
|
+
# @return [String]
|
1228
|
+
attr_accessor :subtitle
|
1229
|
+
|
1230
|
+
# The title of the card header. The title must be specified. The header has a
|
1231
|
+
# fixed height: if both a title and subtitle are specified, each takes up one
|
1232
|
+
# line. If only the title is specified, it takes up both lines.
|
1233
|
+
# Corresponds to the JSON property `title`
|
1234
|
+
# @return [String]
|
1235
|
+
attr_accessor :title
|
1236
|
+
|
1237
|
+
def initialize(**args)
|
1238
|
+
update!(**args)
|
1239
|
+
end
|
1240
|
+
|
1241
|
+
# Update properties of this object
|
1242
|
+
def update!(**args)
|
1243
|
+
@image_alt_text = args[:image_alt_text] if args.key?(:image_alt_text)
|
1244
|
+
@image_type = args[:image_type] if args.key?(:image_type)
|
1245
|
+
@image_url = args[:image_url] if args.key?(:image_url)
|
1246
|
+
@subtitle = args[:subtitle] if args.key?(:subtitle)
|
1247
|
+
@title = args[:title] if args.key?(:title)
|
1248
|
+
end
|
1249
|
+
end
|
1250
|
+
|
1251
|
+
# The widget that lets users to specify a date and time.
|
1252
|
+
class GoogleAppsCardV1DateTimePicker
|
1253
|
+
include Google::Apis::Core::Hashable
|
1254
|
+
|
1255
|
+
# The label for the field that displays to the user.
|
1256
|
+
# Corresponds to the JSON property `label`
|
1257
|
+
# @return [String]
|
1258
|
+
attr_accessor :label
|
1259
|
+
|
1260
|
+
# The name of the text input that's used in formInput, and uniquely identifies
|
1261
|
+
# this input.
|
1262
|
+
# Corresponds to the JSON property `name`
|
1263
|
+
# @return [String]
|
1264
|
+
attr_accessor :name
|
1265
|
+
|
1266
|
+
# An action that describes the behavior when the form is submitted. For example,
|
1267
|
+
# an Apps Script can be invoked to handle the form.
|
1268
|
+
# Corresponds to the JSON property `onChangeAction`
|
1269
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Action]
|
1270
|
+
attr_accessor :on_change_action
|
1271
|
+
|
1272
|
+
# The number representing the time zone offset from UTC, in minutes. If set, the
|
1273
|
+
# `value_ms_epoch` is displayed in the specified time zone. If not set, it uses
|
1274
|
+
# the user's time zone setting on the client side.
|
1275
|
+
# Corresponds to the JSON property `timezoneOffsetDate`
|
1276
|
+
# @return [Fixnum]
|
1277
|
+
attr_accessor :timezone_offset_date
|
1278
|
+
|
1279
|
+
# The type of the date/time picker.
|
1280
|
+
# Corresponds to the JSON property `type`
|
1281
|
+
# @return [String]
|
1282
|
+
attr_accessor :type
|
1283
|
+
|
1284
|
+
# The value to display as the default value before user input or previous user
|
1285
|
+
# input. It is represented in milliseconds (Epoch time). For `DATE_AND_TIME`
|
1286
|
+
# type, the full epoch value is used. For `DATE_ONLY` type, only date of the
|
1287
|
+
# epoch time is used. For `TIME_ONLY` type, only time of the epoch time is used.
|
1288
|
+
# For example, you can set epoch time to `3 * 60 * 60 * 1000` to represent 3am.
|
1289
|
+
# Corresponds to the JSON property `valueMsEpoch`
|
1290
|
+
# @return [Fixnum]
|
1291
|
+
attr_accessor :value_ms_epoch
|
1292
|
+
|
1293
|
+
def initialize(**args)
|
1294
|
+
update!(**args)
|
1295
|
+
end
|
1296
|
+
|
1297
|
+
# Update properties of this object
|
1298
|
+
def update!(**args)
|
1299
|
+
@label = args[:label] if args.key?(:label)
|
1300
|
+
@name = args[:name] if args.key?(:name)
|
1301
|
+
@on_change_action = args[:on_change_action] if args.key?(:on_change_action)
|
1302
|
+
@timezone_offset_date = args[:timezone_offset_date] if args.key?(:timezone_offset_date)
|
1303
|
+
@type = args[:type] if args.key?(:type)
|
1304
|
+
@value_ms_epoch = args[:value_ms_epoch] if args.key?(:value_ms_epoch)
|
1305
|
+
end
|
1306
|
+
end
|
1307
|
+
|
1308
|
+
# A widget that displays text with optional decorations such as a label above or
|
1309
|
+
# below the text, an icon in front of the text, a selection widget or a button
|
1310
|
+
# after the text.
|
1311
|
+
class GoogleAppsCardV1DecoratedText
|
1312
|
+
include Google::Apis::Core::Hashable
|
1313
|
+
|
1314
|
+
# The formatted text label that shows below the main text.
|
1315
|
+
# Corresponds to the JSON property `bottomLabel`
|
1316
|
+
# @return [String]
|
1317
|
+
attr_accessor :bottom_label
|
1318
|
+
|
1319
|
+
# A button. Can be a text button or an image button.
|
1320
|
+
# Corresponds to the JSON property `button`
|
1321
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Button]
|
1322
|
+
attr_accessor :button
|
1323
|
+
|
1324
|
+
# An icon displayed after the text.
|
1325
|
+
# Corresponds to the JSON property `endIcon`
|
1326
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Icon]
|
1327
|
+
attr_accessor :end_icon
|
1328
|
+
|
1329
|
+
# Deprecated in favor of start_icon.
|
1330
|
+
# Corresponds to the JSON property `icon`
|
1331
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Icon]
|
1332
|
+
attr_accessor :icon
|
1333
|
+
|
1334
|
+
# Only the top and bottom label and content region are clickable.
|
1335
|
+
# Corresponds to the JSON property `onClick`
|
1336
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1OnClick]
|
1337
|
+
attr_accessor :on_click
|
1338
|
+
|
1339
|
+
# The icon displayed in front of the text.
|
1340
|
+
# Corresponds to the JSON property `startIcon`
|
1341
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Icon]
|
1342
|
+
attr_accessor :start_icon
|
1343
|
+
|
1344
|
+
# A switch widget can be clicked to change its state or trigger an action.
|
1345
|
+
# Corresponds to the JSON property `switchControl`
|
1346
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1SwitchControl]
|
1347
|
+
attr_accessor :switch_control
|
1348
|
+
|
1349
|
+
# Required. The main widget formatted text. See Text formatting for details.
|
1350
|
+
# Corresponds to the JSON property `text`
|
1351
|
+
# @return [String]
|
1352
|
+
attr_accessor :text
|
1353
|
+
|
1354
|
+
# The formatted text label that shows above the main text.
|
1355
|
+
# Corresponds to the JSON property `topLabel`
|
1356
|
+
# @return [String]
|
1357
|
+
attr_accessor :top_label
|
1358
|
+
|
1359
|
+
# The wrap text setting. If `true`, the text is wrapped and displayed in
|
1360
|
+
# multiline. Otherwise, the text is truncated.
|
1361
|
+
# Corresponds to the JSON property `wrapText`
|
1362
|
+
# @return [Boolean]
|
1363
|
+
attr_accessor :wrap_text
|
1364
|
+
alias_method :wrap_text?, :wrap_text
|
1365
|
+
|
1366
|
+
def initialize(**args)
|
1367
|
+
update!(**args)
|
1368
|
+
end
|
1369
|
+
|
1370
|
+
# Update properties of this object
|
1371
|
+
def update!(**args)
|
1372
|
+
@bottom_label = args[:bottom_label] if args.key?(:bottom_label)
|
1373
|
+
@button = args[:button] if args.key?(:button)
|
1374
|
+
@end_icon = args[:end_icon] if args.key?(:end_icon)
|
1375
|
+
@icon = args[:icon] if args.key?(:icon)
|
1376
|
+
@on_click = args[:on_click] if args.key?(:on_click)
|
1377
|
+
@start_icon = args[:start_icon] if args.key?(:start_icon)
|
1378
|
+
@switch_control = args[:switch_control] if args.key?(:switch_control)
|
1379
|
+
@text = args[:text] if args.key?(:text)
|
1380
|
+
@top_label = args[:top_label] if args.key?(:top_label)
|
1381
|
+
@wrap_text = args[:wrap_text] if args.key?(:wrap_text)
|
1382
|
+
end
|
1383
|
+
end
|
1384
|
+
|
1385
|
+
# A divider that appears in between widgets.
|
1386
|
+
class GoogleAppsCardV1Divider
|
1387
|
+
include Google::Apis::Core::Hashable
|
1388
|
+
|
1389
|
+
def initialize(**args)
|
1390
|
+
update!(**args)
|
1391
|
+
end
|
1392
|
+
|
1393
|
+
# Update properties of this object
|
1394
|
+
def update!(**args)
|
1395
|
+
end
|
1396
|
+
end
|
1397
|
+
|
1398
|
+
# Represents a Grid widget that displays items in a configurable grid layout.
|
1399
|
+
class GoogleAppsCardV1Grid
|
1400
|
+
include Google::Apis::Core::Hashable
|
1401
|
+
|
1402
|
+
# Represents the complete border style applied to widgets.
|
1403
|
+
# Corresponds to the JSON property `borderStyle`
|
1404
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1BorderStyle]
|
1405
|
+
attr_accessor :border_style
|
1406
|
+
|
1407
|
+
# The number of columns to display in the grid. A default value is used if this
|
1408
|
+
# field isn't specified, and that default value is different depending on where
|
1409
|
+
# the grid is shown (dialog versus companion).
|
1410
|
+
# Corresponds to the JSON property `columnCount`
|
1411
|
+
# @return [Fixnum]
|
1412
|
+
attr_accessor :column_count
|
1413
|
+
|
1414
|
+
# The items to display in the grid.
|
1415
|
+
# Corresponds to the JSON property `items`
|
1416
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1GridItem>]
|
1417
|
+
attr_accessor :items
|
1418
|
+
|
1419
|
+
# This callback is reused by each individual grid item, but with the item's
|
1420
|
+
# identifier and index in the items list added to the callback's parameters.
|
1421
|
+
# Corresponds to the JSON property `onClick`
|
1422
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1OnClick]
|
1423
|
+
attr_accessor :on_click
|
1424
|
+
|
1425
|
+
# The text that displays in the grid header.
|
1426
|
+
# Corresponds to the JSON property `title`
|
1427
|
+
# @return [String]
|
1428
|
+
attr_accessor :title
|
1429
|
+
|
1430
|
+
def initialize(**args)
|
1431
|
+
update!(**args)
|
1432
|
+
end
|
1433
|
+
|
1434
|
+
# Update properties of this object
|
1435
|
+
def update!(**args)
|
1436
|
+
@border_style = args[:border_style] if args.key?(:border_style)
|
1437
|
+
@column_count = args[:column_count] if args.key?(:column_count)
|
1438
|
+
@items = args[:items] if args.key?(:items)
|
1439
|
+
@on_click = args[:on_click] if args.key?(:on_click)
|
1440
|
+
@title = args[:title] if args.key?(:title)
|
1441
|
+
end
|
1442
|
+
end
|
1443
|
+
|
1444
|
+
# Represents a single item in the grid layout.
|
1445
|
+
class GoogleAppsCardV1GridItem
|
1446
|
+
include Google::Apis::Core::Hashable
|
1447
|
+
|
1448
|
+
# A user-specified identifier for this grid item. This identifier is returned in
|
1449
|
+
# the parent Grid's onClick callback parameters.
|
1450
|
+
# Corresponds to the JSON property `id`
|
1451
|
+
# @return [String]
|
1452
|
+
attr_accessor :id
|
1453
|
+
|
1454
|
+
# The image that displays in the grid item.
|
1455
|
+
# Corresponds to the JSON property `image`
|
1456
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1ImageComponent]
|
1457
|
+
attr_accessor :image
|
1458
|
+
|
1459
|
+
# The layout to use for the grid item.
|
1460
|
+
# Corresponds to the JSON property `layout`
|
1461
|
+
# @return [String]
|
1462
|
+
attr_accessor :layout
|
1463
|
+
|
1464
|
+
# The grid item's subtitle.
|
1465
|
+
# Corresponds to the JSON property `subtitle`
|
1466
|
+
# @return [String]
|
1467
|
+
attr_accessor :subtitle
|
1468
|
+
|
1469
|
+
# The horizontal alignment of the grid item's text.
|
1470
|
+
# Corresponds to the JSON property `textAlignment`
|
1471
|
+
# @return [String]
|
1472
|
+
attr_accessor :text_alignment
|
1473
|
+
|
1474
|
+
# The grid item's title.
|
1475
|
+
# Corresponds to the JSON property `title`
|
1476
|
+
# @return [String]
|
1477
|
+
attr_accessor :title
|
1478
|
+
|
1479
|
+
def initialize(**args)
|
1480
|
+
update!(**args)
|
1481
|
+
end
|
1482
|
+
|
1483
|
+
# Update properties of this object
|
1484
|
+
def update!(**args)
|
1485
|
+
@id = args[:id] if args.key?(:id)
|
1486
|
+
@image = args[:image] if args.key?(:image)
|
1487
|
+
@layout = args[:layout] if args.key?(:layout)
|
1488
|
+
@subtitle = args[:subtitle] if args.key?(:subtitle)
|
1489
|
+
@text_alignment = args[:text_alignment] if args.key?(:text_alignment)
|
1490
|
+
@title = args[:title] if args.key?(:title)
|
1491
|
+
end
|
1492
|
+
end
|
1493
|
+
|
1494
|
+
#
|
1495
|
+
class GoogleAppsCardV1Icon
|
1496
|
+
include Google::Apis::Core::Hashable
|
1497
|
+
|
1498
|
+
# The description of the icon, used for accessibility. The default value is
|
1499
|
+
# provided if you don't specify one.
|
1500
|
+
# Corresponds to the JSON property `altText`
|
1501
|
+
# @return [String]
|
1502
|
+
attr_accessor :alt_text
|
1503
|
+
|
1504
|
+
# The icon specified by a URL.
|
1505
|
+
# Corresponds to the JSON property `iconUrl`
|
1506
|
+
# @return [String]
|
1507
|
+
attr_accessor :icon_url
|
1508
|
+
|
1509
|
+
# The crop style applied to the image. In some cases, applying a `CIRCLE` crop
|
1510
|
+
# causes the image to be drawn larger than a standard icon.
|
1511
|
+
# Corresponds to the JSON property `imageType`
|
1512
|
+
# @return [String]
|
1513
|
+
attr_accessor :image_type
|
1514
|
+
|
1515
|
+
# The icon specified by the string name of a list of known icons
|
1516
|
+
# Corresponds to the JSON property `knownIcon`
|
1517
|
+
# @return [String]
|
1518
|
+
attr_accessor :known_icon
|
1519
|
+
|
1520
|
+
def initialize(**args)
|
1521
|
+
update!(**args)
|
1522
|
+
end
|
1523
|
+
|
1524
|
+
# Update properties of this object
|
1525
|
+
def update!(**args)
|
1526
|
+
@alt_text = args[:alt_text] if args.key?(:alt_text)
|
1527
|
+
@icon_url = args[:icon_url] if args.key?(:icon_url)
|
1528
|
+
@image_type = args[:image_type] if args.key?(:image_type)
|
1529
|
+
@known_icon = args[:known_icon] if args.key?(:known_icon)
|
1530
|
+
end
|
1531
|
+
end
|
1532
|
+
|
1533
|
+
# An image that is specified by a URL and can have an onClick action.
|
1534
|
+
class GoogleAppsCardV1Image
|
1535
|
+
include Google::Apis::Core::Hashable
|
1536
|
+
|
1537
|
+
# The alternative text of this image, used for accessibility.
|
1538
|
+
# Corresponds to the JSON property `altText`
|
1539
|
+
# @return [String]
|
1540
|
+
attr_accessor :alt_text
|
1541
|
+
|
1542
|
+
# An image URL.
|
1543
|
+
# Corresponds to the JSON property `imageUrl`
|
1544
|
+
# @return [String]
|
1545
|
+
attr_accessor :image_url
|
1546
|
+
|
1547
|
+
#
|
1548
|
+
# Corresponds to the JSON property `onClick`
|
1549
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1OnClick]
|
1550
|
+
attr_accessor :on_click
|
1551
|
+
|
1552
|
+
def initialize(**args)
|
1553
|
+
update!(**args)
|
1554
|
+
end
|
1555
|
+
|
1556
|
+
# Update properties of this object
|
1557
|
+
def update!(**args)
|
1558
|
+
@alt_text = args[:alt_text] if args.key?(:alt_text)
|
1559
|
+
@image_url = args[:image_url] if args.key?(:image_url)
|
1560
|
+
@on_click = args[:on_click] if args.key?(:on_click)
|
1561
|
+
end
|
1562
|
+
end
|
1563
|
+
|
1564
|
+
#
|
1565
|
+
class GoogleAppsCardV1ImageComponent
|
1566
|
+
include Google::Apis::Core::Hashable
|
1567
|
+
|
1568
|
+
# The accessibility label for the image.
|
1569
|
+
# Corresponds to the JSON property `altText`
|
1570
|
+
# @return [String]
|
1571
|
+
attr_accessor :alt_text
|
1572
|
+
|
1573
|
+
# Represents the complete border style applied to widgets.
|
1574
|
+
# Corresponds to the JSON property `borderStyle`
|
1575
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1BorderStyle]
|
1576
|
+
attr_accessor :border_style
|
1577
|
+
|
1578
|
+
# Represents the crop style applied to an image.
|
1579
|
+
# Corresponds to the JSON property `cropStyle`
|
1580
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1ImageCropStyle]
|
1581
|
+
attr_accessor :crop_style
|
1582
|
+
|
1583
|
+
# The image URL.
|
1584
|
+
# Corresponds to the JSON property `imageUri`
|
1585
|
+
# @return [String]
|
1586
|
+
attr_accessor :image_uri
|
1587
|
+
|
1588
|
+
def initialize(**args)
|
1589
|
+
update!(**args)
|
1590
|
+
end
|
1591
|
+
|
1592
|
+
# Update properties of this object
|
1593
|
+
def update!(**args)
|
1594
|
+
@alt_text = args[:alt_text] if args.key?(:alt_text)
|
1595
|
+
@border_style = args[:border_style] if args.key?(:border_style)
|
1596
|
+
@crop_style = args[:crop_style] if args.key?(:crop_style)
|
1597
|
+
@image_uri = args[:image_uri] if args.key?(:image_uri)
|
1598
|
+
end
|
1599
|
+
end
|
1600
|
+
|
1601
|
+
# Represents the crop style applied to an image.
|
1602
|
+
class GoogleAppsCardV1ImageCropStyle
|
1603
|
+
include Google::Apis::Core::Hashable
|
1604
|
+
|
1605
|
+
# The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`.
|
1606
|
+
# Corresponds to the JSON property `aspectRatio`
|
1607
|
+
# @return [Float]
|
1608
|
+
attr_accessor :aspect_ratio
|
1609
|
+
|
1610
|
+
# The crop type.
|
1611
|
+
# Corresponds to the JSON property `type`
|
1612
|
+
# @return [String]
|
1613
|
+
attr_accessor :type
|
1614
|
+
|
1615
|
+
def initialize(**args)
|
1616
|
+
update!(**args)
|
1617
|
+
end
|
1618
|
+
|
1619
|
+
# Update properties of this object
|
1620
|
+
def update!(**args)
|
1621
|
+
@aspect_ratio = args[:aspect_ratio] if args.key?(:aspect_ratio)
|
1622
|
+
@type = args[:type] if args.key?(:type)
|
1623
|
+
end
|
1624
|
+
end
|
1625
|
+
|
1626
|
+
#
|
1627
|
+
class GoogleAppsCardV1OnClick
|
1628
|
+
include Google::Apis::Core::Hashable
|
1629
|
+
|
1630
|
+
# An action that describes the behavior when the form is submitted. For example,
|
1631
|
+
# an Apps Script can be invoked to handle the form.
|
1632
|
+
# Corresponds to the JSON property `action`
|
1633
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Action]
|
1634
|
+
attr_accessor :action
|
1635
|
+
|
1636
|
+
# A card is a UI element that can contain UI widgets such as text and images.
|
1637
|
+
# For more information, see Cards . For example, the following JSON creates a
|
1638
|
+
# card that has a header with the name, position, icons, and link for a contact,
|
1639
|
+
# followed by a section with contact information like email and phone number. ```
|
1640
|
+
# ` "header": ` "title": "Heba Salam", "subtitle": "Software Engineer", "
|
1641
|
+
# imageStyle": "ImageStyle.AVATAR", "imageUrl": "https://example.com/heba_salam.
|
1642
|
+
# png", "imageAltText": "Avatar for Heba Salam" `, "sections" : [ ` "header": "
|
1643
|
+
# Contact Info", "widgets": [ ` "decorated_text": ` "icon": ` "knownIcon": "
|
1644
|
+
# EMAIL" `, "content": "heba.salam@example.com" ` `, ` "decoratedText": ` "icon":
|
1645
|
+
# ` "knownIcon": "PERSON" `, "content": "Online" ` `, ` "decoratedText": ` "
|
1646
|
+
# icon": ` "knownIcon": "PHONE" `, "content": "+1 (555) 555-1234" ` `, ` "
|
1647
|
+
# buttons": [ ` "textButton": ` "text": "Share", `, "onClick": ` "openLink": ` "
|
1648
|
+
# url": "https://example.com/share" ` ` `, ` "textButton": ` "text": "Edit", `, "
|
1649
|
+
# onClick": ` "action": ` "function": "goToView", "parameters": [ ` "key": "
|
1650
|
+
# viewType", "value": "EDIT" ` ], "loadIndicator": "LoadIndicator.SPINNER" ` ` `
|
1651
|
+
# ] ` ], "collapsible": true, "uncollapsibleWidgetsCount": 3 ` ], "cardActions":
|
1652
|
+
# [ ` "actionLabel": "Send Feedback", "onClick": ` "openLink": ` "url": "https://
|
1653
|
+
# example.com/feedback" ` ` ` ], "name": "contact-card-K3wB6arF2H9L" ` ```
|
1654
|
+
# Corresponds to the JSON property `card`
|
1655
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Card]
|
1656
|
+
attr_accessor :card
|
1657
|
+
|
1658
|
+
# An action that describes the behavior when the form is submitted. For example,
|
1659
|
+
# an Apps Script can be invoked to handle the form.
|
1660
|
+
# Corresponds to the JSON property `openDynamicLinkAction`
|
1661
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Action]
|
1662
|
+
attr_accessor :open_dynamic_link_action
|
1663
|
+
|
1664
|
+
# If specified, this onClick triggers an open link action.
|
1665
|
+
# Corresponds to the JSON property `openLink`
|
1666
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1OpenLink]
|
1667
|
+
attr_accessor :open_link
|
1668
|
+
|
1669
|
+
def initialize(**args)
|
1670
|
+
update!(**args)
|
1671
|
+
end
|
1672
|
+
|
1673
|
+
# Update properties of this object
|
1674
|
+
def update!(**args)
|
1675
|
+
@action = args[:action] if args.key?(:action)
|
1676
|
+
@card = args[:card] if args.key?(:card)
|
1677
|
+
@open_dynamic_link_action = args[:open_dynamic_link_action] if args.key?(:open_dynamic_link_action)
|
1678
|
+
@open_link = args[:open_link] if args.key?(:open_link)
|
1679
|
+
end
|
1680
|
+
end
|
1681
|
+
|
1682
|
+
#
|
1683
|
+
class GoogleAppsCardV1OpenLink
|
1684
|
+
include Google::Apis::Core::Hashable
|
1685
|
+
|
1686
|
+
#
|
1687
|
+
# Corresponds to the JSON property `onClose`
|
1688
|
+
# @return [String]
|
1689
|
+
attr_accessor :on_close
|
1690
|
+
|
1691
|
+
#
|
1692
|
+
# Corresponds to the JSON property `openAs`
|
1693
|
+
# @return [String]
|
1694
|
+
attr_accessor :open_as
|
1695
|
+
|
1696
|
+
# The URL to open.
|
1697
|
+
# Corresponds to the JSON property `url`
|
1698
|
+
# @return [String]
|
1699
|
+
attr_accessor :url
|
1700
|
+
|
1701
|
+
def initialize(**args)
|
1702
|
+
update!(**args)
|
1703
|
+
end
|
1704
|
+
|
1705
|
+
# Update properties of this object
|
1706
|
+
def update!(**args)
|
1707
|
+
@on_close = args[:on_close] if args.key?(:on_close)
|
1708
|
+
@open_as = args[:open_as] if args.key?(:open_as)
|
1709
|
+
@url = args[:url] if args.key?(:url)
|
1710
|
+
end
|
1711
|
+
end
|
1712
|
+
|
1713
|
+
# A section contains a collection of widgets that are rendered vertically in the
|
1714
|
+
# order that they are specified. Across all platforms, cards have a narrow fixed
|
1715
|
+
# width, so there is currently no need for layout properties, for example, float.
|
1716
|
+
class GoogleAppsCardV1Section
|
1717
|
+
include Google::Apis::Core::Hashable
|
1718
|
+
|
1719
|
+
# Indicates whether this section is collapsible. If a section is collapsible,
|
1720
|
+
# the description must be given.
|
1721
|
+
# Corresponds to the JSON property `collapsible`
|
1722
|
+
# @return [Boolean]
|
1723
|
+
attr_accessor :collapsible
|
1724
|
+
alias_method :collapsible?, :collapsible
|
1725
|
+
|
1726
|
+
# The header of the section. Formatted text is supported.
|
1727
|
+
# Corresponds to the JSON property `header`
|
1728
|
+
# @return [String]
|
1729
|
+
attr_accessor :header
|
1730
|
+
|
1731
|
+
# The number of uncollapsible widgets. For example, when a section contains five
|
1732
|
+
# widgets and the `numUncollapsibleWidget` is set to `2`, the first two widgets
|
1733
|
+
# are always shown and the last three are collapsed as default. The `
|
1734
|
+
# numUncollapsibleWidget` is taken into account only when collapsible is set to `
|
1735
|
+
# true`.
|
1736
|
+
# Corresponds to the JSON property `uncollapsibleWidgetsCount`
|
1737
|
+
# @return [Fixnum]
|
1738
|
+
attr_accessor :uncollapsible_widgets_count
|
1739
|
+
|
1740
|
+
# A section must contain at least 1 widget.
|
1741
|
+
# Corresponds to the JSON property `widgets`
|
1742
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1Widget>]
|
1743
|
+
attr_accessor :widgets
|
1744
|
+
|
1745
|
+
def initialize(**args)
|
1746
|
+
update!(**args)
|
1747
|
+
end
|
1748
|
+
|
1749
|
+
# Update properties of this object
|
1750
|
+
def update!(**args)
|
1751
|
+
@collapsible = args[:collapsible] if args.key?(:collapsible)
|
1752
|
+
@header = args[:header] if args.key?(:header)
|
1753
|
+
@uncollapsible_widgets_count = args[:uncollapsible_widgets_count] if args.key?(:uncollapsible_widgets_count)
|
1754
|
+
@widgets = args[:widgets] if args.key?(:widgets)
|
1755
|
+
end
|
1756
|
+
end
|
1757
|
+
|
1758
|
+
# A widget that creates a UI item (for example, a drop-down list) with options
|
1759
|
+
# for users to select.
|
1760
|
+
class GoogleAppsCardV1SelectionInput
|
1761
|
+
include Google::Apis::Core::Hashable
|
1762
|
+
|
1763
|
+
#
|
1764
|
+
# Corresponds to the JSON property `items`
|
1765
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1SelectionItem>]
|
1766
|
+
attr_accessor :items
|
1767
|
+
|
1768
|
+
# The label displayed ahead of the switch control.
|
1769
|
+
# Corresponds to the JSON property `label`
|
1770
|
+
# @return [String]
|
1771
|
+
attr_accessor :label
|
1772
|
+
|
1773
|
+
# The name of the text input which is used in formInput.
|
1774
|
+
# Corresponds to the JSON property `name`
|
1775
|
+
# @return [String]
|
1776
|
+
attr_accessor :name
|
1777
|
+
|
1778
|
+
# An action that describes the behavior when the form is submitted. For example,
|
1779
|
+
# an Apps Script can be invoked to handle the form.
|
1780
|
+
# Corresponds to the JSON property `onChangeAction`
|
1781
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Action]
|
1782
|
+
attr_accessor :on_change_action
|
1783
|
+
|
1784
|
+
#
|
1785
|
+
# Corresponds to the JSON property `type`
|
1786
|
+
# @return [String]
|
1787
|
+
attr_accessor :type
|
1788
|
+
|
1789
|
+
def initialize(**args)
|
1790
|
+
update!(**args)
|
1791
|
+
end
|
1792
|
+
|
1793
|
+
# Update properties of this object
|
1794
|
+
def update!(**args)
|
1795
|
+
@items = args[:items] if args.key?(:items)
|
1796
|
+
@label = args[:label] if args.key?(:label)
|
1797
|
+
@name = args[:name] if args.key?(:name)
|
1798
|
+
@on_change_action = args[:on_change_action] if args.key?(:on_change_action)
|
1799
|
+
@type = args[:type] if args.key?(:type)
|
1800
|
+
end
|
1801
|
+
end
|
1802
|
+
|
1803
|
+
# The item in the switch control. A radio button, at most one of the items is
|
1804
|
+
# selected.
|
1805
|
+
class GoogleAppsCardV1SelectionItem
|
1806
|
+
include Google::Apis::Core::Hashable
|
1807
|
+
|
1808
|
+
# If more than one item is selected for `RADIO_BUTTON` and `DROPDOWN`, the first
|
1809
|
+
# selected item is treated as selected and the ones after are ignored.
|
1810
|
+
# Corresponds to the JSON property `selected`
|
1811
|
+
# @return [Boolean]
|
1812
|
+
attr_accessor :selected
|
1813
|
+
alias_method :selected?, :selected
|
1814
|
+
|
1815
|
+
# The text to be displayed.
|
1816
|
+
# Corresponds to the JSON property `text`
|
1817
|
+
# @return [String]
|
1818
|
+
attr_accessor :text
|
1819
|
+
|
1820
|
+
# The value associated with this item. The client should use this as a form
|
1821
|
+
# input value.
|
1822
|
+
# Corresponds to the JSON property `value`
|
1823
|
+
# @return [String]
|
1824
|
+
attr_accessor :value
|
226
1825
|
|
227
1826
|
def initialize(**args)
|
228
1827
|
update!(**args)
|
@@ -230,34 +1829,20 @@ module Google
|
|
230
1829
|
|
231
1830
|
# Update properties of this object
|
232
1831
|
def update!(**args)
|
233
|
-
@
|
234
|
-
@
|
1832
|
+
@selected = args[:selected] if args.key?(:selected)
|
1833
|
+
@text = args[:text] if args.key?(:text)
|
1834
|
+
@value = args[:value] if args.key?(:value)
|
235
1835
|
end
|
236
1836
|
end
|
237
1837
|
|
238
|
-
# A
|
239
|
-
class
|
1838
|
+
# A suggestion item. Only supports text for now.
|
1839
|
+
class GoogleAppsCardV1SuggestionItem
|
240
1840
|
include Google::Apis::Core::Hashable
|
241
1841
|
|
242
|
-
#
|
243
|
-
# Corresponds to the JSON property `
|
244
|
-
# @return [Array<Google::Apis::ChatV1::CardAction>]
|
245
|
-
attr_accessor :card_actions
|
246
|
-
|
247
|
-
# The header of the card. A header usually contains a title and an image.
|
248
|
-
# Corresponds to the JSON property `header`
|
249
|
-
# @return [Google::Apis::ChatV1::CardHeader]
|
250
|
-
attr_accessor :header
|
251
|
-
|
252
|
-
# Name of the card.
|
253
|
-
# Corresponds to the JSON property `name`
|
1842
|
+
#
|
1843
|
+
# Corresponds to the JSON property `text`
|
254
1844
|
# @return [String]
|
255
|
-
attr_accessor :
|
256
|
-
|
257
|
-
# Sections are separated by a line divider.
|
258
|
-
# Corresponds to the JSON property `sections`
|
259
|
-
# @return [Array<Google::Apis::ChatV1::Section>]
|
260
|
-
attr_accessor :sections
|
1845
|
+
attr_accessor :text
|
261
1846
|
|
262
1847
|
def initialize(**args)
|
263
1848
|
update!(**args)
|
@@ -265,28 +1850,19 @@ module Google
|
|
265
1850
|
|
266
1851
|
# Update properties of this object
|
267
1852
|
def update!(**args)
|
268
|
-
@
|
269
|
-
@header = args[:header] if args.key?(:header)
|
270
|
-
@name = args[:name] if args.key?(:name)
|
271
|
-
@sections = args[:sections] if args.key?(:sections)
|
1853
|
+
@text = args[:text] if args.key?(:text)
|
272
1854
|
end
|
273
1855
|
end
|
274
1856
|
|
275
|
-
# A
|
276
|
-
#
|
277
|
-
|
278
|
-
class CardAction
|
1857
|
+
# A container wrapping elements necessary for showing suggestion items used in
|
1858
|
+
# text input autocomplete.
|
1859
|
+
class GoogleAppsCardV1Suggestions
|
279
1860
|
include Google::Apis::Core::Hashable
|
280
1861
|
|
281
|
-
#
|
282
|
-
# Corresponds to the JSON property `
|
283
|
-
# @return [
|
284
|
-
attr_accessor :
|
285
|
-
|
286
|
-
# An onclick action (e.g. open a link).
|
287
|
-
# Corresponds to the JSON property `onClick`
|
288
|
-
# @return [Google::Apis::ChatV1::OnClick]
|
289
|
-
attr_accessor :on_click
|
1862
|
+
# A list of suggestions items which will be used in are used in autocomplete.
|
1863
|
+
# Corresponds to the JSON property `items`
|
1864
|
+
# @return [Array<Google::Apis::ChatV1::GoogleAppsCardV1SuggestionItem>]
|
1865
|
+
attr_accessor :items
|
290
1866
|
|
291
1867
|
def initialize(**args)
|
292
1868
|
update!(**args)
|
@@ -294,36 +1870,40 @@ module Google
|
|
294
1870
|
|
295
1871
|
# Update properties of this object
|
296
1872
|
def update!(**args)
|
297
|
-
@
|
298
|
-
@on_click = args[:on_click] if args.key?(:on_click)
|
1873
|
+
@items = args[:items] if args.key?(:items)
|
299
1874
|
end
|
300
1875
|
end
|
301
1876
|
|
302
1877
|
#
|
303
|
-
class
|
1878
|
+
class GoogleAppsCardV1SwitchControl
|
304
1879
|
include Google::Apis::Core::Hashable
|
305
1880
|
|
306
|
-
# The
|
307
|
-
# Corresponds to the JSON property `
|
1881
|
+
# The control type, either switch or checkbox.
|
1882
|
+
# Corresponds to the JSON property `controlType`
|
308
1883
|
# @return [String]
|
309
|
-
attr_accessor :
|
1884
|
+
attr_accessor :control_type
|
310
1885
|
|
311
|
-
# The
|
312
|
-
# Corresponds to the JSON property `
|
1886
|
+
# The name of the switch widget that's used in formInput.
|
1887
|
+
# Corresponds to the JSON property `name`
|
313
1888
|
# @return [String]
|
314
|
-
attr_accessor :
|
1889
|
+
attr_accessor :name
|
315
1890
|
|
316
|
-
#
|
317
|
-
#
|
318
|
-
#
|
319
|
-
|
1891
|
+
# An action that describes the behavior when the form is submitted. For example,
|
1892
|
+
# an Apps Script can be invoked to handle the form.
|
1893
|
+
# Corresponds to the JSON property `onChangeAction`
|
1894
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Action]
|
1895
|
+
attr_accessor :on_change_action
|
320
1896
|
|
321
|
-
#
|
322
|
-
#
|
323
|
-
#
|
324
|
-
|
1897
|
+
# If the switch is selected.
|
1898
|
+
# Corresponds to the JSON property `selected`
|
1899
|
+
# @return [Boolean]
|
1900
|
+
attr_accessor :selected
|
1901
|
+
alias_method :selected?, :selected
|
1902
|
+
|
1903
|
+
# The value is what is passed back in the callback.
|
1904
|
+
# Corresponds to the JSON property `value`
|
325
1905
|
# @return [String]
|
326
|
-
attr_accessor :
|
1906
|
+
attr_accessor :value
|
327
1907
|
|
328
1908
|
def initialize(**args)
|
329
1909
|
update!(**args)
|
@@ -331,69 +1911,61 @@ module Google
|
|
331
1911
|
|
332
1912
|
# Update properties of this object
|
333
1913
|
def update!(**args)
|
334
|
-
@
|
335
|
-
@
|
336
|
-
@
|
337
|
-
@
|
1914
|
+
@control_type = args[:control_type] if args.key?(:control_type)
|
1915
|
+
@name = args[:name] if args.key?(:name)
|
1916
|
+
@on_change_action = args[:on_change_action] if args.key?(:on_change_action)
|
1917
|
+
@selected = args[:selected] if args.key?(:selected)
|
1918
|
+
@value = args[:value] if args.key?(:value)
|
338
1919
|
end
|
339
1920
|
end
|
340
1921
|
|
341
|
-
#
|
342
|
-
|
1922
|
+
# A text input is a UI item where users can input text. A text input can also
|
1923
|
+
# have an onChange action and suggestions.
|
1924
|
+
class GoogleAppsCardV1TextInput
|
343
1925
|
include Google::Apis::Core::Hashable
|
344
1926
|
|
345
|
-
#
|
1927
|
+
# An action that describes the behavior when the form is submitted. For example,
|
346
1928
|
# an Apps Script can be invoked to handle the form.
|
347
|
-
# Corresponds to the JSON property `
|
348
|
-
# @return [Google::Apis::ChatV1::
|
349
|
-
attr_accessor :
|
350
|
-
|
351
|
-
# The URL the bot should redirect the user to after they have completed an
|
352
|
-
# authorization or configuration flow outside of Google Chat. See the [
|
353
|
-
# Authorizing access to 3p services guide](/chat/how-tos/auth-3p) for more
|
354
|
-
# information.
|
355
|
-
# Corresponds to the JSON property `configCompleteRedirectUrl`
|
356
|
-
# @return [String]
|
357
|
-
attr_accessor :config_complete_redirect_url
|
1929
|
+
# Corresponds to the JSON property `autoCompleteAction`
|
1930
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Action]
|
1931
|
+
attr_accessor :auto_complete_action
|
358
1932
|
|
359
|
-
# The
|
360
|
-
# Corresponds to the JSON property `
|
1933
|
+
# The hint text.
|
1934
|
+
# Corresponds to the JSON property `hintText`
|
361
1935
|
# @return [String]
|
362
|
-
attr_accessor :
|
363
|
-
|
364
|
-
# A message in Hangouts Chat.
|
365
|
-
# Corresponds to the JSON property `message`
|
366
|
-
# @return [Google::Apis::ChatV1::Message]
|
367
|
-
attr_accessor :message
|
1936
|
+
attr_accessor :hint_text
|
368
1937
|
|
369
|
-
# A
|
370
|
-
#
|
371
|
-
#
|
372
|
-
|
1938
|
+
# A container wrapping elements necessary for showing suggestion items used in
|
1939
|
+
# text input autocomplete.
|
1940
|
+
# Corresponds to the JSON property `initialSuggestions`
|
1941
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Suggestions]
|
1942
|
+
attr_accessor :initial_suggestions
|
373
1943
|
|
374
|
-
#
|
375
|
-
#
|
376
|
-
# Corresponds to the JSON property `threadKey`
|
1944
|
+
# At least one of label and hintText must be specified.
|
1945
|
+
# Corresponds to the JSON property `label`
|
377
1946
|
# @return [String]
|
378
|
-
attr_accessor :
|
1947
|
+
attr_accessor :label
|
379
1948
|
|
380
|
-
#
|
381
|
-
#
|
382
|
-
# from the Google Chat API configuration page in the Cloud Console. Developers
|
383
|
-
# can revoke/regenerate it if needed from the same page.
|
384
|
-
# Corresponds to the JSON property `token`
|
1949
|
+
# The name of the text input which is used in formInput.
|
1950
|
+
# Corresponds to the JSON property `name`
|
385
1951
|
# @return [String]
|
386
|
-
attr_accessor :
|
1952
|
+
attr_accessor :name
|
387
1953
|
|
388
|
-
#
|
1954
|
+
# An action that describes the behavior when the form is submitted. For example,
|
1955
|
+
# an Apps Script can be invoked to handle the form.
|
1956
|
+
# Corresponds to the JSON property `onChangeAction`
|
1957
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Action]
|
1958
|
+
attr_accessor :on_change_action
|
1959
|
+
|
1960
|
+
# The style of the text, for example, a single line or multiple lines.
|
389
1961
|
# Corresponds to the JSON property `type`
|
390
1962
|
# @return [String]
|
391
1963
|
attr_accessor :type
|
392
1964
|
|
393
|
-
#
|
394
|
-
# Corresponds to the JSON property `
|
395
|
-
# @return [
|
396
|
-
attr_accessor :
|
1965
|
+
# The default value when there is no input from the user.
|
1966
|
+
# Corresponds to the JSON property `value`
|
1967
|
+
# @return [String]
|
1968
|
+
attr_accessor :value
|
397
1969
|
|
398
1970
|
def initialize(**args)
|
399
1971
|
update!(**args)
|
@@ -401,26 +1973,26 @@ module Google
|
|
401
1973
|
|
402
1974
|
# Update properties of this object
|
403
1975
|
def update!(**args)
|
404
|
-
@
|
405
|
-
@
|
406
|
-
@
|
407
|
-
@
|
408
|
-
@
|
409
|
-
@
|
410
|
-
@token = args[:token] if args.key?(:token)
|
1976
|
+
@auto_complete_action = args[:auto_complete_action] if args.key?(:auto_complete_action)
|
1977
|
+
@hint_text = args[:hint_text] if args.key?(:hint_text)
|
1978
|
+
@initial_suggestions = args[:initial_suggestions] if args.key?(:initial_suggestions)
|
1979
|
+
@label = args[:label] if args.key?(:label)
|
1980
|
+
@name = args[:name] if args.key?(:name)
|
1981
|
+
@on_change_action = args[:on_change_action] if args.key?(:on_change_action)
|
411
1982
|
@type = args[:type] if args.key?(:type)
|
412
|
-
@
|
1983
|
+
@value = args[:value] if args.key?(:value)
|
413
1984
|
end
|
414
1985
|
end
|
415
1986
|
|
416
|
-
# A
|
417
|
-
|
1987
|
+
# A paragraph of text that supports formatting. See [Text formatting](workspace/
|
1988
|
+
# add-ons/concepts/widgets#text_formatting") for details.
|
1989
|
+
class GoogleAppsCardV1TextParagraph
|
418
1990
|
include Google::Apis::Core::Hashable
|
419
1991
|
|
420
|
-
# The
|
421
|
-
# Corresponds to the JSON property `
|
1992
|
+
# The text that's shown in the widget.
|
1993
|
+
# Corresponds to the JSON property `text`
|
422
1994
|
# @return [String]
|
423
|
-
attr_accessor :
|
1995
|
+
attr_accessor :text
|
424
1996
|
|
425
1997
|
def initialize(**args)
|
426
1998
|
update!(**args)
|
@@ -428,44 +2000,68 @@ module Google
|
|
428
2000
|
|
429
2001
|
# Update properties of this object
|
430
2002
|
def update!(**args)
|
431
|
-
@
|
2003
|
+
@text = args[:text] if args.key?(:text)
|
432
2004
|
end
|
433
2005
|
end
|
434
2006
|
|
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
|
2007
|
+
# A widget is a UI element that presents texts, images, etc.
|
2008
|
+
class GoogleAppsCardV1Widget
|
441
2009
|
include Google::Apis::Core::Hashable
|
442
2010
|
|
443
|
-
|
444
|
-
|
445
|
-
|
2011
|
+
# A list of buttons layed out horizontally.
|
2012
|
+
# Corresponds to the JSON property `buttonList`
|
2013
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1ButtonList]
|
2014
|
+
attr_accessor :button_list
|
2015
|
+
|
2016
|
+
# The widget that lets users to specify a date and time.
|
2017
|
+
# Corresponds to the JSON property `dateTimePicker`
|
2018
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1DateTimePicker]
|
2019
|
+
attr_accessor :date_time_picker
|
2020
|
+
|
2021
|
+
# A widget that displays text with optional decorations such as a label above or
|
2022
|
+
# below the text, an icon in front of the text, a selection widget or a button
|
2023
|
+
# after the text.
|
2024
|
+
# Corresponds to the JSON property `decoratedText`
|
2025
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1DecoratedText]
|
2026
|
+
attr_accessor :decorated_text
|
2027
|
+
|
2028
|
+
# A divider that appears in between widgets.
|
2029
|
+
# Corresponds to the JSON property `divider`
|
2030
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Divider]
|
2031
|
+
attr_accessor :divider
|
2032
|
+
|
2033
|
+
# Represents a Grid widget that displays items in a configurable grid layout.
|
2034
|
+
# Corresponds to the JSON property `grid`
|
2035
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Grid]
|
2036
|
+
attr_accessor :grid
|
2037
|
+
|
2038
|
+
# The horizontal alignment of this widget.
|
2039
|
+
# Corresponds to the JSON property `horizontalAlignment`
|
2040
|
+
# @return [String]
|
2041
|
+
attr_accessor :horizontal_alignment
|
446
2042
|
|
447
|
-
#
|
448
|
-
|
449
|
-
|
450
|
-
|
2043
|
+
# An image that is specified by a URL and can have an onClick action.
|
2044
|
+
# Corresponds to the JSON property `image`
|
2045
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1Image]
|
2046
|
+
attr_accessor :image
|
451
2047
|
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
2048
|
+
# A widget that creates a UI item (for example, a drop-down list) with options
|
2049
|
+
# for users to select.
|
2050
|
+
# Corresponds to the JSON property `selectionInput`
|
2051
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1SelectionInput]
|
2052
|
+
attr_accessor :selection_input
|
456
2053
|
|
457
|
-
#
|
458
|
-
#
|
459
|
-
#
|
460
|
-
#
|
461
|
-
|
462
|
-
# @return [String]
|
463
|
-
attr_accessor :action_method_name
|
2054
|
+
# A text input is a UI item where users can input text. A text input can also
|
2055
|
+
# have an onChange action and suggestions.
|
2056
|
+
# Corresponds to the JSON property `textInput`
|
2057
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1TextInput]
|
2058
|
+
attr_accessor :text_input
|
464
2059
|
|
465
|
-
#
|
466
|
-
#
|
467
|
-
#
|
468
|
-
|
2060
|
+
# A paragraph of text that supports formatting. See [Text formatting](workspace/
|
2061
|
+
# add-ons/concepts/widgets#text_formatting") for details.
|
2062
|
+
# Corresponds to the JSON property `textParagraph`
|
2063
|
+
# @return [Google::Apis::ChatV1::GoogleAppsCardV1TextParagraph]
|
2064
|
+
attr_accessor :text_paragraph
|
469
2065
|
|
470
2066
|
def initialize(**args)
|
471
2067
|
update!(**args)
|
@@ -473,8 +2069,16 @@ module Google
|
|
473
2069
|
|
474
2070
|
# Update properties of this object
|
475
2071
|
def update!(**args)
|
476
|
-
@
|
477
|
-
@
|
2072
|
+
@button_list = args[:button_list] if args.key?(:button_list)
|
2073
|
+
@date_time_picker = args[:date_time_picker] if args.key?(:date_time_picker)
|
2074
|
+
@decorated_text = args[:decorated_text] if args.key?(:decorated_text)
|
2075
|
+
@divider = args[:divider] if args.key?(:divider)
|
2076
|
+
@grid = args[:grid] if args.key?(:grid)
|
2077
|
+
@horizontal_alignment = args[:horizontal_alignment] if args.key?(:horizontal_alignment)
|
2078
|
+
@image = args[:image] if args.key?(:image)
|
2079
|
+
@selection_input = args[:selection_input] if args.key?(:selection_input)
|
2080
|
+
@text_input = args[:text_input] if args.key?(:text_input)
|
2081
|
+
@text_paragraph = args[:text_paragraph] if args.key?(:text_paragraph)
|
478
2082
|
end
|
479
2083
|
end
|
480
2084
|
|
@@ -550,6 +2154,45 @@ module Google
|
|
550
2154
|
end
|
551
2155
|
end
|
552
2156
|
|
2157
|
+
# The inputs with widgets.
|
2158
|
+
class Inputs
|
2159
|
+
include Google::Apis::Core::Hashable
|
2160
|
+
|
2161
|
+
# Input Parameter for Date Picker widget.
|
2162
|
+
# Corresponds to the JSON property `dateInput`
|
2163
|
+
# @return [Google::Apis::ChatV1::DateInput]
|
2164
|
+
attr_accessor :date_input
|
2165
|
+
|
2166
|
+
# Input Parameter for Date and Time Picker widget.
|
2167
|
+
# Corresponds to the JSON property `dateTimeInput`
|
2168
|
+
# @return [Google::Apis::ChatV1::DateTimeInput]
|
2169
|
+
attr_accessor :date_time_input
|
2170
|
+
|
2171
|
+
# Input parameter for regular widgets. For single-valued widgets, it will be a
|
2172
|
+
# single value list; for multi-valued widgets, such as checkbox, all the values
|
2173
|
+
# are presented.
|
2174
|
+
# Corresponds to the JSON property `stringInputs`
|
2175
|
+
# @return [Google::Apis::ChatV1::StringInputs]
|
2176
|
+
attr_accessor :string_inputs
|
2177
|
+
|
2178
|
+
# Input Parameter for Time Picker widget.
|
2179
|
+
# Corresponds to the JSON property `timeInput`
|
2180
|
+
# @return [Google::Apis::ChatV1::TimeInput]
|
2181
|
+
attr_accessor :time_input
|
2182
|
+
|
2183
|
+
def initialize(**args)
|
2184
|
+
update!(**args)
|
2185
|
+
end
|
2186
|
+
|
2187
|
+
# Update properties of this object
|
2188
|
+
def update!(**args)
|
2189
|
+
@date_input = args[:date_input] if args.key?(:date_input)
|
2190
|
+
@date_time_input = args[:date_time_input] if args.key?(:date_time_input)
|
2191
|
+
@string_inputs = args[:string_inputs] if args.key?(:string_inputs)
|
2192
|
+
@time_input = args[:time_input] if args.key?(:time_input)
|
2193
|
+
end
|
2194
|
+
end
|
2195
|
+
|
553
2196
|
# A UI element contains a key (label) and a value (content). And this element
|
554
2197
|
# may also contain some actions such as onclick button.
|
555
2198
|
class KeyValue
|
@@ -686,7 +2329,7 @@ module Google
|
|
686
2329
|
end
|
687
2330
|
end
|
688
2331
|
|
689
|
-
# Represents a membership relation in
|
2332
|
+
# Represents a membership relation in Google Chat.
|
690
2333
|
class Membership
|
691
2334
|
include Google::Apis::Core::Hashable
|
692
2335
|
|
@@ -724,7 +2367,7 @@ module Google
|
|
724
2367
|
end
|
725
2368
|
end
|
726
2369
|
|
727
|
-
# A message in
|
2370
|
+
# A message in Google Chat.
|
728
2371
|
class Message
|
729
2372
|
include Google::Apis::Core::Hashable
|
730
2373
|
|
@@ -755,7 +2398,7 @@ module Google
|
|
755
2398
|
# @return [Array<Google::Apis::ChatV1::Card>]
|
756
2399
|
attr_accessor :cards
|
757
2400
|
|
758
|
-
# Output only. The time at which the message was created in
|
2401
|
+
# Output only. The time at which the message was created in Google Chat server.
|
759
2402
|
# Corresponds to the JSON property `createTime`
|
760
2403
|
# @return [String]
|
761
2404
|
attr_accessor :create_time
|
@@ -766,7 +2409,15 @@ module Google
|
|
766
2409
|
# @return [String]
|
767
2410
|
attr_accessor :fallback_text
|
768
2411
|
|
769
|
-
#
|
2412
|
+
# Output only. The time at which the message was last updated in Google Chat
|
2413
|
+
# server. If the message was never updated, this field will be same as
|
2414
|
+
# create_time.
|
2415
|
+
# Corresponds to the JSON property `lastUpdateTime`
|
2416
|
+
# @return [String]
|
2417
|
+
attr_accessor :last_update_time
|
2418
|
+
|
2419
|
+
# Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAMpdlehY/
|
2420
|
+
# messages/UMxbHmzDlr4.UMxbHmzDlr4`
|
770
2421
|
# Corresponds to the JSON property `name`
|
771
2422
|
# @return [String]
|
772
2423
|
attr_accessor :name
|
@@ -788,7 +2439,8 @@ module Google
|
|
788
2439
|
# @return [Google::Apis::ChatV1::SlashCommand]
|
789
2440
|
attr_accessor :slash_command
|
790
2441
|
|
791
|
-
# A
|
2442
|
+
# A space in Google Chat. Spaces are conversations between two or more users or
|
2443
|
+
# 1:1 messages between a user and a Chat bot.
|
792
2444
|
# Corresponds to the JSON property `space`
|
793
2445
|
# @return [Google::Apis::ChatV1::Space]
|
794
2446
|
attr_accessor :space
|
@@ -798,7 +2450,7 @@ module Google
|
|
798
2450
|
# @return [String]
|
799
2451
|
attr_accessor :text
|
800
2452
|
|
801
|
-
# A thread in
|
2453
|
+
# A thread in Google Chat.
|
802
2454
|
# Corresponds to the JSON property `thread`
|
803
2455
|
# @return [Google::Apis::ChatV1::Thread]
|
804
2456
|
attr_accessor :thread
|
@@ -816,6 +2468,7 @@ module Google
|
|
816
2468
|
@cards = args[:cards] if args.key?(:cards)
|
817
2469
|
@create_time = args[:create_time] if args.key?(:create_time)
|
818
2470
|
@fallback_text = args[:fallback_text] if args.key?(:fallback_text)
|
2471
|
+
@last_update_time = args[:last_update_time] if args.key?(:last_update_time)
|
819
2472
|
@name = args[:name] if args.key?(:name)
|
820
2473
|
@preview_text = args[:preview_text] if args.key?(:preview_text)
|
821
2474
|
@sender = args[:sender] if args.key?(:sender)
|
@@ -961,18 +2614,19 @@ module Google
|
|
961
2614
|
end
|
962
2615
|
end
|
963
2616
|
|
964
|
-
# A
|
2617
|
+
# A space in Google Chat. Spaces are conversations between two or more users or
|
2618
|
+
# 1:1 messages between a user and a Chat bot.
|
965
2619
|
class Space
|
966
2620
|
include Google::Apis::Core::Hashable
|
967
2621
|
|
968
|
-
# Output only. The display name (only if the space is
|
969
|
-
# this field might not be populated in direct messages between humans.
|
2622
|
+
# Output only. The display name (only if the space is of type `ROOM`). Please
|
2623
|
+
# note that this field might not be populated in direct messages between humans.
|
970
2624
|
# Corresponds to the JSON property `displayName`
|
971
2625
|
# @return [String]
|
972
2626
|
attr_accessor :display_name
|
973
2627
|
|
974
2628
|
# Resource name of the space, in the form "spaces/*". Example: spaces/
|
975
|
-
#
|
2629
|
+
# AAAAAAAAAAAA
|
976
2630
|
# Corresponds to the JSON property `name`
|
977
2631
|
# @return [String]
|
978
2632
|
attr_accessor :name
|
@@ -1009,6 +2663,27 @@ module Google
|
|
1009
2663
|
end
|
1010
2664
|
end
|
1011
2665
|
|
2666
|
+
# Input parameter for regular widgets. For single-valued widgets, it will be a
|
2667
|
+
# single value list; for multi-valued widgets, such as checkbox, all the values
|
2668
|
+
# are presented.
|
2669
|
+
class StringInputs
|
2670
|
+
include Google::Apis::Core::Hashable
|
2671
|
+
|
2672
|
+
#
|
2673
|
+
# Corresponds to the JSON property `value`
|
2674
|
+
# @return [Array<String>]
|
2675
|
+
attr_accessor :value
|
2676
|
+
|
2677
|
+
def initialize(**args)
|
2678
|
+
update!(**args)
|
2679
|
+
end
|
2680
|
+
|
2681
|
+
# Update properties of this object
|
2682
|
+
def update!(**args)
|
2683
|
+
@value = args[:value] if args.key?(:value)
|
2684
|
+
end
|
2685
|
+
end
|
2686
|
+
|
1012
2687
|
# A button with text and onclick action.
|
1013
2688
|
class TextButton
|
1014
2689
|
include Google::Apis::Core::Hashable
|
@@ -1053,7 +2728,7 @@ module Google
|
|
1053
2728
|
end
|
1054
2729
|
end
|
1055
2730
|
|
1056
|
-
# A thread in
|
2731
|
+
# A thread in Google Chat.
|
1057
2732
|
class Thread
|
1058
2733
|
include Google::Apis::Core::Hashable
|
1059
2734
|
|
@@ -1073,6 +2748,58 @@ module Google
|
|
1073
2748
|
end
|
1074
2749
|
end
|
1075
2750
|
|
2751
|
+
# Input Parameter for Time Picker widget.
|
2752
|
+
class TimeInput
|
2753
|
+
include Google::Apis::Core::Hashable
|
2754
|
+
|
2755
|
+
#
|
2756
|
+
# Corresponds to the JSON property `hours`
|
2757
|
+
# @return [Fixnum]
|
2758
|
+
attr_accessor :hours
|
2759
|
+
|
2760
|
+
#
|
2761
|
+
# Corresponds to the JSON property `minutes`
|
2762
|
+
# @return [Fixnum]
|
2763
|
+
attr_accessor :minutes
|
2764
|
+
|
2765
|
+
def initialize(**args)
|
2766
|
+
update!(**args)
|
2767
|
+
end
|
2768
|
+
|
2769
|
+
# Update properties of this object
|
2770
|
+
def update!(**args)
|
2771
|
+
@hours = args[:hours] if args.key?(:hours)
|
2772
|
+
@minutes = args[:minutes] if args.key?(:minutes)
|
2773
|
+
end
|
2774
|
+
end
|
2775
|
+
|
2776
|
+
# The timezone id and offset. The id is the tz database time zones such as "
|
2777
|
+
# America/Toronto". The user timezone offset, in milliseconds, from Coordinated
|
2778
|
+
# Universal Time (UTC).
|
2779
|
+
class TimeZone
|
2780
|
+
include Google::Apis::Core::Hashable
|
2781
|
+
|
2782
|
+
#
|
2783
|
+
# Corresponds to the JSON property `id`
|
2784
|
+
# @return [String]
|
2785
|
+
attr_accessor :id
|
2786
|
+
|
2787
|
+
#
|
2788
|
+
# Corresponds to the JSON property `offset`
|
2789
|
+
# @return [Fixnum]
|
2790
|
+
attr_accessor :offset
|
2791
|
+
|
2792
|
+
def initialize(**args)
|
2793
|
+
update!(**args)
|
2794
|
+
end
|
2795
|
+
|
2796
|
+
# Update properties of this object
|
2797
|
+
def update!(**args)
|
2798
|
+
@id = args[:id] if args.key?(:id)
|
2799
|
+
@offset = args[:offset] if args.key?(:offset)
|
2800
|
+
end
|
2801
|
+
end
|
2802
|
+
|
1076
2803
|
# A user in Google Chat.
|
1077
2804
|
class User
|
1078
2805
|
include Google::Apis::Core::Hashable
|